tinbase 0.22.2 → 0.22.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -3
- package/dist/admin/api.d.ts +5 -1
- package/dist/admin/api.js +13 -4
- package/dist/admin/api.js.map +1 -1
- package/dist/admin/ui.d.ts +1 -1
- package/dist/admin/ui.js +32 -32
- package/dist/auth/handler.d.ts +9 -1
- package/dist/auth/handler.js +41 -3
- package/dist/auth/handler.js.map +1 -1
- package/dist/auth/password.d.ts +13 -0
- package/dist/auth/password.js +17 -0
- package/dist/auth/password.js.map +1 -1
- package/dist/auth/settings.d.ts +7 -0
- package/dist/auth/settings.js +17 -1
- package/dist/auth/settings.js.map +1 -1
- package/dist/auth/sms.d.ts +13 -1
- package/dist/auth/sms.js +35 -1
- package/dist/auth/sms.js.map +1 -1
- package/dist/cli.js +20 -2
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/node/bundle-function.d.ts +34 -1
- package/dist/node/bundle-function.js +123 -7
- package/dist/node/bundle-function.js.map +1 -1
- package/dist/node/config-toml.js +6 -3
- package/dist/node/config-toml.js.map +1 -1
- package/dist/node/index.d.ts +2 -2
- package/dist/node/index.js +1 -1
- package/dist/node/index.js.map +1 -1
- package/dist/node/load-config.js +9 -0
- package/dist/node/load-config.js.map +1 -1
- package/dist/node/load-functions.d.ts +12 -1
- package/dist/node/load-functions.js +70 -32
- package/dist/node/load-functions.js.map +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/types.js +1 -1
- package/package.json +1 -1
- package/dist/node/load-oauth.d.ts +0 -4
- package/dist/node/load-oauth.js +0 -126
- package/dist/node/load-oauth.js.map +0 -1
package/dist/admin/ui.js
CHANGED
|
@@ -19,15 +19,15 @@ export const ADMIN_HTML = `<!doctype html>
|
|
|
19
19
|
href="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='120'%20height='120'%20viewBox='0%200%20120%20120'%20fill='none'%3E%3Cdefs%3E%3ClinearGradient%20id='b'%20x1='30'%20y1='30'%20x2='92'%20y2='102'%20gradientUnits='userSpaceOnUse'%3E%3Cstop%20stop-color='%2310b981'/%3E%3Cstop%20offset='1'%20stop-color='%23047857'/%3E%3C/linearGradient%3E%3ClinearGradient%20id='l'%20x1='26'%20y1='19'%20x2='94'%20y2='49'%20gradientUnits='userSpaceOnUse'%3E%3Cstop%20stop-color='%236ee7b7'/%3E%3Cstop%20offset='1'%20stop-color='%2334d399'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath%20d='M26%2034v52c0%208.4%2015.2%2015.2%2034%2015.2s34-6.8%2034-15.2V34Z'%20fill='url(%23b)'/%3E%3Cpath%20d='M26%2060c0%208.4%2015.2%2015.2%2034%2015.2S94%2068.4%2094%2060'%20stroke='%236ee7b7'%20stroke-width='3'%20fill='none'/%3E%3Cellipse%20cx='60'%20cy='34'%20rx='34'%20ry='15'%20fill='url(%23l)'/%3E%3Cellipse%20cx='60'%20cy='34'%20rx='25'%20ry='10'%20fill='none'%20stroke='%23059669'%20stroke-opacity='0.5'%20stroke-width='2.5'/%3E%3C/svg%3E"
|
|
20
20
|
/>
|
|
21
21
|
<title>tinbase studio</title>
|
|
22
|
-
<script type="module" crossorigin>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),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,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,\`default\`,{value:n,enumerable:!0}):a,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),e.crossOrigin===\`use-credentials\`?t.credentials=\`include\`:e.crossOrigin===\`anonymous\`?t.credentials=\`omit\`:t.credentials=\`same-origin\`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=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.iterator;function m(e){return typeof e!=\`object\`||!e?null:(e=p&&e[p]||e[\`@@iterator\`],typeof e==\`function\`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.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\`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,\`forceUpdate\`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==\`object\`&&!!e&&e.$$typeof===t}function k(e){var t={"=":\`=0\`,":":\`=2\`};return\`$\`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\\/+/g;function j(e,t){return typeof e==\`object\`&&e&&e.key!=null?k(\`\`+e.key):t.toString(36)}function M(e){switch(e.status){case\`fulfilled\`:return e.value;case\`rejected\`:throw e.reason;default:switch(typeof e.status==\`string\`?e.then(C,C):(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 N(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,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===\`\`?\`.\`+j(e,0):a,S(o)?(i=\`\`,c!=null&&(i=c.replace(A,\`$&/\`)+\`/\`),N(o,r,i,\`\`,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?\`\`:(\`\`+o.key).replace(A,\`$&/\`)+\`/\`)+c)),r.push(o)),1;c=0;var l=a===\`\`?\`.\`:a+\`:\`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==\`function\`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===\`object\`){if(typeof e.then==\`function\`)return N(M(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 ee(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,\`\`,\`\`,function(e){return t.call(n,e,i++)}),r}function te(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var P=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)},F={map:ee,forEach:function(e,t,n){ee(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ee(e,function(){t++}),t},toArray:function(e){return ee(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(\`React.Children.only expected to receive a single React element child.\`);return e}};e.Activity=f,e.Children=F,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},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=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=\`\`+t.key),t)!T.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 E(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)T.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 E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:te}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==\`object\`&&r&&typeof r.then==\`function\`&&r.then(C,P)}catch(e){P(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=\`19.2.7\`})),u=o(((e,t)=>{t.exports=l()})),d=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}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u();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\`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:\`\`+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(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.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 o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.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=c(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=c(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})}}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=c(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=c(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})}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 s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=\`19.2.7\`})),m=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=p()})),h=o((e=>{var t=f(),n=u(),r=m();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){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function 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 d(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 p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,g=Symbol.for(\`react.element\`),_=Symbol.for(\`react.transitional.element\`),v=Symbol.for(\`react.portal\`),y=Symbol.for(\`react.fragment\`),b=Symbol.for(\`react.strict_mode\`),x=Symbol.for(\`react.profiler\`),S=Symbol.for(\`react.consumer\`),C=Symbol.for(\`react.context\`),w=Symbol.for(\`react.forward_ref\`),T=Symbol.for(\`react.suspense\`),E=Symbol.for(\`react.suspense_list\`),D=Symbol.for(\`react.memo\`),O=Symbol.for(\`react.lazy\`),k=Symbol.for(\`react.activity\`),A=Symbol.for(\`react.memo_cache_sentinel\`),j=Symbol.iterator;function M(e){return typeof e!=\`object\`||!e?null:(e=j&&e[j]||e[\`@@iterator\`],typeof e==\`function\`?e:null)}var N=Symbol.for(\`react.client.reference\`);function ee(e){if(e==null)return null;if(typeof e==\`function\`)return e.$$typeof===N?null:e.displayName||e.name||null;if(typeof e==\`string\`)return e;switch(e){case y:return\`Fragment\`;case x:return\`Profiler\`;case b:return\`StrictMode\`;case T:return\`Suspense\`;case E:return\`SuspenseList\`;case k:return\`Activity\`}if(typeof e==\`object\`)switch(e.$$typeof){case v:return\`Portal\`;case C:return e.displayName||\`Context\`;case S:return(e._context.displayName||\`Context\`)+\`.Consumer\`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||\`\`,e===\`\`?\`ForwardRef\`:\`ForwardRef(\`+e+\`)\`),e;case D:return t=e.displayName||null,t===null?ee(e.type)||\`Memo\`:t;case O:t=e._payload,e=e._init;try{return ee(e(t))}catch{}}return null}var te=Array.isArray,P=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne={pending:!1,data:null,method:null,action:null},re=[],ie=-1;function ae(e){return{current:e}}function oe(e){0>ie||(e.current=re[ie],re[ie]=null,ie--)}function I(e,t){ie++,re[ie]=e.current,e.current=t}var se=ae(null),ce=ae(null),le=ae(null),ue=ae(null);function de(e,t){switch(I(le,t),I(ce,e),I(se,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Gd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Gd(t),e=Kd(t,e);else switch(e){case\`svg\`:e=1;break;case\`math\`:e=2;break;default:e=0}}oe(se),I(se,e)}function fe(){oe(se),oe(ce),oe(le)}function pe(e){e.memoizedState!==null&&I(ue,e);var t=se.current,n=Kd(t,e.type);t!==n&&(I(ce,e),I(se,n))}function me(e){ce.current===e&&(oe(se),oe(ce)),ue.current===e&&(oe(ue),tp._currentValue=ne)}var he,ge;function _e(e){if(he===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\\n( *(at )?)/);he=t&&t[1]||\`\`,ge=-1<e.stack.indexOf(\`
|
|
22
|
+
<script type="module" crossorigin>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),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,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,\`default\`,{value:n,enumerable:!0}):a,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),e.crossOrigin===\`use-credentials\`?t.credentials=\`include\`:e.crossOrigin===\`anonymous\`?t.credentials=\`omit\`:t.credentials=\`same-origin\`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=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.iterator;function m(e){return typeof e!=\`object\`||!e?null:(e=p&&e[p]||e[\`@@iterator\`],typeof e==\`function\`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.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\`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,\`forceUpdate\`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==\`object\`&&!!e&&e.$$typeof===t}function k(e){var t={"=":\`=0\`,":":\`=2\`};return\`$\`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\\/+/g;function j(e,t){return typeof e==\`object\`&&e&&e.key!=null?k(\`\`+e.key):t.toString(36)}function M(e){switch(e.status){case\`fulfilled\`:return e.value;case\`rejected\`:throw e.reason;default:switch(typeof e.status==\`string\`?e.then(C,C):(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 N(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,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===\`\`?\`.\`+j(e,0):a,S(o)?(i=\`\`,c!=null&&(i=c.replace(A,\`$&/\`)+\`/\`),N(o,r,i,\`\`,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?\`\`:(\`\`+o.key).replace(A,\`$&/\`)+\`/\`)+c)),r.push(o)),1;c=0;var l=a===\`\`?\`.\`:a+\`:\`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==\`function\`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===\`object\`){if(typeof e.then==\`function\`)return N(M(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 ee(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,\`\`,\`\`,function(e){return t.call(n,e,i++)}),r}function te(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var P=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)},F={map:ee,forEach:function(e,t,n){ee(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ee(e,function(){t++}),t},toArray:function(e){return ee(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(\`React.Children.only expected to receive a single React element child.\`);return e}};e.Activity=f,e.Children=F,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},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=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=\`\`+t.key),t)!T.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 E(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)T.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 E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:te}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==\`object\`&&r&&typeof r.then==\`function\`&&r.then(C,P)}catch(e){P(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=\`19.2.7\`})),u=o(((e,t)=>{t.exports=l()})),d=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}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u();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\`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:\`\`+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(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.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 o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.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=c(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=c(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})}}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=c(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=c(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})}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 s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=\`19.2.7\`})),m=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=p()})),h=o((e=>{var t=f(),n=u(),r=m();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){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function 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 d(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 p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,g=Symbol.for(\`react.element\`),_=Symbol.for(\`react.transitional.element\`),v=Symbol.for(\`react.portal\`),y=Symbol.for(\`react.fragment\`),b=Symbol.for(\`react.strict_mode\`),x=Symbol.for(\`react.profiler\`),S=Symbol.for(\`react.consumer\`),C=Symbol.for(\`react.context\`),w=Symbol.for(\`react.forward_ref\`),T=Symbol.for(\`react.suspense\`),E=Symbol.for(\`react.suspense_list\`),D=Symbol.for(\`react.memo\`),O=Symbol.for(\`react.lazy\`),k=Symbol.for(\`react.activity\`),A=Symbol.for(\`react.memo_cache_sentinel\`),j=Symbol.iterator;function M(e){return typeof e!=\`object\`||!e?null:(e=j&&e[j]||e[\`@@iterator\`],typeof e==\`function\`?e:null)}var N=Symbol.for(\`react.client.reference\`);function ee(e){if(e==null)return null;if(typeof e==\`function\`)return e.$$typeof===N?null:e.displayName||e.name||null;if(typeof e==\`string\`)return e;switch(e){case y:return\`Fragment\`;case x:return\`Profiler\`;case b:return\`StrictMode\`;case T:return\`Suspense\`;case E:return\`SuspenseList\`;case k:return\`Activity\`}if(typeof e==\`object\`)switch(e.$$typeof){case v:return\`Portal\`;case C:return e.displayName||\`Context\`;case S:return(e._context.displayName||\`Context\`)+\`.Consumer\`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||\`\`,e===\`\`?\`ForwardRef\`:\`ForwardRef(\`+e+\`)\`),e;case D:return t=e.displayName||null,t===null?ee(e.type)||\`Memo\`:t;case O:t=e._payload,e=e._init;try{return ee(e(t))}catch{}}return null}var te=Array.isArray,P=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne={pending:!1,data:null,method:null,action:null},re=[],ie=-1;function ae(e){return{current:e}}function oe(e){0>ie||(e.current=re[ie],re[ie]=null,ie--)}function I(e,t){ie++,re[ie]=e.current,e.current=t}var se=ae(null),ce=ae(null),le=ae(null),ue=ae(null);function de(e,t){switch(I(le,t),I(ce,e),I(se,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Kd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Kd(t),e=qd(t,e);else switch(e){case\`svg\`:e=1;break;case\`math\`:e=2;break;default:e=0}}oe(se),I(se,e)}function fe(){oe(se),oe(ce),oe(le)}function pe(e){e.memoizedState!==null&&I(ue,e);var t=se.current,n=qd(t,e.type);t!==n&&(I(ce,e),I(se,n))}function me(e){ce.current===e&&(oe(se),oe(ce)),ue.current===e&&(oe(ue),tp._currentValue=ne)}var he,ge;function _e(e){if(he===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\\n( *(at )?)/);he=t&&t[1]||\`\`,ge=-1<e.stack.indexOf(\`
|
|
23
23
|
at\`)?\` (<anonymous>)\`:-1<e.stack.indexOf(\`@\`)?\`@unknown:0:0\`:\`\`}return\`
|
|
24
24
|
\`+he+e+ge}var ve=!1;function ye(e,t){if(!e||ve)return\`\`;ve=!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}e.call(n.prototype)}}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(\`
|
|
25
25
|
\`),l=s.split(\`
|
|
26
26
|
\`);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=\`
|
|
27
27
|
\`+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{ve=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:\`\`)?_e(n):\`\`}function be(e,t){switch(e.tag){case 26:case 27:case 5:return _e(e.type);case 16:return _e(\`Lazy\`);case 13:return e.child!==t&&t!==null?_e(\`Suspense Fallback\`):_e(\`Suspense\`);case 19:return _e(\`SuspenseList\`);case 0:case 15:return ye(e.type,!1);case 11:return ye(e.type.render,!1);case 1:return ye(e.type,!0);case 31:return _e(\`Activity\`);default:return\`\`}}function xe(e){try{var t=\`\`,n=null;do t+=be(e,n),n=e,e=e.return;while(e);return t}catch(e){return\`
|
|
28
28
|
Error generating stack: \`+e.message+\`
|
|
29
|
-
\`+e.stack}}var Se=Object.prototype.hasOwnProperty,Ce=t.unstable_scheduleCallback,we=t.unstable_cancelCallback,Te=t.unstable_shouldYield,Ee=t.unstable_requestPaint,De=t.unstable_now,Oe=t.unstable_getCurrentPriorityLevel,ke=t.unstable_ImmediatePriority,Ae=t.unstable_UserBlockingPriority,je=t.unstable_NormalPriority,Me=t.unstable_LowPriority,Ne=t.unstable_IdlePriority,Pe=t.log,Fe=t.unstable_setDisableYieldValue,Ie=null,Le=null;function L(e){if(typeof Pe==\`function\`&&Fe(e),Le&&typeof Le.setStrictMode==\`function\`)try{Le.setStrictMode(Ie,e)}catch{}}var Re=Math.clz32?Math.clz32:Ve,ze=Math.log,Be=Math.LN2;function Ve(e){return e>>>=0,e===0?32:31-(ze(e)/Be|0)|0}var He=256,Ue=262144,We=4194304;function Ge(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&261888;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 Ke(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=Ge(n))):i=Ge(o):i=Ge(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ge(n))):i=Ge(o)):i=Ge(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 qe(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Je(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 Ye(){var e=We;return We<<=1,!(We&62914560)&&(We=4194304),e}function Xe(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ze(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Qe(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-Re(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&&$e(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function $e(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Re(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function et(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Re(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function tt(e,t){var n=t&-t;return n=n&42?1:nt(n),(n&(e.suspendedLanes|t))===0?n:0}function nt(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 rt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function it(){var e=F.p;return e===0?(e=window.event,e===void 0?32:_p(e.type)):e}function at(e,t){var n=F.p;try{return F.p=e,t()}finally{F.p=n}}var ot=Math.random().toString(36).slice(2),st=\`__reactFiber$\`+ot,ct=\`__reactProps$\`+ot,lt=\`__reactContainer$\`+ot,ut=\`__reactEvents$\`+ot,dt=\`__reactListeners$\`+ot,ft=\`__reactHandles$\`+ot,pt=\`__reactResources$\`+ot,mt=\`__reactMarker$\`+ot;function ht(e){delete e[st],delete e[ct],delete e[ut],delete e[dt],delete e[ft]}function gt(e){var t=e[st];if(t)return t;for(var n=e.parentNode;n;){if(t=n[lt]||n[st]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=mf(e);e!==null;){if(n=e[st])return n;e=mf(e)}return t}e=n,n=e.parentNode}return null}function _t(e){if(e=e[st]||e[lt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function vt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function yt(e){var t=e[pt];return t||=e[pt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function bt(e){e[mt]=!0}var xt=new Set,St={};function Ct(e,t){wt(e,t),wt(e+\`Capture\`,t)}function wt(e,t){for(St[e]=t,e=0;e<t.length;e++)xt.add(t[e])}var Tt=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]*$\`),Et={},Dt={};function Ot(e){return Se.call(Dt,e)?!0:Se.call(Et,e)?!1:Tt.test(e)?Dt[e]=!0:(Et[e]=!0,!1)}function kt(e,t,n){if(Ot(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 At(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 jt(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 Mt(e){switch(typeof e){case\`bigint\`:case\`boolean\`:case\`number\`:case\`string\`:case\`undefined\`:return e;case\`object\`:return e;default:return\`\`}}function Nt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===\`input\`&&(t===\`checkbox\`||t===\`radio\`)}function Pt(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 Ft(e){if(!e._valueTracker){var t=Nt(e)?\`checked\`:\`value\`;e._valueTracker=Pt(e,t,\`\`+e[t])}}function It(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=\`\`;return e&&(r=Nt(e)?e.checked?\`true\`:\`false\`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Lt(e){if(e||=typeof document<\`u\`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Rt=/[\\n"\\\\]/g;function zt(e){return e.replace(Rt,function(e){return\`\\\\\`+e.charCodeAt(0).toString(16)+\` \`})}function Bt(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=\`\`+Mt(t)):e.value!==\`\`+Mt(t)&&(e.value=\`\`+Mt(t)),t==null?n==null?r!=null&&e.removeAttribute(\`value\`):Ht(e,o,Mt(n)):Ht(e,o,Mt(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=\`\`+Mt(s):e.removeAttribute(\`name\`)}function Vt(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)){Ft(e);return}n=n==null?\`\`:\`\`+Mt(n),t=t==null?n:\`\`+Mt(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),Ft(e)}function Ht(e,t,n){t===\`number\`&&Lt(e.ownerDocument)===e||e.defaultValue===\`\`+n||(e.defaultValue=\`\`+n)}function Ut(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=\`\`+Mt(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 Wt(e,t,n){if(t!=null&&(t=\`\`+Mt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?\`\`:\`\`+Mt(n)}function Gt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(te(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=\`\`,t=n}n=Mt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==\`\`&&r!==null&&(e.value=r),Ft(e)}function Kt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var qt=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 Jt(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||qt.has(t)?t===\`float\`?e.cssFloat=n:e[t]=(\`\`+n).trim():e[t]=n+\`px\`}function R(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]=\`\`);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Jt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Jt(e,o,t[o])}function Yt(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 Xt=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\`],[\`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\`]]),Zt=/^[\\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 Qt(e){return Zt.test(\`\`+e)?\`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')\`:e}function z(){}var B=null;function V(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var $t=null,en=null;function tn(e){var t=_t(e);if(t&&(e=t.stateNode)){var n=e[ct]||null;a:switch(e=t.stateNode,t.type){case\`input\`:if(Bt(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="\`+zt(\`\`+t)+\`"][type="radio"]\`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[ct]||null;if(!a)throw Error(i(90));Bt(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&&It(r)}break a;case\`textarea\`:Wt(e,n.value,n.defaultValue);break a;case\`select\`:t=n.value,t!=null&&Ut(e,!!n.multiple,t,!1)}}}var nn=!1;function rn(e,t,n){if(nn)return e(t,n);nn=!0;try{return e(t)}finally{if(nn=!1,($t!==null||en!==null)&&(xu(),$t&&(t=$t,e=en,en=$t=null,tn(t),e)))for(t=0;t<e.length;t++)tn(e[t])}}function an(e,t){var n=e.stateNode;if(n===null)return null;var r=n[ct]||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 on=!(typeof window>\`u\`||window.document===void 0||window.document.createElement===void 0),sn=!1;if(on)try{var cn={};Object.defineProperty(cn,"passive",{get:function(){sn=!0}}),window.addEventListener(\`test\`,cn,cn),window.removeEventListener(\`test\`,cn,cn)}catch{sn=!1}var ln=null,un=null,dn=null;function fn(){if(dn)return dn;var e,t=un,n=t.length,r,i=\`value\`in ln?ln.value:ln.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 dn=i.slice(e,1<r?1-r:void 0)}function pn(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 mn(){return!0}function hn(){return!1}function gn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?mn:hn,this.isPropagationStopped=hn,this}return h(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=mn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=\`unknown\`&&(e.cancelBubble=!0),this.isPropagationStopped=mn)},persist:function(){},isPersistent:mn}),t}var _n={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},vn=gn(_n),yn=h({},_n,{view:0,detail:0}),bn=gn(yn),xn,Sn,Cn,wn=h({},yn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Fn,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!==Cn&&(Cn&&e.type===\`mousemove\`?(xn=e.screenX-Cn.screenX,Sn=e.screenY-Cn.screenY):Sn=xn=0,Cn=e),xn)},movementY:function(e){return\`movementY\`in e?e.movementY:Sn}}),Tn=gn(wn),En=gn(h({},wn,{dataTransfer:0})),Dn=gn(h({},yn,{relatedTarget:0})),On=gn(h({},_n,{animationName:0,elapsedTime:0,pseudoElement:0})),kn=gn(h({},_n,{clipboardData:function(e){return\`clipboardData\`in e?e.clipboardData:window.clipboardData}})),An=gn(h({},_n,{data:0})),jn={Esc:\`Escape\`,Spacebar:\` \`,Left:\`ArrowLeft\`,Up:\`ArrowUp\`,Right:\`ArrowRight\`,Down:\`ArrowDown\`,Del:\`Delete\`,Win:\`OS\`,Menu:\`ContextMenu\`,Apps:\`ContextMenu\`,Scroll:\`ScrollLock\`,MozPrintableKey:\`Unidentified\`},Mn={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\`},Nn={Alt:\`altKey\`,Control:\`ctrlKey\`,Meta:\`metaKey\`,Shift:\`shiftKey\`};function Pn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Nn[e])?!!t[e]:!1}function Fn(){return Pn}var In=gn(h({},yn,{key:function(e){if(e.key){var t=jn[e.key]||e.key;if(t!==\`Unidentified\`)return t}return e.type===\`keypress\`?(e=pn(e),e===13?\`Enter\`:String.fromCharCode(e)):e.type===\`keydown\`||e.type===\`keyup\`?Mn[e.keyCode]||\`Unidentified\`:\`\`},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Fn,charCode:function(e){return e.type===\`keypress\`?pn(e):0},keyCode:function(e){return e.type===\`keydown\`||e.type===\`keyup\`?e.keyCode:0},which:function(e){return e.type===\`keypress\`?pn(e):e.type===\`keydown\`||e.type===\`keyup\`?e.keyCode:0}})),Ln=gn(h({},wn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Rn=gn(h({},yn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Fn})),zn=gn(h({},_n,{propertyName:0,elapsedTime:0,pseudoElement:0})),Bn=gn(h({},wn,{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})),Vn=gn(h({},_n,{newState:0,oldState:0})),Hn=[9,13,27,32],Un=on&&\`CompositionEvent\`in window,Wn=null;on&&\`documentMode\`in document&&(Wn=document.documentMode);var Gn=on&&\`TextEvent\`in window&&!Wn,Kn=on&&(!Un||Wn&&8<Wn&&11>=Wn),qn=\` \`,Jn=!1;function Yn(e,t){switch(e){case\`keyup\`:return Hn.indexOf(t.keyCode)!==-1;case\`keydown\`:return t.keyCode!==229;case\`keypress\`:case\`mousedown\`:case\`focusout\`:return!0;default:return!1}}function Xn(e){return e=e.detail,typeof e==\`object\`&&\`data\`in e?e.data:null}var H=!1;function Zn(e,t){switch(e){case\`compositionend\`:return Xn(t);case\`keypress\`:return t.which===32?(Jn=!0,qn):null;case\`textInput\`:return e=t.data,e===qn&&Jn?null:e;default:return null}}function Qn(e,t){if(H)return e===\`compositionend\`||!Un&&Yn(e,t)?(e=fn(),dn=un=ln=null,H=!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 Kn&&t.locale!==\`ko\`?null:t.data;default:return null}}var $n={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\`?!!$n[e.type]:t===\`textarea\`}function tr(e,t,n,r){$t?en?en.push(r):en=[r]:$t=r,t=kd(t,\`onChange\`),0<t.length&&(n=new vn(\`onChange\`,\`change\`,null,n,r),e.push({event:n,listeners:t}))}var nr=null,rr=null;function ir(e){xd(e,0)}function U(e){if(It(vt(e)))return e}function ar(e,t){if(e===\`change\`)return t}var or=!1;if(on){var sr;if(on){var cr=\`oninput\`in document;if(!cr){var lr=document.createElement(\`div\`);lr.setAttribute(\`oninput\`,\`return;\`),cr=typeof lr.oninput==\`function\`}sr=cr}else sr=!1;or=sr&&(!document.documentMode||9<document.documentMode)}function ur(){nr&&(nr.detachEvent(\`onpropertychange\`,dr),rr=nr=null)}function dr(e){if(e.propertyName===\`value\`&&U(rr)){var t=[];tr(t,rr,e,V(e)),rn(ir,t)}}function fr(e,t,n){e===\`focusin\`?(ur(),nr=t,rr=n,nr.attachEvent(\`onpropertychange\`,dr)):e===\`focusout\`&&ur()}function pr(e){if(e===\`selectionchange\`||e===\`keyup\`||e===\`keydown\`)return U(rr)}function mr(e,t){if(e===\`click\`)return U(t)}function hr(e,t){if(e===\`input\`||e===\`change\`)return U(t)}function gr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var _r=typeof Object.is==\`function\`?Object.is:gr;function vr(e,t){if(_r(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(!Se.call(t,i)||!_r(e[i],t[i]))return!1}return!0}function yr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function br(e,t){var n=yr(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=yr(n)}}function xr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?xr(e,t.parentNode):\`contains\`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Sr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Lt(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=Lt(e.document)}return t}function Cr(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 wr=on&&\`documentMode\`in document&&11>=document.documentMode,Tr=null,Er=null,Dr=null,Or=!1;function kr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Or||Tr==null||Tr!==Lt(r)||(r=Tr,\`selectionStart\`in r&&Cr(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}),Dr&&vr(Dr,r)||(Dr=r,r=kd(Er,\`onSelect\`),0<r.length&&(t=new vn(\`onSelect\`,\`select\`,null,t,n),e.push({event:t,listeners:r}),t.target=Tr)))}function Ar(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[\`Webkit\`+e]=\`webkit\`+t,n[\`Moz\`+e]=\`moz\`+t,n}var jr={animationend:Ar(\`Animation\`,\`AnimationEnd\`),animationiteration:Ar(\`Animation\`,\`AnimationIteration\`),animationstart:Ar(\`Animation\`,\`AnimationStart\`),transitionrun:Ar(\`Transition\`,\`TransitionRun\`),transitionstart:Ar(\`Transition\`,\`TransitionStart\`),transitioncancel:Ar(\`Transition\`,\`TransitionCancel\`),transitionend:Ar(\`Transition\`,\`TransitionEnd\`)},Mr={},Nr={};on&&(Nr=document.createElement(\`div\`).style,\`AnimationEvent\`in window||(delete jr.animationend.animation,delete jr.animationiteration.animation,delete jr.animationstart.animation),\`TransitionEvent\`in window||delete jr.transitionend.transition);function W(e){if(Mr[e])return Mr[e];if(!jr[e])return e;var t=jr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Nr)return Mr[e]=t[n];return e}var Pr=W(\`animationend\`),Fr=W(\`animationiteration\`),Ir=W(\`animationstart\`),Lr=W(\`transitionrun\`),Rr=W(\`transitionstart\`),zr=W(\`transitioncancel\`),Br=W(\`transitionend\`),Vr=new Map,Hr=\`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel\`.split(\` \`);Hr.push(\`scrollEnd\`);function Ur(e,t){Vr.set(e,t),Ct(t,[e])}var Wr=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)},Gr=[],Kr=0,qr=0;function Jr(){for(var e=Kr,t=qr=Kr=0;t<e;){var n=Gr[t];Gr[t++]=null;var r=Gr[t];Gr[t++]=null;var i=Gr[t];Gr[t++]=null;var a=Gr[t];if(Gr[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&&Qr(n,i,a)}}function Yr(e,t,n,r){Gr[Kr++]=e,Gr[Kr++]=t,Gr[Kr++]=n,Gr[Kr++]=r,qr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Xr(e,t,n,r){return Yr(e,t,n,r),$r(e)}function Zr(e,t){return Yr(e,null,null,t),$r(e)}function Qr(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-Re(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function $r(e){if(50<fu)throw fu=0,pu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ei={};function ti(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 ni(e,t,n,r){return new ti(e,t,n,r)}function ri(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ii(e,t){var n=e.alternate;return n===null?(n=ni(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&65011712,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 ai(e,t){e.flags&=65011714;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 oi(e,t,n,r,a,o){var s=0;if(r=e,typeof e==\`function\`)ri(e)&&(s=1);else if(typeof e==\`string\`)s=Kf(e,n,se.current)?26:e===\`html\`||e===\`head\`||e===\`body\`?27:5;else a:switch(e){case k:return e=ni(31,n,t,a),e.elementType=k,e.lanes=o,e;case y:return si(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=ni(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=ni(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=ni(19,n,t,a),e.elementType=E,e.lanes=o,e;default:if(typeof e==\`object\`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case D:s=14;break a;case O:s=16,r=null;break a}s=29,n=Error(i(130,e===null?\`null\`:typeof e,\`\`)),r=null}return t=ni(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function si(e,t,n,r){return e=ni(7,e,r,t),e.lanes=n,e}function ci(e,t,n){return e=ni(6,e,null,t),e.lanes=n,e}function li(e){var t=ni(18,null,null,0);return t.stateNode=e,t}function ui(e,t,n){return t=ni(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var di=new WeakMap;function fi(e,t){if(typeof e==\`object\`&&e){var n=di.get(e);return n===void 0?(t={value:e,source:t,stack:xe(t)},di.set(e,t),t):n}return{value:e,source:t,stack:xe(t)}}var pi=[],mi=0,hi=null,gi=0,_i=[],vi=0,yi=null,bi=1,xi=\`\`;function Si(e,t){pi[mi++]=gi,pi[mi++]=hi,hi=e,gi=t}function Ci(e,t,n){_i[vi++]=bi,_i[vi++]=xi,_i[vi++]=yi,yi=e;var r=bi;e=xi;var i=32-Re(r)-1;r&=~(1<<i),n+=1;var a=32-Re(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,bi=1<<32-Re(t)+i|n<<i|r,xi=a+e}else bi=1<<a|n<<i|r,xi=e}function wi(e){e.return!==null&&(Si(e,1),Ci(e,1,0))}function Ti(e){for(;e===hi;)hi=pi[--mi],pi[mi]=null,gi=pi[--mi],pi[mi]=null;for(;e===yi;)yi=_i[--vi],_i[vi]=null,xi=_i[--vi],_i[vi]=null,bi=_i[--vi],_i[vi]=null}function Ei(e,t){_i[vi++]=bi,_i[vi++]=xi,_i[vi++]=yi,bi=t.id,xi=t.overflow,yi=e}var Di=null,Oi=null,G=!1,ki=null,Ai=!1,ji=Error(i(519));function Mi(e){throw Ri(fi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?\`text\`:\`HTML\`,\`\`)),e)),ji}function Ni(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[st]=e,t[ct]=r,n){case\`dialog\`:Sd(\`cancel\`,t),Sd(\`close\`,t);break;case\`iframe\`:case\`object\`:case\`embed\`:Sd(\`load\`,t);break;case\`video\`:case\`audio\`:for(n=0;n<yd.length;n++)Sd(yd[n],t);break;case\`source\`:Sd(\`error\`,t);break;case\`img\`:case\`image\`:case\`link\`:Sd(\`error\`,t),Sd(\`load\`,t);break;case\`details\`:Sd(\`toggle\`,t);break;case\`input\`:Sd(\`invalid\`,t),Vt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case\`select\`:Sd(\`invalid\`,t);break;case\`textarea\`:Sd(\`invalid\`,t),Gt(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||Fd(t.textContent,n)?(r.popover!=null&&(Sd(\`beforetoggle\`,t),Sd(\`toggle\`,t)),r.onScroll!=null&&Sd(\`scroll\`,t),r.onScrollEnd!=null&&Sd(\`scrollend\`,t),r.onClick!=null&&(t.onclick=z),t=!0):t=!1,t||Mi(e,!0)}function Pi(e){for(Di=e.return;Di;)switch(Di.tag){case 5:case 31:case 13:Ai=!1;return;case 27:case 3:Ai=!0;return;default:Di=Di.return}}function Fi(e){if(e!==Di)return!1;if(!G)return Pi(e),G=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==\`form\`&&n!==\`button\`)||qd(e.type,e.memoizedProps)),n=!n),n&&Oi&&Mi(e),Pi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Oi=pf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Oi=pf(e)}else t===27?(t=Oi,tf(e.type)?(e=ff,ff=null,Oi=e):Oi=t):Oi=Di?df(e.stateNode.nextSibling):null;return!0}function Ii(){Oi=Di=null,G=!1}function Li(){var e=ki;return e!==null&&(Ql===null?Ql=e:Ql.push.apply(Ql,e),ki=null),e}function Ri(e){ki===null?ki=[e]:ki.push(e)}var zi=ae(null),Bi=null,Vi=null;function Hi(e,t,n){I(zi,t._currentValue),t._currentValue=n}function Ui(e){e._currentValue=zi.current,oe(zi)}function Wi(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 Gi(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),Wi(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),Wi(s,n,e),s=null}else 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 Ki(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;_r(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===ue.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[tp]:e.push(tp))}a=a.return}e!==null&&Gi(t,e,n,r),t.flags|=262144}function qi(e){for(e=e.firstContext;e!==null;){if(!_r(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ji(e){Bi=e,Vi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Yi(e){return Zi(Bi,e)}function Xi(e,t){return Bi===null&&Ji(e),Zi(e,t)}function Zi(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Vi===null){if(e===null)throw Error(i(308));Vi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Vi=Vi.next=t;return n}var Qi=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()})}},$i=t.unstable_scheduleCallback,ea=t.unstable_NormalPriority,ta={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function na(){return{controller:new Qi,data:new Map,refCount:0}}function ra(e){e.refCount--,e.refCount===0&&$i(ea,function(){e.controller.abort()})}var ia=null,aa=0,oa=0,sa=null;function ca(e,t){if(ia===null){var n=ia=[];aa=0,oa=pd(),sa={status:\`pending\`,value:void 0,then:function(e){n.push(e)}}}return aa++,t.then(la,la),t}function la(){if(--aa===0&&ia!==null){sa!==null&&(sa.status=\`fulfilled\`);var e=ia;ia=null,oa=0,sa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ua(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 da=P.S;P.S=function(e,t){tu=De(),typeof t==\`object\`&&t&&typeof t.then==\`function\`&&ca(e,t),da!==null&&da(e,t)};var fa=ae(null);function pa(){var e=fa.current;return e===null?Rl.pooledCache:e}function ma(e,t){t===null?I(fa,fa.current):I(fa,t.pool)}function ha(){var e=pa();return e===null?null:{parent:ta._currentValue,pool:e}}var ga=Error(i(460)),_a=Error(i(474)),va=Error(i(542)),ya={then:function(){}};function ba(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(z,z),t=n),t.status){case\`fulfilled\`:return t.value;case\`rejected\`:throw e=t.reason,Ta(e),e;default:if(typeof t.status==\`string\`)t.then(z,z);else{if(e=Rl,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,Ta(e),e}throw Ca=t,ga}}function Sa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==\`object\`&&e&&typeof e.then==\`function\`?(Ca=e,ga):e}}var Ca=null;function wa(){if(Ca===null)throw Error(i(459));var e=Ca;return Ca=null,e}function Ta(e){if(e===ga||e===va)throw Error(i(483))}var Ea=null,Da=0;function Oa(e){var t=Da;return Da+=1,Ea===null&&(Ea=[]),xa(Ea,e,t)}function ka(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Aa(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===\`[object Object]\`?\`object with keys {\`+Object.keys(t).join(\`, \`)+\`}\`:e)))}function ja(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=ii(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|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=ci(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===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==\`object\`&&i&&i.$$typeof===O&&Sa(i)===t.type)?(t=a(t,n.props),ka(t,n),t.return=e,t):(t=oi(n.type,n.key,n.props,null,e.mode,r),ka(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=ui(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=si(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=ci(\`\`+t,e.mode,n),t.return=e,t;if(typeof t==\`object\`&&t){switch(t.$$typeof){case _:return n=oi(t.type,t.key,t.props,null,e.mode,n),ka(n,t),n.return=e,n;case v:return t=ui(t,e.mode,n),t.return=e,t;case O:return t=Sa(t),f(e,t,n)}if(te(t)||M(t))return t=si(t,e.mode,n,null),t.return=e,t;if(typeof t.then==\`function\`)return f(e,Oa(t),n);if(t.$$typeof===C)return f(e,Xi(e,t),n);Aa(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 _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case O:return n=Sa(n),p(e,t,n,r)}if(te(n)||M(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==\`function\`)return p(e,t,Oa(n),r);if(n.$$typeof===C)return p(e,t,Xi(e,n),r);Aa(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 _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case O:return r=Sa(r),m(e,t,n,r,i)}if(te(r)||M(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==\`function\`)return m(e,t,n,Oa(r),i);if(r.$$typeof===C)return m(e,t,n,Xi(t,r),i);Aa(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),G&&Si(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 G&&Si(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(g.key===null?h:g.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)}),G&&Si(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),G&&Si(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 G&&Si(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(v.key===null?g:v.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)}),G&&Si(a,g),u}function b(e,r,o,c){if(typeof o==\`object\`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==\`object\`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==\`object\`&&l&&l.$$typeof===O&&Sa(l)===r.type){n(e,r.sibling),c=a(r,o.props),ka(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=si(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=oi(o.type,o.key,o.props,null,e.mode,c),ka(c,o),c.return=e,e=c)}return s(e);case v: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}else{n(e,r);break}else t(e,r);r=r.sibling}c=ui(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=Sa(o),b(e,r,o,c)}if(te(o))return h(e,r,o,c);if(M(o)){if(l=M(o),typeof l!=\`function\`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==\`function\`)return b(e,r,Oa(o),c);if(o.$$typeof===C)return b(e,r,Xi(e,o),c);Aa(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=ci(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Da=0;var i=b(e,t,n,r);return Ea=null,i}catch(t){if(t===ga||t===va)throw t;var a=ni(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ma=ja(!0),Na=ja(!1),Pa=!1;function Fa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ia(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 La(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ra(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ll&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=$r(e),Qr(e,null,n),t}return Yr(e,r,t,n),$r(e)}function za(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,et(e,n)}}function Ba(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;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Va=!1;function Ha(){if(Va){var e=sa;if(e!==null)throw e}}function Ua(e,t,n,r){Va=!1;var i=e.updateQueue;Pa=!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?(Y&f)===f:(r&f)===f){f!==0&&f===oa&&(Va=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(m=g.payload,typeof m==\`function\`){d=m.call(_,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m==\`function\`?m.call(_,d,f):m,f==null)break a;d=h({},d,f);break a;case 2:Pa=!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),Kl|=o,e.lanes=o,e.memoizedState=d}}function Wa(e,t){if(typeof e!=\`function\`)throw Error(i(191,e));e.call(t)}function Ga(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Wa(n[e],t)}var Ka=ae(null),qa=ae(0);function Ja(e,t){e=Wl,I(qa,e),I(Ka,t),Wl=e|t.baseLanes}function Ya(){I(qa,Wl),I(Ka,Ka.current)}function Xa(){Wl=qa.current,oe(Ka),oe(qa)}var Za=ae(null),Qa=null;function $a(e){var t=e.alternate;I(io,io.current&1),I(Za,e),Qa===null&&(t===null||Ka.current!==null||t.memoizedState!==null)&&(Qa=e)}function eo(e){I(io,io.current),I(Za,e),Qa===null&&(Qa=e)}function to(e){e.tag===22?(I(io,io.current),I(Za,e),Qa===null&&(Qa=e)):no(e)}function no(){I(io,io.current),I(Za,Za.current)}function ro(e){oe(Za),Qa===e&&(Qa=null),oe(io)}var io=ae(0);function ao(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||lf(n)||uf(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===\`forwards\`||t.memoizedProps.revealOrder===\`backwards\`||t.memoizedProps.revealOrder===\`unstable_legacy-backwards\`||t.memoizedProps.revealOrder===\`together\`)){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 oo=0,K=null,so=null,co=null,lo=!1,uo=!1,fo=!1,po=0,mo=0,ho=null,go=0;function q(){throw Error(i(321))}function _o(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!_r(e[n],t[n]))return!1;return!0}function vo(e,t,n,r,i,a){return oo=a,K=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,P.H=e===null||e.memoizedState===null?Fs:Is,fo=!1,a=n(r,i),fo=!1,uo&&(a=bo(t,n,r,i)),yo(e),a}function yo(e){P.H=Ps;var t=so!==null&&so.next!==null;if(oo=0,co=so=K=null,lo=!1,mo=0,ho=null,t)throw Error(i(300));e===null||$s||(e=e.dependencies,e!==null&&qi(e)&&($s=!0))}function bo(e,t,n,r){K=e;var a=0;do{if(uo&&(ho=null),mo=0,uo=!1,25<=a)throw Error(i(301));if(a+=1,co=so=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}P.H=Ls,o=t(n,r)}while(uo);return o}function xo(){var e=P.H,t=e.useState()[0];return t=typeof t.then==\`function\`?Oo(t):t,e=e.useState()[0],(so===null?null:so.memoizedState)!==e&&(K.flags|=1024),t}function So(){var e=po!==0;return po=0,e}function Co(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function wo(e){if(lo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}lo=!1}oo=0,co=so=K=null,uo=!1,mo=po=0,ho=null}function To(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return co===null?K.memoizedState=co=e:co=co.next=e,co}function Eo(){if(so===null){var e=K.alternate;e=e===null?null:e.memoizedState}else e=so.next;var t=co===null?K.memoizedState:co.next;if(t!==null)co=t,so=e;else{if(e===null)throw K.alternate===null?Error(i(467)):Error(i(310));so=e,e={memoizedState:so.memoizedState,baseState:so.baseState,baseQueue:so.baseQueue,queue:so.queue,next:null},co===null?K.memoizedState=co=e:co=co.next=e}return co}function Do(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Oo(e){var t=mo;return mo+=1,ho===null&&(ho=[]),e=xa(ho,e,t),t=K,(co===null?t.memoizedState:co.next)===null&&(t=t.alternate,P.H=t===null||t.memoizedState===null?Fs:Is),e}function ko(e){if(typeof e==\`object\`&&e){if(typeof e.then==\`function\`)return Oo(e);if(e.$$typeof===C)return Yi(e)}throw Error(i(438,String(e)))}function Ao(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=Do(),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]=A;return t.index++,n}function jo(e,t){return typeof t==\`function\`?t(e):t}function Mo(e){return No(Eo(),so,e)}function No(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?(oo&f)===f:(Y&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===oa&&(d=!0);else if((oo&p)===p){u=u.next,p===oa&&(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,Kl|=p;f=u.action,fo&&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,Kl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!_r(o,e.memoizedState)&&($s=!0,d&&(n=sa,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 Po(e){var t=Eo(),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);_r(o,t.memoizedState)||($s=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Fo(e,t,n){var r=K,a=Eo(),o=G;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!_r((so||a).memoizedState,n);if(s&&(a.memoizedState=n,$s=!0),a=a.queue,os(Ro.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||co!==null&&co.memoizedState.tag&1){if(r.flags|=2048,ts(9,{destroy:void 0},Lo.bind(null,r,a,n,t),null),Rl===null)throw Error(i(349));o||oo&127||Io(r,t,n)}return n}function Io(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=K.updateQueue,t===null?(t=Do(),K.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Lo(e,t,n,r){t.value=n,t.getSnapshot=r,zo(t)&&Bo(e)}function Ro(e,t,n){return n(function(){zo(t)&&Bo(e)})}function zo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!_r(e,n)}catch{return!0}}function Bo(e){var t=Zr(e,2);t!==null&&gu(t,e,2)}function Vo(e){var t=To();if(typeof e==\`function\`){var n=e;if(e=n(),fo){L(!0);try{n()}finally{L(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:jo,lastRenderedState:e},t}function Ho(e,t,n,r){return e.baseState=n,No(e,so,typeof r==\`function\`?r:jo)}function Uo(e,t,n,r,a){if(js(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)}};P.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Wo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Wo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=P.T,o={};P.T=o;try{var s=n(i,r),c=P.S;c!==null&&c(o,s),Go(e,t,s)}catch(n){qo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),P.T=a}}else try{a=n(i,r),Go(e,t,a)}catch(n){qo(e,t,n)}}function Go(e,t,n){typeof n==\`object\`&&n&&typeof n.then==\`function\`?n.then(function(n){Ko(e,t,n)},function(n){return qo(e,t,n)}):Ko(e,t,n)}function Ko(e,t,n){t.status=\`fulfilled\`,t.value=n,Jo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Wo(e,n)))}function qo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=\`rejected\`,t.reason=n,Jo(t),t=t.next;while(t!==r)}e.action=null}function Jo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Yo(e,t){return t}function Xo(e,t){if(G){var n=Rl.formState;if(n!==null){a:{var r=K;if(G){if(Oi){b:{for(var i=Oi,a=Ai;i.nodeType!==8;){if(!a){i=null;break b}if(i=df(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===\`F!\`||a===\`F\`?i:null}if(i){Oi=df(i.nextSibling),r=i.data===\`F!\`;break a}}Mi(r)}r=!1}r&&(t=n[0])}}return n=To(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yo,lastRenderedState:t},n.queue=r,n=Os.bind(null,K,r),r.dispatch=n,r=Vo(!1),a=As.bind(null,K,!1,r.queue),r=To(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Uo.bind(null,K,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Zo(e){return Qo(Eo(),so,e)}function Qo(e,t,n){if(t=No(e,t,Yo)[0],e=Mo(jo)[0],typeof t==\`object\`&&t&&typeof t.then==\`function\`)try{var r=Oo(t)}catch(e){throw e===ga?va:e}else r=t;t=Eo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(K.flags|=2048,ts(9,{destroy:void 0},$o.bind(null,i,n),null)),[r,a,e]}function $o(e,t){e.action=t}function es(e){var t=Eo(),n=so;if(n!==null)return Qo(t,n,e);Eo(),t=t.memoizedState,n=Eo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ts(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=K.updateQueue,t===null&&(t=Do(),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 ns(){return Eo().memoizedState}function rs(e,t,n,r){var i=To();K.flags|=e,i.memoizedState=ts(1|t,{destroy:void 0},n,r===void 0?null:r)}function is(e,t,n,r){var i=Eo();r=r===void 0?null:r;var a=i.memoizedState.inst;so!==null&&r!==null&&_o(r,so.memoizedState.deps)?i.memoizedState=ts(t,a,n,r):(K.flags|=e,i.memoizedState=ts(1|t,a,n,r))}function as(e,t){rs(8390656,8,e,t)}function os(e,t){is(2048,8,e,t)}function ss(e){K.flags|=4;var t=K.updateQueue;if(t===null)t=Do(),K.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function cs(e){var t=Eo().memoizedState;return ss({ref:t,nextImpl:e}),function(){if(Ll&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function ls(e,t){return is(4,2,e,t)}function us(e,t){return is(4,4,e,t)}function ds(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 fs(e,t,n){n=n==null?null:n.concat([e]),is(4,4,ds.bind(null,t,e),n)}function ps(){}function ms(e,t){var n=Eo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&_o(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function hs(e,t){var n=Eo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&_o(t,r[1]))return r[0];if(r=e(),fo){L(!0);try{e()}finally{L(!1)}}return n.memoizedState=[r,t],r}function gs(e,t,n){return n===void 0||oo&1073741824&&!(Y&261930)?e.memoizedState=t:(e.memoizedState=n,e=hu(),K.lanes|=e,Kl|=e,n)}function _s(e,t,n,r){return _r(n,t)?n:Ka.current===null?!(oo&42)||oo&1073741824&&!(Y&261930)?($s=!0,e.memoizedState=n):(e=hu(),K.lanes|=e,Kl|=e,t):(e=gs(e,n,r),_r(e,t)||($s=!0),e)}function vs(e,t,n,r,i){var a=F.p;F.p=a!==0&&8>a?a:8;var o=P.T,s={};P.T=s,As(e,!1,t,n);try{var c=i(),l=P.S;l!==null&&l(s,c),typeof c==\`object\`&&c&&typeof c.then==\`function\`?ks(e,t,ua(c,r),mu(e)):ks(e,t,r,mu(e))}catch(n){ks(e,t,{then:function(){},status:\`rejected\`,reason:n},mu())}finally{F.p=a,o!==null&&s.types!==null&&(o.types=s.types),P.T=o}}function ys(){}function bs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=xs(e).queue;vs(e,a,t,ne,n===null?ys:function(){return Ss(e),n(r)})}function xs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:jo,lastRenderedState:ne},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:jo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ss(e){var t=xs(e);t.next===null&&(t=e.alternate.memoizedState),ks(e,t.next.queue,{},mu())}function Cs(){return Yi(tp)}function ws(){return Eo().memoizedState}function Ts(){return Eo().memoizedState}function Es(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=mu();e=La(n);var r=Ra(t,e,n);r!==null&&(gu(r,t,n),za(r,t,n)),t={cache:na()},e.payload=t;return}t=t.return}}function Ds(e,t,n){var r=mu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},js(e)?Ms(t,n):(n=Xr(e,t,n,r),n!==null&&(gu(n,e,r),Ns(n,t,r)))}function Os(e,t,n){ks(e,t,n,mu())}function ks(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(js(e))Ms(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,_r(s,o))return Yr(e,t,i,0),Rl===null&&Jr(),!1}catch{}if(n=Xr(e,t,i,r),n!==null)return gu(n,e,r),Ns(n,t,r),!0}return!1}function As(e,t,n,r){if(r={lane:2,revertLane:pd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},js(e)){if(t)throw Error(i(479))}else t=Xr(e,n,r,2),t!==null&&gu(t,e,2)}function js(e){var t=e.alternate;return e===K||t!==null&&t===K}function Ms(e,t){uo=lo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ns(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,et(e,n)}}var Ps={readContext:Yi,use:ko,useCallback:q,useContext:q,useEffect:q,useImperativeHandle:q,useLayoutEffect:q,useInsertionEffect:q,useMemo:q,useReducer:q,useRef:q,useState:q,useDebugValue:q,useDeferredValue:q,useTransition:q,useSyncExternalStore:q,useId:q,useHostTransitionStatus:q,useFormState:q,useActionState:q,useOptimistic:q,useMemoCache:q,useCacheRefresh:q};Ps.useEffectEvent=q;var Fs={readContext:Yi,use:ko,useCallback:function(e,t){return To().memoizedState=[e,t===void 0?null:t],e},useContext:Yi,useEffect:as,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),rs(4194308,4,ds.bind(null,t,e),n)},useLayoutEffect:function(e,t){return rs(4194308,4,e,t)},useInsertionEffect:function(e,t){rs(4,2,e,t)},useMemo:function(e,t){var n=To();t=t===void 0?null:t;var r=e();if(fo){L(!0);try{e()}finally{L(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=To();if(n!==void 0){var i=n(t);if(fo){L(!0);try{n(t)}finally{L(!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=Ds.bind(null,K,e),[r.memoizedState,e]},useRef:function(e){var t=To();return e={current:e},t.memoizedState=e},useState:function(e){e=Vo(e);var t=e.queue,n=Os.bind(null,K,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ps,useDeferredValue:function(e,t){return gs(To(),e,t)},useTransition:function(){var e=Vo(!1);return e=vs.bind(null,K,e.queue,!0,!1),To().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=K,a=To();if(G){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Rl===null)throw Error(i(349));Y&127||Io(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,as(Ro.bind(null,r,o,e),[e]),r.flags|=2048,ts(9,{destroy:void 0},Lo.bind(null,r,o,n,t),null),n},useId:function(){var e=To(),t=Rl.identifierPrefix;if(G){var n=xi,r=bi;n=(r&~(1<<32-Re(r)-1)).toString(32)+n,t=\`_\`+t+\`R_\`+n,n=po++,0<n&&(t+=\`H\`+n.toString(32)),t+=\`_\`}else n=go++,t=\`_\`+t+\`r_\`+n.toString(32)+\`_\`;return e.memoizedState=t},useHostTransitionStatus:Cs,useFormState:Xo,useActionState:Xo,useOptimistic:function(e){var t=To();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=As.bind(null,K,!0,n),n.dispatch=t,[e,t]},useMemoCache:Ao,useCacheRefresh:function(){return To().memoizedState=Es.bind(null,K)},useEffectEvent:function(e){var t=To(),n={impl:e};return t.memoizedState=n,function(){if(Ll&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Is={readContext:Yi,use:ko,useCallback:ms,useContext:Yi,useEffect:os,useImperativeHandle:fs,useInsertionEffect:ls,useLayoutEffect:us,useMemo:hs,useReducer:Mo,useRef:ns,useState:function(){return Mo(jo)},useDebugValue:ps,useDeferredValue:function(e,t){return _s(Eo(),so.memoizedState,e,t)},useTransition:function(){var e=Mo(jo)[0],t=Eo().memoizedState;return[typeof e==\`boolean\`?e:Oo(e),t]},useSyncExternalStore:Fo,useId:ws,useHostTransitionStatus:Cs,useFormState:Zo,useActionState:Zo,useOptimistic:function(e,t){return Ho(Eo(),so,e,t)},useMemoCache:Ao,useCacheRefresh:Ts};Is.useEffectEvent=cs;var Ls={readContext:Yi,use:ko,useCallback:ms,useContext:Yi,useEffect:os,useImperativeHandle:fs,useInsertionEffect:ls,useLayoutEffect:us,useMemo:hs,useReducer:Po,useRef:ns,useState:function(){return Po(jo)},useDebugValue:ps,useDeferredValue:function(e,t){var n=Eo();return so===null?gs(n,e,t):_s(n,so.memoizedState,e,t)},useTransition:function(){var e=Po(jo)[0],t=Eo().memoizedState;return[typeof e==\`boolean\`?e:Oo(e),t]},useSyncExternalStore:Fo,useId:ws,useHostTransitionStatus:Cs,useFormState:es,useActionState:es,useOptimistic:function(e,t){var n=Eo();return so===null?(n.baseState=e,[e,n.queue.dispatch]):Ho(n,so,e,t)},useMemoCache:Ao,useCacheRefresh:Ts};Ls.useEffectEvent=cs;function Rs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:h({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var zs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=mu(),i=La(r);i.payload=t,n!=null&&(i.callback=n),t=Ra(e,i,r),t!==null&&(gu(t,e,r),za(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=mu(),i=La(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ra(e,i,r),t!==null&&(gu(t,e,r),za(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=mu(),r=La(n);r.tag=2,t!=null&&(r.callback=t),t=Ra(e,r,n),t!==null&&(gu(t,e,n),za(t,e,n))}};function Bs(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?!vr(n,r)||!vr(i,a):!0}function Vs(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&&zs.enqueueReplaceState(t,t.state,null)}function Hs(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=h({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Us(e){Wr(e)}function Ws(e){console.error(e)}function Gs(e){Wr(e)}function Ks(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function qs(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 Js(e,t,n){return n=La(n),n.tag=3,n.payload={element:null},n.callback=function(){Ks(e,t)},n}function Ys(e){return e=La(e),e.tag=3,e}function Xs(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(){qs(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==\`function\`&&(e.callback=function(){qs(t,n,r),typeof i!=\`function\`&&(iu===null?iu=new Set([this]):iu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?\`\`:e})})}function Zs(e,t,n,r,a){if(n.flags|=32768,typeof r==\`object\`&&r&&typeof r.then==\`function\`){if(t=n.alternate,t!==null&&Ki(t,n,a,!0),n=Za.current,n!==null){switch(n.tag){case 31:case 13:return Qa===null?Ou():n.alternate===null&&Gl===0&&(Gl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===ya?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),qu(e,r,a)),!1;case 22:return n.flags|=65536,r===ya?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)),qu(e,r,a)),!1}throw Error(i(435,n.tag))}return qu(e,r,a),Ou(),!1}if(G)return t=Za.current,t===null?(r!==ji&&(t=Error(i(423),{cause:r}),Ri(fi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=fi(r,n),a=Js(e.stateNode,r,a),Ba(e,a),Gl!==4&&(Gl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==ji&&(e=Error(i(422),{cause:r}),Ri(fi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=fi(o,n),Zl===null?Zl=[o]:Zl.push(o),Gl!==4&&(Gl=2),t===null)return!0;r=fi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Js(n.stateNode,r,e),Ba(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\`&&(iu===null||!iu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Ys(a),Xs(a,e,n,r),Ba(n,a),!1}n=n.return}while(n!==null);return!1}var Qs=Error(i(461)),$s=!1;function ec(e,t,n,r){t.child=e===null?Na(t,null,n,r):Ma(t,e.child,n,r)}function tc(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 Ji(t),r=vo(e,t,n,o,a,i),s=So(),e!==null&&!$s?(Co(e,t,i),Tc(e,t,i)):(G&&s&&wi(t),t.flags|=1,ec(e,t,r,i),t.child)}function nc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==\`function\`&&!ri(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,rc(e,t,a,r,i)):(e=oi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Ec(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?vr:n,n(o,r)&&e.ref===t.ref)return Tc(e,t,i)}return t.flags|=1,e=ii(a,r),e.ref=t.ref,e.return=t,t.child=e}function rc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(vr(a,r)&&e.ref===t.ref)if($s=!1,t.pendingProps=r=a,Ec(e,i))e.flags&131072&&($s=!0);else return t.lanes=e.lanes,Tc(e,t,i)}return dc(e,t,n,r,i)}function ic(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 oc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ma(t,a===null?null:a.cachePool),a===null?Ya():Ja(t,a),to(t);else return r=t.lanes=536870912,oc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ma(t,null),Ya(),no(t)):(ma(t,a.cachePool),Ja(t,a),no(t),t.memoizedState=null);return ec(e,t,i,n),t.child}function ac(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function oc(e,t,n,r,i){var a=pa();return a=a===null?null:{parent:ta._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ma(t,null),Ya(),to(t),e!==null&&Ki(e,t,r,!0),t.childLanes=i,null}function sc(e,t){return t=bc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function cc(e,t,n){return Ma(t,e.child,null,n),e=sc(t,t.pendingProps),e.flags|=2,ro(t),t.memoizedState=null,e}function lc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(G){if(r.mode===\`hidden\`)return e=sc(t,r),t.lanes=536870912,ac(null,e);if(eo(t),(e=Oi)?(e=cf(e,Ai),e=e!==null&&e.data===\`&\`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:yi===null?null:{id:bi,overflow:xi},retryLane:536870912,hydrationErrors:null},n=li(e),n.return=t,t.child=n,Di=t,Oi=null)):e=null,e===null)throw Mi(t);return t.lanes=536870912,null}return sc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(eo(t),a)if(t.flags&256)t.flags&=-257,t=cc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if($s||Ki(e,t,n,!1),a=(n&e.childLanes)!==0,$s||a){if(r=Rl,r!==null&&(s=tt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Zr(e,s),gu(r,e,s),Qs;Ou(),t=cc(e,t,n)}else e=o.treeContext,Oi=df(s.nextSibling),Di=t,G=!0,ki=null,Ai=!1,e!==null&&Ei(t,e),t=sc(t,r),t.flags|=4096;return t}return e=ii(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function uc(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 dc(e,t,n,r,i){return Ji(t),n=vo(e,t,n,r,void 0,i),r=So(),e!==null&&!$s?(Co(e,t,i),Tc(e,t,i)):(G&&r&&wi(t),t.flags|=1,ec(e,t,n,i),t.child)}function fc(e,t,n,r,i,a){return Ji(t),t.updateQueue=null,n=bo(t,r,n,i),yo(e),r=So(),e!==null&&!$s?(Co(e,t,a),Tc(e,t,a)):(G&&r&&wi(t),t.flags|=1,ec(e,t,n,a),t.child)}function pc(e,t,n,r,i){if(Ji(t),t.stateNode===null){var a=ei,o=n.contextType;typeof o==\`object\`&&o&&(a=Yi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=zs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Fa(t),o=n.contextType,a.context=typeof o==\`object\`&&o?Yi(o):ei,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==\`function\`&&(Rs(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&&zs.enqueueReplaceState(a,a.state,null),Ua(t,r,a,i),Ha(),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=Hs(n,s);a.props=c;var l=a.context,u=n.contextType;o=ei,typeof u==\`object\`&&u&&(o=Yi(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)&&Vs(t,a,r,o),Pa=!1;var f=t.memoizedState;a.state=f,Ua(t,r,a,i),Ha(),l=t.memoizedState,s||f!==l||Pa?(typeof d==\`function\`&&(Rs(t,n,d,r),l=t.memoizedState),(c=Pa||Bs(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,Ia(e,t),o=t.memoizedProps,u=Hs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ei,typeof l==\`object\`&&l&&(c=Yi(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)&&Vs(t,a,r,c),Pa=!1,f=t.memoizedState,a.state=f,Ua(t,r,a,i),Ha();var p=t.memoizedState;o!==d||f!==p||Pa||e!==null&&e.dependencies!==null&&qi(e.dependencies)?(typeof s==\`function\`&&(Rs(t,n,s,r),p=t.memoizedState),(u=Pa||Bs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&qi(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,uc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=\`function\`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Ma(t,e.child,null,i),t.child=Ma(t,null,n,i)):ec(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Tc(e,t,i),e}function mc(e,t,n,r){return Ii(),t.flags|=256,ec(e,t,n,r),t.child}var hc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function gc(e){return{baseLanes:e,cachePool:ha()}}function _c(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Yl),e}function vc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(io.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(G){if(a?$a(t):no(t),(e=Oi)?(e=cf(e,Ai),e=e!==null&&e.data!==\`&\`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:yi===null?null:{id:bi,overflow:xi},retryLane:536870912,hydrationErrors:null},n=li(e),n.return=t,t.child=n,Di=t,Oi=null)):e=null,e===null)throw Mi(t);return uf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(no(t),a=t.mode,c=bc({mode:\`hidden\`,children:c},a),r=si(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=gc(n),r.childLanes=_c(e,s,n),t.memoizedState=hc,ac(null,r)):($a(t),yc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?($a(t),t.flags&=-257,t=xc(e,t,n)):t.memoizedState===null?(no(t),c=r.fallback,a=t.mode,r=bc({mode:\`visible\`,children:r.children},a),c=si(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ma(t,e.child,null,n),r=t.child,r.memoizedState=gc(n),r.childLanes=_c(e,s,n),t.memoizedState=hc,t=ac(null,r)):(no(t),t.child=e.child,t.flags|=128,t=null);else if($a(t),uf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=\`\`,r.digest=s,Ri({value:r,source:null,stack:null}),t=xc(e,t,n)}else if($s||Ki(e,t,n,!1),s=(n&e.childLanes)!==0,$s||s){if(s=Rl,s!==null&&(r=tt(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Zr(e,r),gu(s,e,r),Qs;lf(c)||Ou(),t=xc(e,t,n)}else lf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Oi=df(c.nextSibling),Di=t,G=!0,ki=null,Ai=!1,e!==null&&Ei(t,e),t=yc(t,r.children),t.flags|=4096);return t}return a?(no(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=ii(l,{mode:\`hidden\`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=si(c,a,n,null),c.flags|=2):c=ii(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,ac(null,r),r=t.child,c=e.child.memoizedState,c===null?c=gc(n):(a=c.cachePool,a===null?a=ha():(l=ta._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=_c(e,s,n),t.memoizedState=hc,ac(e.child,r)):($a(t),n=e.child,e=n.sibling,n=ii(n,{mode:\`visible\`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function yc(e,t){return t=bc({mode:\`visible\`,children:t},e.mode),t.return=e,e.child=t}function bc(e,t){return e=ni(22,e,null,t),e.lanes=0,e}function xc(e,t,n){return Ma(t,e.child,null,n),e=yc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Sc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Wi(e.return,t,n)}function Cc(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 wc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=io.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,I(io,o),ec(e,t,r,n),r=G?gi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Sc(e,n,t);else if(e.tag===19)Sc(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\`forwards\`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&ao(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Cc(t,!1,i,n,a,r);break;case\`backwards\`:case\`unstable_legacy-backwards\`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&ao(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Cc(t,!0,n,null,a,r);break;case\`together\`:Cc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Tc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Kl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Ki(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=ii(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ii(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Ec(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&qi(e))):!0}function Dc(e,t,n){switch(t.tag){case 3:de(t,t.stateNode.containerInfo),Hi(t,ta,e.memoizedState.cache),Ii();break;case 27:case 5:pe(t);break;case 4:de(t,t.stateNode.containerInfo);break;case 10:Hi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,eo(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?($a(t),e=Tc(e,t,n),e===null?null:e.sibling):vc(e,t,n):($a(t),t.flags|=128,null);$a(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Ki(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return wc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),I(io,io.current),r)break;return null;case 22:return t.lanes=0,ic(e,t,n,t.pendingProps);case 24:Hi(t,ta,e.memoizedState.cache)}return Tc(e,t,n)}function Oc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)$s=!0;else{if(!Ec(e,n)&&!(t.flags&128))return $s=!1,Dc(e,t,n);$s=!!(e.flags&131072)}else $s=!1,G&&t.flags&1048576&&Ci(t,gi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Sa(t.elementType),t.type=e,typeof e==\`function\`)ri(e)?(r=Hs(e,r),t.tag=1,t=pc(null,t,e,r,n)):(t.tag=0,t=dc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=tc(null,t,e,r,n);break a}else if(a===D){t.tag=14,t=nc(null,t,e,r,n);break a}}throw t=ee(e)||e,Error(i(306,t,\`\`))}}return t;case 0:return dc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Hs(r,t.pendingProps),pc(e,t,r,a,n);case 3:a:{if(de(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ia(e,t),Ua(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Hi(t,ta,r),r!==o.cache&&Gi(t,[ta],n,!0),Ha(),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=mc(e,t,r,n);break a}else if(r!==a){a=fi(Error(i(424)),t),Ri(a),t=mc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===\`HTML\`?e.ownerDocument.body:e}for(Oi=df(e.firstChild),Di=t,G=!0,ki=null,Ai=!0,n=Na(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ii(),r===a){t=Tc(e,t,n);break a}ec(e,t,r,n)}t=t.child}return t;case 26:return uc(e,t),e===null?(n=Mf(t.type,null,t.pendingProps,null))?t.memoizedState=n:G||(n=t.type,e=t.pendingProps,r=Wd(le.current).createElement(n),r[st]=t,r[ct]=e,Rd(r,n,e),bt(r),t.stateNode=r):t.memoizedState=Mf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return pe(t),e===null&&G&&(r=t.stateNode=hf(t.type,t.pendingProps,le.current),Di=t,Ai=!0,a=Oi,tf(t.type)?(ff=a,Oi=df(r.firstChild)):Oi=a),ec(e,t,t.pendingProps.children,n),uc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&G&&((a=r=Oi)&&(r=of(r,t.type,t.pendingProps,Ai),r===null?a=!1:(t.stateNode=r,Di=t,Oi=df(r.firstChild),Ai=!1,a=!0)),a||Mi(t)),pe(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,qd(a,o)?r=null:s!==null&&qd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=vo(e,t,xo,null,null,n),tp._currentValue=a),uc(e,t),ec(e,t,r,n),t.child;case 6:return e===null&&G&&((e=n=Oi)&&(n=sf(n,t.pendingProps,Ai),n===null?e=!1:(t.stateNode=n,Di=t,Oi=null,e=!0)),e||Mi(t)),null;case 13:return vc(e,t,n);case 4:return de(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ma(t,null,r,n):ec(e,t,r,n),t.child;case 11:return tc(e,t,t.type,t.pendingProps,n);case 7:return ec(e,t,t.pendingProps,n),t.child;case 8:return ec(e,t,t.pendingProps.children,n),t.child;case 12:return ec(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Hi(t,t.type,r.value),ec(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Ji(t),a=Yi(a),r=r(a),t.flags|=1,ec(e,t,r,n),t.child;case 14:return nc(e,t,t.type,t.pendingProps,n);case 15:return rc(e,t,t.type,t.pendingProps,n);case 19:return wc(e,t,n);case 31:return lc(e,t,n);case 22:return ic(e,t,n,t.pendingProps);case 24:return Ji(t),r=Yi(ta),e===null?(a=pa(),a===null&&(a=Rl,o=na(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Fa(t),Hi(t,ta,a)):((e.lanes&n)!==0&&(Ia(e,t),Ua(t,null,null,n),Ha()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Hi(t,ta,r),r!==a.cache&&Gi(t,[ta],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Hi(t,ta,r))),ec(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function kc(e){e.flags|=4}function Ac(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Tu())e.flags|=8192;else throw Ca=ya,_a}else e.flags&=-16777217}function jc(e,t){if(t.type!==\`stylesheet\`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!qf(t))if(Tu())e.flags|=8192;else throw Ca=ya,_a}function Mc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Ye(),e.lanes|=t,Xl|=t)}function Nc(e,t){if(!G)switch(e.tailMode){case\`hidden\`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case\`collapsed\`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Pc(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&65011712,r|=i.flags&65011712,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 Fc(e,t,n){var r=t.pendingProps;switch(Ti(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pc(t),null;case 1:return Pc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Ui(ta),fe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Fi(t)?kc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Li())),Pc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(kc(t),o===null?(Pc(t),Ac(t,a,null,r,n)):(Pc(t),jc(t,o))):o?o===e.memoizedState?(Pc(t),t.flags&=-16777217):(kc(t),Pc(t),jc(t,o)):(e=e.memoizedProps,e!==r&&kc(t),Pc(t),Ac(t,a,e,r,n)),null;case 27:if(me(t),n=le.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&kc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Pc(t),null}e=se.current,Fi(t)?Ni(t,e):(e=hf(a,r,n),t.stateNode=e,kc(t))}return Pc(t),null;case 5:if(me(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&kc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Pc(t),null}if(o=se.current,Fi(t))Ni(t,o);else{var s=Wd(le.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[st]=t,o[ct]=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(Rd(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&&kc(t)}}return Pc(t),Ac(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&kc(t);else{if(typeof r!=\`string\`&&t.stateNode===null)throw Error(i(166));if(e=le.current,Fi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Di,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[st]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Fd(e.nodeValue,n)),e||Mi(t,!0)}else e=Wd(e).createTextNode(r),e[st]=t,t.stateNode=e}return Pc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Fi(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[st]=t}else Ii(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Pc(t),e=!1}else n=Li(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ro(t),t):(ro(t),null);if(t.flags&128)throw Error(i(558))}return Pc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Fi(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[st]=t}else Ii(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Pc(t),a=!1}else a=Li(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(ro(t),t):(ro(t),null)}return ro(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),Mc(t,t.updateQueue),Pc(t),null);case 4:return fe(),e===null&&Td(t.stateNode.containerInfo),Pc(t),null;case 10:return Ui(t.type),Pc(t),null;case 19:if(oe(io),r=t.memoizedState,r===null)return Pc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Nc(r,!1);else{if(Gl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=ao(e),o!==null){for(t.flags|=128,Nc(r,!1),e=o.updateQueue,t.updateQueue=e,Mc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ai(n,e),n=n.sibling;return I(io,io.current&1|2),G&&Si(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&De()>nu&&(t.flags|=128,a=!0,Nc(r,!1),t.lanes=4194304)}else{if(!a)if(e=ao(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Mc(t,e),Nc(r,!0),r.tail===null&&r.tailMode===\`hidden\`&&!o.alternate&&!G)return Pc(t),null}else 2*De()-r.renderingStartTime>nu&&n!==536870912&&(t.flags|=128,a=!0,Nc(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)}return r.tail===null?(Pc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=De(),e.sibling=null,n=io.current,I(io,a?n&1|2:n&1),G&&Si(t,r.treeForkCount),e);case 22:case 23:return ro(t),Xa(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Pc(t),t.subtreeFlags&6&&(t.flags|=8192)):Pc(t),n=t.updateQueue,n!==null&&Mc(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&&oe(fa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ui(ta),Pc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Ic(e,t){switch(Ti(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ui(ta),fe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return me(t),null;case 31:if(t.memoizedState!==null){if(ro(t),t.alternate===null)throw Error(i(340));Ii()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ro(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Ii()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return oe(io),null;case 4:return fe(),null;case 10:return Ui(t.type),null;case 22:case 23:return ro(t),Xa(),e!==null&&oe(fa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ui(ta),null;case 25:return null;default:return null}}function Lc(e,t){switch(Ti(t),t.tag){case 3:Ui(ta),fe();break;case 26:case 27:case 5:me(t);break;case 4:fe();break;case 31:t.memoizedState!==null&&ro(t);break;case 13:ro(t);break;case 19:oe(io);break;case 10:Ui(t.type);break;case 22:case 23:ro(t),Xa(),e!==null&&oe(fa);break;case 24:Ui(ta)}}function Rc(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){Ku(t,t.return,e)}}function zc(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){Ku(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Ku(t,t.return,e)}}function Bc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ga(t,n)}catch(t){Ku(e,e.return,t)}}}function Vc(e,t,n){n.props=Hs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Ku(e,t,n)}}function Hc(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:r=e.stateNode;break;default:r=e.stateNode}typeof n==\`function\`?e.refCleanup=n(r):n.current=r}}catch(n){Ku(e,t,n)}}function Uc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==\`function\`)try{r()}catch(n){Ku(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){Ku(e,t,n)}else n.current=null}function Wc(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){Ku(e,e.return,t)}}function Gc(e,t,n){try{var r=e.stateNode;zd(r,e.type,n,t),r[ct]=t}catch(t){Ku(e,e.return,t)}}function Kc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&tf(e.type)||e.tag===4}function qc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Kc(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&&tf(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 Jc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===\`HTML\`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===\`HTML\`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=z));else if(r!==4&&(r===27&&tf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Jc(e,t,n),e=e.sibling;e!==null;)Jc(e,t,n),e=e.sibling}function Yc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&tf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Yc(e,t,n),e=e.sibling;e!==null;)Yc(e,t,n),e=e.sibling}function Xc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Rd(t,r,n),t[st]=e,t[ct]=n}catch(t){Ku(e,e.return,t)}}var Zc=!1,Qc=!1,$c=!1,el=typeof WeakSet==\`function\`?WeakSet:Set,tl=null;function nl(e,t){if(e=e.containerInfo,Hd=up,e=Sr(e),Cr(e)){if(\`selectionStart\`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Ud={focusedElem:e,selectionRange:n},up=!1,tl=t;tl!==null;)if(t=tl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,tl=e;else for(;tl!==null;){switch(t=tl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Hs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Ku(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)af(e);else if(n===1)switch(e.nodeName){case\`HEAD\`:case\`HTML\`:case\`BODY\`:af(e);break;default:e.textContent=\`\`}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,tl=e;break}tl=t.return}}function rl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:vl(e,n),r&4&&Rc(5,n);break;case 1:if(vl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Ku(n,n.return,e)}else{var i=Hs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Ku(n,n.return,e)}}r&64&&Bc(n),r&512&&Hc(n,n.return);break;case 3:if(vl(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{Ga(e,t)}catch(e){Ku(n,n.return,e)}}break;case 27:t===null&&r&4&&Xc(n);case 26:case 5:vl(e,n),t===null&&r&4&&Wc(n),r&512&&Hc(n,n.return);break;case 12:vl(e,n);break;case 31:vl(e,n),r&4&&ll(e,n);break;case 13:vl(e,n),r&4&&ul(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Xu.bind(null,n),X(e,n))));break;case 22:if(r=n.memoizedState!==null||Zc,!r){t=t!==null&&t.memoizedState!==null||Qc,i=Zc;var a=Qc;Zc=r,(Qc=t)&&!a?bl(e,n,(n.subtreeFlags&8772)!=0):vl(e,n),Zc=i,Qc=a}break;case 30:break;default:vl(e,n)}}function il(e){var t=e.alternate;t!==null&&(e.alternate=null,il(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ht(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 al=null,ol=!1;function sl(e,t,n){for(n=n.child;n!==null;)cl(e,t,n),n=n.sibling}function cl(e,t,n){if(Le&&typeof Le.onCommitFiberUnmount==\`function\`)try{Le.onCommitFiberUnmount(Ie,n)}catch{}switch(n.tag){case 26:Qc||Uc(n,t),sl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Qc||Uc(n,t);var r=al,i=ol;tf(n.type)&&(al=n.stateNode,ol=!1),sl(e,t,n),gf(n.stateNode),al=r,ol=i;break;case 5:Qc||Uc(n,t);case 6:if(r=al,i=ol,al=null,sl(e,t,n),al=r,ol=i,al!==null)if(ol)try{(al.nodeType===9?al.body:al.nodeName===\`HTML\`?al.ownerDocument.body:al).removeChild(n.stateNode)}catch(e){Ku(n,t,e)}else try{al.removeChild(n.stateNode)}catch(e){Ku(n,t,e)}break;case 18:al!==null&&(ol?(e=al,nf(e.nodeType===9?e.body:e.nodeName===\`HTML\`?e.ownerDocument.body:e,n.stateNode),Ip(e)):nf(al,n.stateNode));break;case 4:r=al,i=ol,al=n.stateNode.containerInfo,ol=!0,sl(e,t,n),al=r,ol=i;break;case 0:case 11:case 14:case 15:zc(2,n,t),Qc||zc(4,n,t),sl(e,t,n);break;case 1:Qc||(Uc(n,t),r=n.stateNode,typeof r.componentWillUnmount==\`function\`&&Vc(n,t,r)),sl(e,t,n);break;case 21:sl(e,t,n);break;case 22:Qc=(r=Qc)||n.memoizedState!==null,sl(e,t,n),Qc=r;break;default:sl(e,t,n)}}function ll(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ip(e)}catch(e){Ku(t,t.return,e)}}}function ul(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ip(e)}catch(e){Ku(t,t.return,e)}}function dl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new el),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new el),t;default:throw Error(i(435,e.tag))}}function fl(e,t){var n=dl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Zu.bind(null,e,t);t.then(r,r)}})}function pl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(tf(c.type)){al=c.stateNode,ol=!1;break a}break;case 5:al=c.stateNode,ol=!1;break a;case 3:case 4:al=c.stateNode.containerInfo,ol=!0;break a}c=c.return}if(al===null)throw Error(i(160));cl(o,s,a),al=null,ol=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)hl(t,e),t=t.sibling}var ml=null;function hl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:pl(t,e),gl(e),r&4&&(zc(3,e,e.return),Rc(3,e),zc(5,e,e.return));break;case 1:pl(t,e),gl(e),r&512&&(Qc||n===null||Uc(n,n.return)),r&64&&Zc&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=ml;if(pl(t,e),gl(e),r&512&&(Qc||n===null||Uc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case\`title\`:o=a.getElementsByTagName(\`title\`)[0],(!o||o[mt]||o[st]||o.namespaceURI===\`http://www.w3.org/2000/svg\`||o.hasAttribute(\`itemprop\`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(\`head > title\`))),Rd(o,r,n),o[st]=e,bt(o),r=o;break a;case\`link\`:var s=Wf(\`link\`,\`href\`,a).get(r+(n.href||\`\`));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(\`href\`)===(n.href==null||n.href===\`\`?null:n.href)&&o.getAttribute(\`rel\`)===(n.rel==null?null:n.rel)&&o.getAttribute(\`title\`)===(n.title==null?null:n.title)&&o.getAttribute(\`crossorigin\`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Rd(o,r,n),a.head.appendChild(o);break;case\`meta\`:if(s=Wf(\`meta\`,\`content\`,a).get(r+(n.content||\`\`))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(\`content\`)===(n.content==null?null:\`\`+n.content)&&o.getAttribute(\`name\`)===(n.name==null?null:n.name)&&o.getAttribute(\`property\`)===(n.property==null?null:n.property)&&o.getAttribute(\`http-equiv\`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(\`charset\`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Rd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[st]=e,bt(o),r=o}e.stateNode=r}else Gf(a,e.type,e.stateNode);else e.stateNode=zf(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&Gc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Gf(a,e.type,e.stateNode):zf(a,r,e.memoizedProps))}break;case 27:pl(t,e),gl(e),r&512&&(Qc||n===null||Uc(n,n.return)),n!==null&&r&4&&Gc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(pl(t,e),gl(e),r&512&&(Qc||n===null||Uc(n,n.return)),e.flags&32){a=e.stateNode;try{Kt(a,\`\`)}catch(t){Ku(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Gc(e,a,n===null?a:n.memoizedProps)),r&1024&&($c=!0);break;case 6:if(pl(t,e),gl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Ku(e,e.return,t)}}break;case 3:if(Uf=null,a=ml,ml=yf(t.containerInfo),pl(t,e),ml=a,gl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Ip(t.containerInfo)}catch(t){Ku(e,e.return,t)}$c&&($c=!1,_l(e));break;case 4:r=ml,ml=yf(e.stateNode.containerInfo),pl(t,e),gl(e),ml=r;break;case 12:pl(t,e),gl(e);break;case 31:pl(t,e),gl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,fl(e,r)));break;case 13:pl(t,e),gl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(eu=De()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,fl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Zc,d=Qc;if(Zc=u||a,Qc=d||l,pl(t,e),Qc=d,Zc=u,gl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||Zc||Qc||yl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==\`function\`?s.setProperty(\`display\`,\`none\`,\`important\`):s.display=\`none\`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(\`display\`)?f.display:null;c.style.display=p==null||typeof p==\`boolean\`?\`\`:(\`\`+p).trim()}}catch(e){Ku(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?\`\`:l.memoizedProps}catch(e){Ku(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?rf(m,!0):rf(l.stateNode,!1)}catch(e){Ku(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,fl(e,n))));break;case 19:pl(t,e),gl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,fl(e,r)));break;case 30:break;case 21:break;default:pl(t,e),gl(e)}}function gl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Kc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Yc(e,qc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Kt(o,\`\`),n.flags&=-33),Yc(e,qc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Jc(e,qc(e),s);break;default:throw Error(i(161))}}catch(t){Ku(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function _l(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;_l(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function vl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)rl(e,t.alternate,t),t=t.sibling}function yl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:zc(4,t,t.return),yl(t);break;case 1:Uc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==\`function\`&&Vc(t,t.return,n),yl(t);break;case 27:gf(t.stateNode);case 26:case 5:Uc(t,t.return),yl(t);break;case 22:t.memoizedState===null&&yl(t);break;case 30:yl(t);break;default:yl(t)}e=e.sibling}}function bl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:bl(i,a,n),Rc(4,a);break;case 1:if(bl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==\`function\`)try{i.componentDidMount()}catch(e){Ku(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Wa(c[i],s)}catch(e){Ku(r,r.return,e)}}n&&o&64&&Bc(a),Hc(a,a.return);break;case 27:Xc(a);case 26:case 5:bl(i,a,n),n&&r===null&&o&4&&Wc(a),Hc(a,a.return);break;case 12:bl(i,a,n);break;case 31:bl(i,a,n),n&&o&4&&ll(i,a);break;case 13:bl(i,a,n),n&&o&4&&ul(i,a);break;case 22:a.memoizedState===null&&bl(i,a,n),Hc(a,a.return);break;case 30:break;default:bl(i,a,n)}t=t.sibling}}function xl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&ra(n))}function Sl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ra(e))}function Cl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)wl(e,t,n,r),t=t.sibling}function wl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Cl(e,t,n,r),i&2048&&Rc(9,t);break;case 1:Cl(e,t,n,r);break;case 3:Cl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ra(e)));break;case 12:if(i&2048){Cl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==\`function\`&&s(o,t.alternate===null?\`mount\`:\`update\`,e.passiveEffectDuration,-0)}catch(e){Ku(t,t.return,e)}}else Cl(e,t,n,r);break;case 31:Cl(e,t,n,r);break;case 13:Cl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Cl(e,t,n,r):(a._visibility|=2,Tl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?Cl(e,t,n,r):El(e,t),i&2048&&xl(o,t);break;case 24:Cl(e,t,n,r),i&2048&&Sl(t.alternate,t);break;default:Cl(e,t,n,r)}}function Tl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!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:Tl(a,o,s,c,i),Rc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Tl(a,o,s,c,i)):u._visibility&2?Tl(a,o,s,c,i):El(a,o),i&&l&2048&&xl(o.alternate,o);break;case 24:Tl(a,o,s,c,i),i&&l&2048&&Sl(o.alternate,o);break;default:Tl(a,o,s,c,i)}t=t.sibling}}function El(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:El(n,r),i&2048&&xl(r.alternate,r);break;case 24:El(n,r),i&2048&&Sl(r.alternate,r);break;default:El(n,r)}t=t.sibling}}var Dl=8192;function Ol(e,t,n){if(e.subtreeFlags&Dl)for(e=e.child;e!==null;)kl(e,t,n),e=e.sibling}function kl(e,t,n){switch(e.tag){case 26:Ol(e,t,n),e.flags&Dl&&e.memoizedState!==null&&Jf(n,ml,e.memoizedState,e.memoizedProps);break;case 5:Ol(e,t,n);break;case 3:case 4:var r=ml;ml=yf(e.stateNode.containerInfo),Ol(e,t,n),ml=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Dl,Dl=16777216,Ol(e,t,n),Dl=r):Ol(e,t,n));break;default:Ol(e,t,n)}}function Al(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 jl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];tl=r,Pl(r,e)}Al(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ml(e),e=e.sibling}function Ml(e){switch(e.tag){case 0:case 11:case 15:jl(e),e.flags&2048&&zc(9,e,e.return);break;case 3:jl(e);break;case 12:jl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Nl(e)):jl(e);break;default:jl(e)}}function Nl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];tl=r,Pl(r,e)}Al(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:zc(8,t,t.return),Nl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Nl(t));break;default:Nl(t)}e=e.sibling}}function Pl(e,t){for(;tl!==null;){var n=tl;switch(n.tag){case 0:case 11:case 15:zc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:ra(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,tl=r;else a:for(n=e;tl!==null;){r=tl;var i=r.sibling,a=r.return;if(il(r),r===n){tl=null;break a}if(i!==null){i.return=a,tl=i;break a}tl=a}}}var Fl={getCacheForType:function(e){var t=Yi(ta),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Yi(ta).controller.signal}},Il=typeof WeakMap==\`function\`?WeakMap:Map,Ll=0,Rl=null,J=null,Y=0,zl=0,Bl=null,Vl=!1,Hl=!1,Ul=!1,Wl=0,Gl=0,Kl=0,ql=0,Jl=0,Yl=0,Xl=0,Zl=null,Ql=null,$l=!1,eu=0,tu=0,nu=1/0,ru=null,iu=null,au=0,ou=null,su=null,cu=0,lu=0,uu=null,du=null,fu=0,pu=null;function mu(){return Ll&2&&Y!==0?Y&-Y:P.T===null?it():pd()}function hu(){if(Yl===0)if(!(Y&536870912)||G){var e=Ue;Ue<<=1,!(Ue&3932160)&&(Ue=262144),Yl=e}else Yl=536870912;return e=Za.current,e!==null&&(e.flags|=32),Yl}function gu(e,t,n){(e===Rl&&(zl===2||zl===9)||e.cancelPendingCommit!==null)&&(Cu(e,0),bu(e,Y,Yl,!1)),Ze(e,n),(!(Ll&2)||e!==Rl)&&(e===Rl&&(!(Ll&2)&&(ql|=n),Gl===4&&bu(e,Y,Yl,!1)),ad(e))}function _u(e,t,n){if(Ll&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||qe(e,t),a=r?ju(e,t):ku(e,t,!0),o=r;do{if(a===0){Hl&&!r&&bu(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!yu(n)){a=ku(e,t,!1),o=!1;continue}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=Zl;var l=c.current.memoizedState.isDehydrated;if(l&&(Cu(c,s).flags|=256),s=ku(c,s,!1),s!==2){if(Ul&&!l){c.errorRecoveryDisabledLanes|=o,ql|=o,a=4;break a}o=Ql,Ql=a,o!==null&&(Ql===null?Ql=o:Ql.push.apply(Ql,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Cu(e,0),bu(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)break;case 6:bu(r,t,Yl,!Vl);break a;case 2:Ql=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=eu+300-De(),10<a)){if(bu(r,t,Yl,!Vl),Ke(r,0,!0)!==0)break a;cu=t,r.timeoutHandle=Xd(vu.bind(null,r,n,Ql,ru,$l,t,Yl,ql,Xl,Vl,o,\`Throttled\`,-0,0),a);break a}vu(r,n,Ql,ru,$l,t,Yl,ql,Xl,Vl,o,null,-0,0)}}break}while(1);ad(e)}function vu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:z},kl(t,a,d);var m=(a&62914560)===a?eu-De():(a&4194048)===a?tu-De():0;if(m=Xf(d,m),m!==null){cu=a,e.cancelPendingCommit=m(Ru.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),bu(e,a,o,!l);return}}Ru(e,t,a,n,r,i,o,s,c)}function yu(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(!_r(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 bu(e,t,n,r){t&=~Jl,t&=~ql,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Re(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&$e(e,n,t)}function xu(){return Ll&6?!0:(od(0,!1),!1)}function Su(){if(J!==null){if(zl===0)var e=J.return;else e=J,Vi=Bi=null,wo(e),Ea=null,Da=0,e=J;for(;e!==null;)Lc(e.alternate,e),e=e.return;J=null}}function Cu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Zd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),cu=0,Su(),Rl=e,J=n=ii(e.current,null),Y=t,zl=0,Bl=null,Vl=!1,Hl=qe(e,t),Ul=!1,Xl=Yl=Jl=ql=Kl=Gl=0,Ql=Zl=null,$l=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Re(r),a=1<<i;t|=e[i],r&=~a}return Wl=t,Jr(),n}function wu(e,t){K=null,P.H=Ps,t===ga||t===va?(t=wa(),zl=3):t===_a?(t=wa(),zl=4):zl=t===Qs?8:typeof t==\`object\`&&t&&typeof t.then==\`function\`?6:1,Bl=t,J===null&&(Gl=1,Ks(e,fi(t,e.current)))}function Tu(){var e=Za.current;return e===null?!0:(Y&4194048)===Y?Qa===null:(Y&62914560)===Y||Y&536870912?e===Qa:!1}function Eu(){var e=P.H;return P.H=Ps,e===null?Ps:e}function Du(){var e=P.A;return P.A=Fl,e}function Ou(){Gl=4,Vl||(Y&4194048)!==Y&&Za.current!==null||(Hl=!0),!(Kl&134217727)&&!(ql&134217727)||Rl===null||bu(Rl,Y,Yl,!1)}function ku(e,t,n){var r=Ll;Ll|=2;var i=Eu(),a=Du();(Rl!==e||Y!==t)&&(ru=null,Cu(e,t)),t=!1;var o=Gl;a:do try{if(zl!==0&&J!==null){var s=J,c=Bl;switch(zl){case 8:Su(),o=6;break a;case 3:case 2:case 9:case 6:Za.current===null&&(t=!0);var l=zl;if(zl=0,Bl=null,Fu(e,s,c,l),n&&Hl){o=0;break a}break;default:l=zl,zl=0,Bl=null,Fu(e,s,c,l)}}Au(),o=Gl;break}catch(t){wu(e,t)}while(1);return t&&e.shellSuspendCounter++,Vi=Bi=null,Ll=r,P.H=i,P.A=a,J===null&&(Rl=null,Y=0,Jr()),o}function Au(){for(;J!==null;)Nu(J)}function ju(e,t){var n=Ll;Ll|=2;var r=Eu(),a=Du();Rl!==e||Y!==t?(ru=null,nu=De()+500,Cu(e,t)):Hl=qe(e,t);a:do try{if(zl!==0&&J!==null){t=J;var o=Bl;b:switch(zl){case 1:zl=0,Bl=null,Fu(e,t,o,1);break;case 2:case 9:if(ba(o)){zl=0,Bl=null,Pu(t);break}t=function(){zl!==2&&zl!==9||Rl!==e||(zl=7),ad(e)},o.then(t,t);break a;case 3:zl=7;break a;case 4:zl=5;break a;case 7:ba(o)?(zl=0,Bl=null,Pu(t)):(zl=0,Bl=null,Fu(e,t,o,7));break;case 5:var s=null;switch(J.tag){case 26:s=J.memoizedState;case 5:case 27:var c=J;if(s?qf(s):c.stateNode.complete){zl=0,Bl=null;var l=c.sibling;if(l!==null)J=l;else{var u=c.return;u===null?J=null:(J=u,Iu(u))}break b}}zl=0,Bl=null,Fu(e,t,o,5);break;case 6:zl=0,Bl=null,Fu(e,t,o,6);break;case 8:Su(),Gl=6;break a;default:throw Error(i(462))}}Mu();break}catch(t){wu(e,t)}while(1);return Vi=Bi=null,P.H=r,P.A=a,Ll=n,J===null?(Rl=null,Y=0,Jr(),Gl):0}function Mu(){for(;J!==null&&!Te();)Nu(J)}function Nu(e){var t=Oc(e.alternate,e,Wl);e.memoizedProps=e.pendingProps,t===null?Iu(e):J=t}function Pu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=fc(n,t,t.pendingProps,t.type,void 0,Y);break;case 11:t=fc(n,t,t.pendingProps,t.type.render,t.ref,Y);break;case 5:wo(t);default:Lc(n,t),t=J=ai(t,Wl),t=Oc(n,t,Wl)}e.memoizedProps=e.pendingProps,t===null?Iu(e):J=t}function Fu(e,t,n,r){Vi=Bi=null,wo(t),Ea=null,Da=0;var i=t.return;try{if(Zs(e,i,t,n,Y)){Gl=1,Ks(e,fi(n,e.current)),J=null;return}}catch(t){if(i!==null)throw J=i,t;Gl=1,Ks(e,fi(n,e.current)),J=null;return}t.flags&32768?(G||r===1?e=!0:Hl||Y&536870912?e=!1:(Vl=e=!0,(r===2||r===9||r===3||r===6)&&(r=Za.current,r!==null&&r.tag===13&&(r.flags|=16384))),Lu(t,e)):Iu(t)}function Iu(e){var t=e;do{if(t.flags&32768){Lu(t,Vl);return}e=t.return;var n=Fc(t.alternate,t,Wl);if(n!==null){J=n;return}if(t=t.sibling,t!==null){J=t;return}J=t=e}while(t!==null);Gl===0&&(Gl=5)}function Lu(e,t){do{var n=Ic(e.alternate,e);if(n!==null){n.flags&=32767,J=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){J=e;return}J=e=n}while(e!==null);Gl=6,J=null}function Ru(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Uu();while(au!==0);if(Ll&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=qr,Qe(e,n,o,s,c,l),e===Rl&&(J=Rl=null,Y=0),su=t,ou=e,cu=n,lu=o,uu=a,du=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Qu(je,function(){return Wu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=P.T,P.T=null,a=F.p,F.p=2,s=Ll,Ll|=4;try{nl(e,t,n)}finally{Ll=s,F.p=a,P.T=r}}au=1,zu(),Bu(),Vu()}}function zu(){if(au===1){au=0;var e=ou,t=su,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=P.T,P.T=null;var r=F.p;F.p=2;var i=Ll;Ll|=4;try{hl(t,e);var a=Ud,o=Sr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&xr(s.ownerDocument.documentElement,s)){if(c!==null&&Cr(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 _=br(s,h),v=br(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}}up=!!Hd,Ud=Hd=null}finally{Ll=i,F.p=r,P.T=n}}e.current=t,au=2}}function Bu(){if(au===2){au=0;var e=ou,t=su,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=P.T,P.T=null;var r=F.p;F.p=2;var i=Ll;Ll|=4;try{rl(e,t.alternate,t)}finally{Ll=i,F.p=r,P.T=n}}au=3}}function Vu(){if(au===4||au===3){au=0,Ee();var e=ou,t=su,n=cu,r=du;t.subtreeFlags&10256||t.flags&10256?au=5:(au=0,su=ou=null,Hu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(iu=null),rt(n),t=t.stateNode,Le&&typeof Le.onCommitFiberRoot==\`function\`)try{Le.onCommitFiberRoot(Ie,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=P.T,i=F.p,F.p=2,P.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{P.T=t,F.p=i}}cu&3&&Uu(),ad(e),i=e.pendingLanes,n&261930&&i&42?e===pu?fu++:(fu=0,pu=e):fu=0,od(0,!1)}}function Hu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ra(t)))}function Uu(){return zu(),Bu(),Vu(),Wu()}function Wu(){if(au!==5)return!1;var e=ou,t=lu;lu=0;var n=rt(cu),r=P.T,a=F.p;try{F.p=32>n?32:n,P.T=null,n=uu,uu=null;var o=ou,s=cu;if(au=0,su=ou=null,cu=0,Ll&6)throw Error(i(331));var c=Ll;if(Ll|=4,Ml(o.current),wl(o,o.current,s,n),Ll=c,od(0,!1),Le&&typeof Le.onPostCommitFiberRoot==\`function\`)try{Le.onPostCommitFiberRoot(Ie,o)}catch{}return!0}finally{F.p=a,P.T=r,Hu(e,t)}}function Gu(e,t,n){t=fi(n,t),t=Js(e.stateNode,t,2),e=Ra(e,t,2),e!==null&&(Ze(e,2),ad(e))}function Ku(e,t,n){if(e.tag===3)Gu(e,e,n);else for(;t!==null;){if(t.tag===3){Gu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==\`function\`||typeof r.componentDidCatch==\`function\`&&(iu===null||!iu.has(r))){e=fi(n,e),n=Ys(2),r=Ra(t,n,2),r!==null&&(Xs(n,r,t,e),Ze(r,2),ad(r));break}}t=t.return}}function qu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Il;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)||(Ul=!0,i.add(n),e=Ju.bind(null,e,t,n),t.then(e,e))}function Ju(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Rl===e&&(Y&n)===n&&(Gl===4||Gl===3&&(Y&62914560)===Y&&300>De()-eu?!(Ll&2)&&Cu(e,0):Jl|=n,Xl===Y&&(Xl=0)),ad(e)}function Yu(e,t){t===0&&(t=Ye()),e=Zr(e,t),e!==null&&(Ze(e,t),ad(e))}function Xu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Yu(e,n)}function Zu(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),Yu(e,n)}function Qu(e,t){return Ce(e,t)}var $u=null,ed=null,td=!1,nd=!1,rd=!1,id=0;function ad(e){e!==ed&&e.next===null&&(ed===null?$u=ed=e:ed=ed.next=e),nd=!0,td||(td=!0,fd())}function od(e,t){if(!rd&&nd){rd=!0;do for(var n=!1,r=$u;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-Re(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,dd(r,a))}else a=Y,a=Ke(r,r===Rl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||qe(r,a)||(n=!0,dd(r,a));r=r.next}while(n);rd=!1}}function sd(){cd()}function cd(){nd=td=!1;var e=0;id!==0&&Yd()&&(e=id);for(var t=De(),n=null,r=$u;r!==null;){var i=r.next,a=ld(r,t);a===0?(r.next=null,n===null?$u=i:n.next=i,i===null&&(ed=n)):(n=r,(e!==0||a&3)&&(nd=!0)),r=i}au!==0&&au!==5||od(e,!1),id!==0&&(id=0)}function ld(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Re(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Je(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Rl,n=Y,n=Ke(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(zl===2||zl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&we(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||qe(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&we(r),rt(n)){case 2:case 8:n=Ae;break;case 32:n=je;break;case 268435456:n=Ne;break;default:n=je}return r=ud.bind(null,e),n=Ce(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&we(r),e.callbackPriority=2,e.callbackNode=null,2}function ud(e,t){if(au!==0&&au!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Uu()&&e.callbackNode!==n)return null;var r=Y;return r=Ke(e,e===Rl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(_u(e,r,t),ld(e,De()),e.callbackNode!=null&&e.callbackNode===n?ud.bind(null,e):null)}function dd(e,t){if(Uu())return null;_u(e,t,!0)}function fd(){$d(function(){Ll&6?Ce(ke,sd):cd()})}function pd(){if(id===0){var e=oa;e===0&&(e=He,He<<=1,!(He&261888)&&(He=256)),id=e}return id}function md(e){return e==null||typeof e==\`symbol\`||typeof e==\`boolean\`?null:typeof e==\`function\`?e:Qt(\`\`+e)}function hd(e,t){var n=t.ownerDocument.createElement(\`input\`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(\`form\`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function gd(e,t,n,r,i){if(t===\`submit\`&&n&&n.stateNode===i){var a=md((i[ct]||null).action),o=r.submitter;o&&(t=(t=o[ct]||null)?md(t.formAction):o.getAttribute(\`formAction\`),t!==null&&(a=t,o=null));var s=new vn(\`action\`,\`action\`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(id!==0){var e=o?hd(i,o):new FormData(i);bs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==\`function\`&&(s.preventDefault(),e=o?hd(i,o):new FormData(i),bs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var _d=0;_d<Hr.length;_d++){var vd=Hr[_d];Ur(vd.toLowerCase(),\`on\`+(vd[0].toUpperCase()+vd.slice(1)))}Ur(Pr,\`onAnimationEnd\`),Ur(Fr,\`onAnimationIteration\`),Ur(Ir,\`onAnimationStart\`),Ur(\`dblclick\`,\`onDoubleClick\`),Ur(\`focusin\`,\`onFocus\`),Ur(\`focusout\`,\`onBlur\`),Ur(Lr,\`onTransitionRun\`),Ur(Rr,\`onTransitionStart\`),Ur(zr,\`onTransitionCancel\`),Ur(Br,\`onTransitionEnd\`),wt(\`onMouseEnter\`,[\`mouseout\`,\`mouseover\`]),wt(\`onMouseLeave\`,[\`mouseout\`,\`mouseover\`]),wt(\`onPointerEnter\`,[\`pointerout\`,\`pointerover\`]),wt(\`onPointerLeave\`,[\`pointerout\`,\`pointerover\`]),Ct(\`onChange\`,\`change click focusin focusout input keydown keyup selectionchange\`.split(\` \`)),Ct(\`onSelect\`,\`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange\`.split(\` \`)),Ct(\`onBeforeInput\`,[\`compositionend\`,\`keypress\`,\`textInput\`,\`paste\`]),Ct(\`onCompositionEnd\`,\`compositionend focusout keydown keypress keyup mousedown\`.split(\` \`)),Ct(\`onCompositionStart\`,\`compositionstart focusout keydown keypress keyup mousedown\`.split(\` \`)),Ct(\`onCompositionUpdate\`,\`compositionupdate focusout keydown keypress keyup mousedown\`.split(\` \`));var yd=\`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(\` \`),bd=new Set(\`beforetoggle cancel close invalid load scroll scrollend toggle\`.split(\` \`).concat(yd));function xd(e,t){t=(t&4)!=0;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){Wr(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){Wr(e)}i.currentTarget=null,a=c}}}}function Sd(e,t){var n=t[ut];n===void 0&&(n=t[ut]=new Set);var r=e+\`__bubble\`;n.has(r)||(Ed(t,e,2,!1),n.add(r))}function Cd(e,t,n){var r=0;t&&(r|=4),Ed(n,e,r,t)}var wd=\`_reactListening\`+Math.random().toString(36).slice(2);function Td(e){if(!e[wd]){e[wd]=!0,xt.forEach(function(t){t!==\`selectionchange\`&&(bd.has(t)||Cd(t,!1,e),Cd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[wd]||(t[wd]=!0,Cd(\`selectionchange\`,!1,t))}}function Ed(e,t,n,r){switch(_p(t)){case 2:var i=dp;break;case 8:i=fp;break;default:i=pp}n=i.bind(null,t,n,e),i=void 0,!sn||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 Dd(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=gt(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}rn(function(){var r=a,i=V(n),s=[];a:{var c=Vr.get(e);if(c!==void 0){var l=vn,u=e;switch(e){case\`keypress\`:if(pn(n)===0)break a;case\`keydown\`:case\`keyup\`:l=In;break;case\`focusin\`:u=\`focus\`,l=Dn;break;case\`focusout\`:u=\`blur\`,l=Dn;break;case\`beforeblur\`:case\`afterblur\`:l=Dn;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=Tn;break;case\`drag\`:case\`dragend\`:case\`dragenter\`:case\`dragexit\`:case\`dragleave\`:case\`dragover\`:case\`dragstart\`:case\`drop\`:l=En;break;case\`touchcancel\`:case\`touchend\`:case\`touchmove\`:case\`touchstart\`:l=Rn;break;case Pr:case Fr:case Ir:l=On;break;case Br:l=zn;break;case\`scroll\`:case\`scrollend\`:l=bn;break;case\`wheel\`:l=Bn;break;case\`copy\`:case\`cut\`:case\`paste\`:l=kn;break;case\`gotpointercapture\`:case\`lostpointercapture\`:case\`pointercancel\`:case\`pointerdown\`:case\`pointermove\`:case\`pointerout\`:case\`pointerover\`:case\`pointerup\`:l=Ln;break;case\`toggle\`:case\`beforetoggle\`:l=Vn}var d=(t&4)!=0,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=an(m,p),g!=null&&d.push(Od(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(c=e===\`mouseover\`||e===\`pointerover\`,l=e===\`mouseout\`||e===\`pointerout\`,c&&n!==B&&(u=n.relatedTarget||n.fromElement)&&(gt(u)||u[lt]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?gt(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=Tn,g=\`onMouseLeave\`,p=\`onMouseEnter\`,m=\`mouse\`,(e===\`pointerout\`||e===\`pointerover\`)&&(d=Ln,g=\`onPointerLeave\`,p=\`onPointerEnter\`,m=\`pointer\`),f=l==null?c:vt(l),h=u==null?c:vt(u),c=new d(g,m+\`leave\`,l,n,i),c.target=f,c.relatedTarget=h,g=null,gt(i)===r&&(d=new d(p,m+\`enter\`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Ad,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&jd(s,c,l,d,!1),u!==null&&f!==null&&jd(s,f,u,d,!0)}}a:{if(c=r?vt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===\`select\`||l===\`input\`&&c.type===\`file\`)var v=ar;else if(er(c))if(or)v=hr;else{v=pr;var y=fr}else l=c.nodeName,!l||l.toLowerCase()!==\`input\`||c.type!==\`checkbox\`&&c.type!==\`radio\`?r&&Yt(r.elementType)&&(v=ar):v=mr;if(v&&=v(e,r)){tr(s,v,n,i);break a}y&&y(e,c,r),e===\`focusout\`&&r&&c.type===\`number\`&&r.memoizedProps.value!=null&&Ht(c,\`number\`,c.value)}switch(y=r?vt(r):window,e){case\`focusin\`:(er(y)||y.contentEditable===\`true\`)&&(Tr=y,Er=r,Dr=null);break;case\`focusout\`:Dr=Er=Tr=null;break;case\`mousedown\`:Or=!0;break;case\`contextmenu\`:case\`mouseup\`:case\`dragend\`:Or=!1,kr(s,n,i);break;case\`selectionchange\`:if(wr)break;case\`keydown\`:case\`keyup\`:kr(s,n,i)}var b;if(Un)b:{switch(e){case\`compositionstart\`:var x=\`onCompositionStart\`;break b;case\`compositionend\`:x=\`onCompositionEnd\`;break b;case\`compositionupdate\`:x=\`onCompositionUpdate\`;break b}x=void 0}else H?Yn(e,n)&&(x=\`onCompositionEnd\`):e===\`keydown\`&&n.keyCode===229&&(x=\`onCompositionStart\`);x&&(Kn&&n.locale!==\`ko\`&&(H||x!==\`onCompositionStart\`?x===\`onCompositionEnd\`&&H&&(b=fn()):(ln=i,un=\`value\`in ln?ln.value:ln.textContent,H=!0)),y=kd(r,x),0<y.length&&(x=new An(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=Xn(n),b!==null&&(x.data=b)))),(b=Gn?Zn(e,n):Qn(e,n))&&(x=kd(r,\`onBeforeInput\`),0<x.length&&(y=new An(\`onBeforeInput\`,\`beforeinput\`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),gd(s,e,r,n,i)}xd(s,t)})}function Od(e,t,n){return{instance:e,listener:t,currentTarget:n}}function kd(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=an(e,n),i!=null&&r.unshift(Od(e,i,a)),i=an(e,t),i!=null&&r.push(Od(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Ad(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function jd(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=an(n,a),l!=null&&o.unshift(Od(n,l,c))):i||(l=an(n,a),l!=null&&o.push(Od(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Md=/\\r\\n?/g,Nd=/\\u0000|\\uFFFD/g;function Pd(e){return(typeof e==\`string\`?e:\`\`+e).replace(Md,\`
|
|
30
|
-
\`).replace(Nd,\`\`)}function Fd(e,t){return t=Pd(t),Pd(e)===t}function Id(e,t,n,r,a,o){switch(n){case\`children\`:typeof r==\`string\`?t===\`body\`||t===\`textarea\`&&r===\`\`||Kt(e,r):(typeof r==\`number\`||typeof r==\`bigint\`)&&t!==\`body\`&&Kt(e,\`\`+r);break;case\`className\`:At(e,\`class\`,r);break;case\`tabIndex\`:At(e,\`tabindex\`,r);break;case\`dir\`:case\`role\`:case\`viewBox\`:case\`width\`:case\`height\`:At(e,n,r);break;case\`style\`:R(e,r,o);break;case\`data\`:if(t!==\`object\`){At(e,\`data\`,r);break}case\`src\`:case\`href\`:if(r===\`\`&&(t!==\`a\`||n!==\`href\`)){e.removeAttribute(n);break}if(r==null||typeof r==\`function\`||typeof r==\`symbol\`||typeof r==\`boolean\`){e.removeAttribute(n);break}r=Qt(\`\`+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}else typeof o==\`function\`&&(n===\`formAction\`?(t!==\`input\`&&Id(e,t,\`name\`,a.name,a,null),Id(e,t,\`formEncType\`,a.formEncType,a,null),Id(e,t,\`formMethod\`,a.formMethod,a,null),Id(e,t,\`formTarget\`,a.formTarget,a,null)):(Id(e,t,\`encType\`,a.encType,a,null),Id(e,t,\`method\`,a.method,a,null),Id(e,t,\`target\`,a.target,a,null)));if(r==null||typeof r==\`symbol\`||typeof r==\`boolean\`){e.removeAttribute(n);break}r=Qt(\`\`+r),e.setAttribute(n,r);break;case\`onClick\`:r!=null&&(e.onclick=z);break;case\`onScroll\`:r!=null&&Sd(\`scroll\`,e);break;case\`onScrollEnd\`:r!=null&&Sd(\`scrollend\`,e);break;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));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=Qt(\`\`+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\`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\`:Sd(\`beforetoggle\`,e),Sd(\`toggle\`,e),kt(e,\`popover\`,r);break;case\`xlinkActuate\`:jt(e,\`http://www.w3.org/1999/xlink\`,\`xlink:actuate\`,r);break;case\`xlinkArcrole\`:jt(e,\`http://www.w3.org/1999/xlink\`,\`xlink:arcrole\`,r);break;case\`xlinkRole\`:jt(e,\`http://www.w3.org/1999/xlink\`,\`xlink:role\`,r);break;case\`xlinkShow\`:jt(e,\`http://www.w3.org/1999/xlink\`,\`xlink:show\`,r);break;case\`xlinkTitle\`:jt(e,\`http://www.w3.org/1999/xlink\`,\`xlink:title\`,r);break;case\`xlinkType\`:jt(e,\`http://www.w3.org/1999/xlink\`,\`xlink:type\`,r);break;case\`xmlBase\`:jt(e,\`http://www.w3.org/XML/1998/namespace\`,\`xml:base\`,r);break;case\`xmlLang\`:jt(e,\`http://www.w3.org/XML/1998/namespace\`,\`xml:lang\`,r);break;case\`xmlSpace\`:jt(e,\`http://www.w3.org/XML/1998/namespace\`,\`xml:space\`,r);break;case\`is\`:kt(e,\`is\`,r);break;case\`innerText\`:case\`textContent\`:break;default:(!(2<n.length)||n[0]!==\`o\`&&n[0]!==\`O\`||n[1]!==\`n\`&&n[1]!==\`N\`)&&(n=Xt.get(n)||n,kt(e,n,r))}}function Ld(e,t,n,r,a,o){switch(n){case\`style\`:R(e,r,o);break;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));e.innerHTML=n}}break;case\`children\`:typeof r==\`string\`?Kt(e,r):(typeof r==\`number\`||typeof r==\`bigint\`)&&Kt(e,\`\`+r);break;case\`onScroll\`:r!=null&&Sd(\`scroll\`,e);break;case\`onScrollEnd\`:r!=null&&Sd(\`scrollend\`,e);break;case\`onClick\`:r!=null&&(e.onclick=z);break;case\`suppressContentEditableWarning\`:case\`suppressHydrationWarning\`:case\`innerHTML\`:case\`ref\`:break;case\`innerText\`:case\`textContent\`:break;default:if(!St.hasOwnProperty(n))a:{if(n[0]===\`o\`&&n[1]===\`n\`&&(a=n.endsWith(\`Capture\`),t=n.slice(2,a?n.length-7:void 0),o=e[ct]||null,o=o==null?null:o[n],typeof o==\`function\`&&e.removeEventListener(t,o,a),typeof r==\`function\`)){typeof o!=\`function\`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,\`\`):kt(e,n,r)}}}function Rd(e,t,n){switch(t){case\`div\`:case\`span\`:case\`svg\`:case\`path\`:case\`a\`:case\`g\`:case\`p\`:case\`li\`:break;case\`img\`:Sd(\`error\`,e),Sd(\`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:Id(e,t,o,s,n,null)}}a&&Id(e,t,\`srcSet\`,n.srcSet,n,null),r&&Id(e,t,\`src\`,n.src,n,null);return;case\`input\`:Sd(\`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:Id(e,t,r,d,n,null)}}Vt(e,o,c,l,u,s,a,!1);return;case\`select\`:for(a in Sd(\`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:Id(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Ut(e,!!r,n,!0):Ut(e,!!r,t,!1);return;case\`textarea\`:for(s in Sd(\`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:Id(e,t,s,c,n,null)}Gt(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:Id(e,t,l,r,n,null)}return;case\`dialog\`:Sd(\`beforetoggle\`,e),Sd(\`toggle\`,e),Sd(\`cancel\`,e),Sd(\`close\`,e);break;case\`iframe\`:case\`object\`:Sd(\`load\`,e);break;case\`video\`:case\`audio\`:for(r=0;r<yd.length;r++)Sd(yd[r],e);break;case\`image\`:Sd(\`error\`,e),Sd(\`load\`,e);break;case\`details\`:Sd(\`toggle\`,e);break;case\`embed\`:case\`source\`:case\`link\`:Sd(\`error\`,e),Sd(\`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:Id(e,t,u,r,n,null)}return;default:if(Yt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Ld(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Id(e,t,c,r,n,null))}function zd(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)||Id(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\`:o=m;break;case\`name\`:a=m;break;case\`checked\`:u=m;break;case\`defaultChecked\`:d=m;break;case\`value\`:s=m;break;case\`defaultValue\`:c=m;break;case\`children\`:case\`dangerouslySetInnerHTML\`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Id(e,t,p,m,r,f)}}Bt(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)||Id(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\`:p=o;break;case\`defaultValue\`:c=o;break;case\`multiple\`:s=o;default:o!==l&&Id(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Ut(e,!!n,n?[]:\`\`,!1):Ut(e,!!n,t,!0)):Ut(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:Id(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\`:p=a;break;case\`defaultValue\`:m=a;break;case\`children\`:break;case\`dangerouslySetInnerHTML\`:if(a!=null)throw Error(i(91));break;default:a!==o&&Id(e,t,s,a,r,o)}Wt(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:Id(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\`:e.selected=p&&typeof p!=\`function\`&&typeof p!=\`symbol\`;break;default:Id(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)&&Id(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:Id(e,t,u,p,r,m)}return;default:if(Yt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Ld(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||Ld(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Id(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||Id(e,t,f,p,r,m)}function Bd(e){switch(e){case\`css\`:case\`script\`:case\`font\`:case\`img\`:case\`image\`:case\`input\`:case\`link\`:return!0;default:return!1}}function Vd(){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&&Bd(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&&Bd(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 Hd=null,Ud=null;function Wd(e){return e.nodeType===9?e:e.ownerDocument}function Gd(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 Kd(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 qd(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 Jd=null;function Yd(){var e=window.event;return e&&e.type===\`popstate\`?e===Jd?!1:(Jd=e,!0):(Jd=null,!1)}var Xd=typeof setTimeout==\`function\`?setTimeout:void 0,Zd=typeof clearTimeout==\`function\`?clearTimeout:void 0,Qd=typeof Promise==\`function\`?Promise:void 0,$d=typeof queueMicrotask==\`function\`?queueMicrotask:Qd===void 0?Xd:function(e){return Qd.resolve(null).then(e).catch(ef)};function ef(e){setTimeout(function(){throw e})}function tf(e){return e===\`head\`}function nf(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),Ip(t);return}r--}else if(n===\`$\`||n===\`$?\`||n===\`$~\`||n===\`$!\`||n===\`&\`)r++;else if(n===\`html\`)gf(e.ownerDocument.documentElement);else if(n===\`head\`){n=e.ownerDocument.head,gf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[mt]||s===\`SCRIPT\`||s===\`STYLE\`||s===\`LINK\`&&a.rel.toLowerCase()===\`stylesheet\`||n.removeChild(a),a=o}}else n===\`body\`&&gf(e.ownerDocument.body);n=i}while(n);Ip(t)}function rf(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 af(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\`:af(n),ht(n);continue;case\`SCRIPT\`:case\`STYLE\`:continue;case\`LINK\`:if(n.rel.toLowerCase()===\`stylesheet\`)continue}e.removeChild(n)}}function of(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[mt])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=df(e.nextSibling),e===null)break}return null}function sf(e,t,n){if(t===\`\`)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==\`INPUT\`||e.type!==\`hidden\`)&&!n||(e=df(e.nextSibling),e===null))return null;return e}function cf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==\`INPUT\`||e.type!==\`hidden\`)&&!t||(e=df(e.nextSibling),e===null))return null;return e}function lf(e){return e.data===\`$?\`||e.data===\`$~\`}function uf(e){return e.data===\`$!\`||e.data===\`$?\`&&e.ownerDocument.readyState!==\`loading\`}function X(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 df(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 ff=null;function pf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===\`/$\`||n===\`/&\`){if(t===0)return df(e.nextSibling);t--}else n!==\`$\`&&n!==\`$!\`&&n!==\`$?\`&&n!==\`$~\`&&n!==\`&\`||t++}e=e.nextSibling}return null}function mf(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 hf(e,t,n){switch(t=Wd(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 gf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ht(e)}var _f=new Map,vf=new Set;function yf(e){return typeof e.getRootNode==\`function\`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var bf=F.d;F.d={f:xf,r:Sf,D:Tf,C:Ef,L:Df,m:Of,X:Af,S:kf,M:jf};function xf(){var e=bf.f(),t=xu();return e||t}function Sf(e){var t=_t(e);t!==null&&t.tag===5&&t.type===\`form\`?Ss(t):bf.r(e)}var Cf=typeof document>\`u\`?null:document;function wf(e,t,n){var r=Cf;if(r&&typeof t==\`string\`&&t){var i=zt(t);i=\`link[rel="\`+e+\`"][href="\`+i+\`"]\`,typeof n==\`string\`&&(i+=\`[crossorigin="\`+n+\`"]\`),vf.has(i)||(vf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(\`link\`),Rd(t,\`link\`,e),bt(t),r.head.appendChild(t)))}}function Tf(e){bf.D(e),wf(\`dns-prefetch\`,e,null)}function Ef(e,t){bf.C(e,t),wf(\`preconnect\`,e,t)}function Df(e,t,n){bf.L(e,t,n);var r=Cf;if(r&&e&&t){var i=\`link[rel="preload"][as="\`+zt(t)+\`"]\`;t===\`image\`&&n&&n.imageSrcSet?(i+=\`[imagesrcset="\`+zt(n.imageSrcSet)+\`"]\`,typeof n.imageSizes==\`string\`&&(i+=\`[imagesizes="\`+zt(n.imageSizes)+\`"]\`)):i+=\`[href="\`+zt(e)+\`"]\`;var a=i;switch(t){case\`style\`:a=Nf(e);break;case\`script\`:a=Lf(e)}_f.has(a)||(e=h({rel:\`preload\`,href:t===\`image\`&&n&&n.imageSrcSet?void 0:e,as:t},n),_f.set(a,e),r.querySelector(i)!==null||t===\`style\`&&r.querySelector(Pf(a))||t===\`script\`&&r.querySelector(Rf(a))||(t=r.createElement(\`link\`),Rd(t,\`link\`,e),bt(t),r.head.appendChild(t)))}}function Of(e,t){bf.m(e,t);var n=Cf;if(n&&e){var r=t&&typeof t.as==\`string\`?t.as:\`script\`,i=\`link[rel="modulepreload"][as="\`+zt(r)+\`"][href="\`+zt(e)+\`"]\`,a=i;switch(r){case\`audioworklet\`:case\`paintworklet\`:case\`serviceworker\`:case\`sharedworker\`:case\`worker\`:case\`script\`:a=Lf(e)}if(!_f.has(a)&&(e=h({rel:\`modulepreload\`,href:e},t),_f.set(a,e),n.querySelector(i)===null)){switch(r){case\`audioworklet\`:case\`paintworklet\`:case\`serviceworker\`:case\`sharedworker\`:case\`worker\`:case\`script\`:if(n.querySelector(Rf(a)))return}r=n.createElement(\`link\`),Rd(r,\`link\`,e),bt(r),n.head.appendChild(r)}}}function kf(e,t,n){bf.S(e,t,n);var r=Cf;if(r&&e){var i=yt(r).hoistableStyles,a=Nf(e);t||=\`default\`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Pf(a)))s.loading=5;else{e=h({rel:\`stylesheet\`,href:e,"data-precedence":t},n),(n=_f.get(a))&&Vf(e,n);var c=o=r.createElement(\`link\`);bt(c),Rd(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,Bf(o,t,r)}o={type:\`stylesheet\`,instance:o,count:1,state:s},i.set(a,o)}}}function Af(e,t){bf.X(e,t);var n=Cf;if(n&&e){var r=yt(n).hoistableScripts,i=Lf(e),a=r.get(i);a||(a=n.querySelector(Rf(i)),a||(e=h({src:e,async:!0},t),(t=_f.get(i))&&Hf(e,t),a=n.createElement(\`script\`),bt(a),Rd(a,\`link\`,e),n.head.appendChild(a)),a={type:\`script\`,instance:a,count:1,state:null},r.set(i,a))}}function jf(e,t){bf.M(e,t);var n=Cf;if(n&&e){var r=yt(n).hoistableScripts,i=Lf(e),a=r.get(i);a||(a=n.querySelector(Rf(i)),a||(e=h({src:e,async:!0,type:\`module\`},t),(t=_f.get(i))&&Hf(e,t),a=n.createElement(\`script\`),bt(a),Rd(a,\`link\`,e),n.head.appendChild(a)),a={type:\`script\`,instance:a,count:1,state:null},r.set(i,a))}}function Mf(e,t,n,r){var a=(a=le.current)?yf(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\`?(t=Nf(n.href),n=yt(a).hoistableStyles,r=n.get(t),r||(r={type:\`style\`,instance:null,count:0,state:null},n.set(t,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=Nf(n.href);var o=yt(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(Pf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),_f.has(e)||(n={rel:\`preload\`,as:\`style\`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},_f.set(e,n),o||If(a,e,n,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\`?(t=Lf(n),n=yt(a).hoistableScripts,r=n.get(t),r||(r={type:\`script\`,instance:null,count:0,state:null},n.set(t,r)),r):{type:\`void\`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Nf(e){return\`href="\`+zt(e)+\`"\`}function Pf(e){return\`link[rel="stylesheet"][\`+e+\`]\`}function Ff(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function If(e,t,n,r){e.querySelector(\`link[rel="preload"][as="style"][\`+t+\`]\`)?r.loading=1:(t=e.createElement(\`link\`),r.preload=t,t.addEventListener(\`load\`,function(){return r.loading|=1}),t.addEventListener(\`error\`,function(){return r.loading|=2}),Rd(t,\`link\`,n),bt(t),e.head.appendChild(t))}function Lf(e){return\`[src="\`+zt(e)+\`"]\`}function Rf(e){return\`script[async]\`+e}function zf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case\`style\`:var r=e.querySelector(\`style[data-href~="\`+zt(n.href)+\`"]\`);if(r)return t.instance=r,bt(r),r;var a=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(\`style\`),bt(r),Rd(r,\`style\`,a),Bf(r,n.precedence,e),t.instance=r;case\`stylesheet\`:a=Nf(n.href);var o=e.querySelector(Pf(a));if(o)return t.state.loading|=4,t.instance=o,bt(o),o;r=Ff(n),(a=_f.get(a))&&Vf(r,a),o=(e.ownerDocument||e).createElement(\`link\`),bt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Rd(o,\`link\`,r),t.state.loading|=4,Bf(o,n.precedence,e),t.instance=o;case\`script\`:return o=Lf(n.src),(a=e.querySelector(Rf(o)))?(t.instance=a,bt(a),a):(r=n,(a=_f.get(o))&&(r=h({},n),Hf(r,a)),e=e.ownerDocument||e,a=e.createElement(\`script\`),bt(a),Rd(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,Bf(r,n.precedence,e));return t.instance}function Bf(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 Vf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Hf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Uf=null;function Wf(e,t,n){if(Uf===null){var r=new Map,i=Uf=new Map;i.set(n,r)}else i=Uf,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[mt]||a[st]||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 Gf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===\`title\`?e.querySelector(\`head > title\`):null)}function Kf(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 qf(e){return!(e.type===\`stylesheet\`&&!(e.state.loading&3))}function Jf(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=Nf(r.href),a=t.querySelector(Pf(i));if(a){t=a._p,typeof t==\`object\`&&t&&typeof t.then==\`function\`&&(e.count++,e=Zf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,bt(a);return}a=t.ownerDocument||t,r=Ff(r),(i=_f.get(i))&&Vf(r,i),a=a.createElement(\`link\`),bt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Rd(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=Zf.bind(e),t.addEventListener(\`load\`,n),t.addEventListener(\`error\`,n))}}var Yf=0;function Xf(e,t){return e.stylesheets&&e.count===0&&$f(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&$f(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Yf===0&&(Yf=62500*Vd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&$f(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Yf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Zf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)$f(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Qf=null;function $f(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Qf=new Map,t.forEach(ep,e),Qf=null,Zf.call(e))}function ep(e,t){if(!(t.state.loading&4)){var n=Qf.get(e);if(n)var r=n.get(null);else{n=new Map,Qf.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=Zf.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 tp={$$typeof:C,Provider:null,Consumer:null,_currentValue:ne,_currentValue2:ne,_threadCount:0};function np(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=Xe(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xe(0),this.hiddenUpdates=Xe(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function rp(e,t,n,r,i,a,o,s,c,l,u,d){return e=new np(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ni(3,null,null,t),e.current=a,a.stateNode=e,t=na(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Fa(a),e}function ip(e){return e?(e=ei,e):ei}function ap(e,t,n,r,i,a){i=ip(i),r.context===null?r.context=i:r.pendingContext=i,r=La(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ra(e,r,t),n!==null&&(gu(n,e,t),za(n,e,t))}function op(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function sp(e,t){op(e,t),(e=e.alternate)&&op(e,t)}function cp(e){if(e.tag===13||e.tag===31){var t=Zr(e,67108864);t!==null&&gu(t,e,67108864),sp(e,67108864)}}function lp(e){if(e.tag===13||e.tag===31){var t=mu();t=nt(t);var n=Zr(e,t);n!==null&&gu(n,e,t),sp(e,t)}}var up=!0;function dp(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=2,pp(e,t,n,r)}finally{F.p=a,P.T=i}}function fp(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=8,pp(e,t,n,r)}finally{F.p=a,P.T=i}}function pp(e,t,n,r){if(up){var i=mp(r);if(i===null)Dd(e,t,r,hp,n),Ep(e,r);else if(Op(i,e,t,n,r))r.stopPropagation();else if(Ep(e,r),t&4&&-1<Tp.indexOf(e)){for(;i!==null;){var a=_t(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ge(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Re(o);s.entanglements[1]|=c,o&=~c}ad(a),!(Ll&6)&&(nu=De()+500,od(0,!1))}}break;case 31:case 13:s=Zr(a,2),s!==null&&gu(s,a,2),xu(),sp(a,2)}if(a=mp(r),a===null&&Dd(e,t,r,hp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Dd(e,t,r,null,n)}}function mp(e){return e=V(e),gp(e)}var hp=null;function gp(e){if(hp=null,e=gt(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 hp=e,null}function _p(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\`resize\`: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\`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\`scroll\`:case\`touchmove\`:case\`wheel\`:case\`mouseenter\`:case\`mouseleave\`:case\`pointerenter\`:case\`pointerleave\`:return 8;case\`message\`:switch(Oe()){case ke:return 2;case Ae:return 8;case je:case Me:return 32;case Ne:return 268435456;default:return 32}default:return 32}}var vp=!1,yp=null,bp=null,xp=null,Sp=new Map,Cp=new Map,wp=[],Tp=\`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 Ep(e,t){switch(e){case\`focusin\`:case\`focusout\`:yp=null;break;case\`dragenter\`:case\`dragleave\`:bp=null;break;case\`mouseover\`:case\`mouseout\`:xp=null;break;case\`pointerover\`:case\`pointerout\`:Sp.delete(t.pointerId);break;case\`gotpointercapture\`:case\`lostpointercapture\`:Cp.delete(t.pointerId)}}function Dp(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=_t(t),t!==null&&cp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Op(e,t,n,r,i){switch(t){case\`focusin\`:return yp=Dp(yp,e,t,n,r,i),!0;case\`dragenter\`:return bp=Dp(bp,e,t,n,r,i),!0;case\`mouseover\`:return xp=Dp(xp,e,t,n,r,i),!0;case\`pointerover\`:var a=i.pointerId;return Sp.set(a,Dp(Sp.get(a)||null,e,t,n,r,i)),!0;case\`gotpointercapture\`:return a=i.pointerId,Cp.set(a,Dp(Cp.get(a)||null,e,t,n,r,i)),!0}return!1}function kp(e){var t=gt(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,at(e.priority,function(){lp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,at(e.priority,function(){lp(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 Ap(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=mp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);B=r,n.target.dispatchEvent(r),B=null}else return t=_t(n),t!==null&&cp(t),e.blockedOn=n,!1;t.shift()}return!0}function jp(e,t,n){Ap(e)&&n.delete(t)}function Mp(){vp=!1,yp!==null&&Ap(yp)&&(yp=null),bp!==null&&Ap(bp)&&(bp=null),xp!==null&&Ap(xp)&&(xp=null),Sp.forEach(jp),Cp.forEach(jp)}function Np(e,n){e.blockedOn===n&&(e.blockedOn=null,vp||(vp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Mp)))}var Pp=null;function Fp(e){Pp!==e&&(Pp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Pp===e&&(Pp=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(gp(r||n)===null)continue;break}var a=_t(n);a!==null&&(e.splice(t,3),t-=3,bs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Ip(e){function t(t){return Np(t,e)}yp!==null&&Np(yp,e),bp!==null&&Np(bp,e),xp!==null&&Np(xp,e),Sp.forEach(t),Cp.forEach(t);for(var n=0;n<wp.length;n++){var r=wp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<wp.length&&(n=wp[0],n.blockedOn===null);)kp(n),n.blockedOn===null&&wp.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[ct]||null;if(typeof a==\`function\`)o||Fp(n);else if(o){var s=null;if(a&&a.hasAttribute(\`formAction\`)){if(i=a,o=a[ct]||null)s=o.formAction;else if(gp(i)!==null)continue}else s=o.action;typeof s==\`function\`?n[r+1]=s:(n.splice(r,3),r-=3),Fp(n)}}}function Lp(){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 Rp(e){this._internalRoot=e}zp.prototype.render=Rp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;ap(n,mu(),e,t,null,null)},zp.prototype.unmount=Rp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ap(e.current,2,null,e,null,null),xu(),t[lt]=null}};function zp(e){this._internalRoot=e}zp.prototype.unstable_scheduleHydration=function(e){if(e){var t=it();e={blockedOn:null,target:e,priority:t};for(var n=0;n<wp.length&&t!==0&&t<wp[n].priority;n++);wp.splice(n,0,e),n===0&&kp(e)}};var Bp=n.version;if(Bp!==\`19.2.7\`)throw Error(i(527,Bp,\`19.2.7\`));F.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=d(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var Vp={bundleType:0,version:\`19.2.7\`,rendererPackageName:\`react-dom\`,currentDispatcherRef:P,reconcilerVersion:\`19.2.7\`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<\`u\`){var Hp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Hp.isDisabled&&Hp.supportsFiber)try{Ie=Hp.inject(Vp),Le=Hp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=\`\`,o=Us,s=Ws,c=Gs;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=rp(e,1,!1,null,null,n,r,null,o,s,c,Lp),e[lt]=t.current,Td(e),new Rp(t)}})),g=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=h()})),_=c(u(),1),v=g(),y=\`tinbase_service_key\`,b=sessionStorage.getItem(y)||\`\`,x=()=>b,S=e=>{b=e,sessionStorage.setItem(y,e)},C=()=>{b=\`\`,sessionStorage.removeItem(y)},w=null,T=e=>{w=e};function E(e={}){return{apikey:b,authorization:\`Bearer \${b}\`,"content-type":\`application/json\`,...e}}function D(e={}){let t=w??b;return{apikey:t,authorization:\`Bearer \${t}\`,"content-type":\`application/json\`,...e}}async function O(e,t={}){return fetch(\`\${e}\`,{...t,headers:{...E(),...t.headers}})}async function k(e,t={},n){let r=(t.method??\`GET\`).toUpperCase(),i=n&&n!==\`public\`?{[r===\`GET\`||r===\`HEAD\`?\`accept-profile\`:\`content-profile\`]:n}:{};return fetch(\`\${e}\`,{...t,headers:{...D(),...i,...t.headers}})}var A=class extends Error{status;constructor(e,t){super(e),this.status=t,this.name=\`ApiError\`}};function j(e){if(!e)return null;try{return JSON.parse(e)}catch{return null}}async function M(e){let t=j(await e.text());if(!e.ok)throw new A(t?.error||t?.message||t?.msg||\`HTTP \${e.status}\`,e.status);return t}var N={ping:()=>O(\`/admin/v1/stats\`).then(M),stats:()=>O(\`/admin/v1/stats\`).then(M),keys:()=>O(\`/admin/v1/keys\`).then(M),impersonate:(e,t)=>{let n=new URLSearchParams({role:e});return t&&(n.set(\`sub\`,t.sub),t.email&&n.set(\`email\`,t.email)),O(\`/admin/v1/impersonate?\${n}\`).then(M)},schemas:()=>O(\`/admin/v1/schemas\`).then(M).then(e=>e.schemas),tables:(e=\`public\`)=>O(\`/admin/v1/tables?schema=\${encodeURIComponent(e)}\`).then(M).then(e=>e.tables),migrations:()=>O(\`/admin/v1/migrations\`).then(M).then(e=>e.migrations),policies:(e=\`public\`)=>O(\`/admin/v1/policies?schema=\${encodeURIComponent(e)}\`).then(M).then(e=>e.policies),createPolicy:e=>O(\`/admin/v1/policies\`,{method:\`POST\`,body:JSON.stringify(e)}).then(M),dropPolicy:(e,t,n=\`public\`)=>O(\`/admin/v1/policies?\${new URLSearchParams({table:e,name:t,schema:n})}\`,{method:\`DELETE\`}).then(M),functions:(e=\`public\`)=>O(\`/admin/v1/functions?schema=\${encodeURIComponent(e)}\`).then(M).then(e=>e.functions),triggers:(e=\`public\`)=>O(\`/admin/v1/triggers?schema=\${encodeURIComponent(e)}\`).then(M).then(e=>e.triggers),logs:()=>O(\`/admin/v1/logs\`).then(M).then(e=>e.logs),clearLogs:()=>O(\`/admin/v1/logs\`,{method:\`DELETE\`}).then(M),sql:(e,t)=>O(\`/admin/v1/sql\`,{method:\`POST\`,body:JSON.stringify({query:e,role:t?.role,claims:t?.claims})}).then(async e=>{let t=j(await e.text())??{error:\`HTTP \${e.status}\`};return{ok:e.ok,...t}}),edgeFunctions:()=>O(\`/admin/v1/edge-functions\`).then(M),putSecrets:e=>O(\`/admin/v1/edge-functions/secrets\`,{method:\`PUT\`,body:JSON.stringify({secrets:e})}).then(M),deleteSecret:e=>O(\`/admin/v1/edge-functions/secrets?name=\${encodeURIComponent(e)}\`,{method:\`DELETE\`}).then(M),authConfig:()=>O(\`/admin/v1/auth-config\`).then(M),updateAuthSettings:e=>O(\`/admin/v1/auth-config\`,{method:\`PATCH\`,body:JSON.stringify(e)}).then(M).then(e=>e.settings),webhooksConfig:()=>O(\`/admin/v1/webhooks\`).then(M).then(e=>e.webhooks),rows:(e,t)=>{let n=new URLSearchParams({select:\`*\`,limit:String(t.limit),offset:String(t.offset)});t.order&&n.set(\`order\`,t.order);for(let[e,r]of t.filters??[])n.append(e,r);return k(\`/rest/v1/\${encodeURIComponent(e)}?\${n}\`,{headers:{prefer:\`count=exact\`}},t.schema).then(async e=>{let t=await M(e),n=e.headers.get(\`content-range\`)||\`\`;return{rows:t,total:parseInt(n.split(\`/\`)[1]||\`0\`,10)}})},insertRow:(e,t,n)=>k(\`/rest/v1/\${encodeURIComponent(e)}\`,{method:\`POST\`,headers:{prefer:\`return=representation\`},body:JSON.stringify(t)},n).then(M),updateRow:(e,t,n,r)=>{let i=new URLSearchParams;for(let[e,n]of Object.entries(t))i.set(e,\`eq.\${n}\`);return k(\`/rest/v1/\${encodeURIComponent(e)}?\${i}\`,{method:\`PATCH\`,headers:{prefer:\`return=representation\`},body:JSON.stringify(n)},r).then(M)},deleteRow:(e,t,n)=>{let r=new URLSearchParams;for(let[e,n]of Object.entries(t))r.set(e,\`eq.\${n}\`);return k(\`/rest/v1/\${encodeURIComponent(e)}?\${r}\`,{method:\`DELETE\`},n).then(M)},deleteRows:(e,t,n,r)=>{let i=n.map(e=>{let t=String(e);return/^-?\\d+(\\.\\d+)?$/.test(t)?t:\`"\${t.replace(/"/g,\`\\\\"\`)}"\`}),a=new URLSearchParams;return a.set(t,\`in.(\${i.join(\`,\`)})\`),k(\`/rest/v1/\${encodeURIComponent(e)}?\${a}\`,{method:\`DELETE\`},r).then(M)},users:()=>O(\`/auth/v1/admin/users\`).then(M).then(e=>e.users),createUser:e=>O(\`/auth/v1/admin/users\`,{method:\`POST\`,body:JSON.stringify({email_confirm:!0,...e})}).then(M),updateUser:(e,t)=>O(\`/auth/v1/admin/users/\${e}\`,{method:\`PUT\`,body:JSON.stringify(t)}).then(M),deleteUser:e=>O(\`/auth/v1/admin/users/\${e}\`,{method:\`DELETE\`}).then(M),sendMagicLink:e=>O(\`/auth/v1/otp\`,{method:\`POST\`,body:JSON.stringify({email:e,create_user:!0})}).then(M),buckets:()=>O(\`/storage/v1/bucket\`).then(M),createBucket:e=>O(\`/storage/v1/bucket\`,{method:\`POST\`,body:JSON.stringify(e)}).then(M),deleteBucket:e=>O(\`/storage/v1/bucket/\${encodeURIComponent(e)}\`,{method:\`DELETE\`}).then(M),listObjects:(e,t=\`\`)=>O(\`/storage/v1/object/list/\${encodeURIComponent(e)}\`,{method:\`POST\`,body:JSON.stringify({prefix:t,limit:100,offset:0,sortBy:{column:\`name\`,order:\`asc\`}})}).then(M),uploadObject:(e,t,n)=>{let r=new FormData;return r.append(\`\`,n),fetch(\`/storage/v1/object/\${encodeURIComponent(e)}/\${t}\`,{method:\`POST\`,headers:{apikey:b,authorization:\`Bearer \${b}\`,"x-upsert":\`true\`},body:r}).then(M)},removeObject:(e,t)=>O(\`/storage/v1/object/\${encodeURIComponent(e)}\`,{method:\`DELETE\`,body:JSON.stringify({prefixes:[t]})}).then(M),removeObjects:(e,t)=>O(\`/storage/v1/object/\${encodeURIComponent(e)}\`,{method:\`DELETE\`,body:JSON.stringify({prefixes:t})}).then(M),signUrl:(e,t,n=3600)=>O(\`/storage/v1/object/sign/\${encodeURIComponent(e)}/\${t}\`,{method:\`POST\`,body:JSON.stringify({expiresIn:n})}).then(M).then(e=>\`/storage/v1\${e.signedURL??e.signedUrl??\`\`}\`),downloadObject:(e,t)=>O(\`/storage/v1/object/\${encodeURIComponent(e)}/\${t}\`).then(async e=>{if(!e.ok)throw Error(\`HTTP \${e.status}\`);return e.blob()})},ee=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==\`\`&&n.indexOf(e)===t).join(\` \`).trim(),te=e=>e.replace(/([a-z0-9])([A-Z])/g,\`$1-$2\`).toLowerCase(),P=e=>e.replace(/^([A-Z])|[\\s-_]+(\\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),F=e=>{let t=P(e);return t.charAt(0).toUpperCase()+t.slice(1)},ne={xmlns:\`http://www.w3.org/2000/svg\`,width:24,height:24,viewBox:\`0 0 24 24\`,fill:\`none\`,stroke:\`currentColor\`,strokeWidth:2,strokeLinecap:\`round\`,strokeLinejoin:\`round\`},re=e=>{for(let t in e)if(t.startsWith(\`aria-\`)||t===\`role\`||t===\`title\`)return!0;return!1},ie=(0,_.createContext)({}),ae=()=>(0,_.useContext)(ie),oe=(0,_.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=\`\`,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=\`currentColor\`,className:p=\`\`}=ae()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,_.createElement)(\`svg\`,{ref:c,...ne,width:t??l??ne.width,height:t??l??ne.height,stroke:e??f,strokeWidth:m,className:ee(\`lucide\`,p,i),...!a&&!re(s)&&{"aria-hidden":\`true\`},...s},[...o.map(([e,t])=>(0,_.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),I=(e,t)=>{let n=(0,_.forwardRef)(({className:n,...r},i)=>(0,_.createElement)(oe,{ref:i,iconNode:t,className:ee(\`lucide-\${te(F(e))}\`,\`lucide-\${e}\`,n),...r}));return n.displayName=F(e),n},se=I(\`activity\`,[[\`path\`,{d:\`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2\`,key:\`169zse\`}]]),ce=I(\`arrow-down-up\`,[[\`path\`,{d:\`m3 16 4 4 4-4\`,key:\`1co6wj\`}],[\`path\`,{d:\`M7 20V4\`,key:\`1yoxec\`}],[\`path\`,{d:\`m21 8-4-4-4 4\`,key:\`1c9v7m\`}],[\`path\`,{d:\`M17 4v16\`,key:\`7dpous\`}]]),le=I(\`arrow-down\`,[[\`path\`,{d:\`M12 5v14\`,key:\`s699le\`}],[\`path\`,{d:\`m19 12-7 7-7-7\`,key:\`1idqje\`}]]),ue=I(\`arrow-right\`,[[\`path\`,{d:\`M5 12h14\`,key:\`1ays0h\`}],[\`path\`,{d:\`m12 5 7 7-7 7\`,key:\`xquz4c\`}]]),de=I(\`arrow-up-right\`,[[\`path\`,{d:\`M7 7h10v10\`,key:\`1tivn9\`}],[\`path\`,{d:\`M7 17 17 7\`,key:\`1vkiza\`}]]),fe=I(\`arrow-up\`,[[\`path\`,{d:\`m5 12 7-7 7 7\`,key:\`hav0vg\`}],[\`path\`,{d:\`M12 19V5\`,key:\`x0mq9r\`}]]),pe=I(\`check\`,[[\`path\`,{d:\`M20 6 9 17l-5-5\`,key:\`1gmf2c\`}]]),me=I(\`chevron-down\`,[[\`path\`,{d:\`m6 9 6 6 6-6\`,key:\`qrunsl\`}]]),he=I(\`chevron-left\`,[[\`path\`,{d:\`m15 18-6-6 6-6\`,key:\`1wnfg3\`}]]),ge=I(\`chevron-right\`,[[\`path\`,{d:\`m9 18 6-6-6-6\`,key:\`mthhwq\`}]]),_e=I(\`circle-alert\`,[[\`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\`}]]),ve=I(\`circle-check\`,[[\`circle\`,{cx:\`12\`,cy:\`12\`,r:\`10\`,key:\`1mglay\`}],[\`path\`,{d:\`m9 12 2 2 4-4\`,key:\`dzmm74\`}]]),ye=I(\`circle-dot\`,[[\`circle\`,{cx:\`12\`,cy:\`12\`,r:\`10\`,key:\`1mglay\`}],[\`circle\`,{cx:\`12\`,cy:\`12\`,r:\`1\`,key:\`41hilf\`}]]),be=I(\`circle\`,[[\`circle\`,{cx:\`12\`,cy:\`12\`,r:\`10\`,key:\`1mglay\`}]]),xe=I(\`clock\`,[[\`circle\`,{cx:\`12\`,cy:\`12\`,r:\`10\`,key:\`1mglay\`}],[\`path\`,{d:\`M12 6v6l4 2\`,key:\`mmk7yg\`}]]),Se=I(\`copy\`,[[\`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\`}]]),Ce=I(\`corner-down-left\`,[[\`path\`,{d:\`M20 4v7a4 4 0 0 1-4 4H4\`,key:\`6o5b7l\`}],[\`path\`,{d:\`m9 10-5 5 5 5\`,key:\`1kshq7\`}]]),we=I(\`database\`,[[\`ellipse\`,{cx:\`12\`,cy:\`5\`,rx:\`9\`,ry:\`3\`,key:\`msslwz\`}],[\`path\`,{d:\`M3 5V19A9 3 0 0 0 21 19V5\`,key:\`1wlel7\`}],[\`path\`,{d:\`M3 12A9 3 0 0 0 21 12\`,key:\`mv7ke4\`}]]),Te=I(\`diamond\`,[[\`path\`,{d:\`M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z\`,key:\`1f1r0c\`}]]),Ee=I(\`download\`,[[\`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\`}]]),De=I(\`ellipsis-vertical\`,[[\`circle\`,{cx:\`12\`,cy:\`12\`,r:\`1\`,key:\`41hilf\`}],[\`circle\`,{cx:\`12\`,cy:\`5\`,r:\`1\`,key:\`gxeob9\`}],[\`circle\`,{cx:\`12\`,cy:\`19\`,r:\`1\`,key:\`lyex9k\`}]]),Oe=I(\`external-link\`,[[\`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\`}]]),ke=I(\`eye-off\`,[[\`path\`,{d:\`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49\`,key:\`ct8e1f\`}],[\`path\`,{d:\`M14.084 14.158a3 3 0 0 1-4.242-4.242\`,key:\`151rxh\`}],[\`path\`,{d:\`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143\`,key:\`13bj9a\`}],[\`path\`,{d:\`m2 2 20 20\`,key:\`1ooewy\`}]]),Ae=I(\`eye\`,[[\`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\`}]]),je=I(\`file-clock\`,[[\`path\`,{d:\`M16 22h2a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v2.85\`,key:\`ryk6xj\`}],[\`path\`,{d:\`M14 2v5a1 1 0 0 0 1 1h5\`,key:\`wfsgrz\`}],[\`path\`,{d:\`M8 14v2.2l1.6 1\`,key:\`6m4bie\`}],[\`circle\`,{cx:\`8\`,cy:\`16\`,r:\`6\`,key:\`10v15b\`}]]),Me=I(\`file-code\`,[[\`path\`,{d:\`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\`,key:\`1oefj6\`}],[\`path\`,{d:\`M14 2v5a1 1 0 0 0 1 1h5\`,key:\`wfsgrz\`}],[\`path\`,{d:\`M10 12.5 8 15l2 2.5\`,key:\`1tg20x\`}],[\`path\`,{d:\`m14 12.5 2 2.5-2 2.5\`,key:\`yinavb\`}]]),Ne=I(\`file\`,[[\`path\`,{d:\`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\`,key:\`1oefj6\`}],[\`path\`,{d:\`M14 2v5a1 1 0 0 0 1 1h5\`,key:\`wfsgrz\`}]]),Pe=I(\`files\`,[[\`path\`,{d:\`M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8\`,key:\`14sh0y\`}],[\`path\`,{d:\`M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z\`,key:\`1970lx\`}],[\`path\`,{d:\`M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1\`,key:\`l4dndm\`}]]),Fe=I(\`folder-plus\`,[[\`path\`,{d:\`M12 10v6\`,key:\`1bos4e\`}],[\`path\`,{d:\`M9 13h6\`,key:\`1uhe8q\`}],[\`path\`,{d:\`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z\`,key:\`1kt360\`}]]),Ie=I(\`folder\`,[[\`path\`,{d:\`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z\`,key:\`1kt360\`}]]),Le=I(\`funnel\`,[[\`path\`,{d:\`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z\`,key:\`sc7q7i\`}]]),L=I(\`gauge\`,[[\`path\`,{d:\`m12 14 4-4\`,key:\`9kzdfg\`}],[\`path\`,{d:\`M3.34 19a10 10 0 1 1 17.32 0\`,key:\`19p75a\`}]]),Re=I(\`git-branch\`,[[\`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\`}]]),ze=I(\`globe\`,[[\`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=I(\`hard-drive\`,[[\`path\`,{d:\`M10 16h.01\`,key:\`1bzywj\`}],[\`path\`,{d:\`M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z\`,key:\`18tbho\`}],[\`path\`,{d:\`M21.946 12.013H2.054\`,key:\`zqlbp7\`}],[\`path\`,{d:\`M6 16h.01\`,key:\`1pmjb7\`}]]),Ve=I(\`heart\`,[[\`path\`,{d:\`M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5\`,key:\`mvr1a0\`}]]),He=I(\`history\`,[[\`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\`}]]),Ue=I(\`house\`,[[\`path\`,{d:\`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8\`,key:\`5wwlr5\`}],[\`path\`,{d:\`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z\`,key:\`r6nss1\`}]]),We=I(\`inbox\`,[[\`polyline\`,{points:\`22 12 16 12 14 15 10 15 8 12 2 12\`,key:\`o97t9d\`}],[\`path\`,{d:\`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z\`,key:\`oot6mr\`}]]),Ge=I(\`info\`,[[\`circle\`,{cx:\`12\`,cy:\`12\`,r:\`10\`,key:\`1mglay\`}],[\`path\`,{d:\`M12 16v-4\`,key:\`1dtifu\`}],[\`path\`,{d:\`M12 8h.01\`,key:\`e9boi3\`}]]),Ke=I(\`key-round\`,[[\`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\`}]]),qe=I(\`layout-grid\`,[[\`rect\`,{width:\`7\`,height:\`7\`,x:\`3\`,y:\`3\`,rx:\`1\`,key:\`1g98yp\`}],[\`rect\`,{width:\`7\`,height:\`7\`,x:\`14\`,y:\`3\`,rx:\`1\`,key:\`6d4xhi\`}],[\`rect\`,{width:\`7\`,height:\`7\`,x:\`14\`,y:\`14\`,rx:\`1\`,key:\`nxv5o0\`}],[\`rect\`,{width:\`7\`,height:\`7\`,x:\`3\`,y:\`14\`,rx:\`1\`,key:\`1bb6yr\`}]]),Je=I(\`lightbulb\`,[[\`path\`,{d:\`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5\`,key:\`1gvzjb\`}],[\`path\`,{d:\`M9 18h6\`,key:\`x1upvd\`}],[\`path\`,{d:\`M10 22h4\`,key:\`ceow96\`}]]),Ye=I(\`link-2\`,[[\`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\`}]]),Xe=I(\`list-filter\`,[[\`path\`,{d:\`M2 5h20\`,key:\`1fs1ex\`}],[\`path\`,{d:\`M6 12h12\`,key:\`8npq4p\`}],[\`path\`,{d:\`M9 19h6\`,key:\`456am0\`}]]),Ze=I(\`lock\`,[[\`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\`}]]),Qe=I(\`lock-open\`,[[\`rect\`,{width:\`18\`,height:\`11\`,x:\`3\`,y:\`11\`,rx:\`2\`,ry:\`2\`,key:\`1w4ew1\`}],[\`path\`,{d:\`M7 11V7a5 5 0 0 1 9.9-1\`,key:\`1mm8w8\`}]]),$e=I(\`log-out\`,[[\`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\`}]]),et=I(\`mail\`,[[\`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\`}]]),tt=I(\`maximize-2\`,[[\`path\`,{d:\`M15 3h6v6\`,key:\`1q9fwt\`}],[\`path\`,{d:\`m21 3-7 7\`,key:\`1l2asr\`}],[\`path\`,{d:\`m3 21 7-7\`,key:\`tjx5ai\`}],[\`path\`,{d:\`M9 21H3v-6\`,key:\`wtvkvv\`}]]),nt=I(\`minus\`,[[\`path\`,{d:\`M5 12h14\`,key:\`1ays0h\`}]]),rt=I(\`package\`,[[\`path\`,{d:\`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z\`,key:\`1a0edw\`}],[\`path\`,{d:\`M12 22V12\`,key:\`d0xqtd\`}],[\`polyline\`,{points:\`3.29 7 12 12 20.71 7\`,key:\`ousv84\`}],[\`path\`,{d:\`m7.5 4.27 9 5.15\`,key:\`1c824w\`}]]),it=I(\`panel-left-close\`,[[\`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\`}]]),at=I(\`panel-left-open\`,[[\`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\`}]]),ot=I(\`panel-right-close\`,[[\`rect\`,{width:\`18\`,height:\`18\`,x:\`3\`,y:\`3\`,rx:\`2\`,key:\`afitv7\`}],[\`path\`,{d:\`M15 3v18\`,key:\`14nvp0\`}],[\`path\`,{d:\`m8 9 3 3-3 3\`,key:\`12hl5m\`}]]),st=I(\`panel-right-open\`,[[\`rect\`,{width:\`18\`,height:\`18\`,x:\`3\`,y:\`3\`,rx:\`2\`,key:\`afitv7\`}],[\`path\`,{d:\`M15 3v18\`,key:\`14nvp0\`}],[\`path\`,{d:\`m10 15-3-3 3-3\`,key:\`1pgupc\`}]]),ct=I(\`pause\`,[[\`rect\`,{x:\`14\`,y:\`3\`,width:\`5\`,height:\`18\`,rx:\`1\`,key:\`kaeet6\`}],[\`rect\`,{x:\`5\`,y:\`3\`,width:\`5\`,height:\`18\`,rx:\`1\`,key:\`1wsw3u\`}]]),lt=I(\`pencil\`,[[\`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\`}]]),ut=I(\`pin\`,[[\`path\`,{d:\`M12 17v5\`,key:\`bb1du9\`}],[\`path\`,{d:\`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z\`,key:\`1nkz8b\`}]]),dt=I(\`pin-off\`,[[\`path\`,{d:\`M12 17v5\`,key:\`bb1du9\`}],[\`path\`,{d:\`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89\`,key:\`znwnzq\`}],[\`path\`,{d:\`m2 2 20 20\`,key:\`1ooewy\`}],[\`path\`,{d:\`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11\`,key:\`c9qhm2\`}]]),ft=I(\`play\`,[[\`path\`,{d:\`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z\`,key:\`10ikf1\`}]]),pt=I(\`plug\`,[[\`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\`}]]),mt=I(\`plus\`,[[\`path\`,{d:\`M5 12h14\`,key:\`1ays0h\`}],[\`path\`,{d:\`M12 5v14\`,key:\`s699le\`}]]),ht=I(\`radio\`,[[\`path\`,{d:\`M16.247 7.761a6 6 0 0 1 0 8.478\`,key:\`1fwjs5\`}],[\`path\`,{d:\`M19.075 4.933a10 10 0 0 1 0 14.134\`,key:\`ehdyv1\`}],[\`path\`,{d:\`M4.925 19.067a10 10 0 0 1 0-14.134\`,key:\`1q22gi\`}],[\`path\`,{d:\`M7.753 16.239a6 6 0 0 1 0-8.478\`,key:\`r2q7qm\`}],[\`circle\`,{cx:\`12\`,cy:\`12\`,r:\`2\`,key:\`1c9p78\`}]]),gt=I(\`refresh-cw\`,[[\`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\`}]]),_t=I(\`scroll-text\`,[[\`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\`}]]),vt=I(\`search\`,[[\`path\`,{d:\`m21 21-4.34-4.34\`,key:\`14j7rj\`}],[\`circle\`,{cx:\`11\`,cy:\`11\`,r:\`8\`,key:\`4ej97u\`}]]),yt=I(\`send\`,[[\`path\`,{d:\`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z\`,key:\`1ffxy3\`}],[\`path\`,{d:\`m21.854 2.147-10.94 10.939\`,key:\`12cjpa\`}]]),bt=I(\`settings\`,[[\`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\`}]]),xt=I(\`shield-alert\`,[[\`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\`}]]),St=I(\`shield-check\`,[[\`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\`}]]),Ct=I(\`shield-off\`,[[\`path\`,{d:\`m2 2 20 20\`,key:\`1ooewy\`}],[\`path\`,{d:\`M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71\`,key:\`1jlk70\`}],[\`path\`,{d:\`M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264\`,key:\`18rp1v\`}]]),wt=I(\`shield-plus\`,[[\`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 12h6\`,key:\`1c52cq\`}],[\`path\`,{d:\`M12 9v6\`,key:\`199k2o\`}]]),Tt=I(\`smartphone\`,[[\`rect\`,{width:\`14\`,height:\`20\`,x:\`5\`,y:\`2\`,rx:\`2\`,ry:\`2\`,key:\`1yt0o3\`}],[\`path\`,{d:\`M12 18h.01\`,key:\`mhygvu\`}]]),Et=I(\`square-function\`,[[\`rect\`,{width:\`18\`,height:\`18\`,x:\`3\`,y:\`3\`,rx:\`2\`,ry:\`2\`,key:\`1m3agn\`}],[\`path\`,{d:\`M9 17c2 0 2.8-1 2.8-2.8V10c0-2 1-3.3 3.2-3\`,key:\`m1af9g\`}],[\`path\`,{d:\`M9 11.2h5.7\`,key:\`3zgcl2\`}]]),Dt=I(\`square\`,[[\`rect\`,{width:\`18\`,height:\`18\`,x:\`3\`,y:\`3\`,rx:\`2\`,key:\`afitv7\`}]]),Ot=I(\`table-2\`,[[\`path\`,{d:\`M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18\`,key:\`gugj83\`}]]),kt=I(\`terminal\`,[[\`path\`,{d:\`M12 19h8\`,key:\`baeox8\`}],[\`path\`,{d:\`m4 17 6-6-6-6\`,key:\`1yngyt\`}]]),At=I(\`trash-2\`,[[\`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\`}]]),jt=I(\`triangle-alert\`,[[\`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\`}]]),Mt=I(\`upload\`,[[\`path\`,{d:\`M12 3v12\`,key:\`1x0j5s\`}],[\`path\`,{d:\`m17 8-5-5-5 5\`,key:\`7q97r8\`}],[\`path\`,{d:\`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\`,key:\`ih7n3h\`}]]),Nt=I(\`user-round\`,[[\`circle\`,{cx:\`12\`,cy:\`8\`,r:\`5\`,key:\`1hypcn\`}],[\`path\`,{d:\`M20 21a8 8 0 0 0-16 0\`,key:\`rfgkzh\`}]]),Pt=I(\`users\`,[[\`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\`}]]),Ft=I(\`wand-sparkles\`,[[\`path\`,{d:\`m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72\`,key:\`ul74o6\`}],[\`path\`,{d:\`m14 7 3 3\`,key:\`1r5n42\`}],[\`path\`,{d:\`M5 6v4\`,key:\`ilb8ba\`}],[\`path\`,{d:\`M19 14v4\`,key:\`blhpug\`}],[\`path\`,{d:\`M10 2v2\`,key:\`7u0qdc\`}],[\`path\`,{d:\`M7 8H3\`,key:\`zfb6yr\`}],[\`path\`,{d:\`M21 16h-4\`,key:\`1cnmox\`}],[\`path\`,{d:\`M11 3H9\`,key:\`1obp7u\`}]]),It=I(\`workflow\`,[[\`rect\`,{width:\`8\`,height:\`8\`,x:\`3\`,y:\`3\`,rx:\`2\`,key:\`by2w9f\`}],[\`path\`,{d:\`M7 11v4a2 2 0 0 0 2 2h4\`,key:\`xkn7yn\`}],[\`rect\`,{width:\`8\`,height:\`8\`,x:\`13\`,y:\`13\`,rx:\`2\`,key:\`1cgmvn\`}]]),Lt=I(\`x\`,[[\`path\`,{d:\`M18 6 6 18\`,key:\`1bl5f8\`}],[\`path\`,{d:\`m6 6 12 12\`,key:\`d8bk6v\`}]]),Rt=I(\`zap\`,[[\`path\`,{d:\`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z\`,key:\`1xq2db\`}]]);function zt(e){if(Array.isArray(e))return e.map(e=>e==null?\`\`:String(e));if(typeof e!=\`string\`)return e==null?[]:[String(e)];let t=e.trim();if(!(t.startsWith(\`{\`)&&t.endsWith(\`}\`)))return t===\`\`?[]:[t];let n=t.slice(1,-1);if(n===\`\`)return[];let r=[],i=\`\`,a=!1;for(let e=0;e<n.length;e++){let t=n[e];a?t===\`\\\\\`?i+=n[++e]??\`\`:t===\`"\`?a=!1:i+=t:t===\`"\`?a=!0:t===\`,\`?(r.push(i),i=\`\`):i+=t}return r.push(i),r.map(e=>e===\`NULL\`?\`\`:e)}var Bt=[{title:null,items:[{id:\`home\`,label:\`Project overview\`,icon:Ue}]},{title:\`Database\`,items:[{id:\`table\`,label:\`Table Editor\`,icon:Ot},{id:\`sql\`,label:\`SQL Editor\`,icon:kt},{id:\`database\`,label:\`Database\`,icon:Re}]},{title:\`Manage\`,items:[{id:\`auth\`,label:\`Authentication\`,icon:Ke},{id:\`storage\`,label:\`Storage\`,icon:Be},{id:\`functions\`,label:\`Edge Functions\`,icon:Rt},{id:\`realtime\`,label:\`Realtime\`,icon:ht}]},{title:\`Automations\`,items:[{id:\`automations\`,label:\`Automations\`,icon:It}]},{title:\`Observe\`,items:[{id:\`logs\`,label:\`Logs\`,icon:_t}]},{title:\`Project\`,items:[{id:\`settings\`,label:\`Project Settings\`,icon:bt}]}];function Vt(){try{return new URL(document.URL).pathname}catch{return window.location.pathname}}var Ht=Vt().startsWith(\`/_\`)?\`/_\`:\`\`,Ut=new Set(Bt.flatMap(e=>e.items.map(e=>e.id)));function Wt(){let e=Vt().slice(Ht.length).split(\`/\`).filter(Boolean);return{tab:Ut.has(e[0])?e[0]:\`home\`,section:e[1]?decodeURIComponent(e[1]):null}}function Gt(e,t){return e===\`home\`?\`\${Ht}/\`:t?\`\${Ht}/\${e}/\${encodeURIComponent(t)}\`:\`\${Ht}/\${e}\`}var Kt=Wt(),qt=new Set;function Jt(){let e=Wt();(e.tab!==Kt.tab||e.section!==Kt.section)&&(Kt=e,qt.forEach(e=>e()))}window.addEventListener(\`popstate\`,Jt);function R(e,t=null,n={}){let r=Gt(e,t);Vt()!==r&&(n.replace?window.history.replaceState(null,\`\`,r):window.history.pushState(null,\`\`,r)),Jt()}function Yt(){return(0,_.useSyncExternalStore)(e=>(qt.add(e),()=>qt.delete(e)),()=>Kt)}function Xt(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=Xt(e[t]))&&(r&&(r+=\` \`),r+=n)}else for(n in e)e[n]&&(r&&(r+=\` \`),r+=n);return r}function Zt(){for(var e,t,n=0,r=\`\`,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Xt(e))&&(r&&(r+=\` \`),r+=t);return r}var Qt=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})),z=o(((e,t)=>{t.exports=Qt()}))();function B({variant:e=\`neutral\`,className:t,children:n}){return(0,z.jsx)(\`span\`,{className:Zt(\`inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[11px] leading-none\`,{neutral:\`bg-accent text-muted-foreground\`,brand:\`bg-brand/15 text-brand\`,amber:\`bg-warning/15 text-warning\`,red:\`bg-destructive/15 text-destructive\`,blue:\`bg-info/15 text-info\`,outline:\`border border-input text-muted-foreground\`}[e],t),children:n})}function V({variant:e=\`default\`,size:t=\`sm\`,className:n,...r}){return(0,z.jsx)(\`button\`,{className:Zt(\`inline-flex shrink-0 items-center justify-center gap-1.5 whitespace-nowrap rounded-md transition-colors disabled:opacity-50 disabled:pointer-events-none\`,{sm:\`h-8 px-3 text-[13px]\`,xs:\`h-6 px-2 text-xs\`,icon:\`size-8\`,iconXs:\`size-6\`}[t],{default:\`bg-primary text-primary-foreground hover:bg-primary/90 font-medium\`,outline:\`border border-input text-foreground hover:bg-accent hover:border-muted-foreground\`,ghost:\`text-foreground/80 hover:bg-accent\`,danger:\`border border-destructive/30 text-destructive hover:bg-destructive/10\`,dangerSolid:\`bg-destructive text-primary-foreground hover:bg-destructive/90 font-medium\`}[e],n),...r})}function $t({checked:e,indeterminate:t,onChange:n,disabled:r,title:i,className:a}){return(0,z.jsx)(\`button\`,{type:\`button\`,role:\`checkbox\`,"aria-checked":t?\`mixed\`:e,disabled:r,title:i,onClick:t=>{t.stopPropagation(),n?.(!e,t)},className:Zt(\`flex size-4 shrink-0 items-center justify-center rounded-[4px] border transition-colors\`,e||t?\`border-brand bg-brand text-primary-foreground\`:\`border-muted-foreground bg-transparent hover:border-foreground\`,r&&\`pointer-events-none opacity-40\`,a),children:t?(0,z.jsx)(nt,{size:11,strokeWidth:3}):e?(0,z.jsx)(pe,{size:11,strokeWidth:3}):null})}var en=o(((e,t)=>{(function(){var e=\`ace\`,t=(function(){return this})();if(!t&&typeof window<\`u\`&&(t=window),!e&&typeof requirejs<\`u\`)return;var n=function(e,t,r){if(typeof e!=\`string\`){n.original?n.original.apply(this,arguments):(console.error(\`dropping module because define wasn't a string.\`),console.trace());return}arguments.length==2&&(r=t),n.modules[e]||(n.payloads[e]=r,n.modules[e]=null)};n.modules={},n.payloads={};var r=function(e,t,n){if(typeof t==\`string\`){var r=o(e,t);if(r!=null)return n&&n(),r}else if(Object.prototype.toString.call(t)===\`[object Array]\`){for(var a=[],s=0,c=t.length;s<c;++s){var l=o(e,t[s]);if(l==null&&i.original)return;a.push(l)}return n&&n.apply(null,a)||!0}},i=function(e,t){var n=r(\`\`,e,t);return n==null&&i.original?i.original.apply(this,arguments):n},a=function(e,t){if(t.indexOf(\`!\`)!==-1){var n=t.split(\`!\`);return a(e,n[0])+\`!\`+a(e,n[1])}if(t.charAt(0)==\`.\`)for(t=e.split(\`/\`).slice(0,-1).join(\`/\`)+\`/\`+t;t.indexOf(\`.\`)!==-1&&r!=t;){var r=t;t=t.replace(/\\/\\.\\//,\`/\`).replace(/[^\\/]+\\/\\.\\.\\//,\`\`)}return t},o=function(e,t){t=a(e,t);var i=n.modules[t];if(!i){if(i=n.payloads[t],typeof i==\`function\`){var o={},s={id:t,uri:\`\`,exports:o,packaged:!0};o=i(function(e,n){return r(t,e,n)},o,s)||s.exports,n.modules[t]=o,delete n.payloads[t]}i=n.modules[t]=o||i}return i};function s(e){var r=t;e&&(t[e]||(t[e]={}),r=t[e]),(!r.define||!r.define.packaged)&&(n.original=r.define,r.define=n,r.define.packaged=!0),(!r.require||!r.require.packaged)&&(i.original=r.require,r.require=i,r.require.packaged=!0)}s(e)})(),ace.define(\`ace/lib/es6-shim\`,[\`require\`,\`exports\`,\`module\`],function(e,t,n){function r(e,t,n){Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}String.prototype.startsWith||r(String.prototype,\`startsWith\`,function(e,t){return t||=0,this.lastIndexOf(e,t)===t}),String.prototype.endsWith||r(String.prototype,\`endsWith\`,function(e,t){var n=this;(t===void 0||t>n.length)&&(t=n.length),t-=e.length;var r=n.indexOf(e,t);return r!==-1&&r===t}),String.prototype.repeat||r(String.prototype,\`repeat\`,function(e){for(var t=\`\`,n=this;e>0;)e&1&&(t+=n),(e>>=1)&&(n+=n);return t}),String.prototype.includes||r(String.prototype,\`includes\`,function(e,t){return this.indexOf(e,t)!=-1}),Object.assign||(Object.assign=function(e){if(e==null)throw TypeError(\`Cannot convert undefined or null to object\`);for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];r!=null&&Object.keys(r).forEach(function(e){t[e]=r[e]})}return t}),Object.values||(Object.values=function(e){return Object.keys(e).map(function(t){return e[t]})}),Array.prototype.find||r(Array.prototype,\`find\`,function(e){for(var t=this.length,n=arguments[1],r=0;r<t;r++){var i=this[r];if(e.call(n,i,r,this))return i}}),Array.prototype.findIndex||r(Array.prototype,\`findIndex\`,function(e){for(var t=this.length,n=arguments[1],r=0;r<t;r++){var i=this[r];if(e.call(n,i,r,this))return r}}),Array.prototype.includes||r(Array.prototype,\`includes\`,function(e,t){return this.indexOf(e,t)!=-1}),Array.prototype.fill||r(Array.prototype,\`fill\`,function(e){for(var t=this,n=t.length>>>0,r=arguments[1]>>0,i=r<0?Math.max(n+r,0):Math.min(r,n),a=arguments[2],o=a===void 0?n:a>>0,s=o<0?Math.max(n+o,0):Math.min(o,n);i<s;)t[i]=e,i++;return t}),Array.of||r(Array,\`of\`,function(){return Array.prototype.slice.call(arguments)})}),ace.define(\`ace/lib/fixoldbrowsers\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/es6-shim\`],function(e,t,n){e("./es6-shim")}),ace.define(\`ace/lib/deep_copy\`,[\`require\`,\`exports\`,\`module\`],function(e,t,n){t.deepCopy=function e(t){if(typeof t!=\`object\`||!t)return t;var n;if(Array.isArray(t)){n=[];for(var r=0;r<t.length;r++)n[r]=e(t[r]);return n}if(Object.prototype.toString.call(t)!==\`[object Object]\`)return t;for(var r in n={},t)n[r]=e(t[r]);return n}}),ace.define(\`ace/lib/lang\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/deep_copy\`],function(e,t,n){t.last=function(e){return e[e.length-1]},t.stringReverse=function(e){return e.split(\`\`).reverse().join(\`\`)},t.stringRepeat=function(e,t){for(var n=\`\`;t>0;)t&1&&(n+=e),(t>>=1)&&(e+=e);return n};var r=/^\\s\\s*/,i=/\\s\\s*$/;t.stringTrimLeft=function(e){return e.replace(r,\`\`)},t.stringTrimRight=function(e){return e.replace(i,\`\`)},t.copyObject=function(e){var t={};for(var n in e)t[n]=e[n];return t},t.copyArray=function(e){for(var t=[],n=0,r=e.length;n<r;n++)e[n]&&typeof e[n]==\`object\`?t[n]=this.copyObject(e[n]):t[n]=e[n];return t},t.deepCopy=e("./deep_copy").deepCopy,t.arrayToMap=function(e){for(var t={},n=0;n<e.length;n++)t[e[n]]=1;return t},t.createMap=function(e){var t=Object.create(null);for(var n in e)t[n]=e[n];return t},t.arrayRemove=function(e,t){for(var n=0;n<=e.length;n++)t===e[n]&&e.splice(n,1)},t.escapeRegExp=function(e){return e.replace(/([.*+?^\${}()|[\\]\\/\\\\])/g,\`\\\\$1\`)},t.escapeHTML=function(e){return(\`\`+e).replace(/&/g,\`&\`).replace(/"/g,\`"\`).replace(/'/g,\`'\`).replace(/</g,\`<\`)},t.getMatchOffsets=function(e,t){var n=[];return e.replace(t,function(e){n.push({offset:arguments[arguments.length-2],length:e.length})}),n},t.deferredCall=function(e){var t=null,n=function(){t=null,e()},r=function(e){return r.cancel(),t=setTimeout(n,e||0),r};return r.schedule=r,r.call=function(){return this.cancel(),e(),r},r.cancel=function(){return clearTimeout(t),t=null,r},r.isPending=function(){return t},r},t.delayedCall=function(e,t){var n=null,r=function(){n=null,e()},i=function(e){n??=setTimeout(r,e||t)};return i.delay=function(e){n&&clearTimeout(n),n=setTimeout(r,e||t)},i.schedule=i,i.call=function(){this.cancel(),e()},i.cancel=function(){n&&clearTimeout(n),n=null},i.isPending=function(){return n},i},t.sleep=function(e){return new Promise(function(t){setTimeout(t,e)})},t.supportsLookbehind=function(){return!0},t.skipEmptyMatch=function(e,t,n){return n&&e.codePointAt(t)>65535?2:1}}),ace.define(\`ace/lib/useragent\`,[\`require\`,\`exports\`,\`module\`],function(e,t,n){t.OS={LINUX:\`LINUX\`,MAC:\`MAC\`,WINDOWS:\`WINDOWS\`},t.getOS=function(){return t.isMac?t.OS.MAC:t.isLinux?t.OS.LINUX:t.OS.WINDOWS};var r=typeof navigator==\`object\`?navigator:{},i=(/mac|win|linux/i.exec(r.platform)||[\`other\`])[0].toLowerCase(),a=r.userAgent||\`\`,o=r.appName||\`\`;t.isWin=i==\`win\`,t.isMac=i==\`mac\`,t.isLinux=i==\`linux\`,t.isIE=o==\`Microsoft Internet Explorer\`||o.indexOf(\`MSAppHost\`)>=0?parseFloat((a.match(/(?:MSIE |Trident\\/[0-9]+[\\.0-9]+;.*rv:)([0-9]+[\\.0-9]+)/)||[])[1]):parseFloat((a.match(/(?:Trident\\/[0-9]+[\\.0-9]+;.*rv:)([0-9]+[\\.0-9]+)/)||[])[1]),t.isOldIE=t.isIE&&t.isIE<9,t.isGecko=t.isMozilla=a.match(/ Gecko\\/\\d+/),t.isOpera=typeof opera==\`object\`&&Object.prototype.toString.call(window.opera)==\`[object Opera]\`,t.isWebKit=parseFloat(a.split(\`WebKit/\`)[1])||void 0,t.isChrome=parseFloat(a.split(\` Chrome/\`)[1])||void 0,t.isSafari=parseFloat(a.split(\` Safari/\`)[1])&&!t.isChrome||void 0,t.isEdge=parseFloat(a.split(\` Edge/\`)[1])||void 0,t.isAIR=a.indexOf(\`AdobeAIR\`)>=0,t.isAndroid=a.indexOf(\`Android\`)>=0,t.isChromeOS=a.indexOf(\` CrOS \`)>=0,t.isIOS=/iPad|iPhone|iPod/.test(a)&&!window.MSStream,t.isIOS&&(t.isMac=!0),t.isMobile=t.isIOS||t.isAndroid}),ace.define(\`ace/lib/dom\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/useragent\`],function(e,t,n){var r=e("./useragent"),i=\`http://www.w3.org/1999/xhtml\`;t.buildDom=function e(t,n,r){if(typeof t==\`string\`&&t){var i=document.createTextNode(t);return n&&n.appendChild(i),i}if(!Array.isArray(t))return t&&t.appendChild&&n&&n.appendChild(t),t;if(typeof t[0]!=\`string\`||!t[0]){for(var a=[],o=0;o<t.length;o++){var s=e(t[o],n,r);s&&a.push(s)}return a}var c=document.createElement(t[0]),l=t[1],u=1;l&&typeof l==\`object\`&&!Array.isArray(l)&&(u=2);for(var o=u;o<t.length;o++)e(t[o],c,r);return u==2&&Object.keys(l).forEach(function(e){var t=l[e];e===\`class\`?c.className=Array.isArray(t)?t.join(\` \`):t:typeof t==\`function\`||e==\`value\`||e[0]==\`$\`?c[e]=t:e===\`ref\`?r&&(r[t]=c):e===\`style\`?typeof t==\`string\`&&(c.style.cssText=t):t!=null&&c.setAttribute(e,t)}),n&&n.appendChild(c),c},t.getDocumentHead=function(e){return e||=document,e.head||e.getElementsByTagName(\`head\`)[0]||e.documentElement},t.createElement=function(e,t){return document.createElementNS?document.createElementNS(t||i,e):document.createElement(e)},t.removeChildren=function(e){e.innerHTML=\`\`},t.createTextNode=function(e,t){return(t?t.ownerDocument:document).createTextNode(e)},t.createFragment=function(e){return(e?e.ownerDocument:document).createDocumentFragment()},t.hasCssClass=function(e,t){return(e.className+\`\`).split(/\\s+/g).indexOf(t)!==-1},t.addCssClass=function(e,n){t.hasCssClass(e,n)||(e.className+=\` \`+n)},t.removeCssClass=function(e,t){for(var n=e.className.split(/\\s+/g);;){var r=n.indexOf(t);if(r==-1)break;n.splice(r,1)}e.className=n.join(\` \`)},t.toggleCssClass=function(e,t){for(var n=e.className.split(/\\s+/g),r=!0;;){var i=n.indexOf(t);if(i==-1)break;r=!1,n.splice(i,1)}return r&&n.push(t),e.className=n.join(\` \`),r},t.setCssClass=function(e,n,r){r?t.addCssClass(e,n):t.removeCssClass(e,n)},t.hasCssString=function(e,t){var n=0,r;if(t||=document,r=t.querySelectorAll(\`style\`)){for(;n<r.length;)if(r[n++].id===e)return!0}},t.removeElementById=function(e,t){t||=document,t.getElementById(e)&&t.getElementById(e).remove()};var a,o=[];t.useStrictCSP=function(e){a=e,e==0?s():o||=[]};function s(){var e=o;o=null,e&&e.forEach(function(e){c(e[0],e[1])})}function c(e,n,r){if(!(typeof document>\`u\`)){if(o){if(r)s();else if(r===!1)return o.push([e,n])}if(!a){var i=r;!r||!r.getRootNode?i=document:(i=r.getRootNode(),(!i||i==r)&&(i=document));var c=i.ownerDocument||i;if(n&&t.hasCssString(n,i))return null;n&&(e+=\`
|
|
29
|
+
\`+e.stack}}var Se=Object.prototype.hasOwnProperty,Ce=t.unstable_scheduleCallback,we=t.unstable_cancelCallback,Te=t.unstable_shouldYield,Ee=t.unstable_requestPaint,De=t.unstable_now,Oe=t.unstable_getCurrentPriorityLevel,ke=t.unstable_ImmediatePriority,Ae=t.unstable_UserBlockingPriority,je=t.unstable_NormalPriority,Me=t.unstable_LowPriority,Ne=t.unstable_IdlePriority,Pe=t.log,Fe=t.unstable_setDisableYieldValue,Ie=null,Le=null;function L(e){if(typeof Pe==\`function\`&&Fe(e),Le&&typeof Le.setStrictMode==\`function\`)try{Le.setStrictMode(Ie,e)}catch{}}var Re=Math.clz32?Math.clz32:Ve,ze=Math.log,Be=Math.LN2;function Ve(e){return e>>>=0,e===0?32:31-(ze(e)/Be|0)|0}var He=256,Ue=262144,We=4194304;function Ge(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&261888;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 Ke(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=Ge(n))):i=Ge(o):i=Ge(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ge(n))):i=Ge(o)):i=Ge(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 qe(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Je(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 Ye(){var e=We;return We<<=1,!(We&62914560)&&(We=4194304),e}function Xe(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ze(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Qe(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-Re(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&&$e(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function $e(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Re(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function et(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Re(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function tt(e,t){var n=t&-t;return n=n&42?1:nt(n),(n&(e.suspendedLanes|t))===0?n:0}function nt(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 rt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function it(){var e=F.p;return e===0?(e=window.event,e===void 0?32:_p(e.type)):e}function at(e,t){var n=F.p;try{return F.p=e,t()}finally{F.p=n}}var ot=Math.random().toString(36).slice(2),st=\`__reactFiber$\`+ot,ct=\`__reactProps$\`+ot,lt=\`__reactContainer$\`+ot,ut=\`__reactEvents$\`+ot,dt=\`__reactListeners$\`+ot,ft=\`__reactHandles$\`+ot,pt=\`__reactResources$\`+ot,mt=\`__reactMarker$\`+ot;function ht(e){delete e[st],delete e[ct],delete e[ut],delete e[dt],delete e[ft]}function gt(e){var t=e[st];if(t)return t;for(var n=e.parentNode;n;){if(t=n[lt]||n[st]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=mf(e);e!==null;){if(n=e[st])return n;e=mf(e)}return t}e=n,n=e.parentNode}return null}function _t(e){if(e=e[st]||e[lt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function vt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function yt(e){var t=e[pt];return t||=e[pt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function bt(e){e[mt]=!0}var xt=new Set,St={};function Ct(e,t){wt(e,t),wt(e+\`Capture\`,t)}function wt(e,t){for(St[e]=t,e=0;e<t.length;e++)xt.add(t[e])}var Tt=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]*$\`),Et={},Dt={};function Ot(e){return Se.call(Dt,e)?!0:Se.call(Et,e)?!1:Tt.test(e)?Dt[e]=!0:(Et[e]=!0,!1)}function kt(e,t,n){if(Ot(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 At(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 jt(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 Mt(e){switch(typeof e){case\`bigint\`:case\`boolean\`:case\`number\`:case\`string\`:case\`undefined\`:return e;case\`object\`:return e;default:return\`\`}}function Nt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===\`input\`&&(t===\`checkbox\`||t===\`radio\`)}function Pt(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 Ft(e){if(!e._valueTracker){var t=Nt(e)?\`checked\`:\`value\`;e._valueTracker=Pt(e,t,\`\`+e[t])}}function It(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=\`\`;return e&&(r=Nt(e)?e.checked?\`true\`:\`false\`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Lt(e){if(e||=typeof document<\`u\`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Rt=/[\\n"\\\\]/g;function zt(e){return e.replace(Rt,function(e){return\`\\\\\`+e.charCodeAt(0).toString(16)+\` \`})}function Bt(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=\`\`+Mt(t)):e.value!==\`\`+Mt(t)&&(e.value=\`\`+Mt(t)),t==null?n==null?r!=null&&e.removeAttribute(\`value\`):Ht(e,o,Mt(n)):Ht(e,o,Mt(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=\`\`+Mt(s):e.removeAttribute(\`name\`)}function Vt(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)){Ft(e);return}n=n==null?\`\`:\`\`+Mt(n),t=t==null?n:\`\`+Mt(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),Ft(e)}function Ht(e,t,n){t===\`number\`&&Lt(e.ownerDocument)===e||e.defaultValue===\`\`+n||(e.defaultValue=\`\`+n)}function Ut(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=\`\`+Mt(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 Wt(e,t,n){if(t!=null&&(t=\`\`+Mt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?\`\`:\`\`+Mt(n)}function Gt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(te(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=\`\`,t=n}n=Mt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==\`\`&&r!==null&&(e.value=r),Ft(e)}function Kt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var qt=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 Jt(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||qt.has(t)?t===\`float\`?e.cssFloat=n:e[t]=(\`\`+n).trim():e[t]=n+\`px\`}function R(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]=\`\`);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Jt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Jt(e,o,t[o])}function Yt(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 Xt=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\`],[\`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\`]]),Zt=/^[\\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 Qt(e){return Zt.test(\`\`+e)?\`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')\`:e}function z(){}var B=null;function V(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var $t=null,en=null;function tn(e){var t=_t(e);if(t&&(e=t.stateNode)){var n=e[ct]||null;a:switch(e=t.stateNode,t.type){case\`input\`:if(Bt(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="\`+zt(\`\`+t)+\`"][type="radio"]\`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[ct]||null;if(!a)throw Error(i(90));Bt(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&&It(r)}break a;case\`textarea\`:Wt(e,n.value,n.defaultValue);break a;case\`select\`:t=n.value,t!=null&&Ut(e,!!n.multiple,t,!1)}}}var nn=!1;function rn(e,t,n){if(nn)return e(t,n);nn=!0;try{return e(t)}finally{if(nn=!1,($t!==null||en!==null)&&(Su(),$t&&(t=$t,e=en,en=$t=null,tn(t),e)))for(t=0;t<e.length;t++)tn(e[t])}}function an(e,t){var n=e.stateNode;if(n===null)return null;var r=n[ct]||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 on=!(typeof window>\`u\`||window.document===void 0||window.document.createElement===void 0),sn=!1;if(on)try{var cn={};Object.defineProperty(cn,"passive",{get:function(){sn=!0}}),window.addEventListener(\`test\`,cn,cn),window.removeEventListener(\`test\`,cn,cn)}catch{sn=!1}var ln=null,un=null,dn=null;function fn(){if(dn)return dn;var e,t=un,n=t.length,r,i=\`value\`in ln?ln.value:ln.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 dn=i.slice(e,1<r?1-r:void 0)}function pn(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 mn(){return!0}function hn(){return!1}function gn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?mn:hn,this.isPropagationStopped=hn,this}return h(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=mn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=\`unknown\`&&(e.cancelBubble=!0),this.isPropagationStopped=mn)},persist:function(){},isPersistent:mn}),t}var _n={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},vn=gn(_n),yn=h({},_n,{view:0,detail:0}),bn=gn(yn),xn,Sn,Cn,wn=h({},yn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Fn,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!==Cn&&(Cn&&e.type===\`mousemove\`?(xn=e.screenX-Cn.screenX,Sn=e.screenY-Cn.screenY):Sn=xn=0,Cn=e),xn)},movementY:function(e){return\`movementY\`in e?e.movementY:Sn}}),Tn=gn(wn),En=gn(h({},wn,{dataTransfer:0})),Dn=gn(h({},yn,{relatedTarget:0})),On=gn(h({},_n,{animationName:0,elapsedTime:0,pseudoElement:0})),kn=gn(h({},_n,{clipboardData:function(e){return\`clipboardData\`in e?e.clipboardData:window.clipboardData}})),An=gn(h({},_n,{data:0})),jn={Esc:\`Escape\`,Spacebar:\` \`,Left:\`ArrowLeft\`,Up:\`ArrowUp\`,Right:\`ArrowRight\`,Down:\`ArrowDown\`,Del:\`Delete\`,Win:\`OS\`,Menu:\`ContextMenu\`,Apps:\`ContextMenu\`,Scroll:\`ScrollLock\`,MozPrintableKey:\`Unidentified\`},Mn={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\`},Nn={Alt:\`altKey\`,Control:\`ctrlKey\`,Meta:\`metaKey\`,Shift:\`shiftKey\`};function Pn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Nn[e])?!!t[e]:!1}function Fn(){return Pn}var In=gn(h({},yn,{key:function(e){if(e.key){var t=jn[e.key]||e.key;if(t!==\`Unidentified\`)return t}return e.type===\`keypress\`?(e=pn(e),e===13?\`Enter\`:String.fromCharCode(e)):e.type===\`keydown\`||e.type===\`keyup\`?Mn[e.keyCode]||\`Unidentified\`:\`\`},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Fn,charCode:function(e){return e.type===\`keypress\`?pn(e):0},keyCode:function(e){return e.type===\`keydown\`||e.type===\`keyup\`?e.keyCode:0},which:function(e){return e.type===\`keypress\`?pn(e):e.type===\`keydown\`||e.type===\`keyup\`?e.keyCode:0}})),Ln=gn(h({},wn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Rn=gn(h({},yn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Fn})),zn=gn(h({},_n,{propertyName:0,elapsedTime:0,pseudoElement:0})),Bn=gn(h({},wn,{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})),Vn=gn(h({},_n,{newState:0,oldState:0})),Hn=[9,13,27,32],Un=on&&\`CompositionEvent\`in window,Wn=null;on&&\`documentMode\`in document&&(Wn=document.documentMode);var Gn=on&&\`TextEvent\`in window&&!Wn,Kn=on&&(!Un||Wn&&8<Wn&&11>=Wn),qn=\` \`,Jn=!1;function Yn(e,t){switch(e){case\`keyup\`:return Hn.indexOf(t.keyCode)!==-1;case\`keydown\`:return t.keyCode!==229;case\`keypress\`:case\`mousedown\`:case\`focusout\`:return!0;default:return!1}}function Xn(e){return e=e.detail,typeof e==\`object\`&&\`data\`in e?e.data:null}var H=!1;function Zn(e,t){switch(e){case\`compositionend\`:return Xn(t);case\`keypress\`:return t.which===32?(Jn=!0,qn):null;case\`textInput\`:return e=t.data,e===qn&&Jn?null:e;default:return null}}function Qn(e,t){if(H)return e===\`compositionend\`||!Un&&Yn(e,t)?(e=fn(),dn=un=ln=null,H=!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 Kn&&t.locale!==\`ko\`?null:t.data;default:return null}}var $n={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\`?!!$n[e.type]:t===\`textarea\`}function tr(e,t,n,r){$t?en?en.push(r):en=[r]:$t=r,t=Ad(t,\`onChange\`),0<t.length&&(n=new vn(\`onChange\`,\`change\`,null,n,r),e.push({event:n,listeners:t}))}var nr=null,rr=null;function ir(e){Sd(e,0)}function U(e){if(It(vt(e)))return e}function ar(e,t){if(e===\`change\`)return t}var or=!1;if(on){var sr;if(on){var cr=\`oninput\`in document;if(!cr){var lr=document.createElement(\`div\`);lr.setAttribute(\`oninput\`,\`return;\`),cr=typeof lr.oninput==\`function\`}sr=cr}else sr=!1;or=sr&&(!document.documentMode||9<document.documentMode)}function ur(){nr&&(nr.detachEvent(\`onpropertychange\`,dr),rr=nr=null)}function dr(e){if(e.propertyName===\`value\`&&U(rr)){var t=[];tr(t,rr,e,V(e)),rn(ir,t)}}function fr(e,t,n){e===\`focusin\`?(ur(),nr=t,rr=n,nr.attachEvent(\`onpropertychange\`,dr)):e===\`focusout\`&&ur()}function pr(e){if(e===\`selectionchange\`||e===\`keyup\`||e===\`keydown\`)return U(rr)}function mr(e,t){if(e===\`click\`)return U(t)}function hr(e,t){if(e===\`input\`||e===\`change\`)return U(t)}function gr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var _r=typeof Object.is==\`function\`?Object.is:gr;function vr(e,t){if(_r(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(!Se.call(t,i)||!_r(e[i],t[i]))return!1}return!0}function yr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function br(e,t){var n=yr(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=yr(n)}}function xr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?xr(e,t.parentNode):\`contains\`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Sr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Lt(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=Lt(e.document)}return t}function Cr(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 wr=on&&\`documentMode\`in document&&11>=document.documentMode,Tr=null,Er=null,Dr=null,Or=!1;function kr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Or||Tr==null||Tr!==Lt(r)||(r=Tr,\`selectionStart\`in r&&Cr(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}),Dr&&vr(Dr,r)||(Dr=r,r=Ad(Er,\`onSelect\`),0<r.length&&(t=new vn(\`onSelect\`,\`select\`,null,t,n),e.push({event:t,listeners:r}),t.target=Tr)))}function Ar(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[\`Webkit\`+e]=\`webkit\`+t,n[\`Moz\`+e]=\`moz\`+t,n}var jr={animationend:Ar(\`Animation\`,\`AnimationEnd\`),animationiteration:Ar(\`Animation\`,\`AnimationIteration\`),animationstart:Ar(\`Animation\`,\`AnimationStart\`),transitionrun:Ar(\`Transition\`,\`TransitionRun\`),transitionstart:Ar(\`Transition\`,\`TransitionStart\`),transitioncancel:Ar(\`Transition\`,\`TransitionCancel\`),transitionend:Ar(\`Transition\`,\`TransitionEnd\`)},Mr={},Nr={};on&&(Nr=document.createElement(\`div\`).style,\`AnimationEvent\`in window||(delete jr.animationend.animation,delete jr.animationiteration.animation,delete jr.animationstart.animation),\`TransitionEvent\`in window||delete jr.transitionend.transition);function W(e){if(Mr[e])return Mr[e];if(!jr[e])return e;var t=jr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Nr)return Mr[e]=t[n];return e}var Pr=W(\`animationend\`),Fr=W(\`animationiteration\`),Ir=W(\`animationstart\`),Lr=W(\`transitionrun\`),Rr=W(\`transitionstart\`),zr=W(\`transitioncancel\`),Br=W(\`transitionend\`),Vr=new Map,Hr=\`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel\`.split(\` \`);Hr.push(\`scrollEnd\`);function Ur(e,t){Vr.set(e,t),Ct(t,[e])}var Wr=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)},Gr=[],Kr=0,qr=0;function Jr(){for(var e=Kr,t=qr=Kr=0;t<e;){var n=Gr[t];Gr[t++]=null;var r=Gr[t];Gr[t++]=null;var i=Gr[t];Gr[t++]=null;var a=Gr[t];if(Gr[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&&Qr(n,i,a)}}function Yr(e,t,n,r){Gr[Kr++]=e,Gr[Kr++]=t,Gr[Kr++]=n,Gr[Kr++]=r,qr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Xr(e,t,n,r){return Yr(e,t,n,r),$r(e)}function Zr(e,t){return Yr(e,null,null,t),$r(e)}function Qr(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-Re(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function $r(e){if(50<pu)throw pu=0,mu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ei={};function ti(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 ni(e,t,n,r){return new ti(e,t,n,r)}function ri(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ii(e,t){var n=e.alternate;return n===null?(n=ni(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&65011712,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 ai(e,t){e.flags&=65011714;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 oi(e,t,n,r,a,o){var s=0;if(r=e,typeof e==\`function\`)ri(e)&&(s=1);else if(typeof e==\`string\`)s=Kf(e,n,se.current)?26:e===\`html\`||e===\`head\`||e===\`body\`?27:5;else a:switch(e){case k:return e=ni(31,n,t,a),e.elementType=k,e.lanes=o,e;case y:return si(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=ni(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=ni(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=ni(19,n,t,a),e.elementType=E,e.lanes=o,e;default:if(typeof e==\`object\`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case D:s=14;break a;case O:s=16,r=null;break a}s=29,n=Error(i(130,e===null?\`null\`:typeof e,\`\`)),r=null}return t=ni(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function si(e,t,n,r){return e=ni(7,e,r,t),e.lanes=n,e}function ci(e,t,n){return e=ni(6,e,null,t),e.lanes=n,e}function li(e){var t=ni(18,null,null,0);return t.stateNode=e,t}function ui(e,t,n){return t=ni(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var di=new WeakMap;function fi(e,t){if(typeof e==\`object\`&&e){var n=di.get(e);return n===void 0?(t={value:e,source:t,stack:xe(t)},di.set(e,t),t):n}return{value:e,source:t,stack:xe(t)}}var pi=[],mi=0,hi=null,gi=0,_i=[],vi=0,yi=null,bi=1,xi=\`\`;function Si(e,t){pi[mi++]=gi,pi[mi++]=hi,hi=e,gi=t}function Ci(e,t,n){_i[vi++]=bi,_i[vi++]=xi,_i[vi++]=yi,yi=e;var r=bi;e=xi;var i=32-Re(r)-1;r&=~(1<<i),n+=1;var a=32-Re(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,bi=1<<32-Re(t)+i|n<<i|r,xi=a+e}else bi=1<<a|n<<i|r,xi=e}function wi(e){e.return!==null&&(Si(e,1),Ci(e,1,0))}function Ti(e){for(;e===hi;)hi=pi[--mi],pi[mi]=null,gi=pi[--mi],pi[mi]=null;for(;e===yi;)yi=_i[--vi],_i[vi]=null,xi=_i[--vi],_i[vi]=null,bi=_i[--vi],_i[vi]=null}function Ei(e,t){_i[vi++]=bi,_i[vi++]=xi,_i[vi++]=yi,bi=t.id,xi=t.overflow,yi=e}var Di=null,Oi=null,G=!1,ki=null,Ai=!1,ji=Error(i(519));function Mi(e){throw Ri(fi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?\`text\`:\`HTML\`,\`\`)),e)),ji}function Ni(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[st]=e,t[ct]=r,n){case\`dialog\`:Cd(\`cancel\`,t),Cd(\`close\`,t);break;case\`iframe\`:case\`object\`:case\`embed\`:Cd(\`load\`,t);break;case\`video\`:case\`audio\`:for(n=0;n<bd.length;n++)Cd(bd[n],t);break;case\`source\`:Cd(\`error\`,t);break;case\`img\`:case\`image\`:case\`link\`:Cd(\`error\`,t),Cd(\`load\`,t);break;case\`details\`:Cd(\`toggle\`,t);break;case\`input\`:Cd(\`invalid\`,t),Vt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case\`select\`:Cd(\`invalid\`,t);break;case\`textarea\`:Cd(\`invalid\`,t),Gt(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||Id(t.textContent,n)?(r.popover!=null&&(Cd(\`beforetoggle\`,t),Cd(\`toggle\`,t)),r.onScroll!=null&&Cd(\`scroll\`,t),r.onScrollEnd!=null&&Cd(\`scrollend\`,t),r.onClick!=null&&(t.onclick=z),t=!0):t=!1,t||Mi(e,!0)}function Pi(e){for(Di=e.return;Di;)switch(Di.tag){case 5:case 31:case 13:Ai=!1;return;case 27:case 3:Ai=!0;return;default:Di=Di.return}}function Fi(e){if(e!==Di)return!1;if(!G)return Pi(e),G=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==\`form\`&&n!==\`button\`)||Jd(e.type,e.memoizedProps)),n=!n),n&&Oi&&Mi(e),Pi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Oi=pf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Oi=pf(e)}else t===27?(t=Oi,nf(e.type)?(e=ff,ff=null,Oi=e):Oi=t):Oi=Di?df(e.stateNode.nextSibling):null;return!0}function Ii(){Oi=Di=null,G=!1}function Li(){var e=ki;return e!==null&&($l===null?$l=e:$l.push.apply($l,e),ki=null),e}function Ri(e){ki===null?ki=[e]:ki.push(e)}var zi=ae(null),Bi=null,Vi=null;function Hi(e,t,n){I(zi,t._currentValue),t._currentValue=n}function Ui(e){e._currentValue=zi.current,oe(zi)}function Wi(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 Gi(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),Wi(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),Wi(s,n,e),s=null}else 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 Ki(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;_r(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===ue.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[tp]:e.push(tp))}a=a.return}e!==null&&Gi(t,e,n,r),t.flags|=262144}function qi(e){for(e=e.firstContext;e!==null;){if(!_r(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ji(e){Bi=e,Vi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Yi(e){return Zi(Bi,e)}function Xi(e,t){return Bi===null&&Ji(e),Zi(e,t)}function Zi(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Vi===null){if(e===null)throw Error(i(308));Vi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Vi=Vi.next=t;return n}var Qi=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()})}},$i=t.unstable_scheduleCallback,ea=t.unstable_NormalPriority,ta={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function na(){return{controller:new Qi,data:new Map,refCount:0}}function ra(e){e.refCount--,e.refCount===0&&$i(ea,function(){e.controller.abort()})}var ia=null,aa=0,oa=0,sa=null;function ca(e,t){if(ia===null){var n=ia=[];aa=0,oa=md(),sa={status:\`pending\`,value:void 0,then:function(e){n.push(e)}}}return aa++,t.then(la,la),t}function la(){if(--aa===0&&ia!==null){sa!==null&&(sa.status=\`fulfilled\`);var e=ia;ia=null,oa=0,sa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ua(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 da=P.S;P.S=function(e,t){nu=De(),typeof t==\`object\`&&t&&typeof t.then==\`function\`&&ca(e,t),da!==null&&da(e,t)};var fa=ae(null);function pa(){var e=fa.current;return e===null?Rl.pooledCache:e}function ma(e,t){t===null?I(fa,fa.current):I(fa,t.pool)}function ha(){var e=pa();return e===null?null:{parent:ta._currentValue,pool:e}}var ga=Error(i(460)),_a=Error(i(474)),va=Error(i(542)),ya={then:function(){}};function ba(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(z,z),t=n),t.status){case\`fulfilled\`:return t.value;case\`rejected\`:throw e=t.reason,Ta(e),e;default:if(typeof t.status==\`string\`)t.then(z,z);else{if(e=Rl,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,Ta(e),e}throw Ca=t,ga}}function Sa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==\`object\`&&e&&typeof e.then==\`function\`?(Ca=e,ga):e}}var Ca=null;function wa(){if(Ca===null)throw Error(i(459));var e=Ca;return Ca=null,e}function Ta(e){if(e===ga||e===va)throw Error(i(483))}var Ea=null,Da=0;function Oa(e){var t=Da;return Da+=1,Ea===null&&(Ea=[]),xa(Ea,e,t)}function ka(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Aa(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===\`[object Object]\`?\`object with keys {\`+Object.keys(t).join(\`, \`)+\`}\`:e)))}function ja(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=ii(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|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=ci(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===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==\`object\`&&i&&i.$$typeof===O&&Sa(i)===t.type)?(t=a(t,n.props),ka(t,n),t.return=e,t):(t=oi(n.type,n.key,n.props,null,e.mode,r),ka(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=ui(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=si(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=ci(\`\`+t,e.mode,n),t.return=e,t;if(typeof t==\`object\`&&t){switch(t.$$typeof){case _:return n=oi(t.type,t.key,t.props,null,e.mode,n),ka(n,t),n.return=e,n;case v:return t=ui(t,e.mode,n),t.return=e,t;case O:return t=Sa(t),f(e,t,n)}if(te(t)||M(t))return t=si(t,e.mode,n,null),t.return=e,t;if(typeof t.then==\`function\`)return f(e,Oa(t),n);if(t.$$typeof===C)return f(e,Xi(e,t),n);Aa(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 _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case O:return n=Sa(n),p(e,t,n,r)}if(te(n)||M(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==\`function\`)return p(e,t,Oa(n),r);if(n.$$typeof===C)return p(e,t,Xi(e,n),r);Aa(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 _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case O:return r=Sa(r),m(e,t,n,r,i)}if(te(r)||M(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==\`function\`)return m(e,t,n,Oa(r),i);if(r.$$typeof===C)return m(e,t,n,Xi(t,r),i);Aa(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),G&&Si(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 G&&Si(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(g.key===null?h:g.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)}),G&&Si(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),G&&Si(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 G&&Si(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(v.key===null?g:v.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)}),G&&Si(a,g),u}function b(e,r,o,c){if(typeof o==\`object\`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==\`object\`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==\`object\`&&l&&l.$$typeof===O&&Sa(l)===r.type){n(e,r.sibling),c=a(r,o.props),ka(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=si(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=oi(o.type,o.key,o.props,null,e.mode,c),ka(c,o),c.return=e,e=c)}return s(e);case v: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}else{n(e,r);break}else t(e,r);r=r.sibling}c=ui(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=Sa(o),b(e,r,o,c)}if(te(o))return h(e,r,o,c);if(M(o)){if(l=M(o),typeof l!=\`function\`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==\`function\`)return b(e,r,Oa(o),c);if(o.$$typeof===C)return b(e,r,Xi(e,o),c);Aa(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=ci(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Da=0;var i=b(e,t,n,r);return Ea=null,i}catch(t){if(t===ga||t===va)throw t;var a=ni(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ma=ja(!0),Na=ja(!1),Pa=!1;function Fa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ia(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 La(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ra(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ll&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=$r(e),Qr(e,null,n),t}return Yr(e,r,t,n),$r(e)}function za(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,et(e,n)}}function Ba(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;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Va=!1;function Ha(){if(Va){var e=sa;if(e!==null)throw e}}function Ua(e,t,n,r){Va=!1;var i=e.updateQueue;Pa=!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?(J&f)===f:(r&f)===f){f!==0&&f===oa&&(Va=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(m=g.payload,typeof m==\`function\`){d=m.call(_,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m==\`function\`?m.call(_,d,f):m,f==null)break a;d=h({},d,f);break a;case 2:Pa=!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),ql|=o,e.lanes=o,e.memoizedState=d}}function Wa(e,t){if(typeof e!=\`function\`)throw Error(i(191,e));e.call(t)}function Ga(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Wa(n[e],t)}var Ka=ae(null),qa=ae(0);function Ja(e,t){e=Gl,I(qa,e),I(Ka,t),Gl=e|t.baseLanes}function Ya(){I(qa,Gl),I(Ka,Ka.current)}function Xa(){Gl=qa.current,oe(Ka),oe(qa)}var Za=ae(null),Qa=null;function $a(e){var t=e.alternate;I(io,io.current&1),I(Za,e),Qa===null&&(t===null||Ka.current!==null||t.memoizedState!==null)&&(Qa=e)}function eo(e){I(io,io.current),I(Za,e),Qa===null&&(Qa=e)}function to(e){e.tag===22?(I(io,io.current),I(Za,e),Qa===null&&(Qa=e)):no(e)}function no(){I(io,io.current),I(Za,Za.current)}function ro(e){oe(Za),Qa===e&&(Qa=null),oe(io)}var io=ae(0);function ao(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Y(n)||uf(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===\`forwards\`||t.memoizedProps.revealOrder===\`backwards\`||t.memoizedProps.revealOrder===\`unstable_legacy-backwards\`||t.memoizedProps.revealOrder===\`together\`)){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 oo=0,K=null,so=null,co=null,lo=!1,uo=!1,fo=!1,po=0,mo=0,ho=null,go=0;function q(){throw Error(i(321))}function _o(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!_r(e[n],t[n]))return!1;return!0}function vo(e,t,n,r,i,a){return oo=a,K=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,P.H=e===null||e.memoizedState===null?Fs:Is,fo=!1,a=n(r,i),fo=!1,uo&&(a=bo(t,n,r,i)),yo(e),a}function yo(e){P.H=Ps;var t=so!==null&&so.next!==null;if(oo=0,co=so=K=null,lo=!1,mo=0,ho=null,t)throw Error(i(300));e===null||$s||(e=e.dependencies,e!==null&&qi(e)&&($s=!0))}function bo(e,t,n,r){K=e;var a=0;do{if(uo&&(ho=null),mo=0,uo=!1,25<=a)throw Error(i(301));if(a+=1,co=so=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}P.H=Ls,o=t(n,r)}while(uo);return o}function xo(){var e=P.H,t=e.useState()[0];return t=typeof t.then==\`function\`?Oo(t):t,e=e.useState()[0],(so===null?null:so.memoizedState)!==e&&(K.flags|=1024),t}function So(){var e=po!==0;return po=0,e}function Co(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function wo(e){if(lo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}lo=!1}oo=0,co=so=K=null,uo=!1,mo=po=0,ho=null}function To(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return co===null?K.memoizedState=co=e:co=co.next=e,co}function Eo(){if(so===null){var e=K.alternate;e=e===null?null:e.memoizedState}else e=so.next;var t=co===null?K.memoizedState:co.next;if(t!==null)co=t,so=e;else{if(e===null)throw K.alternate===null?Error(i(467)):Error(i(310));so=e,e={memoizedState:so.memoizedState,baseState:so.baseState,baseQueue:so.baseQueue,queue:so.queue,next:null},co===null?K.memoizedState=co=e:co=co.next=e}return co}function Do(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Oo(e){var t=mo;return mo+=1,ho===null&&(ho=[]),e=xa(ho,e,t),t=K,(co===null?t.memoizedState:co.next)===null&&(t=t.alternate,P.H=t===null||t.memoizedState===null?Fs:Is),e}function ko(e){if(typeof e==\`object\`&&e){if(typeof e.then==\`function\`)return Oo(e);if(e.$$typeof===C)return Yi(e)}throw Error(i(438,String(e)))}function Ao(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=Do(),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]=A;return t.index++,n}function jo(e,t){return typeof t==\`function\`?t(e):t}function Mo(e){return No(Eo(),so,e)}function No(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?(oo&f)===f:(J&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===oa&&(d=!0);else if((oo&p)===p){u=u.next,p===oa&&(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,ql|=p;f=u.action,fo&&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,ql|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!_r(o,e.memoizedState)&&($s=!0,d&&(n=sa,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 Po(e){var t=Eo(),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);_r(o,t.memoizedState)||($s=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Fo(e,t,n){var r=K,a=Eo(),o=G;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!_r((so||a).memoizedState,n);if(s&&(a.memoizedState=n,$s=!0),a=a.queue,os(Ro.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||co!==null&&co.memoizedState.tag&1){if(r.flags|=2048,ts(9,{destroy:void 0},Lo.bind(null,r,a,n,t),null),Rl===null)throw Error(i(349));o||oo&127||Io(r,t,n)}return n}function Io(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=K.updateQueue,t===null?(t=Do(),K.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Lo(e,t,n,r){t.value=n,t.getSnapshot=r,zo(t)&&Bo(e)}function Ro(e,t,n){return n(function(){zo(t)&&Bo(e)})}function zo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!_r(e,n)}catch{return!0}}function Bo(e){var t=Zr(e,2);t!==null&&_u(t,e,2)}function Vo(e){var t=To();if(typeof e==\`function\`){var n=e;if(e=n(),fo){L(!0);try{n()}finally{L(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:jo,lastRenderedState:e},t}function Ho(e,t,n,r){return e.baseState=n,No(e,so,typeof r==\`function\`?r:jo)}function Uo(e,t,n,r,a){if(js(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)}};P.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Wo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Wo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=P.T,o={};P.T=o;try{var s=n(i,r),c=P.S;c!==null&&c(o,s),Go(e,t,s)}catch(n){qo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),P.T=a}}else try{a=n(i,r),Go(e,t,a)}catch(n){qo(e,t,n)}}function Go(e,t,n){typeof n==\`object\`&&n&&typeof n.then==\`function\`?n.then(function(n){Ko(e,t,n)},function(n){return qo(e,t,n)}):Ko(e,t,n)}function Ko(e,t,n){t.status=\`fulfilled\`,t.value=n,Jo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Wo(e,n)))}function qo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=\`rejected\`,t.reason=n,Jo(t),t=t.next;while(t!==r)}e.action=null}function Jo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Yo(e,t){return t}function Xo(e,t){if(G){var n=Rl.formState;if(n!==null){a:{var r=K;if(G){if(Oi){b:{for(var i=Oi,a=Ai;i.nodeType!==8;){if(!a){i=null;break b}if(i=df(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===\`F!\`||a===\`F\`?i:null}if(i){Oi=df(i.nextSibling),r=i.data===\`F!\`;break a}}Mi(r)}r=!1}r&&(t=n[0])}}return n=To(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yo,lastRenderedState:t},n.queue=r,n=Os.bind(null,K,r),r.dispatch=n,r=Vo(!1),a=As.bind(null,K,!1,r.queue),r=To(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Uo.bind(null,K,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Zo(e){return Qo(Eo(),so,e)}function Qo(e,t,n){if(t=No(e,t,Yo)[0],e=Mo(jo)[0],typeof t==\`object\`&&t&&typeof t.then==\`function\`)try{var r=Oo(t)}catch(e){throw e===ga?va:e}else r=t;t=Eo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(K.flags|=2048,ts(9,{destroy:void 0},$o.bind(null,i,n),null)),[r,a,e]}function $o(e,t){e.action=t}function es(e){var t=Eo(),n=so;if(n!==null)return Qo(t,n,e);Eo(),t=t.memoizedState,n=Eo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ts(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=K.updateQueue,t===null&&(t=Do(),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 ns(){return Eo().memoizedState}function rs(e,t,n,r){var i=To();K.flags|=e,i.memoizedState=ts(1|t,{destroy:void 0},n,r===void 0?null:r)}function is(e,t,n,r){var i=Eo();r=r===void 0?null:r;var a=i.memoizedState.inst;so!==null&&r!==null&&_o(r,so.memoizedState.deps)?i.memoizedState=ts(t,a,n,r):(K.flags|=e,i.memoizedState=ts(1|t,a,n,r))}function as(e,t){rs(8390656,8,e,t)}function os(e,t){is(2048,8,e,t)}function ss(e){K.flags|=4;var t=K.updateQueue;if(t===null)t=Do(),K.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function cs(e){var t=Eo().memoizedState;return ss({ref:t,nextImpl:e}),function(){if(Ll&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function ls(e,t){return is(4,2,e,t)}function us(e,t){return is(4,4,e,t)}function ds(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 fs(e,t,n){n=n==null?null:n.concat([e]),is(4,4,ds.bind(null,t,e),n)}function ps(){}function ms(e,t){var n=Eo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&_o(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function hs(e,t){var n=Eo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&_o(t,r[1]))return r[0];if(r=e(),fo){L(!0);try{e()}finally{L(!1)}}return n.memoizedState=[r,t],r}function gs(e,t,n){return n===void 0||oo&1073741824&&!(J&261930)?e.memoizedState=t:(e.memoizedState=n,e=gu(),K.lanes|=e,ql|=e,n)}function _s(e,t,n,r){return _r(n,t)?n:Ka.current===null?!(oo&42)||oo&1073741824&&!(J&261930)?($s=!0,e.memoizedState=n):(e=gu(),K.lanes|=e,ql|=e,t):(e=gs(e,n,r),_r(e,t)||($s=!0),e)}function vs(e,t,n,r,i){var a=F.p;F.p=a!==0&&8>a?a:8;var o=P.T,s={};P.T=s,As(e,!1,t,n);try{var c=i(),l=P.S;l!==null&&l(s,c),typeof c==\`object\`&&c&&typeof c.then==\`function\`?ks(e,t,ua(c,r),hu(e)):ks(e,t,r,hu(e))}catch(n){ks(e,t,{then:function(){},status:\`rejected\`,reason:n},hu())}finally{F.p=a,o!==null&&s.types!==null&&(o.types=s.types),P.T=o}}function ys(){}function bs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=xs(e).queue;vs(e,a,t,ne,n===null?ys:function(){return Ss(e),n(r)})}function xs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:jo,lastRenderedState:ne},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:jo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ss(e){var t=xs(e);t.next===null&&(t=e.alternate.memoizedState),ks(e,t.next.queue,{},hu())}function Cs(){return Yi(tp)}function ws(){return Eo().memoizedState}function Ts(){return Eo().memoizedState}function Es(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=hu();e=La(n);var r=Ra(t,e,n);r!==null&&(_u(r,t,n),za(r,t,n)),t={cache:na()},e.payload=t;return}t=t.return}}function Ds(e,t,n){var r=hu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},js(e)?Ms(t,n):(n=Xr(e,t,n,r),n!==null&&(_u(n,e,r),Ns(n,t,r)))}function Os(e,t,n){ks(e,t,n,hu())}function ks(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(js(e))Ms(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,_r(s,o))return Yr(e,t,i,0),Rl===null&&Jr(),!1}catch{}if(n=Xr(e,t,i,r),n!==null)return _u(n,e,r),Ns(n,t,r),!0}return!1}function As(e,t,n,r){if(r={lane:2,revertLane:md(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},js(e)){if(t)throw Error(i(479))}else t=Xr(e,n,r,2),t!==null&&_u(t,e,2)}function js(e){var t=e.alternate;return e===K||t!==null&&t===K}function Ms(e,t){uo=lo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ns(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,et(e,n)}}var Ps={readContext:Yi,use:ko,useCallback:q,useContext:q,useEffect:q,useImperativeHandle:q,useLayoutEffect:q,useInsertionEffect:q,useMemo:q,useReducer:q,useRef:q,useState:q,useDebugValue:q,useDeferredValue:q,useTransition:q,useSyncExternalStore:q,useId:q,useHostTransitionStatus:q,useFormState:q,useActionState:q,useOptimistic:q,useMemoCache:q,useCacheRefresh:q};Ps.useEffectEvent=q;var Fs={readContext:Yi,use:ko,useCallback:function(e,t){return To().memoizedState=[e,t===void 0?null:t],e},useContext:Yi,useEffect:as,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),rs(4194308,4,ds.bind(null,t,e),n)},useLayoutEffect:function(e,t){return rs(4194308,4,e,t)},useInsertionEffect:function(e,t){rs(4,2,e,t)},useMemo:function(e,t){var n=To();t=t===void 0?null:t;var r=e();if(fo){L(!0);try{e()}finally{L(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=To();if(n!==void 0){var i=n(t);if(fo){L(!0);try{n(t)}finally{L(!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=Ds.bind(null,K,e),[r.memoizedState,e]},useRef:function(e){var t=To();return e={current:e},t.memoizedState=e},useState:function(e){e=Vo(e);var t=e.queue,n=Os.bind(null,K,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ps,useDeferredValue:function(e,t){return gs(To(),e,t)},useTransition:function(){var e=Vo(!1);return e=vs.bind(null,K,e.queue,!0,!1),To().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=K,a=To();if(G){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Rl===null)throw Error(i(349));J&127||Io(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,as(Ro.bind(null,r,o,e),[e]),r.flags|=2048,ts(9,{destroy:void 0},Lo.bind(null,r,o,n,t),null),n},useId:function(){var e=To(),t=Rl.identifierPrefix;if(G){var n=xi,r=bi;n=(r&~(1<<32-Re(r)-1)).toString(32)+n,t=\`_\`+t+\`R_\`+n,n=po++,0<n&&(t+=\`H\`+n.toString(32)),t+=\`_\`}else n=go++,t=\`_\`+t+\`r_\`+n.toString(32)+\`_\`;return e.memoizedState=t},useHostTransitionStatus:Cs,useFormState:Xo,useActionState:Xo,useOptimistic:function(e){var t=To();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=As.bind(null,K,!0,n),n.dispatch=t,[e,t]},useMemoCache:Ao,useCacheRefresh:function(){return To().memoizedState=Es.bind(null,K)},useEffectEvent:function(e){var t=To(),n={impl:e};return t.memoizedState=n,function(){if(Ll&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Is={readContext:Yi,use:ko,useCallback:ms,useContext:Yi,useEffect:os,useImperativeHandle:fs,useInsertionEffect:ls,useLayoutEffect:us,useMemo:hs,useReducer:Mo,useRef:ns,useState:function(){return Mo(jo)},useDebugValue:ps,useDeferredValue:function(e,t){return _s(Eo(),so.memoizedState,e,t)},useTransition:function(){var e=Mo(jo)[0],t=Eo().memoizedState;return[typeof e==\`boolean\`?e:Oo(e),t]},useSyncExternalStore:Fo,useId:ws,useHostTransitionStatus:Cs,useFormState:Zo,useActionState:Zo,useOptimistic:function(e,t){return Ho(Eo(),so,e,t)},useMemoCache:Ao,useCacheRefresh:Ts};Is.useEffectEvent=cs;var Ls={readContext:Yi,use:ko,useCallback:ms,useContext:Yi,useEffect:os,useImperativeHandle:fs,useInsertionEffect:ls,useLayoutEffect:us,useMemo:hs,useReducer:Po,useRef:ns,useState:function(){return Po(jo)},useDebugValue:ps,useDeferredValue:function(e,t){var n=Eo();return so===null?gs(n,e,t):_s(n,so.memoizedState,e,t)},useTransition:function(){var e=Po(jo)[0],t=Eo().memoizedState;return[typeof e==\`boolean\`?e:Oo(e),t]},useSyncExternalStore:Fo,useId:ws,useHostTransitionStatus:Cs,useFormState:es,useActionState:es,useOptimistic:function(e,t){var n=Eo();return so===null?(n.baseState=e,[e,n.queue.dispatch]):Ho(n,so,e,t)},useMemoCache:Ao,useCacheRefresh:Ts};Ls.useEffectEvent=cs;function Rs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:h({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var zs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=hu(),i=La(r);i.payload=t,n!=null&&(i.callback=n),t=Ra(e,i,r),t!==null&&(_u(t,e,r),za(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=hu(),i=La(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ra(e,i,r),t!==null&&(_u(t,e,r),za(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=hu(),r=La(n);r.tag=2,t!=null&&(r.callback=t),t=Ra(e,r,n),t!==null&&(_u(t,e,n),za(t,e,n))}};function Bs(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?!vr(n,r)||!vr(i,a):!0}function Vs(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&&zs.enqueueReplaceState(t,t.state,null)}function Hs(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=h({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Us(e){Wr(e)}function Ws(e){console.error(e)}function Gs(e){Wr(e)}function Ks(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function qs(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 Js(e,t,n){return n=La(n),n.tag=3,n.payload={element:null},n.callback=function(){Ks(e,t)},n}function Ys(e){return e=La(e),e.tag=3,e}function Xs(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(){qs(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==\`function\`&&(e.callback=function(){qs(t,n,r),typeof i!=\`function\`&&(au===null?au=new Set([this]):au.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?\`\`:e})})}function Zs(e,t,n,r,a){if(n.flags|=32768,typeof r==\`object\`&&r&&typeof r.then==\`function\`){if(t=n.alternate,t!==null&&Ki(t,n,a,!0),n=Za.current,n!==null){switch(n.tag){case 31:case 13:return Qa===null?ku():n.alternate===null&&Kl===0&&(Kl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===ya?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Ju(e,r,a)),!1;case 22:return n.flags|=65536,r===ya?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)),Ju(e,r,a)),!1}throw Error(i(435,n.tag))}return Ju(e,r,a),ku(),!1}if(G)return t=Za.current,t===null?(r!==ji&&(t=Error(i(423),{cause:r}),Ri(fi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=fi(r,n),a=Js(e.stateNode,r,a),Ba(e,a),Kl!==4&&(Kl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==ji&&(e=Error(i(422),{cause:r}),Ri(fi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=fi(o,n),Ql===null?Ql=[o]:Ql.push(o),Kl!==4&&(Kl=2),t===null)return!0;r=fi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Js(n.stateNode,r,e),Ba(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\`&&(au===null||!au.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Ys(a),Xs(a,e,n,r),Ba(n,a),!1}n=n.return}while(n!==null);return!1}var Qs=Error(i(461)),$s=!1;function ec(e,t,n,r){t.child=e===null?Na(t,null,n,r):Ma(t,e.child,n,r)}function tc(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 Ji(t),r=vo(e,t,n,o,a,i),s=So(),e!==null&&!$s?(Co(e,t,i),Tc(e,t,i)):(G&&s&&wi(t),t.flags|=1,ec(e,t,r,i),t.child)}function nc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==\`function\`&&!ri(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,rc(e,t,a,r,i)):(e=oi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Ec(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?vr:n,n(o,r)&&e.ref===t.ref)return Tc(e,t,i)}return t.flags|=1,e=ii(a,r),e.ref=t.ref,e.return=t,t.child=e}function rc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(vr(a,r)&&e.ref===t.ref)if($s=!1,t.pendingProps=r=a,Ec(e,i))e.flags&131072&&($s=!0);else return t.lanes=e.lanes,Tc(e,t,i)}return dc(e,t,n,r,i)}function ic(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 oc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ma(t,a===null?null:a.cachePool),a===null?Ya():Ja(t,a),to(t);else return r=t.lanes=536870912,oc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ma(t,null),Ya(),no(t)):(ma(t,a.cachePool),Ja(t,a),no(t),t.memoizedState=null);return ec(e,t,i,n),t.child}function ac(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function oc(e,t,n,r,i){var a=pa();return a=a===null?null:{parent:ta._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ma(t,null),Ya(),to(t),e!==null&&Ki(e,t,r,!0),t.childLanes=i,null}function sc(e,t){return t=bc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function cc(e,t,n){return Ma(t,e.child,null,n),e=sc(t,t.pendingProps),e.flags|=2,ro(t),t.memoizedState=null,e}function lc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(G){if(r.mode===\`hidden\`)return e=sc(t,r),t.lanes=536870912,ac(null,e);if(eo(t),(e=Oi)?(e=lf(e,Ai),e=e!==null&&e.data===\`&\`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:yi===null?null:{id:bi,overflow:xi},retryLane:536870912,hydrationErrors:null},n=li(e),n.return=t,t.child=n,Di=t,Oi=null)):e=null,e===null)throw Mi(t);return t.lanes=536870912,null}return sc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(eo(t),a)if(t.flags&256)t.flags&=-257,t=cc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if($s||Ki(e,t,n,!1),a=(n&e.childLanes)!==0,$s||a){if(r=Rl,r!==null&&(s=tt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Zr(e,s),_u(r,e,s),Qs;ku(),t=cc(e,t,n)}else e=o.treeContext,Oi=df(s.nextSibling),Di=t,G=!0,ki=null,Ai=!1,e!==null&&Ei(t,e),t=sc(t,r),t.flags|=4096;return t}return e=ii(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function uc(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 dc(e,t,n,r,i){return Ji(t),n=vo(e,t,n,r,void 0,i),r=So(),e!==null&&!$s?(Co(e,t,i),Tc(e,t,i)):(G&&r&&wi(t),t.flags|=1,ec(e,t,n,i),t.child)}function fc(e,t,n,r,i,a){return Ji(t),t.updateQueue=null,n=bo(t,r,n,i),yo(e),r=So(),e!==null&&!$s?(Co(e,t,a),Tc(e,t,a)):(G&&r&&wi(t),t.flags|=1,ec(e,t,n,a),t.child)}function pc(e,t,n,r,i){if(Ji(t),t.stateNode===null){var a=ei,o=n.contextType;typeof o==\`object\`&&o&&(a=Yi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=zs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Fa(t),o=n.contextType,a.context=typeof o==\`object\`&&o?Yi(o):ei,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==\`function\`&&(Rs(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&&zs.enqueueReplaceState(a,a.state,null),Ua(t,r,a,i),Ha(),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=Hs(n,s);a.props=c;var l=a.context,u=n.contextType;o=ei,typeof u==\`object\`&&u&&(o=Yi(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)&&Vs(t,a,r,o),Pa=!1;var f=t.memoizedState;a.state=f,Ua(t,r,a,i),Ha(),l=t.memoizedState,s||f!==l||Pa?(typeof d==\`function\`&&(Rs(t,n,d,r),l=t.memoizedState),(c=Pa||Bs(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,Ia(e,t),o=t.memoizedProps,u=Hs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ei,typeof l==\`object\`&&l&&(c=Yi(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)&&Vs(t,a,r,c),Pa=!1,f=t.memoizedState,a.state=f,Ua(t,r,a,i),Ha();var p=t.memoizedState;o!==d||f!==p||Pa||e!==null&&e.dependencies!==null&&qi(e.dependencies)?(typeof s==\`function\`&&(Rs(t,n,s,r),p=t.memoizedState),(u=Pa||Bs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&qi(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,uc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=\`function\`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Ma(t,e.child,null,i),t.child=Ma(t,null,n,i)):ec(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Tc(e,t,i),e}function mc(e,t,n,r){return Ii(),t.flags|=256,ec(e,t,n,r),t.child}var hc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function gc(e){return{baseLanes:e,cachePool:ha()}}function _c(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Xl),e}function vc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(io.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(G){if(a?$a(t):no(t),(e=Oi)?(e=lf(e,Ai),e=e!==null&&e.data!==\`&\`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:yi===null?null:{id:bi,overflow:xi},retryLane:536870912,hydrationErrors:null},n=li(e),n.return=t,t.child=n,Di=t,Oi=null)):e=null,e===null)throw Mi(t);return uf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(no(t),a=t.mode,c=bc({mode:\`hidden\`,children:c},a),r=si(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=gc(n),r.childLanes=_c(e,s,n),t.memoizedState=hc,ac(null,r)):($a(t),yc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?($a(t),t.flags&=-257,t=xc(e,t,n)):t.memoizedState===null?(no(t),c=r.fallback,a=t.mode,r=bc({mode:\`visible\`,children:r.children},a),c=si(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ma(t,e.child,null,n),r=t.child,r.memoizedState=gc(n),r.childLanes=_c(e,s,n),t.memoizedState=hc,t=ac(null,r)):(no(t),t.child=e.child,t.flags|=128,t=null);else if($a(t),uf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=\`\`,r.digest=s,Ri({value:r,source:null,stack:null}),t=xc(e,t,n)}else if($s||Ki(e,t,n,!1),s=(n&e.childLanes)!==0,$s||s){if(s=Rl,s!==null&&(r=tt(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Zr(e,r),_u(s,e,r),Qs;Y(c)||ku(),t=xc(e,t,n)}else Y(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Oi=df(c.nextSibling),Di=t,G=!0,ki=null,Ai=!1,e!==null&&Ei(t,e),t=yc(t,r.children),t.flags|=4096);return t}return a?(no(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=ii(l,{mode:\`hidden\`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=si(c,a,n,null),c.flags|=2):c=ii(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,ac(null,r),r=t.child,c=e.child.memoizedState,c===null?c=gc(n):(a=c.cachePool,a===null?a=ha():(l=ta._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=_c(e,s,n),t.memoizedState=hc,ac(e.child,r)):($a(t),n=e.child,e=n.sibling,n=ii(n,{mode:\`visible\`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function yc(e,t){return t=bc({mode:\`visible\`,children:t},e.mode),t.return=e,e.child=t}function bc(e,t){return e=ni(22,e,null,t),e.lanes=0,e}function xc(e,t,n){return Ma(t,e.child,null,n),e=yc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Sc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Wi(e.return,t,n)}function Cc(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 wc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=io.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,I(io,o),ec(e,t,r,n),r=G?gi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Sc(e,n,t);else if(e.tag===19)Sc(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\`forwards\`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&ao(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Cc(t,!1,i,n,a,r);break;case\`backwards\`:case\`unstable_legacy-backwards\`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&ao(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Cc(t,!0,n,null,a,r);break;case\`together\`:Cc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Tc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ql|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Ki(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=ii(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ii(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Ec(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&qi(e))):!0}function Dc(e,t,n){switch(t.tag){case 3:de(t,t.stateNode.containerInfo),Hi(t,ta,e.memoizedState.cache),Ii();break;case 27:case 5:pe(t);break;case 4:de(t,t.stateNode.containerInfo);break;case 10:Hi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,eo(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?($a(t),e=Tc(e,t,n),e===null?null:e.sibling):vc(e,t,n):($a(t),t.flags|=128,null);$a(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Ki(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return wc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),I(io,io.current),r)break;return null;case 22:return t.lanes=0,ic(e,t,n,t.pendingProps);case 24:Hi(t,ta,e.memoizedState.cache)}return Tc(e,t,n)}function Oc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)$s=!0;else{if(!Ec(e,n)&&!(t.flags&128))return $s=!1,Dc(e,t,n);$s=!!(e.flags&131072)}else $s=!1,G&&t.flags&1048576&&Ci(t,gi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Sa(t.elementType),t.type=e,typeof e==\`function\`)ri(e)?(r=Hs(e,r),t.tag=1,t=pc(null,t,e,r,n)):(t.tag=0,t=dc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=tc(null,t,e,r,n);break a}else if(a===D){t.tag=14,t=nc(null,t,e,r,n);break a}}throw t=ee(e)||e,Error(i(306,t,\`\`))}}return t;case 0:return dc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Hs(r,t.pendingProps),pc(e,t,r,a,n);case 3:a:{if(de(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ia(e,t),Ua(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Hi(t,ta,r),r!==o.cache&&Gi(t,[ta],n,!0),Ha(),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=mc(e,t,r,n);break a}else if(r!==a){a=fi(Error(i(424)),t),Ri(a),t=mc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===\`HTML\`?e.ownerDocument.body:e}for(Oi=df(e.firstChild),Di=t,G=!0,ki=null,Ai=!0,n=Na(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ii(),r===a){t=Tc(e,t,n);break a}ec(e,t,r,n)}t=t.child}return t;case 26:return uc(e,t),e===null?(n=Mf(t.type,null,t.pendingProps,null))?t.memoizedState=n:G||(n=t.type,e=t.pendingProps,r=Gd(le.current).createElement(n),r[st]=t,r[ct]=e,zd(r,n,e),bt(r),t.stateNode=r):t.memoizedState=Mf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return pe(t),e===null&&G&&(r=t.stateNode=hf(t.type,t.pendingProps,le.current),Di=t,Ai=!0,a=Oi,nf(t.type)?(ff=a,Oi=df(r.firstChild)):Oi=a),ec(e,t,t.pendingProps.children,n),uc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&G&&((a=r=Oi)&&(r=sf(r,t.type,t.pendingProps,Ai),r===null?a=!1:(t.stateNode=r,Di=t,Oi=df(r.firstChild),Ai=!1,a=!0)),a||Mi(t)),pe(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Jd(a,o)?r=null:s!==null&&Jd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=vo(e,t,xo,null,null,n),tp._currentValue=a),uc(e,t),ec(e,t,r,n),t.child;case 6:return e===null&&G&&((e=n=Oi)&&(n=cf(n,t.pendingProps,Ai),n===null?e=!1:(t.stateNode=n,Di=t,Oi=null,e=!0)),e||Mi(t)),null;case 13:return vc(e,t,n);case 4:return de(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ma(t,null,r,n):ec(e,t,r,n),t.child;case 11:return tc(e,t,t.type,t.pendingProps,n);case 7:return ec(e,t,t.pendingProps,n),t.child;case 8:return ec(e,t,t.pendingProps.children,n),t.child;case 12:return ec(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Hi(t,t.type,r.value),ec(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Ji(t),a=Yi(a),r=r(a),t.flags|=1,ec(e,t,r,n),t.child;case 14:return nc(e,t,t.type,t.pendingProps,n);case 15:return rc(e,t,t.type,t.pendingProps,n);case 19:return wc(e,t,n);case 31:return lc(e,t,n);case 22:return ic(e,t,n,t.pendingProps);case 24:return Ji(t),r=Yi(ta),e===null?(a=pa(),a===null&&(a=Rl,o=na(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Fa(t),Hi(t,ta,a)):((e.lanes&n)!==0&&(Ia(e,t),Ua(t,null,null,n),Ha()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Hi(t,ta,r),r!==a.cache&&Gi(t,[ta],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Hi(t,ta,r))),ec(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function kc(e){e.flags|=4}function Ac(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Eu())e.flags|=8192;else throw Ca=ya,_a}else e.flags&=-16777217}function jc(e,t){if(t.type!==\`stylesheet\`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!qf(t))if(Eu())e.flags|=8192;else throw Ca=ya,_a}function Mc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Ye(),e.lanes|=t,Zl|=t)}function Nc(e,t){if(!G)switch(e.tailMode){case\`hidden\`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case\`collapsed\`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Pc(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&65011712,r|=i.flags&65011712,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 Fc(e,t,n){var r=t.pendingProps;switch(Ti(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pc(t),null;case 1:return Pc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Ui(ta),fe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Fi(t)?kc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Li())),Pc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(kc(t),o===null?(Pc(t),Ac(t,a,null,r,n)):(Pc(t),jc(t,o))):o?o===e.memoizedState?(Pc(t),t.flags&=-16777217):(kc(t),Pc(t),jc(t,o)):(e=e.memoizedProps,e!==r&&kc(t),Pc(t),Ac(t,a,e,r,n)),null;case 27:if(me(t),n=le.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&kc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Pc(t),null}e=se.current,Fi(t)?Ni(t,e):(e=hf(a,r,n),t.stateNode=e,kc(t))}return Pc(t),null;case 5:if(me(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&kc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Pc(t),null}if(o=se.current,Fi(t))Ni(t,o);else{var s=Gd(le.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[st]=t,o[ct]=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(zd(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&&kc(t)}}return Pc(t),Ac(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&kc(t);else{if(typeof r!=\`string\`&&t.stateNode===null)throw Error(i(166));if(e=le.current,Fi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Di,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[st]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Id(e.nodeValue,n)),e||Mi(t,!0)}else e=Gd(e).createTextNode(r),e[st]=t,t.stateNode=e}return Pc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Fi(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[st]=t}else Ii(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Pc(t),e=!1}else n=Li(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ro(t),t):(ro(t),null);if(t.flags&128)throw Error(i(558))}return Pc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Fi(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[st]=t}else Ii(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Pc(t),a=!1}else a=Li(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(ro(t),t):(ro(t),null)}return ro(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),Mc(t,t.updateQueue),Pc(t),null);case 4:return fe(),e===null&&Ed(t.stateNode.containerInfo),Pc(t),null;case 10:return Ui(t.type),Pc(t),null;case 19:if(oe(io),r=t.memoizedState,r===null)return Pc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Nc(r,!1);else{if(Kl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=ao(e),o!==null){for(t.flags|=128,Nc(r,!1),e=o.updateQueue,t.updateQueue=e,Mc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ai(n,e),n=n.sibling;return I(io,io.current&1|2),G&&Si(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&De()>ru&&(t.flags|=128,a=!0,Nc(r,!1),t.lanes=4194304)}else{if(!a)if(e=ao(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Mc(t,e),Nc(r,!0),r.tail===null&&r.tailMode===\`hidden\`&&!o.alternate&&!G)return Pc(t),null}else 2*De()-r.renderingStartTime>ru&&n!==536870912&&(t.flags|=128,a=!0,Nc(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)}return r.tail===null?(Pc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=De(),e.sibling=null,n=io.current,I(io,a?n&1|2:n&1),G&&Si(t,r.treeForkCount),e);case 22:case 23:return ro(t),Xa(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Pc(t),t.subtreeFlags&6&&(t.flags|=8192)):Pc(t),n=t.updateQueue,n!==null&&Mc(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&&oe(fa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ui(ta),Pc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Ic(e,t){switch(Ti(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ui(ta),fe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return me(t),null;case 31:if(t.memoizedState!==null){if(ro(t),t.alternate===null)throw Error(i(340));Ii()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ro(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Ii()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return oe(io),null;case 4:return fe(),null;case 10:return Ui(t.type),null;case 22:case 23:return ro(t),Xa(),e!==null&&oe(fa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ui(ta),null;case 25:return null;default:return null}}function Lc(e,t){switch(Ti(t),t.tag){case 3:Ui(ta),fe();break;case 26:case 27:case 5:me(t);break;case 4:fe();break;case 31:t.memoizedState!==null&&ro(t);break;case 13:ro(t);break;case 19:oe(io);break;case 10:Ui(t.type);break;case 22:case 23:ro(t),Xa(),e!==null&&oe(fa);break;case 24:Ui(ta)}}function Rc(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){qu(t,t.return,e)}}function zc(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){qu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){qu(t,t.return,e)}}function Bc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ga(t,n)}catch(t){qu(e,e.return,t)}}}function Vc(e,t,n){n.props=Hs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){qu(e,t,n)}}function Hc(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:r=e.stateNode;break;default:r=e.stateNode}typeof n==\`function\`?e.refCleanup=n(r):n.current=r}}catch(n){qu(e,t,n)}}function Uc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==\`function\`)try{r()}catch(n){qu(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){qu(e,t,n)}else n.current=null}function Wc(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){qu(e,e.return,t)}}function Gc(e,t,n){try{var r=e.stateNode;Bd(r,e.type,n,t),r[ct]=t}catch(t){qu(e,e.return,t)}}function Kc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&nf(e.type)||e.tag===4}function qc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Kc(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&&nf(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 Jc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===\`HTML\`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===\`HTML\`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=z));else if(r!==4&&(r===27&&nf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Jc(e,t,n),e=e.sibling;e!==null;)Jc(e,t,n),e=e.sibling}function Yc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&nf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Yc(e,t,n),e=e.sibling;e!==null;)Yc(e,t,n),e=e.sibling}function Xc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);zd(t,r,n),t[st]=e,t[ct]=n}catch(t){qu(e,e.return,t)}}var Zc=!1,Qc=!1,$c=!1,el=typeof WeakSet==\`function\`?WeakSet:Set,tl=null;function nl(e,t){if(e=e.containerInfo,Ud=up,e=Sr(e),Cr(e)){if(\`selectionStart\`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Wd={focusedElem:e,selectionRange:n},up=!1,tl=t;tl!==null;)if(t=tl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,tl=e;else for(;tl!==null;){switch(t=tl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Hs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){qu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)of(e);else if(n===1)switch(e.nodeName){case\`HEAD\`:case\`HTML\`:case\`BODY\`:of(e);break;default:e.textContent=\`\`}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,tl=e;break}tl=t.return}}function rl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:vl(e,n),r&4&&Rc(5,n);break;case 1:if(vl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){qu(n,n.return,e)}else{var i=Hs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){qu(n,n.return,e)}}r&64&&Bc(n),r&512&&Hc(n,n.return);break;case 3:if(vl(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{Ga(e,t)}catch(e){qu(n,n.return,e)}}break;case 27:t===null&&r&4&&Xc(n);case 26:case 5:vl(e,n),t===null&&r&4&&Wc(n),r&512&&Hc(n,n.return);break;case 12:vl(e,n);break;case 31:vl(e,n),r&4&&ll(e,n);break;case 13:vl(e,n),r&4&&ul(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Zu.bind(null,n),X(e,n))));break;case 22:if(r=n.memoizedState!==null||Zc,!r){t=t!==null&&t.memoizedState!==null||Qc,i=Zc;var a=Qc;Zc=r,(Qc=t)&&!a?bl(e,n,(n.subtreeFlags&8772)!=0):vl(e,n),Zc=i,Qc=a}break;case 30:break;default:vl(e,n)}}function il(e){var t=e.alternate;t!==null&&(e.alternate=null,il(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ht(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 al=null,ol=!1;function sl(e,t,n){for(n=n.child;n!==null;)cl(e,t,n),n=n.sibling}function cl(e,t,n){if(Le&&typeof Le.onCommitFiberUnmount==\`function\`)try{Le.onCommitFiberUnmount(Ie,n)}catch{}switch(n.tag){case 26:Qc||Uc(n,t),sl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Qc||Uc(n,t);var r=al,i=ol;nf(n.type)&&(al=n.stateNode,ol=!1),sl(e,t,n),gf(n.stateNode),al=r,ol=i;break;case 5:Qc||Uc(n,t);case 6:if(r=al,i=ol,al=null,sl(e,t,n),al=r,ol=i,al!==null)if(ol)try{(al.nodeType===9?al.body:al.nodeName===\`HTML\`?al.ownerDocument.body:al).removeChild(n.stateNode)}catch(e){qu(n,t,e)}else try{al.removeChild(n.stateNode)}catch(e){qu(n,t,e)}break;case 18:al!==null&&(ol?(e=al,rf(e.nodeType===9?e.body:e.nodeName===\`HTML\`?e.ownerDocument.body:e,n.stateNode),Ip(e)):rf(al,n.stateNode));break;case 4:r=al,i=ol,al=n.stateNode.containerInfo,ol=!0,sl(e,t,n),al=r,ol=i;break;case 0:case 11:case 14:case 15:zc(2,n,t),Qc||zc(4,n,t),sl(e,t,n);break;case 1:Qc||(Uc(n,t),r=n.stateNode,typeof r.componentWillUnmount==\`function\`&&Vc(n,t,r)),sl(e,t,n);break;case 21:sl(e,t,n);break;case 22:Qc=(r=Qc)||n.memoizedState!==null,sl(e,t,n),Qc=r;break;default:sl(e,t,n)}}function ll(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ip(e)}catch(e){qu(t,t.return,e)}}}function ul(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ip(e)}catch(e){qu(t,t.return,e)}}function dl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new el),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new el),t;default:throw Error(i(435,e.tag))}}function fl(e,t){var n=dl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Qu.bind(null,e,t);t.then(r,r)}})}function pl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(nf(c.type)){al=c.stateNode,ol=!1;break a}break;case 5:al=c.stateNode,ol=!1;break a;case 3:case 4:al=c.stateNode.containerInfo,ol=!0;break a}c=c.return}if(al===null)throw Error(i(160));cl(o,s,a),al=null,ol=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)hl(t,e),t=t.sibling}var ml=null;function hl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:pl(t,e),gl(e),r&4&&(zc(3,e,e.return),Rc(3,e),zc(5,e,e.return));break;case 1:pl(t,e),gl(e),r&512&&(Qc||n===null||Uc(n,n.return)),r&64&&Zc&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=ml;if(pl(t,e),gl(e),r&512&&(Qc||n===null||Uc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case\`title\`:o=a.getElementsByTagName(\`title\`)[0],(!o||o[mt]||o[st]||o.namespaceURI===\`http://www.w3.org/2000/svg\`||o.hasAttribute(\`itemprop\`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(\`head > title\`))),zd(o,r,n),o[st]=e,bt(o),r=o;break a;case\`link\`:var s=Wf(\`link\`,\`href\`,a).get(r+(n.href||\`\`));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(\`href\`)===(n.href==null||n.href===\`\`?null:n.href)&&o.getAttribute(\`rel\`)===(n.rel==null?null:n.rel)&&o.getAttribute(\`title\`)===(n.title==null?null:n.title)&&o.getAttribute(\`crossorigin\`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),zd(o,r,n),a.head.appendChild(o);break;case\`meta\`:if(s=Wf(\`meta\`,\`content\`,a).get(r+(n.content||\`\`))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(\`content\`)===(n.content==null?null:\`\`+n.content)&&o.getAttribute(\`name\`)===(n.name==null?null:n.name)&&o.getAttribute(\`property\`)===(n.property==null?null:n.property)&&o.getAttribute(\`http-equiv\`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(\`charset\`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),zd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[st]=e,bt(o),r=o}e.stateNode=r}else Gf(a,e.type,e.stateNode);else e.stateNode=zf(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&Gc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Gf(a,e.type,e.stateNode):zf(a,r,e.memoizedProps))}break;case 27:pl(t,e),gl(e),r&512&&(Qc||n===null||Uc(n,n.return)),n!==null&&r&4&&Gc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(pl(t,e),gl(e),r&512&&(Qc||n===null||Uc(n,n.return)),e.flags&32){a=e.stateNode;try{Kt(a,\`\`)}catch(t){qu(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Gc(e,a,n===null?a:n.memoizedProps)),r&1024&&($c=!0);break;case 6:if(pl(t,e),gl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){qu(e,e.return,t)}}break;case 3:if(Uf=null,a=ml,ml=yf(t.containerInfo),pl(t,e),ml=a,gl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Ip(t.containerInfo)}catch(t){qu(e,e.return,t)}$c&&($c=!1,_l(e));break;case 4:r=ml,ml=yf(e.stateNode.containerInfo),pl(t,e),gl(e),ml=r;break;case 12:pl(t,e),gl(e);break;case 31:pl(t,e),gl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,fl(e,r)));break;case 13:pl(t,e),gl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(tu=De()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,fl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Zc,d=Qc;if(Zc=u||a,Qc=d||l,pl(t,e),Qc=d,Zc=u,gl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||Zc||Qc||yl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==\`function\`?s.setProperty(\`display\`,\`none\`,\`important\`):s.display=\`none\`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(\`display\`)?f.display:null;c.style.display=p==null||typeof p==\`boolean\`?\`\`:(\`\`+p).trim()}}catch(e){qu(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?\`\`:l.memoizedProps}catch(e){qu(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?af(m,!0):af(l.stateNode,!1)}catch(e){qu(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,fl(e,n))));break;case 19:pl(t,e),gl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,fl(e,r)));break;case 30:break;case 21:break;default:pl(t,e),gl(e)}}function gl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Kc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Yc(e,qc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Kt(o,\`\`),n.flags&=-33),Yc(e,qc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Jc(e,qc(e),s);break;default:throw Error(i(161))}}catch(t){qu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function _l(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;_l(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function vl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)rl(e,t.alternate,t),t=t.sibling}function yl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:zc(4,t,t.return),yl(t);break;case 1:Uc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==\`function\`&&Vc(t,t.return,n),yl(t);break;case 27:gf(t.stateNode);case 26:case 5:Uc(t,t.return),yl(t);break;case 22:t.memoizedState===null&&yl(t);break;case 30:yl(t);break;default:yl(t)}e=e.sibling}}function bl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:bl(i,a,n),Rc(4,a);break;case 1:if(bl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==\`function\`)try{i.componentDidMount()}catch(e){qu(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Wa(c[i],s)}catch(e){qu(r,r.return,e)}}n&&o&64&&Bc(a),Hc(a,a.return);break;case 27:Xc(a);case 26:case 5:bl(i,a,n),n&&r===null&&o&4&&Wc(a),Hc(a,a.return);break;case 12:bl(i,a,n);break;case 31:bl(i,a,n),n&&o&4&&ll(i,a);break;case 13:bl(i,a,n),n&&o&4&&ul(i,a);break;case 22:a.memoizedState===null&&bl(i,a,n),Hc(a,a.return);break;case 30:break;default:bl(i,a,n)}t=t.sibling}}function xl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&ra(n))}function Sl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ra(e))}function Cl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)wl(e,t,n,r),t=t.sibling}function wl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Cl(e,t,n,r),i&2048&&Rc(9,t);break;case 1:Cl(e,t,n,r);break;case 3:Cl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ra(e)));break;case 12:if(i&2048){Cl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==\`function\`&&s(o,t.alternate===null?\`mount\`:\`update\`,e.passiveEffectDuration,-0)}catch(e){qu(t,t.return,e)}}else Cl(e,t,n,r);break;case 31:Cl(e,t,n,r);break;case 13:Cl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Cl(e,t,n,r):(a._visibility|=2,Tl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?Cl(e,t,n,r):El(e,t),i&2048&&xl(o,t);break;case 24:Cl(e,t,n,r),i&2048&&Sl(t.alternate,t);break;default:Cl(e,t,n,r)}}function Tl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!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:Tl(a,o,s,c,i),Rc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Tl(a,o,s,c,i)):u._visibility&2?Tl(a,o,s,c,i):El(a,o),i&&l&2048&&xl(o.alternate,o);break;case 24:Tl(a,o,s,c,i),i&&l&2048&&Sl(o.alternate,o);break;default:Tl(a,o,s,c,i)}t=t.sibling}}function El(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:El(n,r),i&2048&&xl(r.alternate,r);break;case 24:El(n,r),i&2048&&Sl(r.alternate,r);break;default:El(n,r)}t=t.sibling}}var Dl=8192;function Ol(e,t,n){if(e.subtreeFlags&Dl)for(e=e.child;e!==null;)kl(e,t,n),e=e.sibling}function kl(e,t,n){switch(e.tag){case 26:Ol(e,t,n),e.flags&Dl&&e.memoizedState!==null&&Jf(n,ml,e.memoizedState,e.memoizedProps);break;case 5:Ol(e,t,n);break;case 3:case 4:var r=ml;ml=yf(e.stateNode.containerInfo),Ol(e,t,n),ml=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Dl,Dl=16777216,Ol(e,t,n),Dl=r):Ol(e,t,n));break;default:Ol(e,t,n)}}function Al(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 jl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];tl=r,Pl(r,e)}Al(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ml(e),e=e.sibling}function Ml(e){switch(e.tag){case 0:case 11:case 15:jl(e),e.flags&2048&&zc(9,e,e.return);break;case 3:jl(e);break;case 12:jl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Nl(e)):jl(e);break;default:jl(e)}}function Nl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];tl=r,Pl(r,e)}Al(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:zc(8,t,t.return),Nl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Nl(t));break;default:Nl(t)}e=e.sibling}}function Pl(e,t){for(;tl!==null;){var n=tl;switch(n.tag){case 0:case 11:case 15:zc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:ra(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,tl=r;else a:for(n=e;tl!==null;){r=tl;var i=r.sibling,a=r.return;if(il(r),r===n){tl=null;break a}if(i!==null){i.return=a,tl=i;break a}tl=a}}}var Fl={getCacheForType:function(e){var t=Yi(ta),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Yi(ta).controller.signal}},Il=typeof WeakMap==\`function\`?WeakMap:Map,Ll=0,Rl=null,zl=null,J=0,Bl=0,Vl=null,Hl=!1,Ul=!1,Wl=!1,Gl=0,Kl=0,ql=0,Jl=0,Yl=0,Xl=0,Zl=0,Ql=null,$l=null,eu=!1,tu=0,nu=0,ru=1/0,iu=null,au=null,ou=0,su=null,cu=null,lu=0,uu=0,du=null,fu=null,pu=0,mu=null;function hu(){return Ll&2&&J!==0?J&-J:P.T===null?it():md()}function gu(){if(Xl===0)if(!(J&536870912)||G){var e=Ue;Ue<<=1,!(Ue&3932160)&&(Ue=262144),Xl=e}else Xl=536870912;return e=Za.current,e!==null&&(e.flags|=32),Xl}function _u(e,t,n){(e===Rl&&(Bl===2||Bl===9)||e.cancelPendingCommit!==null)&&(wu(e,0),xu(e,J,Xl,!1)),Ze(e,n),(!(Ll&2)||e!==Rl)&&(e===Rl&&(!(Ll&2)&&(Jl|=n),Kl===4&&xu(e,J,Xl,!1)),od(e))}function vu(e,t,n){if(Ll&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||qe(e,t),a=r?Mu(e,t):Au(e,t,!0),o=r;do{if(a===0){Ul&&!r&&xu(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!bu(n)){a=Au(e,t,!1),o=!1;continue}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=Ql;var l=c.current.memoizedState.isDehydrated;if(l&&(wu(c,s).flags|=256),s=Au(c,s,!1),s!==2){if(Wl&&!l){c.errorRecoveryDisabledLanes|=o,Jl|=o,a=4;break a}o=$l,$l=a,o!==null&&($l===null?$l=o:$l.push.apply($l,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){wu(e,0),xu(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)break;case 6:xu(r,t,Xl,!Hl);break a;case 2:$l=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=tu+300-De(),10<a)){if(xu(r,t,Xl,!Hl),Ke(r,0,!0)!==0)break a;lu=t,r.timeoutHandle=Zd(yu.bind(null,r,n,$l,iu,eu,t,Xl,Jl,Zl,Hl,o,\`Throttled\`,-0,0),a);break a}yu(r,n,$l,iu,eu,t,Xl,Jl,Zl,Hl,o,null,-0,0)}}break}while(1);od(e)}function yu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:z},kl(t,a,d);var m=(a&62914560)===a?tu-De():(a&4194048)===a?nu-De():0;if(m=Xf(d,m),m!==null){lu=a,e.cancelPendingCommit=m(zu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),xu(e,a,o,!l);return}}zu(e,t,a,n,r,i,o,s,c)}function bu(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(!_r(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 xu(e,t,n,r){t&=~Yl,t&=~Jl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Re(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&$e(e,n,t)}function Su(){return Ll&6?!0:(sd(0,!1),!1)}function Cu(){if(zl!==null){if(Bl===0)var e=zl.return;else e=zl,Vi=Bi=null,wo(e),Ea=null,Da=0,e=zl;for(;e!==null;)Lc(e.alternate,e),e=e.return;zl=null}}function wu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Qd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),lu=0,Cu(),Rl=e,zl=n=ii(e.current,null),J=t,Bl=0,Vl=null,Hl=!1,Ul=qe(e,t),Wl=!1,Zl=Xl=Yl=Jl=ql=Kl=0,$l=Ql=null,eu=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Re(r),a=1<<i;t|=e[i],r&=~a}return Gl=t,Jr(),n}function Tu(e,t){K=null,P.H=Ps,t===ga||t===va?(t=wa(),Bl=3):t===_a?(t=wa(),Bl=4):Bl=t===Qs?8:typeof t==\`object\`&&t&&typeof t.then==\`function\`?6:1,Vl=t,zl===null&&(Kl=1,Ks(e,fi(t,e.current)))}function Eu(){var e=Za.current;return e===null?!0:(J&4194048)===J?Qa===null:(J&62914560)===J||J&536870912?e===Qa:!1}function Du(){var e=P.H;return P.H=Ps,e===null?Ps:e}function Ou(){var e=P.A;return P.A=Fl,e}function ku(){Kl=4,Hl||(J&4194048)!==J&&Za.current!==null||(Ul=!0),!(ql&134217727)&&!(Jl&134217727)||Rl===null||xu(Rl,J,Xl,!1)}function Au(e,t,n){var r=Ll;Ll|=2;var i=Du(),a=Ou();(Rl!==e||J!==t)&&(iu=null,wu(e,t)),t=!1;var o=Kl;a:do try{if(Bl!==0&&zl!==null){var s=zl,c=Vl;switch(Bl){case 8:Cu(),o=6;break a;case 3:case 2:case 9:case 6:Za.current===null&&(t=!0);var l=Bl;if(Bl=0,Vl=null,Iu(e,s,c,l),n&&Ul){o=0;break a}break;default:l=Bl,Bl=0,Vl=null,Iu(e,s,c,l)}}ju(),o=Kl;break}catch(t){Tu(e,t)}while(1);return t&&e.shellSuspendCounter++,Vi=Bi=null,Ll=r,P.H=i,P.A=a,zl===null&&(Rl=null,J=0,Jr()),o}function ju(){for(;zl!==null;)Pu(zl)}function Mu(e,t){var n=Ll;Ll|=2;var r=Du(),a=Ou();Rl!==e||J!==t?(iu=null,ru=De()+500,wu(e,t)):Ul=qe(e,t);a:do try{if(Bl!==0&&zl!==null){t=zl;var o=Vl;b:switch(Bl){case 1:Bl=0,Vl=null,Iu(e,t,o,1);break;case 2:case 9:if(ba(o)){Bl=0,Vl=null,Fu(t);break}t=function(){Bl!==2&&Bl!==9||Rl!==e||(Bl=7),od(e)},o.then(t,t);break a;case 3:Bl=7;break a;case 4:Bl=5;break a;case 7:ba(o)?(Bl=0,Vl=null,Fu(t)):(Bl=0,Vl=null,Iu(e,t,o,7));break;case 5:var s=null;switch(zl.tag){case 26:s=zl.memoizedState;case 5:case 27:var c=zl;if(s?qf(s):c.stateNode.complete){Bl=0,Vl=null;var l=c.sibling;if(l!==null)zl=l;else{var u=c.return;u===null?zl=null:(zl=u,Lu(u))}break b}}Bl=0,Vl=null,Iu(e,t,o,5);break;case 6:Bl=0,Vl=null,Iu(e,t,o,6);break;case 8:Cu(),Kl=6;break a;default:throw Error(i(462))}}Nu();break}catch(t){Tu(e,t)}while(1);return Vi=Bi=null,P.H=r,P.A=a,Ll=n,zl===null?(Rl=null,J=0,Jr(),Kl):0}function Nu(){for(;zl!==null&&!Te();)Pu(zl)}function Pu(e){var t=Oc(e.alternate,e,Gl);e.memoizedProps=e.pendingProps,t===null?Lu(e):zl=t}function Fu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=fc(n,t,t.pendingProps,t.type,void 0,J);break;case 11:t=fc(n,t,t.pendingProps,t.type.render,t.ref,J);break;case 5:wo(t);default:Lc(n,t),t=zl=ai(t,Gl),t=Oc(n,t,Gl)}e.memoizedProps=e.pendingProps,t===null?Lu(e):zl=t}function Iu(e,t,n,r){Vi=Bi=null,wo(t),Ea=null,Da=0;var i=t.return;try{if(Zs(e,i,t,n,J)){Kl=1,Ks(e,fi(n,e.current)),zl=null;return}}catch(t){if(i!==null)throw zl=i,t;Kl=1,Ks(e,fi(n,e.current)),zl=null;return}t.flags&32768?(G||r===1?e=!0:Ul||J&536870912?e=!1:(Hl=e=!0,(r===2||r===9||r===3||r===6)&&(r=Za.current,r!==null&&r.tag===13&&(r.flags|=16384))),Ru(t,e)):Lu(t)}function Lu(e){var t=e;do{if(t.flags&32768){Ru(t,Hl);return}e=t.return;var n=Fc(t.alternate,t,Gl);if(n!==null){zl=n;return}if(t=t.sibling,t!==null){zl=t;return}zl=t=e}while(t!==null);Kl===0&&(Kl=5)}function Ru(e,t){do{var n=Ic(e.alternate,e);if(n!==null){n.flags&=32767,zl=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){zl=e;return}zl=e=n}while(e!==null);Kl=6,zl=null}function zu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Wu();while(ou!==0);if(Ll&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=qr,Qe(e,n,o,s,c,l),e===Rl&&(zl=Rl=null,J=0),cu=t,su=e,lu=n,uu=o,du=a,fu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,$u(je,function(){return Gu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=P.T,P.T=null,a=F.p,F.p=2,s=Ll,Ll|=4;try{nl(e,t,n)}finally{Ll=s,F.p=a,P.T=r}}ou=1,Bu(),Vu(),Hu()}}function Bu(){if(ou===1){ou=0;var e=su,t=cu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=P.T,P.T=null;var r=F.p;F.p=2;var i=Ll;Ll|=4;try{hl(t,e);var a=Wd,o=Sr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&xr(s.ownerDocument.documentElement,s)){if(c!==null&&Cr(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 _=br(s,h),v=br(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}}up=!!Ud,Wd=Ud=null}finally{Ll=i,F.p=r,P.T=n}}e.current=t,ou=2}}function Vu(){if(ou===2){ou=0;var e=su,t=cu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=P.T,P.T=null;var r=F.p;F.p=2;var i=Ll;Ll|=4;try{rl(e,t.alternate,t)}finally{Ll=i,F.p=r,P.T=n}}ou=3}}function Hu(){if(ou===4||ou===3){ou=0,Ee();var e=su,t=cu,n=lu,r=fu;t.subtreeFlags&10256||t.flags&10256?ou=5:(ou=0,cu=su=null,Uu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(au=null),rt(n),t=t.stateNode,Le&&typeof Le.onCommitFiberRoot==\`function\`)try{Le.onCommitFiberRoot(Ie,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=P.T,i=F.p,F.p=2,P.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{P.T=t,F.p=i}}lu&3&&Wu(),od(e),i=e.pendingLanes,n&261930&&i&42?e===mu?pu++:(pu=0,mu=e):pu=0,sd(0,!1)}}function Uu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ra(t)))}function Wu(){return Bu(),Vu(),Hu(),Gu()}function Gu(){if(ou!==5)return!1;var e=su,t=uu;uu=0;var n=rt(lu),r=P.T,a=F.p;try{F.p=32>n?32:n,P.T=null,n=du,du=null;var o=su,s=lu;if(ou=0,cu=su=null,lu=0,Ll&6)throw Error(i(331));var c=Ll;if(Ll|=4,Ml(o.current),wl(o,o.current,s,n),Ll=c,sd(0,!1),Le&&typeof Le.onPostCommitFiberRoot==\`function\`)try{Le.onPostCommitFiberRoot(Ie,o)}catch{}return!0}finally{F.p=a,P.T=r,Uu(e,t)}}function Ku(e,t,n){t=fi(n,t),t=Js(e.stateNode,t,2),e=Ra(e,t,2),e!==null&&(Ze(e,2),od(e))}function qu(e,t,n){if(e.tag===3)Ku(e,e,n);else for(;t!==null;){if(t.tag===3){Ku(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==\`function\`||typeof r.componentDidCatch==\`function\`&&(au===null||!au.has(r))){e=fi(n,e),n=Ys(2),r=Ra(t,n,2),r!==null&&(Xs(n,r,t,e),Ze(r,2),od(r));break}}t=t.return}}function Ju(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Il;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)||(Wl=!0,i.add(n),e=Yu.bind(null,e,t,n),t.then(e,e))}function Yu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Rl===e&&(J&n)===n&&(Kl===4||Kl===3&&(J&62914560)===J&&300>De()-tu?!(Ll&2)&&wu(e,0):Yl|=n,Zl===J&&(Zl=0)),od(e)}function Xu(e,t){t===0&&(t=Ye()),e=Zr(e,t),e!==null&&(Ze(e,t),od(e))}function Zu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Xu(e,n)}function Qu(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),Xu(e,n)}function $u(e,t){return Ce(e,t)}var ed=null,td=null,nd=!1,rd=!1,id=!1,ad=0;function od(e){e!==td&&e.next===null&&(td===null?ed=td=e:td=td.next=e),rd=!0,nd||(nd=!0,pd())}function sd(e,t){if(!id&&rd){id=!0;do for(var n=!1,r=ed;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-Re(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,fd(r,a))}else a=J,a=Ke(r,r===Rl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||qe(r,a)||(n=!0,fd(r,a));r=r.next}while(n);id=!1}}function cd(){ld()}function ld(){rd=nd=!1;var e=0;ad!==0&&Xd()&&(e=ad);for(var t=De(),n=null,r=ed;r!==null;){var i=r.next,a=ud(r,t);a===0?(r.next=null,n===null?ed=i:n.next=i,i===null&&(td=n)):(n=r,(e!==0||a&3)&&(rd=!0)),r=i}ou!==0&&ou!==5||sd(e,!1),ad!==0&&(ad=0)}function ud(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Re(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Je(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Rl,n=J,n=Ke(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Bl===2||Bl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&we(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||qe(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&we(r),rt(n)){case 2:case 8:n=Ae;break;case 32:n=je;break;case 268435456:n=Ne;break;default:n=je}return r=dd.bind(null,e),n=Ce(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&we(r),e.callbackPriority=2,e.callbackNode=null,2}function dd(e,t){if(ou!==0&&ou!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Wu()&&e.callbackNode!==n)return null;var r=J;return r=Ke(e,e===Rl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(vu(e,r,t),ud(e,De()),e.callbackNode!=null&&e.callbackNode===n?dd.bind(null,e):null)}function fd(e,t){if(Wu())return null;vu(e,t,!0)}function pd(){ef(function(){Ll&6?Ce(ke,cd):ld()})}function md(){if(ad===0){var e=oa;e===0&&(e=He,He<<=1,!(He&261888)&&(He=256)),ad=e}return ad}function hd(e){return e==null||typeof e==\`symbol\`||typeof e==\`boolean\`?null:typeof e==\`function\`?e:Qt(\`\`+e)}function gd(e,t){var n=t.ownerDocument.createElement(\`input\`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(\`form\`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function _d(e,t,n,r,i){if(t===\`submit\`&&n&&n.stateNode===i){var a=hd((i[ct]||null).action),o=r.submitter;o&&(t=(t=o[ct]||null)?hd(t.formAction):o.getAttribute(\`formAction\`),t!==null&&(a=t,o=null));var s=new vn(\`action\`,\`action\`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(ad!==0){var e=o?gd(i,o):new FormData(i);bs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==\`function\`&&(s.preventDefault(),e=o?gd(i,o):new FormData(i),bs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var vd=0;vd<Hr.length;vd++){var yd=Hr[vd];Ur(yd.toLowerCase(),\`on\`+(yd[0].toUpperCase()+yd.slice(1)))}Ur(Pr,\`onAnimationEnd\`),Ur(Fr,\`onAnimationIteration\`),Ur(Ir,\`onAnimationStart\`),Ur(\`dblclick\`,\`onDoubleClick\`),Ur(\`focusin\`,\`onFocus\`),Ur(\`focusout\`,\`onBlur\`),Ur(Lr,\`onTransitionRun\`),Ur(Rr,\`onTransitionStart\`),Ur(zr,\`onTransitionCancel\`),Ur(Br,\`onTransitionEnd\`),wt(\`onMouseEnter\`,[\`mouseout\`,\`mouseover\`]),wt(\`onMouseLeave\`,[\`mouseout\`,\`mouseover\`]),wt(\`onPointerEnter\`,[\`pointerout\`,\`pointerover\`]),wt(\`onPointerLeave\`,[\`pointerout\`,\`pointerover\`]),Ct(\`onChange\`,\`change click focusin focusout input keydown keyup selectionchange\`.split(\` \`)),Ct(\`onSelect\`,\`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange\`.split(\` \`)),Ct(\`onBeforeInput\`,[\`compositionend\`,\`keypress\`,\`textInput\`,\`paste\`]),Ct(\`onCompositionEnd\`,\`compositionend focusout keydown keypress keyup mousedown\`.split(\` \`)),Ct(\`onCompositionStart\`,\`compositionstart focusout keydown keypress keyup mousedown\`.split(\` \`)),Ct(\`onCompositionUpdate\`,\`compositionupdate focusout keydown keypress keyup mousedown\`.split(\` \`));var bd=\`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(\` \`),xd=new Set(\`beforetoggle cancel close invalid load scroll scrollend toggle\`.split(\` \`).concat(bd));function Sd(e,t){t=(t&4)!=0;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){Wr(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){Wr(e)}i.currentTarget=null,a=c}}}}function Cd(e,t){var n=t[ut];n===void 0&&(n=t[ut]=new Set);var r=e+\`__bubble\`;n.has(r)||(Dd(t,e,2,!1),n.add(r))}function wd(e,t,n){var r=0;t&&(r|=4),Dd(n,e,r,t)}var Td=\`_reactListening\`+Math.random().toString(36).slice(2);function Ed(e){if(!e[Td]){e[Td]=!0,xt.forEach(function(t){t!==\`selectionchange\`&&(xd.has(t)||wd(t,!1,e),wd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Td]||(t[Td]=!0,wd(\`selectionchange\`,!1,t))}}function Dd(e,t,n,r){switch(_p(t)){case 2:var i=dp;break;case 8:i=fp;break;default:i=pp}n=i.bind(null,t,n,e),i=void 0,!sn||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 Od(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=gt(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}rn(function(){var r=a,i=V(n),s=[];a:{var c=Vr.get(e);if(c!==void 0){var l=vn,u=e;switch(e){case\`keypress\`:if(pn(n)===0)break a;case\`keydown\`:case\`keyup\`:l=In;break;case\`focusin\`:u=\`focus\`,l=Dn;break;case\`focusout\`:u=\`blur\`,l=Dn;break;case\`beforeblur\`:case\`afterblur\`:l=Dn;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=Tn;break;case\`drag\`:case\`dragend\`:case\`dragenter\`:case\`dragexit\`:case\`dragleave\`:case\`dragover\`:case\`dragstart\`:case\`drop\`:l=En;break;case\`touchcancel\`:case\`touchend\`:case\`touchmove\`:case\`touchstart\`:l=Rn;break;case Pr:case Fr:case Ir:l=On;break;case Br:l=zn;break;case\`scroll\`:case\`scrollend\`:l=bn;break;case\`wheel\`:l=Bn;break;case\`copy\`:case\`cut\`:case\`paste\`:l=kn;break;case\`gotpointercapture\`:case\`lostpointercapture\`:case\`pointercancel\`:case\`pointerdown\`:case\`pointermove\`:case\`pointerout\`:case\`pointerover\`:case\`pointerup\`:l=Ln;break;case\`toggle\`:case\`beforetoggle\`:l=Vn}var d=(t&4)!=0,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=an(m,p),g!=null&&d.push(kd(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(c=e===\`mouseover\`||e===\`pointerover\`,l=e===\`mouseout\`||e===\`pointerout\`,c&&n!==B&&(u=n.relatedTarget||n.fromElement)&&(gt(u)||u[lt]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?gt(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=Tn,g=\`onMouseLeave\`,p=\`onMouseEnter\`,m=\`mouse\`,(e===\`pointerout\`||e===\`pointerover\`)&&(d=Ln,g=\`onPointerLeave\`,p=\`onPointerEnter\`,m=\`pointer\`),f=l==null?c:vt(l),h=u==null?c:vt(u),c=new d(g,m+\`leave\`,l,n,i),c.target=f,c.relatedTarget=h,g=null,gt(i)===r&&(d=new d(p,m+\`enter\`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=jd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Md(s,c,l,d,!1),u!==null&&f!==null&&Md(s,f,u,d,!0)}}a:{if(c=r?vt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===\`select\`||l===\`input\`&&c.type===\`file\`)var v=ar;else if(er(c))if(or)v=hr;else{v=pr;var y=fr}else l=c.nodeName,!l||l.toLowerCase()!==\`input\`||c.type!==\`checkbox\`&&c.type!==\`radio\`?r&&Yt(r.elementType)&&(v=ar):v=mr;if(v&&=v(e,r)){tr(s,v,n,i);break a}y&&y(e,c,r),e===\`focusout\`&&r&&c.type===\`number\`&&r.memoizedProps.value!=null&&Ht(c,\`number\`,c.value)}switch(y=r?vt(r):window,e){case\`focusin\`:(er(y)||y.contentEditable===\`true\`)&&(Tr=y,Er=r,Dr=null);break;case\`focusout\`:Dr=Er=Tr=null;break;case\`mousedown\`:Or=!0;break;case\`contextmenu\`:case\`mouseup\`:case\`dragend\`:Or=!1,kr(s,n,i);break;case\`selectionchange\`:if(wr)break;case\`keydown\`:case\`keyup\`:kr(s,n,i)}var b;if(Un)b:{switch(e){case\`compositionstart\`:var x=\`onCompositionStart\`;break b;case\`compositionend\`:x=\`onCompositionEnd\`;break b;case\`compositionupdate\`:x=\`onCompositionUpdate\`;break b}x=void 0}else H?Yn(e,n)&&(x=\`onCompositionEnd\`):e===\`keydown\`&&n.keyCode===229&&(x=\`onCompositionStart\`);x&&(Kn&&n.locale!==\`ko\`&&(H||x!==\`onCompositionStart\`?x===\`onCompositionEnd\`&&H&&(b=fn()):(ln=i,un=\`value\`in ln?ln.value:ln.textContent,H=!0)),y=Ad(r,x),0<y.length&&(x=new An(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=Xn(n),b!==null&&(x.data=b)))),(b=Gn?Zn(e,n):Qn(e,n))&&(x=Ad(r,\`onBeforeInput\`),0<x.length&&(y=new An(\`onBeforeInput\`,\`beforeinput\`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),_d(s,e,r,n,i)}Sd(s,t)})}function kd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ad(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=an(e,n),i!=null&&r.unshift(kd(e,i,a)),i=an(e,t),i!=null&&r.push(kd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function jd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Md(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=an(n,a),l!=null&&o.unshift(kd(n,l,c))):i||(l=an(n,a),l!=null&&o.push(kd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Nd=/\\r\\n?/g,Pd=/\\u0000|\\uFFFD/g;function Fd(e){return(typeof e==\`string\`?e:\`\`+e).replace(Nd,\`
|
|
30
|
+
\`).replace(Pd,\`\`)}function Id(e,t){return t=Fd(t),Fd(e)===t}function Ld(e,t,n,r,a,o){switch(n){case\`children\`:typeof r==\`string\`?t===\`body\`||t===\`textarea\`&&r===\`\`||Kt(e,r):(typeof r==\`number\`||typeof r==\`bigint\`)&&t!==\`body\`&&Kt(e,\`\`+r);break;case\`className\`:At(e,\`class\`,r);break;case\`tabIndex\`:At(e,\`tabindex\`,r);break;case\`dir\`:case\`role\`:case\`viewBox\`:case\`width\`:case\`height\`:At(e,n,r);break;case\`style\`:R(e,r,o);break;case\`data\`:if(t!==\`object\`){At(e,\`data\`,r);break}case\`src\`:case\`href\`:if(r===\`\`&&(t!==\`a\`||n!==\`href\`)){e.removeAttribute(n);break}if(r==null||typeof r==\`function\`||typeof r==\`symbol\`||typeof r==\`boolean\`){e.removeAttribute(n);break}r=Qt(\`\`+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}else typeof o==\`function\`&&(n===\`formAction\`?(t!==\`input\`&&Ld(e,t,\`name\`,a.name,a,null),Ld(e,t,\`formEncType\`,a.formEncType,a,null),Ld(e,t,\`formMethod\`,a.formMethod,a,null),Ld(e,t,\`formTarget\`,a.formTarget,a,null)):(Ld(e,t,\`encType\`,a.encType,a,null),Ld(e,t,\`method\`,a.method,a,null),Ld(e,t,\`target\`,a.target,a,null)));if(r==null||typeof r==\`symbol\`||typeof r==\`boolean\`){e.removeAttribute(n);break}r=Qt(\`\`+r),e.setAttribute(n,r);break;case\`onClick\`:r!=null&&(e.onclick=z);break;case\`onScroll\`:r!=null&&Cd(\`scroll\`,e);break;case\`onScrollEnd\`:r!=null&&Cd(\`scrollend\`,e);break;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));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=Qt(\`\`+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\`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\`:Cd(\`beforetoggle\`,e),Cd(\`toggle\`,e),kt(e,\`popover\`,r);break;case\`xlinkActuate\`:jt(e,\`http://www.w3.org/1999/xlink\`,\`xlink:actuate\`,r);break;case\`xlinkArcrole\`:jt(e,\`http://www.w3.org/1999/xlink\`,\`xlink:arcrole\`,r);break;case\`xlinkRole\`:jt(e,\`http://www.w3.org/1999/xlink\`,\`xlink:role\`,r);break;case\`xlinkShow\`:jt(e,\`http://www.w3.org/1999/xlink\`,\`xlink:show\`,r);break;case\`xlinkTitle\`:jt(e,\`http://www.w3.org/1999/xlink\`,\`xlink:title\`,r);break;case\`xlinkType\`:jt(e,\`http://www.w3.org/1999/xlink\`,\`xlink:type\`,r);break;case\`xmlBase\`:jt(e,\`http://www.w3.org/XML/1998/namespace\`,\`xml:base\`,r);break;case\`xmlLang\`:jt(e,\`http://www.w3.org/XML/1998/namespace\`,\`xml:lang\`,r);break;case\`xmlSpace\`:jt(e,\`http://www.w3.org/XML/1998/namespace\`,\`xml:space\`,r);break;case\`is\`:kt(e,\`is\`,r);break;case\`innerText\`:case\`textContent\`:break;default:(!(2<n.length)||n[0]!==\`o\`&&n[0]!==\`O\`||n[1]!==\`n\`&&n[1]!==\`N\`)&&(n=Xt.get(n)||n,kt(e,n,r))}}function Rd(e,t,n,r,a,o){switch(n){case\`style\`:R(e,r,o);break;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));e.innerHTML=n}}break;case\`children\`:typeof r==\`string\`?Kt(e,r):(typeof r==\`number\`||typeof r==\`bigint\`)&&Kt(e,\`\`+r);break;case\`onScroll\`:r!=null&&Cd(\`scroll\`,e);break;case\`onScrollEnd\`:r!=null&&Cd(\`scrollend\`,e);break;case\`onClick\`:r!=null&&(e.onclick=z);break;case\`suppressContentEditableWarning\`:case\`suppressHydrationWarning\`:case\`innerHTML\`:case\`ref\`:break;case\`innerText\`:case\`textContent\`:break;default:if(!St.hasOwnProperty(n))a:{if(n[0]===\`o\`&&n[1]===\`n\`&&(a=n.endsWith(\`Capture\`),t=n.slice(2,a?n.length-7:void 0),o=e[ct]||null,o=o==null?null:o[n],typeof o==\`function\`&&e.removeEventListener(t,o,a),typeof r==\`function\`)){typeof o!=\`function\`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,\`\`):kt(e,n,r)}}}function zd(e,t,n){switch(t){case\`div\`:case\`span\`:case\`svg\`:case\`path\`:case\`a\`:case\`g\`:case\`p\`:case\`li\`:break;case\`img\`:Cd(\`error\`,e),Cd(\`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:Ld(e,t,o,s,n,null)}}a&&Ld(e,t,\`srcSet\`,n.srcSet,n,null),r&&Ld(e,t,\`src\`,n.src,n,null);return;case\`input\`:Cd(\`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:Ld(e,t,r,d,n,null)}}Vt(e,o,c,l,u,s,a,!1);return;case\`select\`:for(a in Cd(\`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:Ld(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Ut(e,!!r,n,!0):Ut(e,!!r,t,!1);return;case\`textarea\`:for(s in Cd(\`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:Ld(e,t,s,c,n,null)}Gt(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:Ld(e,t,l,r,n,null)}return;case\`dialog\`:Cd(\`beforetoggle\`,e),Cd(\`toggle\`,e),Cd(\`cancel\`,e),Cd(\`close\`,e);break;case\`iframe\`:case\`object\`:Cd(\`load\`,e);break;case\`video\`:case\`audio\`:for(r=0;r<bd.length;r++)Cd(bd[r],e);break;case\`image\`:Cd(\`error\`,e),Cd(\`load\`,e);break;case\`details\`:Cd(\`toggle\`,e);break;case\`embed\`:case\`source\`:case\`link\`:Cd(\`error\`,e),Cd(\`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:Ld(e,t,u,r,n,null)}return;default:if(Yt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Rd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Ld(e,t,c,r,n,null))}function Bd(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)||Ld(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\`:o=m;break;case\`name\`:a=m;break;case\`checked\`:u=m;break;case\`defaultChecked\`:d=m;break;case\`value\`:s=m;break;case\`defaultValue\`:c=m;break;case\`children\`:case\`dangerouslySetInnerHTML\`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Ld(e,t,p,m,r,f)}}Bt(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)||Ld(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\`:p=o;break;case\`defaultValue\`:c=o;break;case\`multiple\`:s=o;default:o!==l&&Ld(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Ut(e,!!n,n?[]:\`\`,!1):Ut(e,!!n,t,!0)):Ut(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:Ld(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\`:p=a;break;case\`defaultValue\`:m=a;break;case\`children\`:break;case\`dangerouslySetInnerHTML\`:if(a!=null)throw Error(i(91));break;default:a!==o&&Ld(e,t,s,a,r,o)}Wt(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:Ld(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\`:e.selected=p&&typeof p!=\`function\`&&typeof p!=\`symbol\`;break;default:Ld(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)&&Ld(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:Ld(e,t,u,p,r,m)}return;default:if(Yt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Rd(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||Rd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Ld(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||Ld(e,t,f,p,r,m)}function Vd(e){switch(e){case\`css\`:case\`script\`:case\`font\`:case\`img\`:case\`image\`:case\`input\`:case\`link\`:return!0;default:return!1}}function Hd(){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&&Vd(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&&Vd(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 Ud=null,Wd=null;function Gd(e){return e.nodeType===9?e:e.ownerDocument}function Kd(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 qd(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 Jd(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 Yd=null;function Xd(){var e=window.event;return e&&e.type===\`popstate\`?e===Yd?!1:(Yd=e,!0):(Yd=null,!1)}var Zd=typeof setTimeout==\`function\`?setTimeout:void 0,Qd=typeof clearTimeout==\`function\`?clearTimeout:void 0,$d=typeof Promise==\`function\`?Promise:void 0,ef=typeof queueMicrotask==\`function\`?queueMicrotask:$d===void 0?Zd:function(e){return $d.resolve(null).then(e).catch(tf)};function tf(e){setTimeout(function(){throw e})}function nf(e){return e===\`head\`}function rf(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),Ip(t);return}r--}else if(n===\`$\`||n===\`$?\`||n===\`$~\`||n===\`$!\`||n===\`&\`)r++;else if(n===\`html\`)gf(e.ownerDocument.documentElement);else if(n===\`head\`){n=e.ownerDocument.head,gf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[mt]||s===\`SCRIPT\`||s===\`STYLE\`||s===\`LINK\`&&a.rel.toLowerCase()===\`stylesheet\`||n.removeChild(a),a=o}}else n===\`body\`&&gf(e.ownerDocument.body);n=i}while(n);Ip(t)}function af(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 of(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\`:of(n),ht(n);continue;case\`SCRIPT\`:case\`STYLE\`:continue;case\`LINK\`:if(n.rel.toLowerCase()===\`stylesheet\`)continue}e.removeChild(n)}}function sf(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[mt])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=df(e.nextSibling),e===null)break}return null}function cf(e,t,n){if(t===\`\`)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==\`INPUT\`||e.type!==\`hidden\`)&&!n||(e=df(e.nextSibling),e===null))return null;return e}function lf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==\`INPUT\`||e.type!==\`hidden\`)&&!t||(e=df(e.nextSibling),e===null))return null;return e}function Y(e){return e.data===\`$?\`||e.data===\`$~\`}function uf(e){return e.data===\`$!\`||e.data===\`$?\`&&e.ownerDocument.readyState!==\`loading\`}function X(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 df(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 ff=null;function pf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===\`/$\`||n===\`/&\`){if(t===0)return df(e.nextSibling);t--}else n!==\`$\`&&n!==\`$!\`&&n!==\`$?\`&&n!==\`$~\`&&n!==\`&\`||t++}e=e.nextSibling}return null}function mf(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 hf(e,t,n){switch(t=Gd(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 gf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ht(e)}var _f=new Map,vf=new Set;function yf(e){return typeof e.getRootNode==\`function\`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var bf=F.d;F.d={f:xf,r:Sf,D:Tf,C:Ef,L:Df,m:Of,X:Af,S:kf,M:jf};function xf(){var e=bf.f(),t=Su();return e||t}function Sf(e){var t=_t(e);t!==null&&t.tag===5&&t.type===\`form\`?Ss(t):bf.r(e)}var Cf=typeof document>\`u\`?null:document;function wf(e,t,n){var r=Cf;if(r&&typeof t==\`string\`&&t){var i=zt(t);i=\`link[rel="\`+e+\`"][href="\`+i+\`"]\`,typeof n==\`string\`&&(i+=\`[crossorigin="\`+n+\`"]\`),vf.has(i)||(vf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(\`link\`),zd(t,\`link\`,e),bt(t),r.head.appendChild(t)))}}function Tf(e){bf.D(e),wf(\`dns-prefetch\`,e,null)}function Ef(e,t){bf.C(e,t),wf(\`preconnect\`,e,t)}function Df(e,t,n){bf.L(e,t,n);var r=Cf;if(r&&e&&t){var i=\`link[rel="preload"][as="\`+zt(t)+\`"]\`;t===\`image\`&&n&&n.imageSrcSet?(i+=\`[imagesrcset="\`+zt(n.imageSrcSet)+\`"]\`,typeof n.imageSizes==\`string\`&&(i+=\`[imagesizes="\`+zt(n.imageSizes)+\`"]\`)):i+=\`[href="\`+zt(e)+\`"]\`;var a=i;switch(t){case\`style\`:a=Nf(e);break;case\`script\`:a=Lf(e)}_f.has(a)||(e=h({rel:\`preload\`,href:t===\`image\`&&n&&n.imageSrcSet?void 0:e,as:t},n),_f.set(a,e),r.querySelector(i)!==null||t===\`style\`&&r.querySelector(Pf(a))||t===\`script\`&&r.querySelector(Rf(a))||(t=r.createElement(\`link\`),zd(t,\`link\`,e),bt(t),r.head.appendChild(t)))}}function Of(e,t){bf.m(e,t);var n=Cf;if(n&&e){var r=t&&typeof t.as==\`string\`?t.as:\`script\`,i=\`link[rel="modulepreload"][as="\`+zt(r)+\`"][href="\`+zt(e)+\`"]\`,a=i;switch(r){case\`audioworklet\`:case\`paintworklet\`:case\`serviceworker\`:case\`sharedworker\`:case\`worker\`:case\`script\`:a=Lf(e)}if(!_f.has(a)&&(e=h({rel:\`modulepreload\`,href:e},t),_f.set(a,e),n.querySelector(i)===null)){switch(r){case\`audioworklet\`:case\`paintworklet\`:case\`serviceworker\`:case\`sharedworker\`:case\`worker\`:case\`script\`:if(n.querySelector(Rf(a)))return}r=n.createElement(\`link\`),zd(r,\`link\`,e),bt(r),n.head.appendChild(r)}}}function kf(e,t,n){bf.S(e,t,n);var r=Cf;if(r&&e){var i=yt(r).hoistableStyles,a=Nf(e);t||=\`default\`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Pf(a)))s.loading=5;else{e=h({rel:\`stylesheet\`,href:e,"data-precedence":t},n),(n=_f.get(a))&&Vf(e,n);var c=o=r.createElement(\`link\`);bt(c),zd(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,Bf(o,t,r)}o={type:\`stylesheet\`,instance:o,count:1,state:s},i.set(a,o)}}}function Af(e,t){bf.X(e,t);var n=Cf;if(n&&e){var r=yt(n).hoistableScripts,i=Lf(e),a=r.get(i);a||(a=n.querySelector(Rf(i)),a||(e=h({src:e,async:!0},t),(t=_f.get(i))&&Hf(e,t),a=n.createElement(\`script\`),bt(a),zd(a,\`link\`,e),n.head.appendChild(a)),a={type:\`script\`,instance:a,count:1,state:null},r.set(i,a))}}function jf(e,t){bf.M(e,t);var n=Cf;if(n&&e){var r=yt(n).hoistableScripts,i=Lf(e),a=r.get(i);a||(a=n.querySelector(Rf(i)),a||(e=h({src:e,async:!0,type:\`module\`},t),(t=_f.get(i))&&Hf(e,t),a=n.createElement(\`script\`),bt(a),zd(a,\`link\`,e),n.head.appendChild(a)),a={type:\`script\`,instance:a,count:1,state:null},r.set(i,a))}}function Mf(e,t,n,r){var a=(a=le.current)?yf(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\`?(t=Nf(n.href),n=yt(a).hoistableStyles,r=n.get(t),r||(r={type:\`style\`,instance:null,count:0,state:null},n.set(t,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=Nf(n.href);var o=yt(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(Pf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),_f.has(e)||(n={rel:\`preload\`,as:\`style\`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},_f.set(e,n),o||If(a,e,n,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\`?(t=Lf(n),n=yt(a).hoistableScripts,r=n.get(t),r||(r={type:\`script\`,instance:null,count:0,state:null},n.set(t,r)),r):{type:\`void\`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Nf(e){return\`href="\`+zt(e)+\`"\`}function Pf(e){return\`link[rel="stylesheet"][\`+e+\`]\`}function Ff(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function If(e,t,n,r){e.querySelector(\`link[rel="preload"][as="style"][\`+t+\`]\`)?r.loading=1:(t=e.createElement(\`link\`),r.preload=t,t.addEventListener(\`load\`,function(){return r.loading|=1}),t.addEventListener(\`error\`,function(){return r.loading|=2}),zd(t,\`link\`,n),bt(t),e.head.appendChild(t))}function Lf(e){return\`[src="\`+zt(e)+\`"]\`}function Rf(e){return\`script[async]\`+e}function zf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case\`style\`:var r=e.querySelector(\`style[data-href~="\`+zt(n.href)+\`"]\`);if(r)return t.instance=r,bt(r),r;var a=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(\`style\`),bt(r),zd(r,\`style\`,a),Bf(r,n.precedence,e),t.instance=r;case\`stylesheet\`:a=Nf(n.href);var o=e.querySelector(Pf(a));if(o)return t.state.loading|=4,t.instance=o,bt(o),o;r=Ff(n),(a=_f.get(a))&&Vf(r,a),o=(e.ownerDocument||e).createElement(\`link\`),bt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),zd(o,\`link\`,r),t.state.loading|=4,Bf(o,n.precedence,e),t.instance=o;case\`script\`:return o=Lf(n.src),(a=e.querySelector(Rf(o)))?(t.instance=a,bt(a),a):(r=n,(a=_f.get(o))&&(r=h({},n),Hf(r,a)),e=e.ownerDocument||e,a=e.createElement(\`script\`),bt(a),zd(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,Bf(r,n.precedence,e));return t.instance}function Bf(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 Vf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Hf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Uf=null;function Wf(e,t,n){if(Uf===null){var r=new Map,i=Uf=new Map;i.set(n,r)}else i=Uf,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[mt]||a[st]||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 Gf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===\`title\`?e.querySelector(\`head > title\`):null)}function Kf(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 qf(e){return!(e.type===\`stylesheet\`&&!(e.state.loading&3))}function Jf(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=Nf(r.href),a=t.querySelector(Pf(i));if(a){t=a._p,typeof t==\`object\`&&t&&typeof t.then==\`function\`&&(e.count++,e=Zf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,bt(a);return}a=t.ownerDocument||t,r=Ff(r),(i=_f.get(i))&&Vf(r,i),a=a.createElement(\`link\`),bt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),zd(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=Zf.bind(e),t.addEventListener(\`load\`,n),t.addEventListener(\`error\`,n))}}var Yf=0;function Xf(e,t){return e.stylesheets&&e.count===0&&$f(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&$f(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Yf===0&&(Yf=62500*Hd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&$f(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Yf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Zf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)$f(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Qf=null;function $f(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Qf=new Map,t.forEach(ep,e),Qf=null,Zf.call(e))}function ep(e,t){if(!(t.state.loading&4)){var n=Qf.get(e);if(n)var r=n.get(null);else{n=new Map,Qf.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=Zf.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 tp={$$typeof:C,Provider:null,Consumer:null,_currentValue:ne,_currentValue2:ne,_threadCount:0};function np(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=Xe(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xe(0),this.hiddenUpdates=Xe(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function rp(e,t,n,r,i,a,o,s,c,l,u,d){return e=new np(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ni(3,null,null,t),e.current=a,a.stateNode=e,t=na(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Fa(a),e}function ip(e){return e?(e=ei,e):ei}function ap(e,t,n,r,i,a){i=ip(i),r.context===null?r.context=i:r.pendingContext=i,r=La(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ra(e,r,t),n!==null&&(_u(n,e,t),za(n,e,t))}function op(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function sp(e,t){op(e,t),(e=e.alternate)&&op(e,t)}function cp(e){if(e.tag===13||e.tag===31){var t=Zr(e,67108864);t!==null&&_u(t,e,67108864),sp(e,67108864)}}function lp(e){if(e.tag===13||e.tag===31){var t=hu();t=nt(t);var n=Zr(e,t);n!==null&&_u(n,e,t),sp(e,t)}}var up=!0;function dp(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=2,pp(e,t,n,r)}finally{F.p=a,P.T=i}}function fp(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=8,pp(e,t,n,r)}finally{F.p=a,P.T=i}}function pp(e,t,n,r){if(up){var i=mp(r);if(i===null)Od(e,t,r,hp,n),Ep(e,r);else if(Op(i,e,t,n,r))r.stopPropagation();else if(Ep(e,r),t&4&&-1<Tp.indexOf(e)){for(;i!==null;){var a=_t(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ge(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Re(o);s.entanglements[1]|=c,o&=~c}od(a),!(Ll&6)&&(ru=De()+500,sd(0,!1))}}break;case 31:case 13:s=Zr(a,2),s!==null&&_u(s,a,2),Su(),sp(a,2)}if(a=mp(r),a===null&&Od(e,t,r,hp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Od(e,t,r,null,n)}}function mp(e){return e=V(e),gp(e)}var hp=null;function gp(e){if(hp=null,e=gt(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 hp=e,null}function _p(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\`resize\`: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\`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\`scroll\`:case\`touchmove\`:case\`wheel\`:case\`mouseenter\`:case\`mouseleave\`:case\`pointerenter\`:case\`pointerleave\`:return 8;case\`message\`:switch(Oe()){case ke:return 2;case Ae:return 8;case je:case Me:return 32;case Ne:return 268435456;default:return 32}default:return 32}}var vp=!1,yp=null,bp=null,xp=null,Sp=new Map,Cp=new Map,wp=[],Tp=\`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 Ep(e,t){switch(e){case\`focusin\`:case\`focusout\`:yp=null;break;case\`dragenter\`:case\`dragleave\`:bp=null;break;case\`mouseover\`:case\`mouseout\`:xp=null;break;case\`pointerover\`:case\`pointerout\`:Sp.delete(t.pointerId);break;case\`gotpointercapture\`:case\`lostpointercapture\`:Cp.delete(t.pointerId)}}function Dp(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=_t(t),t!==null&&cp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Op(e,t,n,r,i){switch(t){case\`focusin\`:return yp=Dp(yp,e,t,n,r,i),!0;case\`dragenter\`:return bp=Dp(bp,e,t,n,r,i),!0;case\`mouseover\`:return xp=Dp(xp,e,t,n,r,i),!0;case\`pointerover\`:var a=i.pointerId;return Sp.set(a,Dp(Sp.get(a)||null,e,t,n,r,i)),!0;case\`gotpointercapture\`:return a=i.pointerId,Cp.set(a,Dp(Cp.get(a)||null,e,t,n,r,i)),!0}return!1}function kp(e){var t=gt(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,at(e.priority,function(){lp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,at(e.priority,function(){lp(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 Ap(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=mp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);B=r,n.target.dispatchEvent(r),B=null}else return t=_t(n),t!==null&&cp(t),e.blockedOn=n,!1;t.shift()}return!0}function jp(e,t,n){Ap(e)&&n.delete(t)}function Mp(){vp=!1,yp!==null&&Ap(yp)&&(yp=null),bp!==null&&Ap(bp)&&(bp=null),xp!==null&&Ap(xp)&&(xp=null),Sp.forEach(jp),Cp.forEach(jp)}function Np(e,n){e.blockedOn===n&&(e.blockedOn=null,vp||(vp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Mp)))}var Pp=null;function Fp(e){Pp!==e&&(Pp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Pp===e&&(Pp=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(gp(r||n)===null)continue;break}var a=_t(n);a!==null&&(e.splice(t,3),t-=3,bs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Ip(e){function t(t){return Np(t,e)}yp!==null&&Np(yp,e),bp!==null&&Np(bp,e),xp!==null&&Np(xp,e),Sp.forEach(t),Cp.forEach(t);for(var n=0;n<wp.length;n++){var r=wp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<wp.length&&(n=wp[0],n.blockedOn===null);)kp(n),n.blockedOn===null&&wp.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[ct]||null;if(typeof a==\`function\`)o||Fp(n);else if(o){var s=null;if(a&&a.hasAttribute(\`formAction\`)){if(i=a,o=a[ct]||null)s=o.formAction;else if(gp(i)!==null)continue}else s=o.action;typeof s==\`function\`?n[r+1]=s:(n.splice(r,3),r-=3),Fp(n)}}}function Lp(){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 Rp(e){this._internalRoot=e}zp.prototype.render=Rp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;ap(n,hu(),e,t,null,null)},zp.prototype.unmount=Rp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ap(e.current,2,null,e,null,null),Su(),t[lt]=null}};function zp(e){this._internalRoot=e}zp.prototype.unstable_scheduleHydration=function(e){if(e){var t=it();e={blockedOn:null,target:e,priority:t};for(var n=0;n<wp.length&&t!==0&&t<wp[n].priority;n++);wp.splice(n,0,e),n===0&&kp(e)}};var Bp=n.version;if(Bp!==\`19.2.7\`)throw Error(i(527,Bp,\`19.2.7\`));F.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=d(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var Vp={bundleType:0,version:\`19.2.7\`,rendererPackageName:\`react-dom\`,currentDispatcherRef:P,reconcilerVersion:\`19.2.7\`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<\`u\`){var Hp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Hp.isDisabled&&Hp.supportsFiber)try{Ie=Hp.inject(Vp),Le=Hp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=\`\`,o=Us,s=Ws,c=Gs;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=rp(e,1,!1,null,null,n,r,null,o,s,c,Lp),e[lt]=t.current,Ed(e),new Rp(t)}})),g=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=h()})),_=c(u(),1),v=g(),y=\`tinbase_service_key\`,b=sessionStorage.getItem(y)||\`\`,x=()=>b,S=e=>{b=e,sessionStorage.setItem(y,e)},C=()=>{b=\`\`,sessionStorage.removeItem(y)},w=null,T=e=>{w=e};function E(e={}){return{apikey:b,authorization:\`Bearer \${b}\`,"content-type":\`application/json\`,...e}}function D(e={}){let t=w??b;return{apikey:t,authorization:\`Bearer \${t}\`,"content-type":\`application/json\`,...e}}async function O(e,t={}){return fetch(\`\${e}\`,{...t,headers:{...E(),...t.headers}})}async function k(e,t={},n){let r=(t.method??\`GET\`).toUpperCase(),i=n&&n!==\`public\`?{[r===\`GET\`||r===\`HEAD\`?\`accept-profile\`:\`content-profile\`]:n}:{};return fetch(\`\${e}\`,{...t,headers:{...D(),...i,...t.headers}})}var A=class extends Error{status;constructor(e,t){super(e),this.status=t,this.name=\`ApiError\`}};function j(e){if(!e)return null;try{return JSON.parse(e)}catch{return null}}async function M(e){let t=j(await e.text());if(!e.ok)throw new A(t?.error||t?.message||t?.msg||\`HTTP \${e.status}\`,e.status);return t}var N={ping:()=>O(\`/admin/v1/stats\`).then(M),stats:()=>O(\`/admin/v1/stats\`).then(M),keys:()=>O(\`/admin/v1/keys\`).then(M),impersonate:(e,t)=>{let n=new URLSearchParams({role:e});return t&&(n.set(\`sub\`,t.sub),t.email&&n.set(\`email\`,t.email)),O(\`/admin/v1/impersonate?\${n}\`).then(M)},schemas:()=>O(\`/admin/v1/schemas\`).then(M).then(e=>e.schemas),tables:(e=\`public\`)=>O(\`/admin/v1/tables?schema=\${encodeURIComponent(e)}\`).then(M).then(e=>e.tables),migrations:()=>O(\`/admin/v1/migrations\`).then(M).then(e=>e.migrations),policies:(e=\`public\`)=>O(\`/admin/v1/policies?schema=\${encodeURIComponent(e)}\`).then(M).then(e=>e.policies),createPolicy:e=>O(\`/admin/v1/policies\`,{method:\`POST\`,body:JSON.stringify(e)}).then(M),dropPolicy:(e,t,n=\`public\`)=>O(\`/admin/v1/policies?\${new URLSearchParams({table:e,name:t,schema:n})}\`,{method:\`DELETE\`}).then(M),functions:(e=\`public\`)=>O(\`/admin/v1/functions?schema=\${encodeURIComponent(e)}\`).then(M).then(e=>e.functions),triggers:(e=\`public\`)=>O(\`/admin/v1/triggers?schema=\${encodeURIComponent(e)}\`).then(M).then(e=>e.triggers),logs:()=>O(\`/admin/v1/logs\`).then(M).then(e=>e.logs),clearLogs:()=>O(\`/admin/v1/logs\`,{method:\`DELETE\`}).then(M),sql:(e,t)=>O(\`/admin/v1/sql\`,{method:\`POST\`,body:JSON.stringify({query:e,role:t?.role,claims:t?.claims})}).then(async e=>{let t=j(await e.text())??{error:\`HTTP \${e.status}\`};return{ok:e.ok,...t}}),edgeFunctions:()=>O(\`/admin/v1/edge-functions\`).then(M),putSecrets:e=>O(\`/admin/v1/edge-functions/secrets\`,{method:\`PUT\`,body:JSON.stringify({secrets:e})}).then(M),deleteSecret:e=>O(\`/admin/v1/edge-functions/secrets?name=\${encodeURIComponent(e)}\`,{method:\`DELETE\`}).then(M),authConfig:()=>O(\`/admin/v1/auth-config\`).then(M),updateAuthSettings:e=>O(\`/admin/v1/auth-config\`,{method:\`PATCH\`,body:JSON.stringify(e)}).then(M).then(e=>e.settings),webhooksConfig:()=>O(\`/admin/v1/webhooks\`).then(M).then(e=>e.webhooks),rows:(e,t)=>{let n=new URLSearchParams({select:\`*\`,limit:String(t.limit),offset:String(t.offset)});t.order&&n.set(\`order\`,t.order);for(let[e,r]of t.filters??[])n.append(e,r);return k(\`/rest/v1/\${encodeURIComponent(e)}?\${n}\`,{headers:{prefer:\`count=exact\`}},t.schema).then(async e=>{let t=await M(e),n=e.headers.get(\`content-range\`)||\`\`;return{rows:t,total:parseInt(n.split(\`/\`)[1]||\`0\`,10)}})},insertRow:(e,t,n)=>k(\`/rest/v1/\${encodeURIComponent(e)}\`,{method:\`POST\`,headers:{prefer:\`return=representation\`},body:JSON.stringify(t)},n).then(M),updateRow:(e,t,n,r)=>{let i=new URLSearchParams;for(let[e,n]of Object.entries(t))i.set(e,\`eq.\${n}\`);return k(\`/rest/v1/\${encodeURIComponent(e)}?\${i}\`,{method:\`PATCH\`,headers:{prefer:\`return=representation\`},body:JSON.stringify(n)},r).then(M)},deleteRow:(e,t,n)=>{let r=new URLSearchParams;for(let[e,n]of Object.entries(t))r.set(e,\`eq.\${n}\`);return k(\`/rest/v1/\${encodeURIComponent(e)}?\${r}\`,{method:\`DELETE\`},n).then(M)},deleteRows:(e,t,n,r)=>{let i=n.map(e=>{let t=String(e);return/^-?\\d+(\\.\\d+)?$/.test(t)?t:\`"\${t.replace(/"/g,\`\\\\"\`)}"\`}),a=new URLSearchParams;return a.set(t,\`in.(\${i.join(\`,\`)})\`),k(\`/rest/v1/\${encodeURIComponent(e)}?\${a}\`,{method:\`DELETE\`},r).then(M)},users:()=>O(\`/auth/v1/admin/users\`).then(M).then(e=>e.users),createUser:e=>O(\`/auth/v1/admin/users\`,{method:\`POST\`,body:JSON.stringify({email_confirm:!0,...e})}).then(M),updateUser:(e,t)=>O(\`/auth/v1/admin/users/\${e}\`,{method:\`PUT\`,body:JSON.stringify(t)}).then(M),deleteUser:e=>O(\`/auth/v1/admin/users/\${e}\`,{method:\`DELETE\`}).then(M),sendMagicLink:e=>O(\`/auth/v1/otp\`,{method:\`POST\`,body:JSON.stringify({email:e,create_user:!0})}).then(M),buckets:()=>O(\`/storage/v1/bucket\`).then(M),createBucket:e=>O(\`/storage/v1/bucket\`,{method:\`POST\`,body:JSON.stringify(e)}).then(M),deleteBucket:e=>O(\`/storage/v1/bucket/\${encodeURIComponent(e)}\`,{method:\`DELETE\`}).then(M),listObjects:(e,t=\`\`)=>O(\`/storage/v1/object/list/\${encodeURIComponent(e)}\`,{method:\`POST\`,body:JSON.stringify({prefix:t,limit:100,offset:0,sortBy:{column:\`name\`,order:\`asc\`}})}).then(M),uploadObject:(e,t,n)=>{let r=new FormData;return r.append(\`\`,n),fetch(\`/storage/v1/object/\${encodeURIComponent(e)}/\${t}\`,{method:\`POST\`,headers:{apikey:b,authorization:\`Bearer \${b}\`,"x-upsert":\`true\`},body:r}).then(M)},removeObject:(e,t)=>O(\`/storage/v1/object/\${encodeURIComponent(e)}\`,{method:\`DELETE\`,body:JSON.stringify({prefixes:[t]})}).then(M),removeObjects:(e,t)=>O(\`/storage/v1/object/\${encodeURIComponent(e)}\`,{method:\`DELETE\`,body:JSON.stringify({prefixes:t})}).then(M),signUrl:(e,t,n=3600)=>O(\`/storage/v1/object/sign/\${encodeURIComponent(e)}/\${t}\`,{method:\`POST\`,body:JSON.stringify({expiresIn:n})}).then(M).then(e=>\`/storage/v1\${e.signedURL??e.signedUrl??\`\`}\`),downloadObject:(e,t)=>O(\`/storage/v1/object/\${encodeURIComponent(e)}/\${t}\`).then(async e=>{if(!e.ok)throw Error(\`HTTP \${e.status}\`);return e.blob()})},ee=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==\`\`&&n.indexOf(e)===t).join(\` \`).trim(),te=e=>e.replace(/([a-z0-9])([A-Z])/g,\`$1-$2\`).toLowerCase(),P=e=>e.replace(/^([A-Z])|[\\s-_]+(\\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),F=e=>{let t=P(e);return t.charAt(0).toUpperCase()+t.slice(1)},ne={xmlns:\`http://www.w3.org/2000/svg\`,width:24,height:24,viewBox:\`0 0 24 24\`,fill:\`none\`,stroke:\`currentColor\`,strokeWidth:2,strokeLinecap:\`round\`,strokeLinejoin:\`round\`},re=e=>{for(let t in e)if(t.startsWith(\`aria-\`)||t===\`role\`||t===\`title\`)return!0;return!1},ie=(0,_.createContext)({}),ae=()=>(0,_.useContext)(ie),oe=(0,_.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=\`\`,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=\`currentColor\`,className:p=\`\`}=ae()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,_.createElement)(\`svg\`,{ref:c,...ne,width:t??l??ne.width,height:t??l??ne.height,stroke:e??f,strokeWidth:m,className:ee(\`lucide\`,p,i),...!a&&!re(s)&&{"aria-hidden":\`true\`},...s},[...o.map(([e,t])=>(0,_.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),I=(e,t)=>{let n=(0,_.forwardRef)(({className:n,...r},i)=>(0,_.createElement)(oe,{ref:i,iconNode:t,className:ee(\`lucide-\${te(F(e))}\`,\`lucide-\${e}\`,n),...r}));return n.displayName=F(e),n},se=I(\`activity\`,[[\`path\`,{d:\`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2\`,key:\`169zse\`}]]),ce=I(\`arrow-down-up\`,[[\`path\`,{d:\`m3 16 4 4 4-4\`,key:\`1co6wj\`}],[\`path\`,{d:\`M7 20V4\`,key:\`1yoxec\`}],[\`path\`,{d:\`m21 8-4-4-4 4\`,key:\`1c9v7m\`}],[\`path\`,{d:\`M17 4v16\`,key:\`7dpous\`}]]),le=I(\`arrow-down\`,[[\`path\`,{d:\`M12 5v14\`,key:\`s699le\`}],[\`path\`,{d:\`m19 12-7 7-7-7\`,key:\`1idqje\`}]]),ue=I(\`arrow-right\`,[[\`path\`,{d:\`M5 12h14\`,key:\`1ays0h\`}],[\`path\`,{d:\`m12 5 7 7-7 7\`,key:\`xquz4c\`}]]),de=I(\`arrow-up-right\`,[[\`path\`,{d:\`M7 7h10v10\`,key:\`1tivn9\`}],[\`path\`,{d:\`M7 17 17 7\`,key:\`1vkiza\`}]]),fe=I(\`arrow-up\`,[[\`path\`,{d:\`m5 12 7-7 7 7\`,key:\`hav0vg\`}],[\`path\`,{d:\`M12 19V5\`,key:\`x0mq9r\`}]]),pe=I(\`check\`,[[\`path\`,{d:\`M20 6 9 17l-5-5\`,key:\`1gmf2c\`}]]),me=I(\`chevron-down\`,[[\`path\`,{d:\`m6 9 6 6 6-6\`,key:\`qrunsl\`}]]),he=I(\`chevron-left\`,[[\`path\`,{d:\`m15 18-6-6 6-6\`,key:\`1wnfg3\`}]]),ge=I(\`chevron-right\`,[[\`path\`,{d:\`m9 18 6-6-6-6\`,key:\`mthhwq\`}]]),_e=I(\`circle-alert\`,[[\`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\`}]]),ve=I(\`circle-check\`,[[\`circle\`,{cx:\`12\`,cy:\`12\`,r:\`10\`,key:\`1mglay\`}],[\`path\`,{d:\`m9 12 2 2 4-4\`,key:\`dzmm74\`}]]),ye=I(\`circle-dot\`,[[\`circle\`,{cx:\`12\`,cy:\`12\`,r:\`10\`,key:\`1mglay\`}],[\`circle\`,{cx:\`12\`,cy:\`12\`,r:\`1\`,key:\`41hilf\`}]]),be=I(\`circle\`,[[\`circle\`,{cx:\`12\`,cy:\`12\`,r:\`10\`,key:\`1mglay\`}]]),xe=I(\`clock\`,[[\`circle\`,{cx:\`12\`,cy:\`12\`,r:\`10\`,key:\`1mglay\`}],[\`path\`,{d:\`M12 6v6l4 2\`,key:\`mmk7yg\`}]]),Se=I(\`copy\`,[[\`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\`}]]),Ce=I(\`corner-down-left\`,[[\`path\`,{d:\`M20 4v7a4 4 0 0 1-4 4H4\`,key:\`6o5b7l\`}],[\`path\`,{d:\`m9 10-5 5 5 5\`,key:\`1kshq7\`}]]),we=I(\`database\`,[[\`ellipse\`,{cx:\`12\`,cy:\`5\`,rx:\`9\`,ry:\`3\`,key:\`msslwz\`}],[\`path\`,{d:\`M3 5V19A9 3 0 0 0 21 19V5\`,key:\`1wlel7\`}],[\`path\`,{d:\`M3 12A9 3 0 0 0 21 12\`,key:\`mv7ke4\`}]]),Te=I(\`diamond\`,[[\`path\`,{d:\`M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z\`,key:\`1f1r0c\`}]]),Ee=I(\`download\`,[[\`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\`}]]),De=I(\`ellipsis-vertical\`,[[\`circle\`,{cx:\`12\`,cy:\`12\`,r:\`1\`,key:\`41hilf\`}],[\`circle\`,{cx:\`12\`,cy:\`5\`,r:\`1\`,key:\`gxeob9\`}],[\`circle\`,{cx:\`12\`,cy:\`19\`,r:\`1\`,key:\`lyex9k\`}]]),Oe=I(\`external-link\`,[[\`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\`}]]),ke=I(\`eye-off\`,[[\`path\`,{d:\`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49\`,key:\`ct8e1f\`}],[\`path\`,{d:\`M14.084 14.158a3 3 0 0 1-4.242-4.242\`,key:\`151rxh\`}],[\`path\`,{d:\`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143\`,key:\`13bj9a\`}],[\`path\`,{d:\`m2 2 20 20\`,key:\`1ooewy\`}]]),Ae=I(\`eye\`,[[\`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\`}]]),je=I(\`file-clock\`,[[\`path\`,{d:\`M16 22h2a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v2.85\`,key:\`ryk6xj\`}],[\`path\`,{d:\`M14 2v5a1 1 0 0 0 1 1h5\`,key:\`wfsgrz\`}],[\`path\`,{d:\`M8 14v2.2l1.6 1\`,key:\`6m4bie\`}],[\`circle\`,{cx:\`8\`,cy:\`16\`,r:\`6\`,key:\`10v15b\`}]]),Me=I(\`file-code\`,[[\`path\`,{d:\`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\`,key:\`1oefj6\`}],[\`path\`,{d:\`M14 2v5a1 1 0 0 0 1 1h5\`,key:\`wfsgrz\`}],[\`path\`,{d:\`M10 12.5 8 15l2 2.5\`,key:\`1tg20x\`}],[\`path\`,{d:\`m14 12.5 2 2.5-2 2.5\`,key:\`yinavb\`}]]),Ne=I(\`file\`,[[\`path\`,{d:\`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\`,key:\`1oefj6\`}],[\`path\`,{d:\`M14 2v5a1 1 0 0 0 1 1h5\`,key:\`wfsgrz\`}]]),Pe=I(\`files\`,[[\`path\`,{d:\`M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8\`,key:\`14sh0y\`}],[\`path\`,{d:\`M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z\`,key:\`1970lx\`}],[\`path\`,{d:\`M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1\`,key:\`l4dndm\`}]]),Fe=I(\`folder-plus\`,[[\`path\`,{d:\`M12 10v6\`,key:\`1bos4e\`}],[\`path\`,{d:\`M9 13h6\`,key:\`1uhe8q\`}],[\`path\`,{d:\`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z\`,key:\`1kt360\`}]]),Ie=I(\`folder\`,[[\`path\`,{d:\`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z\`,key:\`1kt360\`}]]),Le=I(\`funnel\`,[[\`path\`,{d:\`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z\`,key:\`sc7q7i\`}]]),L=I(\`gauge\`,[[\`path\`,{d:\`m12 14 4-4\`,key:\`9kzdfg\`}],[\`path\`,{d:\`M3.34 19a10 10 0 1 1 17.32 0\`,key:\`19p75a\`}]]),Re=I(\`git-branch\`,[[\`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\`}]]),ze=I(\`globe\`,[[\`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=I(\`hard-drive\`,[[\`path\`,{d:\`M10 16h.01\`,key:\`1bzywj\`}],[\`path\`,{d:\`M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z\`,key:\`18tbho\`}],[\`path\`,{d:\`M21.946 12.013H2.054\`,key:\`zqlbp7\`}],[\`path\`,{d:\`M6 16h.01\`,key:\`1pmjb7\`}]]),Ve=I(\`heart\`,[[\`path\`,{d:\`M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5\`,key:\`mvr1a0\`}]]),He=I(\`history\`,[[\`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\`}]]),Ue=I(\`house\`,[[\`path\`,{d:\`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8\`,key:\`5wwlr5\`}],[\`path\`,{d:\`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z\`,key:\`r6nss1\`}]]),We=I(\`inbox\`,[[\`polyline\`,{points:\`22 12 16 12 14 15 10 15 8 12 2 12\`,key:\`o97t9d\`}],[\`path\`,{d:\`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z\`,key:\`oot6mr\`}]]),Ge=I(\`info\`,[[\`circle\`,{cx:\`12\`,cy:\`12\`,r:\`10\`,key:\`1mglay\`}],[\`path\`,{d:\`M12 16v-4\`,key:\`1dtifu\`}],[\`path\`,{d:\`M12 8h.01\`,key:\`e9boi3\`}]]),Ke=I(\`key-round\`,[[\`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\`}]]),qe=I(\`layout-grid\`,[[\`rect\`,{width:\`7\`,height:\`7\`,x:\`3\`,y:\`3\`,rx:\`1\`,key:\`1g98yp\`}],[\`rect\`,{width:\`7\`,height:\`7\`,x:\`14\`,y:\`3\`,rx:\`1\`,key:\`6d4xhi\`}],[\`rect\`,{width:\`7\`,height:\`7\`,x:\`14\`,y:\`14\`,rx:\`1\`,key:\`nxv5o0\`}],[\`rect\`,{width:\`7\`,height:\`7\`,x:\`3\`,y:\`14\`,rx:\`1\`,key:\`1bb6yr\`}]]),Je=I(\`lightbulb\`,[[\`path\`,{d:\`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5\`,key:\`1gvzjb\`}],[\`path\`,{d:\`M9 18h6\`,key:\`x1upvd\`}],[\`path\`,{d:\`M10 22h4\`,key:\`ceow96\`}]]),Ye=I(\`link-2\`,[[\`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\`}]]),Xe=I(\`list-filter\`,[[\`path\`,{d:\`M2 5h20\`,key:\`1fs1ex\`}],[\`path\`,{d:\`M6 12h12\`,key:\`8npq4p\`}],[\`path\`,{d:\`M9 19h6\`,key:\`456am0\`}]]),Ze=I(\`lock\`,[[\`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\`}]]),Qe=I(\`lock-open\`,[[\`rect\`,{width:\`18\`,height:\`11\`,x:\`3\`,y:\`11\`,rx:\`2\`,ry:\`2\`,key:\`1w4ew1\`}],[\`path\`,{d:\`M7 11V7a5 5 0 0 1 9.9-1\`,key:\`1mm8w8\`}]]),$e=I(\`log-out\`,[[\`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\`}]]),et=I(\`mail\`,[[\`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\`}]]),tt=I(\`maximize-2\`,[[\`path\`,{d:\`M15 3h6v6\`,key:\`1q9fwt\`}],[\`path\`,{d:\`m21 3-7 7\`,key:\`1l2asr\`}],[\`path\`,{d:\`m3 21 7-7\`,key:\`tjx5ai\`}],[\`path\`,{d:\`M9 21H3v-6\`,key:\`wtvkvv\`}]]),nt=I(\`minus\`,[[\`path\`,{d:\`M5 12h14\`,key:\`1ays0h\`}]]),rt=I(\`package\`,[[\`path\`,{d:\`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z\`,key:\`1a0edw\`}],[\`path\`,{d:\`M12 22V12\`,key:\`d0xqtd\`}],[\`polyline\`,{points:\`3.29 7 12 12 20.71 7\`,key:\`ousv84\`}],[\`path\`,{d:\`m7.5 4.27 9 5.15\`,key:\`1c824w\`}]]),it=I(\`panel-left-close\`,[[\`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\`}]]),at=I(\`panel-left-open\`,[[\`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\`}]]),ot=I(\`panel-right-close\`,[[\`rect\`,{width:\`18\`,height:\`18\`,x:\`3\`,y:\`3\`,rx:\`2\`,key:\`afitv7\`}],[\`path\`,{d:\`M15 3v18\`,key:\`14nvp0\`}],[\`path\`,{d:\`m8 9 3 3-3 3\`,key:\`12hl5m\`}]]),st=I(\`panel-right-open\`,[[\`rect\`,{width:\`18\`,height:\`18\`,x:\`3\`,y:\`3\`,rx:\`2\`,key:\`afitv7\`}],[\`path\`,{d:\`M15 3v18\`,key:\`14nvp0\`}],[\`path\`,{d:\`m10 15-3-3 3-3\`,key:\`1pgupc\`}]]),ct=I(\`pause\`,[[\`rect\`,{x:\`14\`,y:\`3\`,width:\`5\`,height:\`18\`,rx:\`1\`,key:\`kaeet6\`}],[\`rect\`,{x:\`5\`,y:\`3\`,width:\`5\`,height:\`18\`,rx:\`1\`,key:\`1wsw3u\`}]]),lt=I(\`pencil\`,[[\`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\`}]]),ut=I(\`pin\`,[[\`path\`,{d:\`M12 17v5\`,key:\`bb1du9\`}],[\`path\`,{d:\`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z\`,key:\`1nkz8b\`}]]),dt=I(\`pin-off\`,[[\`path\`,{d:\`M12 17v5\`,key:\`bb1du9\`}],[\`path\`,{d:\`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89\`,key:\`znwnzq\`}],[\`path\`,{d:\`m2 2 20 20\`,key:\`1ooewy\`}],[\`path\`,{d:\`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11\`,key:\`c9qhm2\`}]]),ft=I(\`play\`,[[\`path\`,{d:\`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z\`,key:\`10ikf1\`}]]),pt=I(\`plug\`,[[\`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\`}]]),mt=I(\`plus\`,[[\`path\`,{d:\`M5 12h14\`,key:\`1ays0h\`}],[\`path\`,{d:\`M12 5v14\`,key:\`s699le\`}]]),ht=I(\`radio\`,[[\`path\`,{d:\`M16.247 7.761a6 6 0 0 1 0 8.478\`,key:\`1fwjs5\`}],[\`path\`,{d:\`M19.075 4.933a10 10 0 0 1 0 14.134\`,key:\`ehdyv1\`}],[\`path\`,{d:\`M4.925 19.067a10 10 0 0 1 0-14.134\`,key:\`1q22gi\`}],[\`path\`,{d:\`M7.753 16.239a6 6 0 0 1 0-8.478\`,key:\`r2q7qm\`}],[\`circle\`,{cx:\`12\`,cy:\`12\`,r:\`2\`,key:\`1c9p78\`}]]),gt=I(\`refresh-cw\`,[[\`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\`}]]),_t=I(\`scroll-text\`,[[\`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\`}]]),vt=I(\`search\`,[[\`path\`,{d:\`m21 21-4.34-4.34\`,key:\`14j7rj\`}],[\`circle\`,{cx:\`11\`,cy:\`11\`,r:\`8\`,key:\`4ej97u\`}]]),yt=I(\`send\`,[[\`path\`,{d:\`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z\`,key:\`1ffxy3\`}],[\`path\`,{d:\`m21.854 2.147-10.94 10.939\`,key:\`12cjpa\`}]]),bt=I(\`settings\`,[[\`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\`}]]),xt=I(\`shield-alert\`,[[\`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\`}]]),St=I(\`shield-check\`,[[\`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\`}]]),Ct=I(\`shield-off\`,[[\`path\`,{d:\`m2 2 20 20\`,key:\`1ooewy\`}],[\`path\`,{d:\`M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71\`,key:\`1jlk70\`}],[\`path\`,{d:\`M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264\`,key:\`18rp1v\`}]]),wt=I(\`shield-plus\`,[[\`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 12h6\`,key:\`1c52cq\`}],[\`path\`,{d:\`M12 9v6\`,key:\`199k2o\`}]]),Tt=I(\`smartphone\`,[[\`rect\`,{width:\`14\`,height:\`20\`,x:\`5\`,y:\`2\`,rx:\`2\`,ry:\`2\`,key:\`1yt0o3\`}],[\`path\`,{d:\`M12 18h.01\`,key:\`mhygvu\`}]]),Et=I(\`square-function\`,[[\`rect\`,{width:\`18\`,height:\`18\`,x:\`3\`,y:\`3\`,rx:\`2\`,ry:\`2\`,key:\`1m3agn\`}],[\`path\`,{d:\`M9 17c2 0 2.8-1 2.8-2.8V10c0-2 1-3.3 3.2-3\`,key:\`m1af9g\`}],[\`path\`,{d:\`M9 11.2h5.7\`,key:\`3zgcl2\`}]]),Dt=I(\`square\`,[[\`rect\`,{width:\`18\`,height:\`18\`,x:\`3\`,y:\`3\`,rx:\`2\`,key:\`afitv7\`}]]),Ot=I(\`table-2\`,[[\`path\`,{d:\`M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18\`,key:\`gugj83\`}]]),kt=I(\`terminal\`,[[\`path\`,{d:\`M12 19h8\`,key:\`baeox8\`}],[\`path\`,{d:\`m4 17 6-6-6-6\`,key:\`1yngyt\`}]]),At=I(\`trash-2\`,[[\`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\`}]]),jt=I(\`triangle-alert\`,[[\`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\`}]]),Mt=I(\`upload\`,[[\`path\`,{d:\`M12 3v12\`,key:\`1x0j5s\`}],[\`path\`,{d:\`m17 8-5-5-5 5\`,key:\`7q97r8\`}],[\`path\`,{d:\`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\`,key:\`ih7n3h\`}]]),Nt=I(\`user-round\`,[[\`circle\`,{cx:\`12\`,cy:\`8\`,r:\`5\`,key:\`1hypcn\`}],[\`path\`,{d:\`M20 21a8 8 0 0 0-16 0\`,key:\`rfgkzh\`}]]),Pt=I(\`users\`,[[\`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\`}]]),Ft=I(\`wand-sparkles\`,[[\`path\`,{d:\`m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72\`,key:\`ul74o6\`}],[\`path\`,{d:\`m14 7 3 3\`,key:\`1r5n42\`}],[\`path\`,{d:\`M5 6v4\`,key:\`ilb8ba\`}],[\`path\`,{d:\`M19 14v4\`,key:\`blhpug\`}],[\`path\`,{d:\`M10 2v2\`,key:\`7u0qdc\`}],[\`path\`,{d:\`M7 8H3\`,key:\`zfb6yr\`}],[\`path\`,{d:\`M21 16h-4\`,key:\`1cnmox\`}],[\`path\`,{d:\`M11 3H9\`,key:\`1obp7u\`}]]),It=I(\`workflow\`,[[\`rect\`,{width:\`8\`,height:\`8\`,x:\`3\`,y:\`3\`,rx:\`2\`,key:\`by2w9f\`}],[\`path\`,{d:\`M7 11v4a2 2 0 0 0 2 2h4\`,key:\`xkn7yn\`}],[\`rect\`,{width:\`8\`,height:\`8\`,x:\`13\`,y:\`13\`,rx:\`2\`,key:\`1cgmvn\`}]]),Lt=I(\`x\`,[[\`path\`,{d:\`M18 6 6 18\`,key:\`1bl5f8\`}],[\`path\`,{d:\`m6 6 12 12\`,key:\`d8bk6v\`}]]),Rt=I(\`zap\`,[[\`path\`,{d:\`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z\`,key:\`1xq2db\`}]]);function zt(e){if(Array.isArray(e))return e.map(e=>e==null?\`\`:String(e));if(typeof e!=\`string\`)return e==null?[]:[String(e)];let t=e.trim();if(!(t.startsWith(\`{\`)&&t.endsWith(\`}\`)))return t===\`\`?[]:[t];let n=t.slice(1,-1);if(n===\`\`)return[];let r=[],i=\`\`,a=!1;for(let e=0;e<n.length;e++){let t=n[e];a?t===\`\\\\\`?i+=n[++e]??\`\`:t===\`"\`?a=!1:i+=t:t===\`"\`?a=!0:t===\`,\`?(r.push(i),i=\`\`):i+=t}return r.push(i),r.map(e=>e===\`NULL\`?\`\`:e)}var Bt=[{title:null,items:[{id:\`home\`,label:\`Project overview\`,icon:Ue}]},{title:\`Database\`,items:[{id:\`table\`,label:\`Table Editor\`,icon:Ot},{id:\`sql\`,label:\`SQL Editor\`,icon:kt},{id:\`database\`,label:\`Database\`,icon:Re}]},{title:\`Manage\`,items:[{id:\`auth\`,label:\`Authentication\`,icon:Ke},{id:\`storage\`,label:\`Storage\`,icon:Be},{id:\`functions\`,label:\`Edge Functions\`,icon:Rt},{id:\`realtime\`,label:\`Realtime\`,icon:ht}]},{title:\`Automations\`,items:[{id:\`automations\`,label:\`Automations\`,icon:It}]},{title:\`Observe\`,items:[{id:\`logs\`,label:\`Logs\`,icon:_t}]},{title:\`Project\`,items:[{id:\`settings\`,label:\`Project Settings\`,icon:bt}]}];function Vt(){try{return new URL(document.URL).pathname}catch{return window.location.pathname}}var Ht=Vt().startsWith(\`/_\`)?\`/_\`:\`\`,Ut=new Set(Bt.flatMap(e=>e.items.map(e=>e.id)));function Wt(){let e=Vt().slice(Ht.length).split(\`/\`).filter(Boolean);return{tab:Ut.has(e[0])?e[0]:\`home\`,section:e[1]?decodeURIComponent(e[1]):null}}function Gt(e,t){return e===\`home\`?\`\${Ht}/\`:t?\`\${Ht}/\${e}/\${encodeURIComponent(t)}\`:\`\${Ht}/\${e}\`}var Kt=Wt(),qt=new Set;function Jt(){let e=Wt();(e.tab!==Kt.tab||e.section!==Kt.section)&&(Kt=e,qt.forEach(e=>e()))}window.addEventListener(\`popstate\`,Jt);function R(e,t=null,n={}){let r=Gt(e,t);Vt()!==r&&(n.replace?window.history.replaceState(null,\`\`,r):window.history.pushState(null,\`\`,r)),Jt()}function Yt(){return(0,_.useSyncExternalStore)(e=>(qt.add(e),()=>qt.delete(e)),()=>Kt)}function Xt(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=Xt(e[t]))&&(r&&(r+=\` \`),r+=n)}else for(n in e)e[n]&&(r&&(r+=\` \`),r+=n);return r}function Zt(){for(var e,t,n=0,r=\`\`,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Xt(e))&&(r&&(r+=\` \`),r+=t);return r}var Qt=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})),z=o(((e,t)=>{t.exports=Qt()}))();function B({variant:e=\`neutral\`,className:t,children:n}){return(0,z.jsx)(\`span\`,{className:Zt(\`inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[11px] leading-none\`,{neutral:\`bg-accent text-muted-foreground\`,brand:\`bg-brand/15 text-brand\`,amber:\`bg-warning/15 text-warning\`,red:\`bg-destructive/15 text-destructive\`,blue:\`bg-info/15 text-info\`,outline:\`border border-input text-muted-foreground\`}[e],t),children:n})}function V({variant:e=\`default\`,size:t=\`sm\`,className:n,...r}){return(0,z.jsx)(\`button\`,{className:Zt(\`inline-flex shrink-0 items-center justify-center gap-1.5 whitespace-nowrap rounded-md transition-colors disabled:opacity-50 disabled:pointer-events-none\`,{sm:\`h-8 px-3 text-[13px]\`,xs:\`h-6 px-2 text-xs\`,icon:\`size-8\`,iconXs:\`size-6\`}[t],{default:\`bg-primary text-primary-foreground hover:bg-primary/90 font-medium\`,outline:\`border border-input text-foreground hover:bg-accent hover:border-muted-foreground\`,ghost:\`text-foreground/80 hover:bg-accent\`,danger:\`border border-destructive/30 text-destructive hover:bg-destructive/10\`,dangerSolid:\`bg-destructive text-primary-foreground hover:bg-destructive/90 font-medium\`}[e],n),...r})}function $t({checked:e,indeterminate:t,onChange:n,disabled:r,title:i,className:a}){return(0,z.jsx)(\`button\`,{type:\`button\`,role:\`checkbox\`,"aria-checked":t?\`mixed\`:e,disabled:r,title:i,onClick:t=>{t.stopPropagation(),n?.(!e,t)},className:Zt(\`flex size-4 shrink-0 items-center justify-center rounded-[4px] border transition-colors\`,e||t?\`border-brand bg-brand text-primary-foreground\`:\`border-muted-foreground bg-transparent hover:border-foreground\`,r&&\`pointer-events-none opacity-40\`,a),children:t?(0,z.jsx)(nt,{size:11,strokeWidth:3}):e?(0,z.jsx)(pe,{size:11,strokeWidth:3}):null})}var en=o(((e,t)=>{(function(){var e=\`ace\`,t=(function(){return this})();if(!t&&typeof window<\`u\`&&(t=window),!e&&typeof requirejs<\`u\`)return;var n=function(e,t,r){if(typeof e!=\`string\`){n.original?n.original.apply(this,arguments):(console.error(\`dropping module because define wasn't a string.\`),console.trace());return}arguments.length==2&&(r=t),n.modules[e]||(n.payloads[e]=r,n.modules[e]=null)};n.modules={},n.payloads={};var r=function(e,t,n){if(typeof t==\`string\`){var r=o(e,t);if(r!=null)return n&&n(),r}else if(Object.prototype.toString.call(t)===\`[object Array]\`){for(var a=[],s=0,c=t.length;s<c;++s){var l=o(e,t[s]);if(l==null&&i.original)return;a.push(l)}return n&&n.apply(null,a)||!0}},i=function(e,t){var n=r(\`\`,e,t);return n==null&&i.original?i.original.apply(this,arguments):n},a=function(e,t){if(t.indexOf(\`!\`)!==-1){var n=t.split(\`!\`);return a(e,n[0])+\`!\`+a(e,n[1])}if(t.charAt(0)==\`.\`)for(t=e.split(\`/\`).slice(0,-1).join(\`/\`)+\`/\`+t;t.indexOf(\`.\`)!==-1&&r!=t;){var r=t;t=t.replace(/\\/\\.\\//,\`/\`).replace(/[^\\/]+\\/\\.\\.\\//,\`\`)}return t},o=function(e,t){t=a(e,t);var i=n.modules[t];if(!i){if(i=n.payloads[t],typeof i==\`function\`){var o={},s={id:t,uri:\`\`,exports:o,packaged:!0};o=i(function(e,n){return r(t,e,n)},o,s)||s.exports,n.modules[t]=o,delete n.payloads[t]}i=n.modules[t]=o||i}return i};function s(e){var r=t;e&&(t[e]||(t[e]={}),r=t[e]),(!r.define||!r.define.packaged)&&(n.original=r.define,r.define=n,r.define.packaged=!0),(!r.require||!r.require.packaged)&&(i.original=r.require,r.require=i,r.require.packaged=!0)}s(e)})(),ace.define(\`ace/lib/es6-shim\`,[\`require\`,\`exports\`,\`module\`],function(e,t,n){function r(e,t,n){Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}String.prototype.startsWith||r(String.prototype,\`startsWith\`,function(e,t){return t||=0,this.lastIndexOf(e,t)===t}),String.prototype.endsWith||r(String.prototype,\`endsWith\`,function(e,t){var n=this;(t===void 0||t>n.length)&&(t=n.length),t-=e.length;var r=n.indexOf(e,t);return r!==-1&&r===t}),String.prototype.repeat||r(String.prototype,\`repeat\`,function(e){for(var t=\`\`,n=this;e>0;)e&1&&(t+=n),(e>>=1)&&(n+=n);return t}),String.prototype.includes||r(String.prototype,\`includes\`,function(e,t){return this.indexOf(e,t)!=-1}),Object.assign||(Object.assign=function(e){if(e==null)throw TypeError(\`Cannot convert undefined or null to object\`);for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];r!=null&&Object.keys(r).forEach(function(e){t[e]=r[e]})}return t}),Object.values||(Object.values=function(e){return Object.keys(e).map(function(t){return e[t]})}),Array.prototype.find||r(Array.prototype,\`find\`,function(e){for(var t=this.length,n=arguments[1],r=0;r<t;r++){var i=this[r];if(e.call(n,i,r,this))return i}}),Array.prototype.findIndex||r(Array.prototype,\`findIndex\`,function(e){for(var t=this.length,n=arguments[1],r=0;r<t;r++){var i=this[r];if(e.call(n,i,r,this))return r}}),Array.prototype.includes||r(Array.prototype,\`includes\`,function(e,t){return this.indexOf(e,t)!=-1}),Array.prototype.fill||r(Array.prototype,\`fill\`,function(e){for(var t=this,n=t.length>>>0,r=arguments[1]>>0,i=r<0?Math.max(n+r,0):Math.min(r,n),a=arguments[2],o=a===void 0?n:a>>0,s=o<0?Math.max(n+o,0):Math.min(o,n);i<s;)t[i]=e,i++;return t}),Array.of||r(Array,\`of\`,function(){return Array.prototype.slice.call(arguments)})}),ace.define(\`ace/lib/fixoldbrowsers\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/es6-shim\`],function(e,t,n){e("./es6-shim")}),ace.define(\`ace/lib/deep_copy\`,[\`require\`,\`exports\`,\`module\`],function(e,t,n){t.deepCopy=function e(t){if(typeof t!=\`object\`||!t)return t;var n;if(Array.isArray(t)){n=[];for(var r=0;r<t.length;r++)n[r]=e(t[r]);return n}if(Object.prototype.toString.call(t)!==\`[object Object]\`)return t;for(var r in n={},t)n[r]=e(t[r]);return n}}),ace.define(\`ace/lib/lang\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/deep_copy\`],function(e,t,n){t.last=function(e){return e[e.length-1]},t.stringReverse=function(e){return e.split(\`\`).reverse().join(\`\`)},t.stringRepeat=function(e,t){for(var n=\`\`;t>0;)t&1&&(n+=e),(t>>=1)&&(e+=e);return n};var r=/^\\s\\s*/,i=/\\s\\s*$/;t.stringTrimLeft=function(e){return e.replace(r,\`\`)},t.stringTrimRight=function(e){return e.replace(i,\`\`)},t.copyObject=function(e){var t={};for(var n in e)t[n]=e[n];return t},t.copyArray=function(e){for(var t=[],n=0,r=e.length;n<r;n++)e[n]&&typeof e[n]==\`object\`?t[n]=this.copyObject(e[n]):t[n]=e[n];return t},t.deepCopy=e("./deep_copy").deepCopy,t.arrayToMap=function(e){for(var t={},n=0;n<e.length;n++)t[e[n]]=1;return t},t.createMap=function(e){var t=Object.create(null);for(var n in e)t[n]=e[n];return t},t.arrayRemove=function(e,t){for(var n=0;n<=e.length;n++)t===e[n]&&e.splice(n,1)},t.escapeRegExp=function(e){return e.replace(/([.*+?^\${}()|[\\]\\/\\\\])/g,\`\\\\$1\`)},t.escapeHTML=function(e){return(\`\`+e).replace(/&/g,\`&\`).replace(/"/g,\`"\`).replace(/'/g,\`'\`).replace(/</g,\`<\`)},t.getMatchOffsets=function(e,t){var n=[];return e.replace(t,function(e){n.push({offset:arguments[arguments.length-2],length:e.length})}),n},t.deferredCall=function(e){var t=null,n=function(){t=null,e()},r=function(e){return r.cancel(),t=setTimeout(n,e||0),r};return r.schedule=r,r.call=function(){return this.cancel(),e(),r},r.cancel=function(){return clearTimeout(t),t=null,r},r.isPending=function(){return t},r},t.delayedCall=function(e,t){var n=null,r=function(){n=null,e()},i=function(e){n??=setTimeout(r,e||t)};return i.delay=function(e){n&&clearTimeout(n),n=setTimeout(r,e||t)},i.schedule=i,i.call=function(){this.cancel(),e()},i.cancel=function(){n&&clearTimeout(n),n=null},i.isPending=function(){return n},i},t.sleep=function(e){return new Promise(function(t){setTimeout(t,e)})},t.supportsLookbehind=function(){return!0},t.skipEmptyMatch=function(e,t,n){return n&&e.codePointAt(t)>65535?2:1}}),ace.define(\`ace/lib/useragent\`,[\`require\`,\`exports\`,\`module\`],function(e,t,n){t.OS={LINUX:\`LINUX\`,MAC:\`MAC\`,WINDOWS:\`WINDOWS\`},t.getOS=function(){return t.isMac?t.OS.MAC:t.isLinux?t.OS.LINUX:t.OS.WINDOWS};var r=typeof navigator==\`object\`?navigator:{},i=(/mac|win|linux/i.exec(r.platform)||[\`other\`])[0].toLowerCase(),a=r.userAgent||\`\`,o=r.appName||\`\`;t.isWin=i==\`win\`,t.isMac=i==\`mac\`,t.isLinux=i==\`linux\`,t.isIE=o==\`Microsoft Internet Explorer\`||o.indexOf(\`MSAppHost\`)>=0?parseFloat((a.match(/(?:MSIE |Trident\\/[0-9]+[\\.0-9]+;.*rv:)([0-9]+[\\.0-9]+)/)||[])[1]):parseFloat((a.match(/(?:Trident\\/[0-9]+[\\.0-9]+;.*rv:)([0-9]+[\\.0-9]+)/)||[])[1]),t.isOldIE=t.isIE&&t.isIE<9,t.isGecko=t.isMozilla=a.match(/ Gecko\\/\\d+/),t.isOpera=typeof opera==\`object\`&&Object.prototype.toString.call(window.opera)==\`[object Opera]\`,t.isWebKit=parseFloat(a.split(\`WebKit/\`)[1])||void 0,t.isChrome=parseFloat(a.split(\` Chrome/\`)[1])||void 0,t.isSafari=parseFloat(a.split(\` Safari/\`)[1])&&!t.isChrome||void 0,t.isEdge=parseFloat(a.split(\` Edge/\`)[1])||void 0,t.isAIR=a.indexOf(\`AdobeAIR\`)>=0,t.isAndroid=a.indexOf(\`Android\`)>=0,t.isChromeOS=a.indexOf(\` CrOS \`)>=0,t.isIOS=/iPad|iPhone|iPod/.test(a)&&!window.MSStream,t.isIOS&&(t.isMac=!0),t.isMobile=t.isIOS||t.isAndroid}),ace.define(\`ace/lib/dom\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/useragent\`],function(e,t,n){var r=e("./useragent"),i=\`http://www.w3.org/1999/xhtml\`;t.buildDom=function e(t,n,r){if(typeof t==\`string\`&&t){var i=document.createTextNode(t);return n&&n.appendChild(i),i}if(!Array.isArray(t))return t&&t.appendChild&&n&&n.appendChild(t),t;if(typeof t[0]!=\`string\`||!t[0]){for(var a=[],o=0;o<t.length;o++){var s=e(t[o],n,r);s&&a.push(s)}return a}var c=document.createElement(t[0]),l=t[1],u=1;l&&typeof l==\`object\`&&!Array.isArray(l)&&(u=2);for(var o=u;o<t.length;o++)e(t[o],c,r);return u==2&&Object.keys(l).forEach(function(e){var t=l[e];e===\`class\`?c.className=Array.isArray(t)?t.join(\` \`):t:typeof t==\`function\`||e==\`value\`||e[0]==\`$\`?c[e]=t:e===\`ref\`?r&&(r[t]=c):e===\`style\`?typeof t==\`string\`&&(c.style.cssText=t):t!=null&&c.setAttribute(e,t)}),n&&n.appendChild(c),c},t.getDocumentHead=function(e){return e||=document,e.head||e.getElementsByTagName(\`head\`)[0]||e.documentElement},t.createElement=function(e,t){return document.createElementNS?document.createElementNS(t||i,e):document.createElement(e)},t.removeChildren=function(e){e.innerHTML=\`\`},t.createTextNode=function(e,t){return(t?t.ownerDocument:document).createTextNode(e)},t.createFragment=function(e){return(e?e.ownerDocument:document).createDocumentFragment()},t.hasCssClass=function(e,t){return(e.className+\`\`).split(/\\s+/g).indexOf(t)!==-1},t.addCssClass=function(e,n){t.hasCssClass(e,n)||(e.className+=\` \`+n)},t.removeCssClass=function(e,t){for(var n=e.className.split(/\\s+/g);;){var r=n.indexOf(t);if(r==-1)break;n.splice(r,1)}e.className=n.join(\` \`)},t.toggleCssClass=function(e,t){for(var n=e.className.split(/\\s+/g),r=!0;;){var i=n.indexOf(t);if(i==-1)break;r=!1,n.splice(i,1)}return r&&n.push(t),e.className=n.join(\` \`),r},t.setCssClass=function(e,n,r){r?t.addCssClass(e,n):t.removeCssClass(e,n)},t.hasCssString=function(e,t){var n=0,r;if(t||=document,r=t.querySelectorAll(\`style\`)){for(;n<r.length;)if(r[n++].id===e)return!0}},t.removeElementById=function(e,t){t||=document,t.getElementById(e)&&t.getElementById(e).remove()};var a,o=[];t.useStrictCSP=function(e){a=e,e==0?s():o||=[]};function s(){var e=o;o=null,e&&e.forEach(function(e){c(e[0],e[1])})}function c(e,n,r){if(!(typeof document>\`u\`)){if(o){if(r)s();else if(r===!1)return o.push([e,n])}if(!a){var i=r;!r||!r.getRootNode?i=document:(i=r.getRootNode(),(!i||i==r)&&(i=document));var c=i.ownerDocument||i;if(n&&t.hasCssString(n,i))return null;n&&(e+=\`
|
|
31
31
|
/*# sourceURL=ace/css/\`+n+\` */\`);var l=t.createElement(\`style\`);l.appendChild(c.createTextNode(e)),n&&(l.id=n),i==c&&(i=t.getDocumentHead(c)),i.insertBefore(l,i.firstChild)}}}if(t.importCssString=c,t.importCssStylsheet=function(e,n){t.buildDom([\`link\`,{rel:\`stylesheet\`,href:e}],t.getDocumentHead(n))},t.$fixPositionBug=function(e){var t=e.getBoundingClientRect();if(e.style.left){var n=parseFloat(e.style.left),r=+t.left;Math.abs(n-r)>1&&(e.style.left=2*n-r+\`px\`)}if(e.style.right){var n=parseFloat(e.style.right),r=window.innerWidth-t.right;Math.abs(n-r)>1&&(e.style.right=2*n-r+\`px\`)}if(e.style.top){var n=parseFloat(e.style.top),r=+t.top;Math.abs(n-r)>1&&(e.style.top=2*n-r+\`px\`)}if(e.style.bottom){var n=parseFloat(e.style.bottom),r=window.innerHeight-t.bottom;Math.abs(n-r)>1&&(e.style.bottom=2*n-r+\`px\`)}},t.scrollbarWidth=function(e){var n=t.createElement(\`ace_inner\`);n.style.width=\`100%\`,n.style.minWidth=\`0px\`,n.style.height=\`200px\`,n.style.display=\`block\`;var r=t.createElement(\`ace_outer\`),i=r.style;i.position=\`absolute\`,i.left=\`-10000px\`,i.overflow=\`hidden\`,i.width=\`200px\`,i.minWidth=\`0px\`,i.height=\`150px\`,i.display=\`block\`,r.appendChild(n);var a=e&&e.documentElement||document&&document.documentElement;if(!a)return 0;a.appendChild(r);var o=n.offsetWidth;i.overflow=\`scroll\`;var s=n.offsetWidth;return o===s&&(s=r.clientWidth),a.removeChild(r),o-s},t.computedStyle=function(e,t){return window.getComputedStyle(e,\`\`)||{}},t.setStyle=function(e,t,n){e[t]!==n&&(e[t]=n)},t.HAS_CSS_ANIMATION=!1,t.HAS_CSS_TRANSFORMS=!1,t.HI_DPI=r.isWin?typeof window<\`u\`&&window.devicePixelRatio>=1.5:!0,r.isChromeOS&&(t.HI_DPI=!1),typeof document<\`u\`){var l=document.createElement(\`div\`);t.HI_DPI&&l.style.transform!==void 0&&(t.HAS_CSS_TRANSFORMS=!0),!r.isEdge&&l.style.animationName!==void 0&&(t.HAS_CSS_ANIMATION=!0),l=null}t.HAS_CSS_TRANSFORMS?t.translate=function(e,t,n){e.style.transform=\`translate(\`+Math.round(t)+\`px, \`+Math.round(n)+\`px)\`}:t.translate=function(e,t,n){e.style.top=Math.round(n)+\`px\`,e.style.left=Math.round(t)+\`px\`}}),ace.define(\`ace/lib/net\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/dom\`],function(e,t,n){var r=e("./dom");t.get=function(e,t){var n=new XMLHttpRequest;n.open(\`GET\`,e,!0),n.onreadystatechange=function(){n.readyState===4&&t(n.responseText)},n.send(null)},t.loadScript=function(e,t){var n=r.getDocumentHead(),i=document.createElement(\`script\`);i.src=e,n.appendChild(i),i.onload=i.onreadystatechange=function(e,n){(n||!i.readyState||i.readyState==\`loaded\`||i.readyState==\`complete\`)&&(i=i.onload=i.onreadystatechange=null,n||t())}},t.qualifyURL=function(e){var t=document.createElement(\`a\`);return t.href=e,t.href}}),ace.define(\`ace/lib/oop\`,[\`require\`,\`exports\`,\`module\`],function(e,t,n){t.inherits=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})},t.mixin=function(e,t){for(var n in t)e[n]=t[n];return e},t.implement=function(e,n){t.mixin(e,n)}}),ace.define(\`ace/lib/event_emitter\`,[\`require\`,\`exports\`,\`module\`],function(e,t,n){var r={},i=function(){this.propagationStopped=!0},a=function(){this.defaultPrevented=!0};r._emit=r._dispatchEvent=function(e,t){this._eventRegistry||={},this._defaultHandlers||={};var n=this._eventRegistry[e]||[],r=this._defaultHandlers[e];if(!(!n.length&&!r)){(typeof t!=\`object\`||!t)&&(t={}),t.type||=e,t.stopPropagation||=i,t.preventDefault||=a,n=n.slice();for(var o=0;o<n.length&&(n[o](t,this),!t.propagationStopped);o++);if(r&&!t.defaultPrevented)return r(t,this)}},r._signal=function(e,t){var n=(this._eventRegistry||{})[e];if(n){n=n.slice();for(var r=0;r<n.length;r++)n[r](t,this)}},r.once=function(e,t){var n=this;if(this.on(e,function r(){n.off(e,r),t.apply(null,arguments)}),!t)return new Promise(function(e){t=e})},r.setDefaultHandler=function(e,t){var n=this._defaultHandlers;if(n||=this._defaultHandlers={_disabled_:{}},n[e]){var r=n[e],i=n._disabled_[e];i||(n._disabled_[e]=i=[]),i.push(r);var a=i.indexOf(t);a!=-1&&i.splice(a,1)}n[e]=t},r.removeDefaultHandler=function(e,t){var n=this._defaultHandlers;if(n){var r=n._disabled_[e];if(n[e]==t)r&&this.setDefaultHandler(e,r.pop());else if(r){var i=r.indexOf(t);i!=-1&&r.splice(i,1)}}},r.on=r.addEventListener=function(e,t,n){this._eventRegistry=this._eventRegistry||{};var r=this._eventRegistry[e];return r||=this._eventRegistry[e]=[],r.indexOf(t)==-1&&r[n?\`unshift\`:\`push\`](t),t},r.off=r.removeListener=r.removeEventListener=function(e,t){this._eventRegistry=this._eventRegistry||{};var n=this._eventRegistry[e];if(n){var r=n.indexOf(t);r!==-1&&n.splice(r,1)}},r.removeAllListeners=function(e){e||(this._eventRegistry=this._defaultHandlers=void 0),this._eventRegistry&&(this._eventRegistry[e]=void 0),this._defaultHandlers&&(this._defaultHandlers[e]=void 0)},t.EventEmitter=r}),ace.define(\`ace/lib/report_error\`,[\`require\`,\`exports\`,\`module\`],function(e,t,n){t.reportError=function(e,t){var n=Error(e);n.data=t,typeof console==\`object\`&&console.error&&console.error(n),setTimeout(function(){throw n})}}),ace.define(\`ace/lib/default_english_messages\`,[\`require\`,\`exports\`,\`module\`],function(e,t,n){t.defaultEnglishMessages={"autocomplete.popup.aria-roledescription":\`Autocomplete suggestions\`,"autocomplete.popup.aria-label":\`Autocomplete suggestions\`,"autocomplete.popup.item.aria-roledescription":\`item\`,"autocomplete.loading":\`Loading...\`,"editor.scroller.aria-roledescription":\`editor\`,"editor.scroller.aria-label":\`Editor content, press Enter to start editing, press Escape to exit\`,"editor.gutter.aria-roledescription":\`editor gutter\`,"editor.gutter.aria-label":\`Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit\`,"error-marker.good-state":\`Looks good!\`,"prompt.recently-used":\`Recently used\`,"prompt.other-commands":\`Other commands\`,"prompt.no-matching-commands":\`No matching commands\`,"search-box.find.placeholder":\`Search for\`,"search-box.find-all.text":\`All\`,"search-box.replace.placeholder":\`Replace with\`,"search-box.replace-next.text":\`Replace\`,"search-box.replace-all.text":\`All\`,"search-box.toggle-replace.title":\`Toggle Replace mode\`,"search-box.toggle-regexp.title":\`RegExp Search\`,"search-box.toggle-case.title":\`CaseSensitive Search\`,"search-box.toggle-whole-word.title":\`Whole Word Search\`,"search-box.toggle-in-selection.title":\`Search In Selection\`,"search-box.search-counter":\`$0 of $1\`,"text-input.aria-roledescription":\`editor\`,"text-input.aria-label":\`Cursor at row $0\`,"gutter.code-folding.range.aria-label":\`Toggle code folding, rows $0 through $1\`,"gutter.code-folding.closed.aria-label":\`Toggle code folding, rows $0 through $1\`,"gutter.code-folding.open.aria-label":\`Toggle code folding, row $0\`,"gutter.code-folding.closed.title":\`Unfold code\`,"gutter.code-folding.open.title":\`Fold code\`,"gutter.annotation.aria-label.error":\`Error, read annotations row $0\`,"gutter.annotation.aria-label.warning":\`Warning, read annotations row $0\`,"gutter.annotation.aria-label.info":\`Info, read annotations row $0\`,"inline-fold.closed.title":\`Unfold code\`,"gutter-tooltip.aria-label.error.singular":\`error\`,"gutter-tooltip.aria-label.error.plural":\`errors\`,"gutter-tooltip.aria-label.warning.singular":\`warning\`,"gutter-tooltip.aria-label.warning.plural":\`warnings\`,"gutter-tooltip.aria-label.info.singular":\`information message\`,"gutter-tooltip.aria-label.info.plural":\`information messages\`,"gutter.annotation.aria-label.security":\`Security finding, read annotations row $0\`,"gutter.annotation.aria-label.hint":\`Suggestion, read annotations row $0\`,"gutter-tooltip.aria-label.security.singular":\`security finding\`,"gutter-tooltip.aria-label.security.plural":\`security findings\`,"gutter-tooltip.aria-label.hint.singular":\`suggestion\`,"gutter-tooltip.aria-label.hint.plural":\`suggestions\`,"editor.tooltip.disable-editing":\`Editing is disabled\`}}),ace.define(\`ace/lib/app_config\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/oop\`,\`ace/lib/event_emitter\`,\`ace/lib/report_error\`,\`ace/lib/default_english_messages\`],function(e,t,n){"no use strict";var r=e("./oop"),i=e("./event_emitter").EventEmitter,a=e("./report_error").reportError,o=e("./default_english_messages").defaultEnglishMessages,s={setOptions:function(e){Object.keys(e).forEach(function(t){this.setOption(t,e[t])},this)},getOptions:function(e){var t={};if(e)Array.isArray(e)||(e=Object.keys(e));else{var n=this.$options;e=Object.keys(n).filter(function(e){return!n[e].hidden})}return e.forEach(function(e){t[e]=this.getOption(e)},this),t},setOption:function(e,t){if(this[\`$\`+e]!==t){var n=this.$options[e];if(!n)return c(\`misspelled option "\`+e+\`"\`);if(n.forwardTo)return this[n.forwardTo]&&this[n.forwardTo].setOption(e,t);n.handlesSet||(this[\`$\`+e]=t),n&&n.set&&n.set.call(this,t)}},getOption:function(e){var t=this.$options[e];return t?t.forwardTo?this[t.forwardTo]&&this[t.forwardTo].getOption(e):t&&t.get?t.get.call(this):this[\`$\`+e]:c(\`misspelled option "\`+e+\`"\`)}};function c(e){typeof console<\`u\`&&console.warn&&console.warn.apply(console,arguments)}var l,u,d=function(){function e(){this.$defaultOptions={},l=o,u=\`dollarSigns\`}return e.prototype.defineOptions=function(e,t,n){return e.$options||(this.$defaultOptions[t]=e.$options={}),Object.keys(n).forEach(function(t){var r=n[t];typeof r==\`string\`&&(r={forwardTo:r}),r.name||=t,e.$options[r.name]=r,\`initialValue\`in r&&(e[\`$\`+r.name]=r.initialValue)}),r.implement(e,s),this},e.prototype.resetOptions=function(e){Object.keys(e.$options).forEach(function(t){var n=e.$options[t];\`value\`in n&&e.setOption(t,n.value)})},e.prototype.setDefaultValue=function(e,t,n){if(!e){for(e in this.$defaultOptions)if(this.$defaultOptions[e][t])break;if(!this.$defaultOptions[e][t])return!1}var r=this.$defaultOptions[e]||(this.$defaultOptions[e]={});r[t]&&(r.forwardTo?this.setDefaultValue(r.forwardTo,t,n):r[t].value=n)},e.prototype.setDefaultValues=function(e,t){Object.keys(t).forEach(function(n){this.setDefaultValue(e,n,t[n])},this)},e.prototype.setMessages=function(e,t){l=e,t&&t.placeholders&&(u=t.placeholders)},e.prototype.nls=function(e,t,n){l[e]||(c(\`No message found for the key '\`+e+\`' in messages with id \`+l.$id+\`, trying to find a translation for the default string '\`+t+\`'.\`),l[t]||c(\`No message found for the default string '\`+t+\`' in the provided messages. Falling back to the default English message.\`));var r=l[e]||l[t]||t;return n&&(u===\`dollarSigns\`&&(r=r.replace(/\\$(\\$|[\\d]+)/g,function(e,t){return t==\`$\`?\`$\`:n[t]})),u===\`curlyBrackets\`&&(r=r.replace(/\\{([^\\}]+)\\}/g,function(e,t){return n[t]}))),r},e}();d.prototype.warn=c,d.prototype.reportError=a,r.implement(d.prototype,i),t.AppConfig=d}),ace.define(\`ace/theme/textmate-css\`,[\`require\`,\`exports\`,\`module\`],function(e,t,n){n.exports=\`.ace-tm .ace_gutter {
|
|
32
32
|
background: #f0f0f0;
|
|
33
33
|
color: #333;
|
|
@@ -1447,7 +1447,7 @@ Error generating stack: \`+e.message+\`
|
|
|
1447
1447
|
\`},aa=function(){var e=parseInt(document.body.getAttribute(\`data-scroll-locked\`)||\`0\`,10);return isFinite(e)?e:0},oa=function(){_.useEffect(function(){return document.body.setAttribute(ra,(aa()+1).toString()),function(){var e=aa()-1;e<=0?document.body.removeAttribute(ra):document.body.setAttribute(ra,e.toString())}},[])},sa=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?\`margin\`:r;oa();var a=_.useMemo(function(){return ta(i)},[i]);return _.createElement(na,{styles:ia(a,!t,i,n?\`\`:\`!important\`)})},ca=!1;if(typeof window<\`u\`)try{var la=Object.defineProperty({},"passive",{get:function(){return ca=!0,!0}});window.addEventListener(\`test\`,la,la),window.removeEventListener(\`test\`,la,la)}catch{ca=!1}var ua=ca?{passive:!1}:!1,da=function(e){return e.tagName===\`TEXTAREA\`},fa=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==\`hidden\`&&!(n.overflowY===n.overflowX&&!da(e)&&n[t]===\`visible\`)},pa=function(e){return fa(e,\`overflowY\`)},ma=function(e){return fa(e,\`overflowX\`)},ha=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<\`u\`&&r instanceof ShadowRoot&&(r=r.host),va(e,r)){var i=ya(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},ga=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},_a=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},va=function(e,t){return e===\`v\`?pa(t):ma(t)},ya=function(e,t){return e===\`v\`?ga(t):_a(t)},ba=function(e,t){return e===\`h\`&&t===\`rtl\`?-1:1},xa=function(e,t,n,r,i){var a=ba(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=ya(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&va(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},Sa=function(e){return\`changedTouches\`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ca=function(e){return[e.deltaX,e.deltaY]},wa=function(e){return e&&\`current\`in e?e.current:e},Ta=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Ea=function(e){return\`
|
|
1448
1448
|
.block-interactivity-\${e} {pointer-events: none;}
|
|
1449
1449
|
.allow-interactivity-\${e} {pointer-events: all;}
|
|
1450
|
-
\`},Da=0,Oa=[];function ka(e){var t=_.useRef([]),n=_.useRef([0,0]),r=_.useRef(),i=_.useState(Da++)[0],a=_.useState(Zi)[0],o=_.useRef(e);_.useEffect(function(){o.current=e},[e]),_.useEffect(function(){if(e.inert){document.body.classList.add(\`block-interactivity-\${i}\`);var t=Di([e.lockRef.current],(e.shards||[]).map(wa),!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=_.useCallback(function(e,t){if(\`touches\`in e&&e.touches.length===2||e.type===\`wheel\`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Sa(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=ha(d,u);if(!m)return!0;if(m?l=d:(l=d===\`v\`?\`h\`:\`v\`,m=ha(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 xa(h,t,e,h===\`h\`?s:c,!0)},[]),c=_.useCallback(function(e){var n=e;if(!(!Oa.length||Oa[Oa.length-1]!==a)){var r=\`deltaY\`in n?Ca(n):Sa(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Ta(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(wa).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=_.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Aa(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=_.useCallback(function(e){n.current=Sa(e),r.current=void 0},[]),d=_.useCallback(function(t){l(t.type,Ca(t),t.target,s(t,e.lockRef.current))},[]),f=_.useCallback(function(t){l(t.type,Sa(t),t.target,s(t,e.lockRef.current))},[]);_.useEffect(function(){return Oa.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(\`wheel\`,c,ua),document.addEventListener(\`touchmove\`,c,ua),document.addEventListener(\`touchstart\`,u,ua),function(){Oa=Oa.filter(function(e){return e!==a}),document.removeEventListener(\`wheel\`,c,ua),document.removeEventListener(\`touchmove\`,c,ua),document.removeEventListener(\`touchstart\`,u,ua)}},[]);var p=e.removeScrollBar,m=e.inert;return _.createElement(_.Fragment,null,m?_.createElement(a,{styles:Ea(i)}):null,p?_.createElement(sa,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Aa(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var ja=Bi(Vi,ka),Ma=_.forwardRef(function(e,t){return _.createElement(Ui,Ti({},e,{ref:t,sideCar:ja}))});Ma.classNames=Ui.classNames;var Na=function(e){return typeof document>\`u\`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Pa=new WeakMap,Fa=new WeakMap,Ia={},La=0,Ra=function(e){return e&&(e.host||Ra(e.parentNode))},za=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Ra(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})},Ba=function(e,t,n,r){var i=za(t,Array.isArray(e)?e:[e]);Ia[n]||(Ia[n]=new WeakMap);var a=Ia[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=(Pa.get(e)||0)+1,l=(a.get(e)||0)+1;Pa.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Fa.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(),La++,function(){o.forEach(function(e){var t=Pa.get(e)-1,i=a.get(e)-1;Pa.set(e,t),a.set(e,i),t||(Fa.has(e)||e.removeAttribute(r),Fa.delete(e)),i||e.removeAttribute(n)}),La--,La||(Pa=new WeakMap,Pa=new WeakMap,Fa=new WeakMap,Ia={})}},Va=function(e,t,n){n===void 0&&(n=\`data-aria-hidden\`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Na(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(\`[aria-live], script\`))),Ba(r,i,n,\`aria-hidden\`)):function(){return null}},Ha=\`Dialog\`,[Ua,Wa]=cr(Ha),[Ga,Ka]=Ua(Ha),qa=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=_.useRef(null),c=_.useRef(null),[l,u]=vr({prop:r,defaultProp:i??!1,onChange:a,caller:Ha});return(0,z.jsx)(Ga,{scope:t,triggerRef:s,contentRef:c,contentId:pr(),titleId:pr(),descriptionId:pr(),open:l,onOpenChange:u,onOpenToggle:_.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};qa.displayName=Ha;var Ja=\`DialogTrigger\`,Ya=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Ka(Ja,n),a=sr(t,i.triggerRef);return(0,z.jsx)(W.button,{type:\`button\`,"aria-haspopup":\`dialog\`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":ho(i.open),...r,ref:a,onClick:U(e.onClick,i.onOpenToggle)})});Ya.displayName=Ja;var Xa=\`DialogPortal\`,[Za,Qa]=Ua(Xa,{forceMount:void 0}),$a=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Ka(Xa,t);return(0,z.jsx)(Za,{scope:t,forceMount:n,children:_.Children.map(r,e=>(0,z.jsx)(hi,{present:n||a.open,children:(0,z.jsx)(pi,{asChild:!0,container:i,children:e})}))})};$a.displayName=Xa;var eo=\`DialogOverlay\`,to=_.forwardRef((e,t)=>{let n=Qa(eo,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Ka(eo,e.__scopeDialog);return a.modal?(0,z.jsx)(hi,{present:r||a.open,children:(0,z.jsx)(ro,{...i,ref:t})}):null});to.displayName=eo;var no=xr(\`DialogOverlay.RemoveScroll\`),ro=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Ka(eo,n),a=sr(t,Gr());return(0,z.jsx)(Ma,{as:no,allowPinchZoom:!0,shards:[i.contentRef],children:(0,z.jsx)(W.div,{"data-state":ho(i.open),...r,ref:a,style:{pointerEvents:\`auto\`,...r.style}})})}),io=\`DialogContent\`,ao=_.forwardRef((e,t)=>{let n=Qa(io,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Ka(io,e.__scopeDialog);return(0,z.jsx)(hi,{present:r||a.open,children:a.modal?(0,z.jsx)(oo,{...i,ref:t}):(0,z.jsx)(K,{...i,ref:t})})});ao.displayName=io;var oo=_.forwardRef((e,t)=>{let n=Ka(io,e.__scopeDialog),r=_.useRef(null),i=sr(t,n.contentRef,r);return _.useEffect(()=>{let e=r.current;if(e)return Va(e)},[]),(0,z.jsx)(so,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:U(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:U(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:U(e.onFocusOutside,e=>e.preventDefault())})}),K=_.forwardRef((e,t)=>{let n=Ka(io,e.__scopeDialog),r=_.useRef(!1),i=_.useRef(!1);return(0,z.jsx)(so,{...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()}})}),so=_.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=Ka(io,n);return Ci(),(0,z.jsx)(z.Fragment,{children:(0,z.jsx)(ei,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,z.jsx)(Hr,{role:\`dialog\`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":ho(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})}),co=\`DialogTitle\`,lo=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Ka(co,n);return(0,z.jsx)(W.h2,{id:i.titleId,...r,ref:t})});lo.displayName=co;var uo=\`DialogDescription\`,fo=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Ka(uo,n);return(0,z.jsx)(W.p,{id:i.descriptionId,...r,ref:t})});fo.displayName=uo;var po=\`DialogClose\`,mo=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Ka(po,n);return(0,z.jsx)(W.button,{type:\`button\`,...r,ref:t,onClick:U(e.onClick,()=>i.onOpenChange(!1))})});mo.displayName=po;function ho(e){return e?\`open\`:\`closed\`}function go({open:e,onClose:t,title:n,children:r,wide:i,width:a}){return(0,z.jsx)(qa,{open:e,onOpenChange:e=>!e&&t(),children:(0,z.jsxs)($a,{children:[(0,z.jsx)(to,{className:\`fixed inset-0 z-50 bg-black/60 backdrop-blur-sm animate-[fade-in_.15s_ease-out]\`}),(0,z.jsxs)(ao,{className:Zt(\`fixed left-1/2 top-1/2 z-50 -translate-x-1/2 -translate-y-1/2 rounded-lg border border-input bg-popover shadow-2xl\`,\`max-h-[85vh] max-w-[92vw] overflow-auto focus:outline-none\`,a??(i?\`w-160\`:\`w-110\`)),children:[(0,z.jsxs)(\`div\`,{className:\`flex items-center justify-between border-b border-border px-4 py-3\`,children:[(0,z.jsx)(lo,{className:\`text-sm font-semibold\`,children:n}),(0,z.jsx)(mo,{className:\`text-muted-foreground/80 hover:text-foreground\`,children:(0,z.jsx)(Lt,{size:16})})]}),(0,z.jsx)(\`div\`,{className:\`p-4\`,children:r})]})]})})}function q({open:e,title:t,description:n,confirmLabel:r=\`Confirm\`,cancelLabel:i=\`Cancel\`,danger:a,onConfirm:o,onClose:s}){return(0,z.jsxs)(go,{open:e,onClose:s,title:t,children:[(0,z.jsxs)(\`div\`,{className:\`flex items-start gap-3\`,children:[a&&(0,z.jsx)(\`div\`,{className:\`flex size-8 shrink-0 items-center justify-center rounded-full bg-destructive/15\`,children:(0,z.jsx)(jt,{size:15,className:\`text-destructive\`})}),(0,z.jsx)(\`p\`,{className:\`min-w-0 text-[13px] leading-relaxed text-muted-foreground\`,children:n??\`Are you sure?\`})]}),(0,z.jsxs)(\`div\`,{className:\`mt-5 flex justify-end gap-2\`,children:[(0,z.jsx)(V,{variant:\`outline\`,onClick:s,children:i}),(0,z.jsx)(V,{variant:a?\`dangerSolid\`:\`default\`,autoFocus:!0,onClick:()=>{o(),s()},children:r})]})]})}function _o(e){let t=e+\`CollectionProvider\`,[n,r]=cr(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=_.useRef(null),a=_.useRef(new Map).current;return(0,z.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+\`CollectionSlot\`,c=xr(s),l=_.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=sr(t,a(s,n).collectionRef);return(0,z.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+\`CollectionItemSlot\`,d=\`data-radix-collection-item\`,f=xr(u),p=_.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=_.useRef(null),s=sr(t,o),c=a(u,n);return _.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,z.jsx)(f,{[d]:\`\`,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+\`CollectionConsumer\`,t);return _.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[{Provider:o,Slot:l,ItemSlot:p},m,r]}var vo=_.createContext(void 0);function yo(e){let t=_.useContext(vo);return e||t||\`ltr\`}var bo=[\`top\`,\`right\`,\`bottom\`,\`left\`],xo=Math.min,So=Math.max,Co=Math.round,wo=Math.floor,To=e=>({x:e,y:e}),Eo={left:\`right\`,right:\`left\`,bottom:\`top\`,top:\`bottom\`};function Do(e,t,n){return So(e,xo(t,n))}function Oo(e,t){return typeof e==\`function\`?e(t):e}function ko(e){return e.split(\`-\`)[0]}function Ao(e){return e.split(\`-\`)[1]}function jo(e){return e===\`x\`?\`y\`:\`x\`}function Mo(e){return e===\`y\`?\`height\`:\`width\`}function No(e){let t=e[0];return t===\`t\`||t===\`b\`?\`y\`:\`x\`}function Po(e){return jo(No(e))}function Fo(e,t,n){n===void 0&&(n=!1);let r=Ao(e),i=Po(e),a=Mo(i),o=i===\`x\`?r===(n?\`end\`:\`start\`)?\`right\`:\`left\`:r===\`start\`?\`bottom\`:\`top\`;return t.reference[a]>t.floating[a]&&(o=Wo(o)),[o,Wo(o)]}function Io(e){let t=Wo(e);return[Lo(e),t,Lo(t)]}function Lo(e){return e.includes(\`start\`)?e.replace(\`start\`,\`end\`):e.replace(\`end\`,\`start\`)}var Ro=[\`left\`,\`right\`],zo=[\`right\`,\`left\`],Bo=[\`top\`,\`bottom\`],Vo=[\`bottom\`,\`top\`];function Ho(e,t,n){switch(e){case\`top\`:case\`bottom\`:return n?t?zo:Ro:t?Ro:zo;case\`left\`:case\`right\`:return t?Bo:Vo;default:return[]}}function Uo(e,t,n,r){let i=Ao(e),a=Ho(ko(e),n===\`start\`,r);return i&&(a=a.map(e=>e+\`-\`+i),t&&(a=a.concat(a.map(Lo)))),a}function Wo(e){let t=ko(e);return Eo[t]+e.slice(t.length)}function Go(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ko(e){return typeof e==\`number\`?{top:e,right:e,bottom:e,left:e}:Go(e)}function qo(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 Jo(e,t,n){let{reference:r,floating:i}=e,a=No(t),o=Po(t),s=Mo(o),c=ko(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}}switch(Ao(t)){case\`start\`:p[o]-=f*(n&&l?-1:1);break;case\`end\`:p[o]+=f*(n&&l?-1:1);break}return p}async function Yo(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}=Oo(t,e),p=Ko(f),m=o[d?u===\`floating\`?\`reference\`:\`floating\`:u],h=qo(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=qo(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 Xo=50,Zo=async(e,t,n)=>{let{placement:r=\`bottom\`,strategy:i=\`absolute\`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Yo},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Jo(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<Xo&&(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}=Jo(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Qo=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}=Oo(e,t)||{};if(l==null)return{};let d=Ko(u),f={x:n,y:r},p=Po(i),m=Mo(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=xo(d[_],T),D=xo(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=Do(O,A,k),M=!c.arrow&&Ao(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),$o=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}=Oo(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=ko(r),_=No(o),v=ko(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Wo(o)]:Io(o)),x=p!==\`none\`;!d&&x&&b.push(...Uo(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=Fo(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\`&&_!==No(t))||T.every(e=>No(e.placement)===_?e.overflows[0]>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=No(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;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function es(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ts(e){return bo.some(t=>e[t]>=0)}var ns=function(e){return e===void 0&&(e={}),{name:\`hide\`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=\`referenceHidden\`,...a}=Oo(e,t);switch(i){case\`referenceHidden\`:{let e=es(await r.detectOverflow(t,{...a,elementContext:\`reference\`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:ts(e)}}}case\`escaped\`:{let e=es(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:ts(e)}}}default:return{}}}}},rs=new Set([\`left\`,\`top\`]);async function is(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=ko(n),s=Ao(n),c=No(n)===\`y\`,l=rs.has(o)?-1:1,u=a&&c?-1:1,d=Oo(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 as=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 is(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}}}}},os=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}=Oo(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=No(ko(i)),p=jo(f),m=u[p],h=u[f];if(o){let e=p===\`y\`?\`top\`:\`left\`,t=p===\`y\`?\`bottom\`:\`right\`,n=m+d[e],r=m-d[t];m=Do(n,m,r)}if(s){let e=f===\`y\`?\`top\`:\`left\`,t=f===\`y\`?\`bottom\`:\`right\`,n=h+d[e],r=h-d[t];h=Do(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},ss=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}=Oo(e,t),u={x:n,y:r},d=No(i),f=jo(d),p=u[f],m=u[d],h=Oo(s,t),g=typeof h==\`number\`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};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=rs.has(ko(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}}}},cs=function(e){return e===void 0&&(e={}),{name:\`size\`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=Oo(e,t),u=await o.detectOverflow(t,l),d=ko(i),f=Ao(i),p=No(i)===\`y\`,{width:m,height:h}=a.floating,g,_;d===\`top\`||d===\`bottom\`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?\`start\`:\`end\`)?\`left\`:\`right\`):(_=d,g=f===\`end\`?\`top\`:\`bottom\`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=xo(h-u[g],v),x=xo(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=So(u.left,0),t=So(u.right,0),n=So(u.top,0),r=So(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:So(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:So(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function ls(){return typeof window<\`u\`}function us(e){return ps(e)?(e.nodeName||\`\`).toLowerCase():\`#document\`}function ds(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function fs(e){return((ps(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function ps(e){return ls()?e instanceof Node||e instanceof ds(e).Node:!1}function ms(e){return ls()?e instanceof Element||e instanceof ds(e).Element:!1}function hs(e){return ls()?e instanceof HTMLElement||e instanceof ds(e).HTMLElement:!1}function gs(e){return!ls()||typeof ShadowRoot>\`u\`?!1:e instanceof ShadowRoot||e instanceof ds(e).ShadowRoot}function _s(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Os(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==\`inline\`&&i!==\`contents\`}function vs(e){return/^(table|td|th)$/.test(us(e))}function ys(e){try{if(e.matches(\`:popover-open\`))return!0}catch{}try{return e.matches(\`:modal\`)}catch{return!1}}var bs=/transform|translate|scale|rotate|perspective|filter/,xs=/paint|layout|strict|content/,Ss=e=>!!e&&e!==\`none\`,Cs;function ws(e){let t=ms(e)?Os(e):e;return Ss(t.transform)||Ss(t.translate)||Ss(t.scale)||Ss(t.rotate)||Ss(t.perspective)||!Es()&&(Ss(t.backdropFilter)||Ss(t.filter))||bs.test(t.willChange||\`\`)||xs.test(t.contain||\`\`)}function Ts(e){let t=As(e);for(;hs(t)&&!Ds(t);){if(ws(t))return t;if(ys(t))return null;t=As(t)}return null}function Es(){return Cs??=typeof CSS<\`u\`&&CSS.supports&&CSS.supports(\`-webkit-backdrop-filter\`,\`none\`),Cs}function Ds(e){return/^(html|body|#document)$/.test(us(e))}function Os(e){return ds(e).getComputedStyle(e)}function ks(e){return ms(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function As(e){if(us(e)===\`html\`)return e;let t=e.assignedSlot||e.parentNode||gs(e)&&e.host||fs(e);return gs(t)?t.host:t}function js(e){let t=As(e);return Ds(t)?e.ownerDocument?e.ownerDocument.body:e.body:hs(t)&&_s(t)?t:js(t)}function Ms(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=js(e),i=r===e.ownerDocument?.body,a=ds(r);if(i){let e=Ns(a);return t.concat(a,a.visualViewport||[],_s(r)?r:[],e&&n?Ms(e):[])}else return t.concat(r,Ms(r,[],n))}function Ns(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ps(e){let t=Os(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=hs(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Co(n)!==a||Co(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Fs(e){return ms(e)?e:e.contextElement}function Is(e){let t=Fs(e);if(!hs(t))return To(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Ps(t),o=(a?Co(n.width):n.width)/r,s=(a?Co(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Ls=To(0);function Rs(e){let t=ds(e);return!Es()||!t.visualViewport?Ls:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function zs(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ds(e)?!1:t}function Bs(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Fs(e),o=To(1);t&&(r?ms(r)&&(o=Is(r)):o=Is(e));let s=zs(a,n,r)?Rs(a):To(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){let e=ds(a),t=r&&ms(r)?ds(r):r,n=e,i=Ns(n);for(;i&&r&&t!==n;){let e=Is(i),t=i.getBoundingClientRect(),r=Os(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=ds(i),i=Ns(n)}}return qo({width:u,height:d,x:c,y:l})}function Vs(e,t){let n=ks(e).scrollLeft;return t?t.left+n:Bs(fs(e)).left+n}function Hs(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Vs(e,n),y:n.top+t.scrollTop}}function Us(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===\`fixed\`,o=fs(r),s=t?ys(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=To(1),u=To(0),d=hs(r);if((d||!d&&!a)&&((us(r)!==\`body\`||_s(o))&&(c=ks(r)),d)){let e=Bs(r);l=Is(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Hs(o,c):To(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 Ws(e){return Array.from(e.getClientRects())}function Gs(e){let t=fs(e),n=ks(e),r=e.ownerDocument.body,i=So(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=So(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Vs(e),s=-n.scrollTop;return Os(r).direction===\`rtl\`&&(o+=So(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Ks=25;function qs(e,t){let n=ds(e),r=fs(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Es();(!e||e&&t===\`fixed\`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Vs(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===\`CSS1Compat\`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Ks&&(a-=o)}else l<=Ks&&(a+=l);return{width:a,height:o,x:s,y:c}}function Js(e,t){let n=Bs(e,!0,t===\`fixed\`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=hs(e)?Is(e):To(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Ys(e,t,n){let r;if(t===\`viewport\`)r=qs(e,n);else if(t===\`document\`)r=Gs(fs(e));else if(ms(t))r=Js(t,n);else{let n=Rs(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return qo(r)}function Xs(e,t){let n=As(e);return n===t||!ms(n)||Ds(n)?!1:Os(n).position===\`fixed\`||Xs(n,t)}function Zs(e,t){let n=t.get(e);if(n)return n;let r=Ms(e,[],!1).filter(e=>ms(e)&&us(e)!==\`body\`),i=null,a=Os(e).position===\`fixed\`,o=a?As(e):e;for(;ms(o)&&!Ds(o);){let t=Os(o),n=ws(o);!n&&t.position===\`fixed\`&&(i=null),(a?!n&&!i:!n&&t.position===\`static\`&&i&&(i.position===\`absolute\`||i.position===\`fixed\`)||_s(o)&&!n&&Xs(e,o))?r=r.filter(e=>e!==o):i=t,o=As(o)}return t.set(e,r),r}function Qs(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===\`clippingAncestors\`?ys(t)?[]:Zs(t,this._c):[].concat(n),r],o=Ys(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=Ys(t,a[e],i);s=So(n.top,s),c=xo(n.right,c),l=xo(n.bottom,l),u=So(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function $s(e){let{width:t,height:n}=Ps(e);return{width:t,height:n}}function ec(e,t,n){let r=hs(t),i=fs(t),a=n===\`fixed\`,o=Bs(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=To(0);function l(){c.x=Vs(i)}if(r||!r&&!a)if((us(t)!==\`body\`||_s(i))&&(s=ks(t)),r){let e=Bs(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?Hs(i,s):To(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function tc(e){return Os(e).position===\`static\`}function nc(e,t){if(!hs(e)||Os(e).position===\`fixed\`)return null;if(t)return t(e);let n=e.offsetParent;return fs(e)===n&&(n=n.ownerDocument.body),n}function rc(e,t){let n=ds(e);if(ys(e))return n;if(!hs(e)){let t=As(e);for(;t&&!Ds(t);){if(ms(t)&&!tc(t))return t;t=As(t)}return n}let r=nc(e,t);for(;r&&vs(r)&&tc(r);)r=nc(r,t);return r&&Ds(r)&&tc(r)&&!ws(r)?n:r||Ts(e)||n}var ic=async function(e){let t=this.getOffsetParent||rc,n=this.getDimensions,r=await n(e.floating);return{reference:ec(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ac(e){return Os(e).direction===\`rtl\`}var oc={convertOffsetParentRelativeRectToViewportRelativeRect:Us,getDocumentElement:fs,getClippingRect:Qs,getOffsetParent:rc,getElementRects:ic,getClientRects:Ws,getDimensions:$s,getScale:Is,isElement:ms,isRTL:ac};function sc(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function cc(e,t){let n=null,r,i=fs(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=wo(d),h=wo(i.clientWidth-(u+f)),g=wo(i.clientHeight-(d+p)),_=wo(u),v={rootMargin:-m+\`px \`+-h+\`px \`+-g+\`px \`+-_+\`px\`,threshold:So(0,xo(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!sc(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function lc(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=Fs(e),u=i||a?[...l?Ms(l):[],...t?Ms(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(\`scroll\`,n,{passive:!0}),a&&e.addEventListener(\`resize\`,n)});let d=l&&s?cc(l,n):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?Bs(e):null;c&&g();function g(){let t=Bs(e);h&&!sc(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 uc=as,dc=os,fc=$o,pc=cs,mc=ns,hc=Qo,gc=ss,_c=(e,t,n)=>{let r=new Map,i={platform:oc,...n},a={...i.platform,_c:r};return Zo(e,t,{...i,platform:a})},vc=typeof document<\`u\`?_.useLayoutEffect:function(){};function yc(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(!yc(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)&&!yc(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function bc(e){return typeof window>\`u\`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function xc(e,t){let n=bc(e);return Math.round(t*n)/n}function Sc(e){let t=_.useRef(e);return vc(()=>{t.current=e}),t}function Cc(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]=_.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=_.useState(r);yc(f,r)||p(r);let[m,h]=_.useState(null),[g,v]=_.useState(null),y=_.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=_.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||m,S=o||g,C=_.useRef(null),w=_.useRef(null),T=_.useRef(u),E=c!=null,D=Sc(c),O=Sc(i),k=Sc(l),A=_.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),_c(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!yc(T.current,t)&&(T.current=t,_n.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);vc(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=_.useRef(!1);vc(()=>(j.current=!0,()=>{j.current=!1}),[]),vc(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=_.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=_.useMemo(()=>({reference:x,floating:S}),[x,S]),ee=_.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=xc(N.floating,u.x),r=xc(N.floating,u.y);return s?{...e,transform:\`translate(\`+t+\`px, \`+r+\`px)\`,...bc(N.floating)>=1.5&&{willChange:\`transform\`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return _.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:ee}),[u,A,M,N,ee])}var wc=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?{}:hc({element:r.current,padding:i}).fn(n):r?hc({element:r,padding:i}).fn(n):{}}}},Tc=(e,t)=>{let n=uc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ec=(e,t)=>{let n=dc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Dc=(e,t)=>({fn:gc(e).fn,options:[e,t]}),Oc=(e,t)=>{let n=fc(e);return{name:n.name,fn:n.fn,options:[e,t]}},kc=(e,t)=>{let n=pc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ac=(e,t)=>{let n=mc(e);return{name:n.name,fn:n.fn,options:[e,t]}},jc=(e,t)=>{let n=wc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Mc=\`Arrow\`,Nc=_.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,z.jsx)(W.svg,{...a,ref:t,width:r,height:i,viewBox:\`0 0 30 10\`,preserveAspectRatio:\`none\`,children:e.asChild?n:(0,z.jsx)(\`polygon\`,{points:\`0,0 30,0 15,10\`})})});Nc.displayName=Mc;var Pc=Nc;function Fc(e){let[t,n]=_.useState(void 0);return ur(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(\`borderBoxSize\`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:\`border-box\`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var Ic=\`Popper\`,[Lc,Rc]=cr(Ic),[zc,Bc]=Lc(Ic),Vc=e=>{let{__scopePopper:t,children:n}=e,[r,i]=_.useState(null),[a,o]=_.useState(void 0);return(0,z.jsx)(zc,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})};Vc.displayName=Ic;var Hc=\`PopperAnchor\`,Uc=_.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=Bc(Hc,n),o=_.useRef(null),s=a.onAnchorChange,c=sr(t,_.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=_.useRef(null);_.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&$c(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,z.jsx)(W.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})});Uc.displayName=Hc;var Wc=\`PopperContent\`,[Gc,Kc]=Lc(Wc),qc=_.forwardRef((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=\`partial\`,hideWhenDetached:f=!1,updatePositionStrategy:p=\`optimized\`,onPlaced:m,...h}=e,g=Bc(Wc,n),[v,y]=_.useState(null),b=sr(t,y),[x,S]=_.useState(null),C=Fc(x),w=C?.width??0,T=C?.height??0,E=r+(a===\`center\`?\`\`:\`-\`+a),D=typeof u==\`number\`?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(l)?l:[l],k=O.length>0,A={padding:D,boundary:O.filter(Zc),altBoundary:k},{refs:j,floatingStyles:M,placement:N,isPositioned:ee,middlewareData:te}=Cc({strategy:\`fixed\`,placement:E,whileElementsMounted:(...e)=>lc(...e,{animationFrame:p===\`always\`}),elements:{reference:g.anchor},middleware:[Tc({mainAxis:i+T,alignmentAxis:o}),c&&Ec({mainAxis:!0,crossAxis:!1,limiter:d===\`partial\`?Dc():void 0,...A}),c&&Oc({...A}),kc({...A,apply:({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\`)}}),x&&jc({element:x,padding:s}),Qc({arrowWidth:w,arrowHeight:T}),f&&Ac({strategy:\`referenceHidden\`,...A,boundary:k?A.boundary:void 0})]}),P=g.setPlacementState;ur(()=>(P(N),()=>{P(void 0)}),[N,P]);let[F,ne]=$c(N),re=Fr(m);ur(()=>{ee&&re?.()},[ee,re]);let ie=te.arrow?.x,ae=te.arrow?.y,oe=te.arrow?.centerOffset!==0,[I,se]=_.useState();return ur(()=>{v&&se(window.getComputedStyle(v).zIndex)},[v]),(0,z.jsx)(\`div\`,{ref:j.setFloating,"data-radix-popper-content-wrapper":\`\`,style:{...M,transform:ee?M.transform:\`translate(0, -200%)\`,minWidth:\`max-content\`,zIndex:I,"--radix-popper-transform-origin":[te.transformOrigin?.x,te.transformOrigin?.y].join(\` \`),...te.hide?.referenceHidden&&{visibility:\`hidden\`,pointerEvents:\`none\`}},dir:e.dir,children:(0,z.jsx)(Gc,{scope:n,placedSide:F,placedAlign:ne,onArrowChange:S,arrowX:ie,arrowY:ae,shouldHideArrow:oe,children:(0,z.jsx)(W.div,{"data-side":F,"data-align":ne,...h,ref:b,style:{...h.style,animation:ee?void 0:\`none\`}})})})});qc.displayName=Wc;var Jc=\`PopperArrow\`,Yc={top:\`bottom\`,right:\`left\`,bottom:\`top\`,left:\`right\`},Xc=_.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Kc(Jc,n),a=Yc[i.placedSide];return(0,z.jsx)(\`span\`,{ref:i.onArrowChange,style:{position:\`absolute\`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:\`\`,right:\`0 0\`,bottom:\`center 0\`,left:\`100% 0\`}[i.placedSide],transform:{top:\`translateY(100%)\`,right:\`translateY(50%) rotate(90deg) translateX(-50%)\`,bottom:\`rotate(180deg)\`,left:\`translateY(50%) rotate(-90deg) translateX(50%)\`}[i.placedSide],visibility:i.shouldHideArrow?\`hidden\`:void 0},children:(0,z.jsx)(Pc,{...r,ref:t,style:{...r.style,display:\`block\`}})})});Xc.displayName=Jc;function Zc(e){return e!==null}var Qc=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]=$c(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}}}});function $c(e){let[t,n=\`center\`]=e.split(\`-\`);return[t,n]}var el=Vc,tl=Uc,nl=qc,rl=Xc,il=\`rovingFocusGroup.onEntryFocus\`,al={bubbles:!1,cancelable:!0},ol=\`RovingFocusGroup\`,[sl,cl,ll]=_o(ol),[ul,dl]=cr(ol,[ll]),[fl,pl]=ul(ol),ml=_.forwardRef((e,t)=>(0,z.jsx)(sl.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,z.jsx)(sl.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,z.jsx)(hl,{...e,ref:t})})}));ml.displayName=ol;var hl=_.forwardRef((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=_.useRef(null),p=sr(t,f),m=yo(a),[h,g]=vr({prop:o,defaultProp:s??null,onChange:c,caller:ol}),[v,y]=_.useState(!1),b=Fr(l),x=cl(n),S=_.useRef(!1),[C,w]=_.useState(0);return _.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(il,b),()=>e.removeEventListener(il,b)},[b]),(0,z.jsx)(fl,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:_.useCallback(e=>g(e),[g]),onItemShiftTab:_.useCallback(()=>y(!0),[]),onFocusableItemAdd:_.useCallback(()=>w(e=>e+1),[]),onFocusableItemRemove:_.useCallback(()=>w(e=>e-1),[]),children:(0,z.jsx)(W.div,{tabIndex:v||C===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:\`none\`,...e.style},onMouseDown:U(e.onMouseDown,()=>{S.current=!0}),onFocus:U(e.onFocus,e=>{let t=!S.current;if(e.target===e.currentTarget&&t&&!v){let t=new CustomEvent(il,al);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);xl([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}S.current=!1}),onBlur:U(e.onBlur,()=>y(!1))})})}),gl=\`RovingFocusGroupItem\`,_l=_.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=pr(),l=a||c,u=pl(gl,n),d=u.currentTabStopId===l,f=cl(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u;return _.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),(0,z.jsx)(sl.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,z.jsx)(W.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:U(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:U(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:U(e.onKeyDown,e=>{if(e.key===\`Tab\`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=bl(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?Sl(n,r+1):n.slice(r+1)}setTimeout(()=>xl(n))}}),children:typeof o==\`function\`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})});_l.displayName=gl;var vl={ArrowLeft:\`prev\`,ArrowUp:\`prev\`,ArrowRight:\`next\`,ArrowDown:\`next\`,PageUp:\`first\`,Home:\`first\`,PageDown:\`last\`,End:\`last\`};function yl(e,t){return t===\`rtl\`?e===\`ArrowLeft\`?\`ArrowRight\`:e===\`ArrowRight\`?\`ArrowLeft\`:e:e}function bl(e,t,n){let r=yl(e.key,n);if(!(t===\`vertical\`&&[\`ArrowLeft\`,\`ArrowRight\`].includes(r))&&!(t===\`horizontal\`&&[\`ArrowUp\`,\`ArrowDown\`].includes(r)))return vl[r]}function xl(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Sl(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Cl=ml,wl=_l,Tl=[\`Enter\`,\` \`],El=[\`ArrowDown\`,\`PageUp\`,\`Home\`],Dl=[\`ArrowUp\`,\`PageDown\`,\`End\`],Ol=[...El,...Dl],kl={ltr:[...Tl,\`ArrowRight\`],rtl:[...Tl,\`ArrowLeft\`]},Al={ltr:[\`ArrowLeft\`],rtl:[\`ArrowRight\`]},jl=\`Menu\`,[Ml,Nl,Pl]=_o(jl),[Fl,Il]=cr(jl,[Pl,Rc,dl]),Ll=Rc(),Rl=dl(),[J,Y]=Fl(jl),[zl,Bl]=Fl(jl),Vl=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=Ll(t),[c,l]=_.useState(null),u=_.useRef(!1),d=Fr(a),f=yo(i);return _.useEffect(()=>{let e=()=>{u.current=!0,document.addEventListener(\`pointerdown\`,t,{capture:!0,once:!0}),document.addEventListener(\`pointermove\`,t,{capture:!0,once:!0})},t=()=>u.current=!1;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})}},[]),_.useEffect(()=>{if(!n)return;let e=()=>d(!1);return window.addEventListener(\`blur\`,e),()=>window.removeEventListener(\`blur\`,e)},[n,d]),(0,z.jsx)(el,{...s,children:(0,z.jsx)(J,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,z.jsx)(zl,{scope:t,onClose:_.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};Vl.displayName=jl;var Hl=\`MenuAnchor\`,Ul=_.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=Ll(n);return(0,z.jsx)(tl,{...i,...r,ref:t})});Ul.displayName=Hl;var Wl=\`MenuPortal\`,[Gl,Kl]=Fl(Wl,{forceMount:void 0}),ql=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Y(Wl,t);return(0,z.jsx)(Gl,{scope:t,forceMount:n,children:(0,z.jsx)(hi,{present:n||a.open,children:(0,z.jsx)(pi,{asChild:!0,container:i,children:r})})})};ql.displayName=Wl;var Jl=\`MenuContent\`,[Yl,Xl]=Fl(Jl),Zl=_.forwardRef((e,t)=>{let n=Kl(Jl,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Y(Jl,e.__scopeMenu),o=Bl(Jl,e.__scopeMenu);return(0,z.jsx)(Ml.Provider,{scope:e.__scopeMenu,children:(0,z.jsx)(hi,{present:r||a.open,children:(0,z.jsx)(Ml.Slot,{scope:e.__scopeMenu,children:o.modal?(0,z.jsx)(Ql,{...i,ref:t}):(0,z.jsx)($l,{...i,ref:t})})})})}),Ql=_.forwardRef((e,t)=>{let n=Y(Jl,e.__scopeMenu),r=_.useRef(null),i=sr(t,r);return _.useEffect(()=>{let e=r.current;if(e)return Va(e)},[]),(0,z.jsx)(tu,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:U(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),$l=_.forwardRef((e,t)=>{let n=Y(Jl,e.__scopeMenu);return(0,z.jsx)(tu,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),eu=xr(\`MenuContent.ScrollLock\`),tu=_.forwardRef((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=Y(Jl,n),v=Bl(Jl,n),y=Ll(n),b=Rl(n),x=Nl(n),[S,C]=_.useState(null),w=_.useRef(null),T=sr(t,w,g.onContentChange),E=_.useRef(0),D=_.useRef(\`\`),O=_.useRef(0),k=_.useRef(null),A=_.useRef(\`right\`),j=_.useRef(0),M=m?Ma:_.Fragment,N=m?{as:eu,allowPinchZoom:!0}:void 0,ee=e=>{let t=D.current+e,n=x().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=zu(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){D.current=t,window.clearTimeout(E.current),t!==\`\`&&(E.current=window.setTimeout(()=>e(\`\`),1e3))})(t),o&&setTimeout(()=>o.focus())};_.useEffect(()=>()=>window.clearTimeout(E.current),[]),Ci();let te=_.useCallback(e=>A.current===k.current?.side&&Vu(e,k.current?.area),[]);return(0,z.jsx)(Yl,{scope:n,searchRef:D,onItemEnter:_.useCallback(e=>{te(e)&&e.preventDefault()},[te]),onItemLeave:_.useCallback(e=>{te(e)||(w.current?.focus(),C(null))},[te]),onTriggerLeave:_.useCallback(e=>{te(e)&&e.preventDefault()},[te]),pointerGraceTimerRef:O,onPointerGraceIntentChange:_.useCallback(e=>{k.current=e},[]),children:(0,z.jsx)(M,{...N,children:(0,z.jsx)(ei,{asChild:!0,trapped:i,onMountAutoFocus:U(a,e=>{e.preventDefault(),w.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,z.jsx)(Hr,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,z.jsx)(Cl,{asChild:!0,...b,dir:v.dir,orientation:\`vertical\`,loop:r,currentTabStopId:S,onCurrentTabStopIdChange:C,onEntryFocus:U(c,e=>{v.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,z.jsx)(nl,{role:\`menu\`,"aria-orientation":\`vertical\`,"data-state":Pu(g.open),"data-radix-menu-content":\`\`,dir:v.dir,...y,...h,ref:T,style:{outline:\`none\`,...h.style},onKeyDown:U(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&&ee(e.key));let i=w.current;if(e.target!==i||!Ol.includes(e.key))return;e.preventDefault();let a=x().filter(e=>!e.disabled).map(e=>e.ref.current);Dl.includes(e.key)&&a.reverse(),Lu(a)}),onBlur:U(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(E.current),D.current=\`\`)}),onPointerMove:U(e.onPointerMove,Hu(e=>{let t=e.target,n=j.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>j.current?\`right\`:\`left\`;A.current=t,j.current=e.clientX}}))})})})})})})});Zl.displayName=Jl;var nu=\`MenuGroup\`,ru=_.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,z.jsx)(W.div,{role:\`group\`,...r,ref:t})});ru.displayName=nu;var iu=\`MenuLabel\`,au=_.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,z.jsx)(W.div,{...r,ref:t})});au.displayName=iu;var ou=\`MenuItem\`,su=\`menu.itemSelect\`,cu=_.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=_.useRef(null),o=Bl(ou,e.__scopeMenu),s=Xl(ou,e.__scopeMenu),c=sr(t,a),l=_.useRef(!1),u=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(su,{bubbles:!0,cancelable:!0});e.addEventListener(su,e=>r?.(e),{once:!0}),Pr(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,z.jsx)(lu,{...i,ref:c,disabled:n,onClick:U(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:U(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:U(e.onKeyDown,e=>{let t=s.searchRef.current!==\`\`;n||t&&e.key===\` \`||Tl.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});cu.displayName=ou;var lu=_.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=Xl(ou,n),s=Rl(n),c=_.useRef(null),l=sr(t,c),[u,d]=_.useState(!1),[f,p]=_.useState(\`\`);return _.useEffect(()=>{let e=c.current;e&&p((e.textContent??\`\`).trim())},[a.children]),(0,z.jsx)(Ml.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,z.jsx)(wl,{asChild:!0,...s,focusable:!r,children:(0,z.jsx)(W.div,{role:\`menuitem\`,"data-highlighted":u?\`\`:void 0,"aria-disabled":r||void 0,"data-disabled":r?\`\`:void 0,...a,ref:l,onPointerMove:U(e.onPointerMove,Hu(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:U(e.onPointerLeave,Hu(e=>o.onItemLeave(e))),onFocus:U(e.onFocus,()=>d(!0)),onBlur:U(e.onBlur,()=>d(!1))})})})}),uu=\`MenuCheckboxItem\`,du=_.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,z.jsx)(yu,{scope:e.__scopeMenu,checked:n,children:(0,z.jsx)(cu,{role:\`menuitemcheckbox\`,"aria-checked":Fu(n)?\`mixed\`:n,...i,ref:t,"data-state":Iu(n),onSelect:U(i.onSelect,()=>r?.(Fu(n)?!0:!n),{checkForDefaultPrevented:!1})})})});du.displayName=uu;var fu=\`MenuRadioGroup\`,[pu,mu]=Fl(fu,{value:void 0,onValueChange:()=>{}}),hu=_.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=Fr(r);return(0,z.jsx)(pu,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,z.jsx)(ru,{...i,ref:t})})});hu.displayName=fu;var gu=\`MenuRadioItem\`,_u=_.forwardRef((e,t)=>{let{value:n,...r}=e,i=mu(gu,e.__scopeMenu),a=n===i.value;return(0,z.jsx)(yu,{scope:e.__scopeMenu,checked:a,children:(0,z.jsx)(cu,{role:\`menuitemradio\`,"aria-checked":a,...r,ref:t,"data-state":Iu(a),onSelect:U(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});_u.displayName=gu;var vu=\`MenuItemIndicator\`,[yu,bu]=Fl(vu,{checked:!1}),xu=_.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=bu(vu,n);return(0,z.jsx)(hi,{present:r||Fu(a.checked)||a.checked===!0,children:(0,z.jsx)(W.span,{...i,ref:t,"data-state":Iu(a.checked)})})});xu.displayName=vu;var Su=\`MenuSeparator\`,Cu=_.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,z.jsx)(W.div,{role:\`separator\`,"aria-orientation":\`horizontal\`,...r,ref:t})});Cu.displayName=Su;var wu=\`MenuArrow\`,Tu=_.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=Ll(n);return(0,z.jsx)(rl,{...i,...r,ref:t})});Tu.displayName=wu;var Eu=\`MenuSub\`,[Du,Ou]=Fl(Eu),ku=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=Y(Eu,t),o=Ll(t),[s,c]=_.useState(null),[l,u]=_.useState(null),d=Fr(i);return _.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,z.jsx)(el,{...o,children:(0,z.jsx)(J,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,z.jsx)(Du,{scope:t,contentId:pr(),triggerId:pr(),trigger:s,onTriggerChange:c,children:n})})})};ku.displayName=Eu;var Au=\`MenuSubTrigger\`,ju=_.forwardRef((e,t)=>{let n=Y(Au,e.__scopeMenu),r=Bl(Au,e.__scopeMenu),i=Ou(Au,e.__scopeMenu),a=Xl(Au,e.__scopeMenu),o=_.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=_.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);_.useEffect(()=>u,[u]),_.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]);let d=sr(t,i.onTriggerChange);return(0,z.jsx)(Ul,{asChild:!0,...l,children:(0,z.jsx)(lu,{id:i.triggerId,"aria-haspopup":\`menu\`,"aria-expanded":n.open,"aria-controls":n.open?i.contentId:void 0,"data-state":Pu(n.open),...e,ref:d,onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:U(e.onPointerMove,Hu(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:U(e.onPointerLeave,Hu(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===\`right\`,o=i?-5:5,c=t[i?\`left\`:\`right\`],l=t[i?\`right\`:\`left\`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:U(e.onKeyDown,t=>{let i=a.searchRef.current!==\`\`;e.disabled||i&&t.key===\` \`||kl[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});ju.displayName=Au;var Mu=\`MenuSubContent\`,Nu=_.forwardRef((e,t)=>{let n=Kl(Jl,e.__scopeMenu),{forceMount:r=n.forceMount,align:i=\`start\`,...a}=e,o=Y(Jl,e.__scopeMenu),s=Bl(Jl,e.__scopeMenu),c=Ou(Mu,e.__scopeMenu),l=_.useRef(null),u=sr(t,l);return(0,z.jsx)(Ml.Provider,{scope:e.__scopeMenu,children:(0,z.jsx)(hi,{present:r||o.open,children:(0,z.jsx)(Ml.Slot,{scope:e.__scopeMenu,children:(0,z.jsx)(tu,{id:c.contentId,"aria-labelledby":c.triggerId,...a,ref:u,align:i,side:s.dir===\`rtl\`?\`left\`:\`right\`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{s.isUsingKeyboardRef.current&&l.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:U(e.onFocusOutside,e=>{e.target!==c.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:U(e.onEscapeKeyDown,e=>{s.onClose(),e.preventDefault()}),onKeyDown:U(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=Al[s.dir].includes(e.key);t&&n&&(o.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())})})})})})});Nu.displayName=Mu;function Pu(e){return e?\`open\`:\`closed\`}function Fu(e){return e===\`indeterminate\`}function Iu(e){return Fu(e)?\`indeterminate\`:e?\`checked\`:\`unchecked\`}function Lu(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Ru(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function zu(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=Ru(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}function Bu(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}function Vu(e,t){return t?Bu({x:e.clientX,y:e.clientY},t):!1}function Hu(e){return t=>t.pointerType===\`mouse\`?e(t):void 0}var Uu=Vl,Wu=Ul,Gu=ql,Ku=Zl,qu=ru,Ju=au,Yu=cu,Xu=du,Zu=hu,Qu=_u,$u=xu,ed=Cu,td=Tu,nd=ku,rd=ju,id=Nu,ad=\`DropdownMenu\`,[od,sd]=cr(ad,[Il]),cd=Il(),[ld,ud]=od(ad),dd=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=cd(t),l=_.useRef(null),[u,d]=vr({prop:i,defaultProp:a??!1,onChange:o,caller:ad});return(0,z.jsx)(ld,{scope:t,triggerId:pr(),triggerRef:l,contentId:pr(),open:u,onOpenChange:d,onOpenToggle:_.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,z.jsx)(Uu,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};dd.displayName=ad;var fd=\`DropdownMenuTrigger\`,pd=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=ud(fd,n),o=cd(n),s=sr(t,a.triggerRef);return(0,z.jsx)(Wu,{asChild:!0,...o,children:(0,z.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:U(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:U(e.onKeyDown,e=>{r||([\`Enter\`,\` \`].includes(e.key)&&a.onOpenToggle(),e.key===\`ArrowDown\`&&a.onOpenChange(!0),[\`Enter\`,\` \`,\`ArrowDown\`].includes(e.key)&&e.preventDefault())})})})});pd.displayName=fd;var md=\`DropdownMenuPortal\`,hd=e=>{let{__scopeDropdownMenu:t,...n}=e,r=cd(t);return(0,z.jsx)(Gu,{...r,...n})};hd.displayName=md;var gd=\`DropdownMenuContent\`,_d=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=ud(gd,n),a=cd(n),o=_.useRef(!1);return(0,z.jsx)(Ku,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:U(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:U(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)\`}})});_d.displayName=gd;var vd=\`DropdownMenuGroup\`,yd=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=cd(n);return(0,z.jsx)(qu,{...i,...r,ref:t})});yd.displayName=vd;var bd=\`DropdownMenuLabel\`,xd=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=cd(n);return(0,z.jsx)(Ju,{...i,...r,ref:t})});xd.displayName=bd;var Sd=\`DropdownMenuItem\`,Cd=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=cd(n);return(0,z.jsx)(Yu,{...i,...r,ref:t})});Cd.displayName=Sd;var wd=\`DropdownMenuCheckboxItem\`,Td=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=cd(n);return(0,z.jsx)(Xu,{...i,...r,ref:t})});Td.displayName=wd;var Ed=\`DropdownMenuRadioGroup\`,Dd=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=cd(n);return(0,z.jsx)(Zu,{...i,...r,ref:t})});Dd.displayName=Ed;var Od=\`DropdownMenuRadioItem\`,kd=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=cd(n);return(0,z.jsx)(Qu,{...i,...r,ref:t})});kd.displayName=Od;var Ad=\`DropdownMenuItemIndicator\`,jd=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=cd(n);return(0,z.jsx)($u,{...i,...r,ref:t})});jd.displayName=Ad;var Md=\`DropdownMenuSeparator\`,Nd=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=cd(n);return(0,z.jsx)(ed,{...i,...r,ref:t})});Nd.displayName=Md;var Pd=\`DropdownMenuArrow\`,Fd=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=cd(n);return(0,z.jsx)(td,{...i,...r,ref:t})});Fd.displayName=Pd;var Id=e=>{let{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:i,defaultOpen:a}=e,o=cd(t),[s,c]=vr({prop:r,defaultProp:a??!1,onChange:i,caller:\`DropdownMenuSub\`});return(0,z.jsx)(nd,{...o,open:s,onOpenChange:c,children:n})},Ld=\`DropdownMenuSubTrigger\`,Rd=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=cd(n);return(0,z.jsx)(rd,{...i,...r,ref:t})});Rd.displayName=Ld;var zd=\`DropdownMenuSubContent\`,Bd=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=cd(n);return(0,z.jsx)(id,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":\`var(--radix-popper-transform-origin)\`,"--radix-dropdown-menu-content-available-width":\`var(--radix-popper-available-width)\`,"--radix-dropdown-menu-content-available-height":\`var(--radix-popper-available-height)\`,"--radix-dropdown-menu-trigger-width":\`var(--radix-popper-anchor-width)\`,"--radix-dropdown-menu-trigger-height":\`var(--radix-popper-anchor-height)\`}})});Bd.displayName=zd;var Vd=dd,Hd=pd,Ud=hd,Wd=_d,Gd=xd,Kd=Cd,qd=Nd,Jd=Id,Yd=Rd,Xd=Bd,Zd=Vd,Qd=Hd,$d=Jd,ef=\`z-50 min-w-[180px] rounded-md border border-input bg-popover p-1 shadow-xl animate-[fade-in_.1s_ease-out]\`;function tf({children:e,align:t=\`start\`,className:n}){return(0,z.jsx)(Ud,{children:(0,z.jsx)(Wd,{align:t,sideOffset:4,className:Zt(\`z-50 min-w-[180px] rounded-md border border-input bg-popover p-1 shadow-xl animate-[fade-in_.1s_ease-out]\`,n),children:e})})}function nf({children:e,onSelect:t,danger:n,disabled:r,shortcut:i}){return(0,z.jsxs)(Kd,{disabled:r,onSelect:t,className:Zt(\`flex cursor-pointer select-none items-center gap-2 rounded px-2 py-1.5 text-[13px] outline-none\`,n?\`text-destructive data-[highlighted]:bg-destructive/10\`:\`text-foreground data-[highlighted]:bg-accent\`,r&&\`pointer-events-none opacity-40\`),children:[e,i!==void 0&&(0,z.jsx)(\`span\`,{className:\`ml-auto pl-4 text-[11px] text-muted-foreground/80\`,children:i})]})}function rf({children:e}){return(0,z.jsxs)(Yd,{className:\`flex cursor-pointer select-none items-center gap-2 rounded px-2 py-1.5 text-[13px] text-foreground outline-none data-[highlighted]:bg-accent data-[state=open]:bg-accent\`,children:[e,(0,z.jsx)(ge,{size:12,className:\`ml-auto text-muted-foreground/80\`})]})}function af({children:e}){return(0,z.jsx)(Ud,{children:(0,z.jsx)(Xd,{sideOffset:6,className:ef,children:e})})}function of(){return(0,z.jsx)(qd,{className:\`my-1 h-px bg-accent\`})}function sf({children:e}){return(0,z.jsx)(Gd,{className:\`px-2 py-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/80\`,children:e})}function cf({children:e}){return(0,z.jsx)(\`div\`,{className:\`py-16 text-center text-[13px] text-muted-foreground/80\`,children:e})}function lf({className:e,mono:t,...n}){return(0,z.jsx)(\`input\`,{className:Zt(\`h-8 w-full rounded-md border border-input bg-field px-2.5 text-[13px] text-foreground\`,\`placeholder:text-muted-foreground/60 focus:border-brand focus:outline-none disabled:opacity-50\`,t&&\`font-mono\`,e),...n})}function uf({children:e}){return(0,z.jsx)(\`kbd\`,{className:\`inline-flex h-[18px] min-w-[18px] items-center justify-center rounded border border-input bg-accent px-1 font-mono text-[10px] text-muted-foreground\`,children:e})}function X({children:e}){return(0,z.jsx)(\`label\`,{className:\`mb-1 block text-xs font-medium text-muted-foreground\`,children:e})}function df({label:e,hint:t,value:n,danger:r,bare:i}){let[a,o]=(0,_.useState)(!r);return(0,z.jsxs)(\`div\`,{children:[!i&&(0,z.jsxs)(X,{children:[e,\` \`,(0,z.jsx)(\`span\`,{className:\`ml-1 font-normal \`+(r?\`text-destructive/80\`:\`text-muted-foreground/80\`),children:t})]}),(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-2\`,children:[(0,z.jsxs)(\`div\`,{className:\`relative min-w-0 flex-1\`,children:[(0,z.jsx)(lf,{mono:!0,readOnly:!0,type:a?\`text\`:\`password\`,value:n||\`unavailable\`,className:\`pr-9\`}),(0,z.jsx)(\`button\`,{type:\`button\`,title:a?\`Hide key\`:\`Reveal key\`,className:\`absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground/80 transition-colors hover:text-foreground\`,onClick:()=>o(e=>!e),children:a?(0,z.jsx)(ke,{size:14}):(0,z.jsx)(Ae,{size:14})})]}),(0,z.jsx)(er,{value:n,label:e,variant:\`outline\`,size:\`icon\`,iconSize:13,disabled:!n})]})]})}function ff({message:e}){return(0,z.jsxs)(\`div\`,{className:\`m-4 flex items-start gap-2 rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-[12px] text-destructive\`,children:[(0,z.jsx)(_e,{size:14,className:\`mt-0.5 shrink-0\`}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(\`span\`,{className:\`font-medium\`,children:\`Couldn't load this view.\`}),\` \`,e]})]})}function pf({open:e,onOpenChange:t,trigger:n,children:r,align:i=\`start\`,className:a}){return(0,z.jsxs)(\`div\`,{className:\`relative\`,children:[n,e&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(\`div\`,{className:\`fixed inset-0 z-40\`,onClick:()=>t(!1)}),(0,z.jsx)(\`div\`,{className:Zt(\`absolute top-full z-50 mt-1 rounded-md border border-input bg-popover shadow-xl animate-[fade-in_.1s_ease-out]\`,i===\`start\`?\`left-0\`:\`right-0\`,a),children:r})]})]})}var mf=(e,t,n)=>Math.min(n,Math.max(t,e));function hf({id:e,axis:t=\`x\`,side:n=\`left\`,defaultSize:r,min:i=180,max:a=560,className:o,children:s}){let c=\`tinbase_panel_\${e}\`,[l,u]=(0,_.useState)(()=>{let e=parseInt(localStorage.getItem(c)??\`\`,10);return mf(Number.isFinite(e)?e:r,i,a)}),d=(0,_.useRef)(l);d.current=l;let f=(0,_.useRef)(null);return(0,z.jsxs)(\`div\`,{className:Zt(\`relative shrink-0\`,o),style:t===\`x\`?{width:l}:{height:l},children:[s,(0,z.jsx)(\`div\`,{role:\`separator\`,"aria-orientation":t===\`x\`?\`vertical\`:\`horizontal\`,title:\`Drag to resize — double-click to reset\`,className:Zt(\`absolute z-20 transition-colors hover:bg-brand/40 active:bg-brand/60\`,t===\`x\`?Zt(\`inset-y-0 w-1 cursor-col-resize\`,n===\`left\`?\`-right-0.5\`:\`-left-0.5\`):Zt(\`inset-x-0 h-1 cursor-row-resize\`,n===\`left\`?\`-bottom-0.5\`:\`-top-0.5\`)),onPointerDown:e=>{e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),f.current={start:t===\`x\`?e.clientX:e.clientY,startSize:d.current}},onPointerMove:e=>{let r=f.current;if(!r)return;let o=t===\`x\`?e.clientX:e.clientY,s=n===\`left\`?o-r.start:r.start-o;u(mf(r.startSize+s,i,a))},onPointerUp:()=>{f.current=null,localStorage.setItem(c,String(d.current))},onDoubleClick:()=>{u(mf(r,i,a)),localStorage.setItem(c,String(r))}})]})}function gf(e,[t,n]){return Math.min(n,Math.max(t,e))}function _f(e){let t=_.useRef({value:e,previous:e});return _.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var vf=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\`}),yf=\`VisuallyHidden\`,bf=_.forwardRef((e,t)=>(0,z.jsx)(W.span,{...e,ref:t,style:{...vf,...e.style}}));bf.displayName=yf;var xf=bf,Sf=[\` \`,\`Enter\`,\`ArrowUp\`,\`ArrowDown\`],Cf=[\` \`,\`Enter\`],wf=\`Select\`,[Tf,Ef,Df]=_o(wf),[Of,kf]=cr(wf,[Df,Rc]),Af=Rc(),[jf,Mf]=Of(wf),[Nf,Pf]=Of(wf),Ff=\`SelectProvider\`;function If(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=Af(t),[v,y]=_.useState(null),[b,x]=_.useState(null),[S,C]=_.useState(!1),w=yo(l),[T,E]=vr({prop:r,defaultProp:i??!1,onChange:a,caller:wf}),[D,O]=vr({prop:o,defaultProp:s,onChange:c,caller:wf}),k=_.useRef(null),A=v?!!m||!!v.closest(\`form\`):!0,[j,M]=_.useState(new Set),N=pr(),ee=Array.from(j).map(e=>e.props.value).join(\`;\`),te=_.useCallback(e=>{M(t=>new Set(t).add(e))},[]),P=_.useCallback(e=>{M(t=>{let n=new Set(t);return n.delete(e),n})},[]),F={required:p,trigger:v,onTriggerChange:y,valueNode:b,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:N,value:D,onValueChange:O,open:T,onOpenChange:E,dir:w,triggerPointerDownPosRef:k,disabled:f,name:u,autoComplete:d,form:m,nativeOptions:j,nativeSelectKey:ee,isFormControl:A};return(0,z.jsx)(el,{...g,children:(0,z.jsx)(jf,{scope:t,...F,children:(0,z.jsx)(Tf.Provider,{scope:t,children:(0,z.jsx)(Nf,{scope:t,onNativeOptionAdd:te,onNativeOptionRemove:P,children:Ip(h)?h(F):n})})})})}If.displayName=Ff;var Lf=e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,z.jsx)(If,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,z.jsxs)(z.Fragment,{children:[n,e?(0,z.jsx)(Fp,{__scopeSelect:t}):null]})})};Lf.displayName=wf;var Rf=\`SelectTrigger\`,zf=_.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=Af(n),o=Mf(Rf,n),s=o.disabled||r,c=sr(t,o.onTriggerChange),l=Ef(n),u=_.useRef(\`touch\`),[d,f,p]=Rp(e=>{let t=l().filter(e=>!e.disabled),n=zp(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),m=e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,z.jsx)(tl,{asChild:!0,...a,children:(0,z.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":Lp(o.value)?\`\`:void 0,...i,ref:c,onClick:U(i.onClick,e=>{e.currentTarget.focus(),u.current!==\`mouse\`&&m(e)}),onPointerDown:U(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:U(i.onKeyDown,e=>{let t=d.current!==\`\`;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===\` \`)&&Sf.includes(e.key)&&(m(),e.preventDefault())})})})});zf.displayName=Rf;var Bf=\`SelectValue\`,Vf=_.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=\`\`,...s}=e,c=Mf(Bf,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=sr(t,c.onValueNodeChange);ur(()=>{l(u)},[l,u]);let f=Lp(c.value);return(0,z.jsx)(W.span,{...s,asChild:f?!1:s.asChild,ref:d,style:{pointerEvents:\`none\`},children:(0,z.jsx)(_.Fragment,{children:f?o:a},f?\`placeholder\`:\`value\`)})});Vf.displayName=Bf;var Hf=\`SelectIcon\`,Uf=_.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,z.jsx)(W.span,{"aria-hidden":!0,...i,ref:t,children:r||\`▼\`})});Uf.displayName=Hf;var Wf=\`SelectPortal\`,[Gf,Kf]=Of(Wf,{forceMount:void 0}),qf=e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,z.jsx)(Gf,{scope:e.__scopeSelect,forceMount:n,children:(0,z.jsx)(pi,{asChild:!0,...r})})};qf.displayName=Wf;var Jf=\`SelectContent\`,Yf=_.forwardRef((e,t)=>{let n=Kf(Jf,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=Mf(Jf,e.__scopeSelect),[o,s]=_.useState();return ur(()=>{s(new DocumentFragment)},[]),(0,z.jsx)(hi,{present:r||a.open,children:({present:e})=>e?(0,z.jsx)(np,{...i,ref:t}):(0,z.jsx)(Xf,{...i,fragment:o})})});Yf.displayName=Jf;var Xf=_.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,fragment:i}=e;return i?_n.createPortal((0,z.jsx)(Qf,{scope:n,children:(0,z.jsx)(Tf.Slot,{scope:n,children:(0,z.jsx)(\`div\`,{ref:t,children:r})})}),i):null});Xf.displayName=\`SelectContentFragment\`;var Zf=10,[Qf,$f]=Of(Jf),ep=\`SelectContentImpl\`,tp=xr(\`SelectContent.RemoveScroll\`),np=_.forwardRef((e,t)=>{let{__scopeSelect:n}=e,{position:r=\`item-aligned\`,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,...v}=e,y=Mf(Jf,n),[b,x]=_.useState(null),[S,C]=_.useState(null),w=sr(t,x),[T,E]=_.useState(null),[D,O]=_.useState(null),k=Ef(n),[A,j]=_.useState(!1),M=_.useRef(!1);_.useEffect(()=>{if(b)return Va(b)},[b]),Ci();let N=_.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&&S&&(S.scrollTop=0),n===r&&S&&(S.scrollTop=S.scrollHeight),n?.focus(),document.activeElement!==i))return},[k,S]),ee=_.useCallback(()=>N([T,b]),[N,T,b]);_.useEffect(()=>{A&&ee()},[A,ee]);let{onOpenChange:te,triggerPointerDownPosRef:P}=y;_.useEffect(()=>{if(b){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(P.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(P.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(b)||te(!1),document.removeEventListener(\`pointermove\`,t),P.current=null};return P.current!==null&&(document.addEventListener(\`pointermove\`,t),document.addEventListener(\`pointerup\`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(\`pointermove\`,t),document.removeEventListener(\`pointerup\`,n,{capture:!0})}}},[b,te,P]),_.useEffect(()=>{let e=()=>te(!1);return window.addEventListener(\`blur\`,e),window.addEventListener(\`resize\`,e),()=>{window.removeEventListener(\`blur\`,e),window.removeEventListener(\`resize\`,e)}},[te]);let[F,ne]=Rp(e=>{let t=k().filter(e=>!e.disabled),n=zp(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),re=_.useCallback((e,t,n)=>{let r=!M.current&&!n;(y.value!==void 0&&y.value===t||r)&&(E(e),r&&(M.current=!0))},[y.value]),ie=_.useCallback(()=>b?.focus(),[b]),ae=_.useCallback((e,t,n)=>{let r=!M.current&&!n;(y.value!==void 0&&y.value===t||r)&&O(e)},[y.value]),oe=r===\`popper\`?op:ip,I=oe===op?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,z.jsx)(Qf,{scope:n,content:b,viewport:S,onViewportChange:C,itemRefCallback:re,selectedItem:T,onItemLeave:ie,itemTextRefCallback:ae,focusSelectedItem:ee,selectedItemText:D,position:r,isPositioned:A,searchRef:F,children:(0,z.jsx)(Ma,{as:tp,allowPinchZoom:!0,children:(0,z.jsx)(ei,{asChild:!0,trapped:y.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:U(i,e=>{y.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,z.jsx)(Hr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:(0,z.jsx)(oe,{role:\`listbox\`,id:y.contentId,"data-state":y.open?\`open\`:\`closed\`,dir:y.dir,onContextMenu:e=>e.preventDefault(),...v,...I,onPlaced:()=>j(!0),ref:w,style:{display:\`flex\`,flexDirection:\`column\`,outline:\`none\`,...v.style},onKeyDown:U(v.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===\`Tab\`&&e.preventDefault(),!t&&e.key.length===1&&ne(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()}})})})})})})});np.displayName=ep;var rp=\`SelectItemAlignedPosition\`,ip=_.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=Mf(Jf,n),o=$f(Jf,n),[s,c]=_.useState(null),[l,u]=_.useState(null),d=sr(t,u),f=Ef(n),p=_.useRef(!1),m=_.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:v,focusSelectedItem:y}=o,b=_.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&g&&v){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=v.getBoundingClientRect();if(a.dir!==\`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-Zf,d=gf(a,[Zf,Math.max(Zf,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-Zf,d=gf(a,[Zf,Math.max(Zf,u-l)]);s.style.minWidth=c+\`px\`,s.style.right=d+\`px\`}let o=f(),c=window.innerHeight-Zf*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),_=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+_+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-Zf,D=c-E,O=g.offsetHeight/2,k=g.offsetTop+O,A=m+_+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=\`\${Zf}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,v,a.dir,r]);ur(()=>b(),[b]);let[x,S]=_.useState();return ur(()=>{l&&S(window.getComputedStyle(l).zIndex)},[l]),(0,z.jsx)(sp,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:_.useCallback(e=>{e&&m.current===!0&&(b(),y?.(),m.current=!1)},[b,y]),children:(0,z.jsx)(\`div\`,{ref:c,style:{display:\`flex\`,flexDirection:\`column\`,position:\`fixed\`,zIndex:x},children:(0,z.jsx)(W.div,{...i,ref:d,style:{boxSizing:\`border-box\`,maxHeight:\`100%\`,...i.style}})})})});ip.displayName=rp;var ap=\`SelectPopperPosition\`,op=_.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=\`start\`,collisionPadding:i=Zf,...a}=e,o=Af(n);return(0,z.jsx)(nl,{...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)\`}})});op.displayName=ap;var[sp,cp]=Of(Jf,{}),lp=\`SelectViewport\`,up=_.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=$f(lp,n),o=cp(lp,n),s=sr(t,a.onViewportChange),c=_.useRef(0);return(0,z.jsxs)(z.Fragment,{children:[(0,z.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,z.jsx)(Tf.Slot,{scope:n,children:(0,z.jsx)(W.div,{"data-radix-select-viewport":\`\`,role:\`presentation\`,...i,ref:s,style:{position:\`relative\`,flex:1,overflow:\`hidden auto\`,...i.style},onScroll:U(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-Zf*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})})})]})});up.displayName=lp;var dp=\`SelectGroup\`,[fp,pp]=Of(dp),mp=_.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=pr();return(0,z.jsx)(fp,{scope:n,id:i,children:(0,z.jsx)(W.div,{role:\`group\`,"aria-labelledby":i,...r,ref:t})})});mp.displayName=dp;var hp=\`SelectLabel\`,gp=_.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=pp(hp,n);return(0,z.jsx)(W.div,{id:i.id,...r,ref:t})});gp.displayName=hp;var _p=\`SelectItem\`,[vp,yp]=Of(_p),bp=_.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=Mf(_p,n),c=$f(_p,n),l=s.value===r,[u,d]=_.useState(a??\`\`),[f,p]=_.useState(!1),m=sr(t,Fr(e=>c.itemRefCallback?.(e,r,i))),h=pr(),g=_.useRef(\`touch\`),v=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};return(0,z.jsx)(vp,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:_.useCallback(e=>{d(t=>t||(e?.textContent??\`\`).trim())},[]),children:(0,z.jsx)(Tf.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,z.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:U(o.onFocus,()=>p(!0)),onBlur:U(o.onBlur,()=>p(!1)),onClick:U(o.onClick,()=>{g.current!==\`mouse\`&&v()}),onPointerUp:U(o.onPointerUp,()=>{g.current===\`mouse\`&&v()}),onPointerDown:U(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:U(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===\`mouse\`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:U(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:U(o.onKeyDown,e=>{c.searchRef?.current!==\`\`&&e.key===\` \`||(Cf.includes(e.key)&&v(),e.key===\` \`&&e.preventDefault())})})})})});bp.displayName=_p;var xp=\`SelectItemText\`,Sp=_.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=Mf(xp,n),s=$f(xp,n),c=yp(xp,n),l=Pf(xp,n),[u,d]=_.useState(null),f=Fr(e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=sr(t,d,c.onItemTextChange,f),m=u?.textContent,h=_.useMemo(()=>(0,z.jsx)(\`option\`,{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:v}=l;return ur(()=>(g(h),()=>v(h)),[g,v,h]),(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(W.span,{id:c.textId,...a,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!Lp(o.value)?_n.createPortal(a.children,o.valueNode):null]})});Sp.displayName=xp;var Cp=\`SelectItemIndicator\`,wp=_.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return yp(Cp,n).isSelected?(0,z.jsx)(W.span,{"aria-hidden":!0,...r,ref:t}):null});wp.displayName=Cp;var Tp=\`SelectScrollUpButton\`,Ep=_.forwardRef((e,t)=>{let n=$f(Tp,e.__scopeSelect),r=cp(Tp,e.__scopeSelect),[i,a]=_.useState(!1),o=sr(t,r.onScrollButtonChange);return ur(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollTop>0;a(e)},t=n.viewport;return e(),t.addEventListener(\`scroll\`,e),()=>t.removeEventListener(\`scroll\`,e)}},[n.viewport,n.isPositioned]),i?(0,z.jsx)(kp,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});Ep.displayName=Tp;var Dp=\`SelectScrollDownButton\`,Op=_.forwardRef((e,t)=>{let n=$f(Dp,e.__scopeSelect),r=cp(Dp,e.__scopeSelect),[i,a]=_.useState(!1),o=sr(t,r.onScrollButtonChange);return ur(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;a(n)},t=n.viewport;return e(),t.addEventListener(\`scroll\`,e),()=>t.removeEventListener(\`scroll\`,e)}},[n.viewport,n.isPositioned]),i?(0,z.jsx)(kp,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});Op.displayName=Dp;var kp=_.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=$f(\`SelectScrollButton\`,n),o=_.useRef(null),s=Ef(n),c=_.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return _.useEffect(()=>()=>c(),[c]),ur(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:\`nearest\`})},[s]),(0,z.jsx)(W.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:U(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:U(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:U(i.onPointerLeave,()=>{c()})})}),Ap=\`SelectSeparator\`,jp=_.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,z.jsx)(W.div,{"aria-hidden":!0,...r,ref:t})});jp.displayName=Ap;var Mp=\`SelectArrow\`,Np=_.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Af(n);return $f(Mp,n).position===\`popper\`?(0,z.jsx)(rl,{...i,...r,ref:t}):null});Np.displayName=Mp;var Pp=\`SelectBubbleInput\`,Fp=_.forwardRef(({__scopeSelect:e,...t},n)=>{let r=Mf(Pp,e),{value:i,onValueChange:a,required:o,disabled:s,name:c,autoComplete:l,form:u}=r,{nativeOptions:d,nativeSelectKey:f}=r,p=_.useRef(null),m=sr(n,p),h=i??\`\`,g=_f(h),v=Array.from(d).some(e=>(e.props.value??\`\`)===\`\`);return _.useEffect(()=>{let e=p.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,\`value\`).set;if(g!==h&&n){let t=new Event(\`change\`,{bubbles:!0});n.call(e,h),e.dispatchEvent(t)}},[g,h]),(0,z.jsxs)(W.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:u,onChange:e=>a(e.target.value),...t,style:{...vf,...t.style},ref:m,defaultValue:h,children:[Lp(i)&&!v?(0,z.jsx)(\`option\`,{value:\`\`}):null,Array.from(d)]},f)});Fp.displayName=Pp;function Ip(e){return typeof e==\`function\`}function Lp(e){return e===\`\`||e===void 0}function Rp(e){let t=Fr(e),n=_.useRef(\`\`),r=_.useRef(0),i=_.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==\`\`&&(r.current=window.setTimeout(()=>e(\`\`),1e3))})(i)},[t]),a=_.useCallback(()=>{n.current=\`\`,window.clearTimeout(r.current)},[]);return _.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function zp(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=Bp(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}function Bp(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Vp=\`__select-empty__\`,Hp=e=>e===\`\`?Vp:e,Up=e=>e===Vp?\`\`:e;function Wp({value:e,onValueChange:t,options:n,placeholder:r=\`Select…\`,disabled:i,autoFocus:a,mono:o,size:s=\`sm\`,className:c=\`w-full\`}){return(0,z.jsxs)(Lf,{value:Hp(e),onValueChange:e=>t(Up(e)),disabled:i,children:[(0,z.jsxs)(zf,{autoFocus:a,className:Zt(\`flex cursor-pointer items-center gap-1.5 rounded-md border border-input bg-field text-left text-foreground\`,s===\`xs\`?\`h-6 px-2 text-xs\`:\`h-8 px-2.5 text-[13px]\`,\`transition-colors hover:border-muted-foreground focus:border-brand focus:outline-none disabled:pointer-events-none disabled:opacity-50\`,\`data-placeholder:text-muted-foreground/60\`,o&&\`font-mono\`,c),children:[(0,z.jsx)(\`span\`,{className:\`min-w-0 flex-1 truncate\`,children:(0,z.jsx)(Vf,{placeholder:r})}),(0,z.jsx)(Uf,{children:(0,z.jsx)(me,{size:13,className:\`shrink-0 text-muted-foreground/80\`})})]}),(0,z.jsx)(qf,{children:(0,z.jsx)(Yf,{position:\`popper\`,sideOffset:4,className:\`z-90 max-h-64 min-w-(--radix-select-trigger-width) overflow-hidden rounded-md border border-input bg-popover shadow-xl animate-[fade-in_.1s_ease-out]\`,children:(0,z.jsx)(up,{className:\`p-1\`,children:n.map(e=>(0,z.jsxs)(bp,{value:Hp(e.value),disabled:e.disabled,className:Zt(\`flex cursor-pointer select-none items-center gap-2 rounded px-2 py-1.5 text-[13px] text-foreground outline-none\`,\`data-highlighted:bg-accent data-disabled:pointer-events-none data-disabled:opacity-40\`,o&&\`font-mono\`),children:[(0,z.jsx)(\`span\`,{className:\`min-w-0 flex-1 truncate\`,children:(0,z.jsx)(Sp,{children:e.label??e.value})}),(0,z.jsx)(wp,{children:(0,z.jsx)(pe,{size:12,className:\`shrink-0 text-brand\`})})]},e.value))})})})]})}var Gp=200,Kp=mo;function qp({open:e,onClose:t,title:n,children:r,footer:i,actions:a,flush:o,hideHeader:s,width:c=\`w-[500px]\`}){let[l,u]=(0,_.useState)(e),d=(0,_.useRef)(void 0);(0,_.useEffect)(()=>(e&&u(!0),()=>clearTimeout(d.current)),[e]);let f=()=>{l&&(u(!1),d.current=setTimeout(t,Gp))};return(0,z.jsx)(qa,{open:e&&l,onOpenChange:e=>!e&&f(),children:(0,z.jsxs)($a,{children:[(0,z.jsx)(to,{className:\`fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-[fade-in_.15s_ease-out] data-[state=closed]:animate-[fade-out_.2s_ease-in]\`}),(0,z.jsxs)(ao,{className:Zt(\`fixed inset-y-0 right-0 z-50 flex max-w-[92vw] flex-col border-l border-border bg-background shadow-2xl\`,\`transition-[width] duration-300 ease-[cubic-bezier(0.16,1,0.3,1)]\`,\`data-[state=open]:animate-[sheet-in_.25s_cubic-bezier(0.16,1,0.3,1)] data-[state=closed]:animate-[sheet-out_.2s_ease-in]\`,\`focus:outline-none\`,c),children:[s?(0,z.jsx)(lo,{className:\`sr-only\`,children:n}):(0,z.jsxs)(\`div\`,{className:\`flex shrink-0 items-center justify-between border-b border-border px-5 py-3.5\`,children:[(0,z.jsx)(lo,{className:\`text-sm font-medium text-foreground\`,children:n}),(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-1\`,children:[a,(0,z.jsx)(mo,{className:\`rounded p-0.5 text-muted-foreground/80 hover:bg-accent hover:text-foreground\`,children:(0,z.jsx)(Lt,{size:16})})]})]}),(0,z.jsx)(\`div\`,{className:Zt(\`min-h-0 flex-1\`,o?\`overflow-hidden\`:\`overflow-y-auto px-5 py-4\`),children:r}),i&&(0,z.jsx)(\`div\`,{className:\`flex shrink-0 items-center gap-2 border-t border-border bg-card px-5 py-3\`,children:i})]})]})})}function Jp(){return(0,z.jsx)(\`div\`,{className:\`flex items-center justify-center py-16 text-muted-foreground/80\`,children:(0,z.jsx)(\`div\`,{className:\`size-5 animate-spin rounded-full border-2 border-input border-t-brand\`})})}function Yp({checked:e,onChange:t,disabled:n}){return(0,z.jsx)(\`button\`,{type:\`button\`,role:\`switch\`,"aria-checked":e,disabled:n,onClick:()=>t?.(!e),className:Zt(\`relative h-4.5 w-8 shrink-0 rounded-full transition-colors\`,e?\`bg-brand\`:\`bg-muted\`,n&&\`pointer-events-none opacity-40\`),children:(0,z.jsx)(\`span\`,{className:Zt(\`absolute left-0 top-0.5 size-3.5 rounded-full bg-white transition-transform\`,e?\`translate-x-4\`:\`translate-x-0.5\`)})})}function Xp({children:e,className:t}){return(0,z.jsx)(\`table\`,{className:Zt(\`w-full border-collapse text-[13px]\`,t),children:e})}function Zp({children:e}){return(0,z.jsx)(\`thead\`,{className:\`sticky top-0 z-10 bg-card\`,children:e})}function Z({className:e,...t}){return(0,z.jsx)(\`th\`,{className:Zt(\`whitespace-nowrap border-b border-border px-3 py-2 text-left font-medium text-muted-foreground\`,e),...t})}function Qp({className:e,...t}){return(0,z.jsx)(\`tr\`,{className:Zt(\`group border-b border-border/60 transition-colors hover:bg-accent/30\`,e),...t})}function Q({className:e,...t}){return(0,z.jsx)(\`td\`,{className:Zt(\`px-3 py-1.5 align-middle\`,e),...t})}function $p({tabs:e,active:t,onSelect:n}){return(0,z.jsx)(\`div\`,{className:\`flex gap-5 border-b border-border\`,children:e.map(e=>(0,z.jsx)(\`button\`,{onClick:()=>n(e.id),className:\`-mb-px border-b-2 pb-2 text-[13px] transition-colors \`+(t===e.id?\`border-foreground font-medium text-foreground\`:\`border-transparent text-muted-foreground hover:text-foreground\`),children:e.label},e.id))})}function em({className:e,...t}){return(0,z.jsx)(\`textarea\`,{className:Zt(\`w-full rounded-md border border-input bg-field p-2.5 font-mono text-[13px] text-foreground\`,\`placeholder:text-muted-foreground/60 focus:border-brand focus:outline-none disabled:opacity-50\`,e),...t})}var[tm,nm]=cr(\`Tooltip\`,[Rc]),rm=Rc(),im=\`TooltipProvider\`,am=700,om=\`tooltip.open\`,[sm,cm]=tm(im),lm=e=>{let{__scopeTooltip:t,delayDuration:n=am,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=_.useRef(!0),s=_.useRef(!1),c=_.useRef(0);return _.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,z.jsx)(sm,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:_.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:_.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:_.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};lm.displayName=im;var um=\`Tooltip\`,[dm,fm]=tm(um),pm=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=cm(um,e.__scopeTooltip),l=rm(t),[u,d]=_.useState(null),f=pr(),p=_.useRef(0),m=o??c.disableHoverableContent,h=s??c.delayDuration,g=_.useRef(!1),[v,y]=vr({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(om))):c.onClose(),a?.(e)},caller:um}),b=_.useMemo(()=>v?g.current?\`delayed-open\`:\`instant-open\`:\`closed\`,[v]),x=_.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g.current=!1,y(!0)},[y]),S=_.useCallback(()=>{window.clearTimeout(p.current),p.current=0,y(!1)},[y]),C=_.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{g.current=!0,y(!0),p.current=0},h)},[h,y]);return _.useEffect(()=>()=>{p.current&&=(window.clearTimeout(p.current),0)},[]),(0,z.jsx)(el,{...l,children:(0,z.jsx)(dm,{scope:t,contentId:f,open:v,stateAttribute:b,trigger:u,onTriggerChange:d,onTriggerEnter:_.useCallback(()=>{c.isOpenDelayedRef.current?C():x()},[c.isOpenDelayedRef,C,x]),onTriggerLeave:_.useCallback(()=>{m?S():(window.clearTimeout(p.current),p.current=0)},[S,m]),onOpen:x,onClose:S,disableHoverableContent:m,children:n})})};pm.displayName=um;var mm=\`TooltipTrigger\`,hm=_.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=fm(mm,n),a=cm(mm,n),o=rm(n),s=sr(t,_.useRef(null),i.onTriggerChange),c=_.useRef(!1),l=_.useRef(!1),u=_.useCallback(()=>c.current=!1,[]);return _.useEffect(()=>()=>document.removeEventListener(\`pointerup\`,u),[u]),(0,z.jsx)(tl,{asChild:!0,...o,children:(0,z.jsx)(W.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:U(e.onPointerMove,e=>{e.pointerType!==\`touch\`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:U(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:U(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(\`pointerup\`,u,{once:!0})}),onFocus:U(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:U(e.onBlur,i.onClose),onClick:U(e.onClick,i.onClose)})})});hm.displayName=mm;var gm=\`TooltipPortal\`,[_m,vm]=tm(gm,{forceMount:void 0}),ym=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=fm(gm,t);return(0,z.jsx)(_m,{scope:t,forceMount:n,children:(0,z.jsx)(hi,{present:n||a.open,children:(0,z.jsx)(pi,{asChild:!0,container:i,children:r})})})};ym.displayName=gm;var bm=\`TooltipContent\`,xm=_.forwardRef((e,t)=>{let n=vm(bm,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=\`top\`,...a}=e,o=fm(bm,e.__scopeTooltip);return(0,z.jsx)(hi,{present:r||o.open,children:o.disableHoverableContent?(0,z.jsx)(Em,{side:i,...a,ref:t}):(0,z.jsx)(Sm,{side:i,...a,ref:t})})}),Sm=_.forwardRef((e,t)=>{let n=fm(bm,e.__scopeTooltip),r=cm(bm,e.__scopeTooltip),i=_.useRef(null),a=sr(t,i),[o,s]=_.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=_.useCallback(()=>{s(null),d(!1)},[d]),p=_.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=Am(r,km(r,n.getBoundingClientRect())),a=jm(t.getBoundingClientRect()),o=Nm([...i,...a]);s(o),d(!0)},[d]);return _.useEffect(()=>()=>f(),[f]),_.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(\`pointerleave\`,e),u.addEventListener(\`pointerleave\`,t),()=>{c.removeEventListener(\`pointerleave\`,e),u.removeEventListener(\`pointerleave\`,t)}}},[c,u,p,f]),_.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!Mm(n,o);r?f():i&&(f(),l())};return document.addEventListener(\`pointermove\`,e),()=>document.removeEventListener(\`pointermove\`,e)}},[c,u,o,l,f]),(0,z.jsx)(Em,{...e,ref:a})}),[Cm,wm]=tm(um,{isInside:!1}),Tm=Cr(\`TooltipContent\`),Em=_.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=fm(bm,n),l=rm(n),{onClose:u}=c;return _.useEffect(()=>(document.addEventListener(om,u),()=>document.removeEventListener(om,u)),[u]),_.useEffect(()=>{if(c.trigger){let e=e=>{e.target instanceof Node&&e.target.contains(c.trigger)&&u()};return window.addEventListener(\`scroll\`,e,{capture:!0}),()=>window.removeEventListener(\`scroll\`,e,{capture:!0})}},[c.trigger,u]),(0,z.jsx)(Hr,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,z.jsxs)(nl,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.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,z.jsx)(Tm,{children:r}),(0,z.jsx)(Cm,{scope:n,isInside:!0,children:(0,z.jsx)(xf,{id:c.contentId,role:\`tooltip\`,children:i||r})})]})})});xm.displayName=bm;var Dm=\`TooltipArrow\`,Om=_.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=rm(n);return wm(Dm,n).isInside?null:(0,z.jsx)(rl,{...i,...r,ref:t})});Om.displayName=Dm;function km(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\`)}}function Am(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});break}return r}function jm(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}]}function Mm(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}function Nm(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)),Pm(t)}function Pm(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)}var Fm=lm,Im=pm,Lm=hm,Rm=ym,zm=xm;function Bm({content:e,children:t,side:n=\`top\`}){return(0,z.jsx)(Fm,{delayDuration:250,children:(0,z.jsxs)(Im,{children:[(0,z.jsx)(Lm,{asChild:!0,children:t}),(0,z.jsx)(Rm,{children:(0,z.jsx)(zm,{side:n,sideOffset:5,className:\`z-[60] max-w-[300px] rounded-md border border-input bg-field px-2 py-1 text-xs text-foreground shadow-xl animate-[fade-in_.1s_ease-out]\`,children:e})})]})})}var Vm=e=>String(e).padStart(2,\`0\`),Hm=e=>e.toLocaleDateString(void 0,{day:\`2-digit\`,month:\`short\`,year:\`2-digit\`}),Um=e=>\`\${Vm(e.getHours())}:\${Vm(e.getMinutes())}:\${Vm(e.getSeconds())}\`,Wm=e=>{let t=e.toISOString();return\`\${t.slice(8,10)} \${e.toLocaleDateString(\`en\`,{month:\`short\`,timeZone:\`UTC\`})} \${t.slice(2,4)} \${t.slice(11,19)}\`};function Gm(e){let t=e.getTime()-Date.now(),n=Math.abs(t);if(n<1e4)return\`a few seconds ago\`;for(let[e,r]of[[31536e6,\`year\`],[2592e6,\`month\`],[864e5,\`day\`],[36e5,\`hour\`],[6e4,\`minute\`],[1e3,\`second\`]])if(n>=e){let i=Math.round(n/e);return t<0?\`\${i} \${r}\${i>1?\`s\`:\`\`} ago\`:\`in \${i} \${r}\${i>1?\`s\`:\`\`}\`}return\`just now\`}function Km({label:e,value:t}){return(0,z.jsxs)(\`div\`,{className:\`flex items-baseline gap-2 font-mono text-[11px]\`,children:[(0,z.jsx)(\`span\`,{className:\`shrink-0 text-muted-foreground\`,children:e}),(0,z.jsx)(\`span\`,{className:\`min-w-4 flex-1 border-b border-dotted border-muted-foreground/30\`}),(0,z.jsx)(\`span\`,{className:\`shrink-0 tabular-nums text-foreground/90\`,children:t})]})}function qm({value:e,format:t=\`datetime\`,className:n=\`\`}){if(e==null||e===\`\`)return(0,z.jsx)(\`span\`,{className:n,children:\`—\`});let r=e instanceof Date?e:new Date(e);if(Number.isNaN(r.getTime()))return(0,z.jsx)(\`span\`,{className:n,children:String(e)});let i=t===\`time\`?Um(r):t===\`date\`?Hm(r):t===\`relative\`?Gm(r):\`\${Hm(r)} \${Um(r)}\`,a=Intl.DateTimeFormat().resolvedOptions().timeZone;return(0,z.jsx)(Bm,{side:\`top\`,content:(0,z.jsxs)(\`div\`,{className:\`w-72 space-y-1 p-1\`,children:[(0,z.jsx)(Km,{label:\`UTC\`,value:Wm(r)}),(0,z.jsx)(Km,{label:a,value:\`\${Hm(r)} \${Um(r)}\`}),(0,z.jsx)(Km,{label:\`Relative\`,value:Gm(r)}),(0,z.jsx)(Km,{label:\`Timestamp\`,value:r.getTime()})]}),children:(0,z.jsx)(\`span\`,{className:\`cursor-default whitespace-nowrap tabular-nums underline decoration-dotted decoration-muted-foreground/40 underline-offset-2 \`+n,children:i})})}function Jm({value:e}){return e==null?(0,z.jsx)(\`span\`,{className:\`select-none text-muted-foreground/60\`,children:\`NULL\`}):e===\`\`?(0,z.jsx)(\`span\`,{className:\`select-none italic text-muted-foreground/60\`,children:\`empty\`}):typeof e==\`boolean\`?(0,z.jsx)(\`span\`,{className:\`text-info\`,children:String(e)}):typeof e==\`object\`?(0,z.jsx)(\`span\`,{className:\`text-warning/90\`,children:JSON.stringify(e)}):(0,z.jsx)(z.Fragment,{children:String(e)})}function Ym(e){if(e==null)return;let t=typeof e==\`object\`?JSON.stringify(e):String(e);return t.length>40?t:void 0}var $=({children:e})=>(0,z.jsx)(\`code\`,{className:\`rounded bg-accent px-1 py-px font-mono text-[12px] text-foreground/90\`,children:e}),Xm=/auth\\.(uid|jwt|role|email)\\(\\)/i,Zm=/\\(\\s*select\\s+(auth\\.|current_setting)/i;async function Qm(){let[e,t,n,r,i,a,o,s,c,l,u,d,f,p,m]=await Promise.allSettled([N.sql(\`select c.relname as name, c.relrowsecurity as rls,
|
|
1450
|
+
\`},Da=0,Oa=[];function ka(e){var t=_.useRef([]),n=_.useRef([0,0]),r=_.useRef(),i=_.useState(Da++)[0],a=_.useState(Zi)[0],o=_.useRef(e);_.useEffect(function(){o.current=e},[e]),_.useEffect(function(){if(e.inert){document.body.classList.add(\`block-interactivity-\${i}\`);var t=Di([e.lockRef.current],(e.shards||[]).map(wa),!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=_.useCallback(function(e,t){if(\`touches\`in e&&e.touches.length===2||e.type===\`wheel\`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Sa(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=ha(d,u);if(!m)return!0;if(m?l=d:(l=d===\`v\`?\`h\`:\`v\`,m=ha(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 xa(h,t,e,h===\`h\`?s:c,!0)},[]),c=_.useCallback(function(e){var n=e;if(!(!Oa.length||Oa[Oa.length-1]!==a)){var r=\`deltaY\`in n?Ca(n):Sa(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Ta(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(wa).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=_.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Aa(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=_.useCallback(function(e){n.current=Sa(e),r.current=void 0},[]),d=_.useCallback(function(t){l(t.type,Ca(t),t.target,s(t,e.lockRef.current))},[]),f=_.useCallback(function(t){l(t.type,Sa(t),t.target,s(t,e.lockRef.current))},[]);_.useEffect(function(){return Oa.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(\`wheel\`,c,ua),document.addEventListener(\`touchmove\`,c,ua),document.addEventListener(\`touchstart\`,u,ua),function(){Oa=Oa.filter(function(e){return e!==a}),document.removeEventListener(\`wheel\`,c,ua),document.removeEventListener(\`touchmove\`,c,ua),document.removeEventListener(\`touchstart\`,u,ua)}},[]);var p=e.removeScrollBar,m=e.inert;return _.createElement(_.Fragment,null,m?_.createElement(a,{styles:Ea(i)}):null,p?_.createElement(sa,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Aa(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var ja=Bi(Vi,ka),Ma=_.forwardRef(function(e,t){return _.createElement(Ui,Ti({},e,{ref:t,sideCar:ja}))});Ma.classNames=Ui.classNames;var Na=function(e){return typeof document>\`u\`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Pa=new WeakMap,Fa=new WeakMap,Ia={},La=0,Ra=function(e){return e&&(e.host||Ra(e.parentNode))},za=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Ra(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})},Ba=function(e,t,n,r){var i=za(t,Array.isArray(e)?e:[e]);Ia[n]||(Ia[n]=new WeakMap);var a=Ia[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=(Pa.get(e)||0)+1,l=(a.get(e)||0)+1;Pa.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Fa.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(),La++,function(){o.forEach(function(e){var t=Pa.get(e)-1,i=a.get(e)-1;Pa.set(e,t),a.set(e,i),t||(Fa.has(e)||e.removeAttribute(r),Fa.delete(e)),i||e.removeAttribute(n)}),La--,La||(Pa=new WeakMap,Pa=new WeakMap,Fa=new WeakMap,Ia={})}},Va=function(e,t,n){n===void 0&&(n=\`data-aria-hidden\`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Na(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(\`[aria-live], script\`))),Ba(r,i,n,\`aria-hidden\`)):function(){return null}},Ha=\`Dialog\`,[Ua,Wa]=cr(Ha),[Ga,Ka]=Ua(Ha),qa=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=_.useRef(null),c=_.useRef(null),[l,u]=vr({prop:r,defaultProp:i??!1,onChange:a,caller:Ha});return(0,z.jsx)(Ga,{scope:t,triggerRef:s,contentRef:c,contentId:pr(),titleId:pr(),descriptionId:pr(),open:l,onOpenChange:u,onOpenToggle:_.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};qa.displayName=Ha;var Ja=\`DialogTrigger\`,Ya=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Ka(Ja,n),a=sr(t,i.triggerRef);return(0,z.jsx)(W.button,{type:\`button\`,"aria-haspopup":\`dialog\`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":ho(i.open),...r,ref:a,onClick:U(e.onClick,i.onOpenToggle)})});Ya.displayName=Ja;var Xa=\`DialogPortal\`,[Za,Qa]=Ua(Xa,{forceMount:void 0}),$a=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Ka(Xa,t);return(0,z.jsx)(Za,{scope:t,forceMount:n,children:_.Children.map(r,e=>(0,z.jsx)(hi,{present:n||a.open,children:(0,z.jsx)(pi,{asChild:!0,container:i,children:e})}))})};$a.displayName=Xa;var eo=\`DialogOverlay\`,to=_.forwardRef((e,t)=>{let n=Qa(eo,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Ka(eo,e.__scopeDialog);return a.modal?(0,z.jsx)(hi,{present:r||a.open,children:(0,z.jsx)(ro,{...i,ref:t})}):null});to.displayName=eo;var no=xr(\`DialogOverlay.RemoveScroll\`),ro=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Ka(eo,n),a=sr(t,Gr());return(0,z.jsx)(Ma,{as:no,allowPinchZoom:!0,shards:[i.contentRef],children:(0,z.jsx)(W.div,{"data-state":ho(i.open),...r,ref:a,style:{pointerEvents:\`auto\`,...r.style}})})}),io=\`DialogContent\`,ao=_.forwardRef((e,t)=>{let n=Qa(io,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Ka(io,e.__scopeDialog);return(0,z.jsx)(hi,{present:r||a.open,children:a.modal?(0,z.jsx)(oo,{...i,ref:t}):(0,z.jsx)(K,{...i,ref:t})})});ao.displayName=io;var oo=_.forwardRef((e,t)=>{let n=Ka(io,e.__scopeDialog),r=_.useRef(null),i=sr(t,n.contentRef,r);return _.useEffect(()=>{let e=r.current;if(e)return Va(e)},[]),(0,z.jsx)(so,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:U(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:U(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:U(e.onFocusOutside,e=>e.preventDefault())})}),K=_.forwardRef((e,t)=>{let n=Ka(io,e.__scopeDialog),r=_.useRef(!1),i=_.useRef(!1);return(0,z.jsx)(so,{...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()}})}),so=_.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=Ka(io,n);return Ci(),(0,z.jsx)(z.Fragment,{children:(0,z.jsx)(ei,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,z.jsx)(Hr,{role:\`dialog\`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":ho(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})}),co=\`DialogTitle\`,lo=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Ka(co,n);return(0,z.jsx)(W.h2,{id:i.titleId,...r,ref:t})});lo.displayName=co;var uo=\`DialogDescription\`,fo=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Ka(uo,n);return(0,z.jsx)(W.p,{id:i.descriptionId,...r,ref:t})});fo.displayName=uo;var po=\`DialogClose\`,mo=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Ka(po,n);return(0,z.jsx)(W.button,{type:\`button\`,...r,ref:t,onClick:U(e.onClick,()=>i.onOpenChange(!1))})});mo.displayName=po;function ho(e){return e?\`open\`:\`closed\`}function go({open:e,onClose:t,title:n,children:r,wide:i,width:a}){return(0,z.jsx)(qa,{open:e,onOpenChange:e=>!e&&t(),children:(0,z.jsxs)($a,{children:[(0,z.jsx)(to,{className:\`fixed inset-0 z-50 bg-black/60 backdrop-blur-sm animate-[fade-in_.15s_ease-out]\`}),(0,z.jsxs)(ao,{className:Zt(\`fixed left-1/2 top-1/2 z-50 -translate-x-1/2 -translate-y-1/2 rounded-lg border border-input bg-popover shadow-2xl\`,\`max-h-[85vh] max-w-[92vw] overflow-auto focus:outline-none\`,a??(i?\`w-160\`:\`w-110\`)),children:[(0,z.jsxs)(\`div\`,{className:\`flex items-center justify-between border-b border-border px-4 py-3\`,children:[(0,z.jsx)(lo,{className:\`text-sm font-semibold\`,children:n}),(0,z.jsx)(mo,{className:\`text-muted-foreground/80 hover:text-foreground\`,children:(0,z.jsx)(Lt,{size:16})})]}),(0,z.jsx)(\`div\`,{className:\`p-4\`,children:r})]})]})})}function q({open:e,title:t,description:n,confirmLabel:r=\`Confirm\`,cancelLabel:i=\`Cancel\`,danger:a,onConfirm:o,onClose:s}){return(0,z.jsxs)(go,{open:e,onClose:s,title:t,children:[(0,z.jsxs)(\`div\`,{className:\`flex items-start gap-3\`,children:[a&&(0,z.jsx)(\`div\`,{className:\`flex size-8 shrink-0 items-center justify-center rounded-full bg-destructive/15\`,children:(0,z.jsx)(jt,{size:15,className:\`text-destructive\`})}),(0,z.jsx)(\`p\`,{className:\`min-w-0 text-[13px] leading-relaxed text-muted-foreground\`,children:n??\`Are you sure?\`})]}),(0,z.jsxs)(\`div\`,{className:\`mt-5 flex justify-end gap-2\`,children:[(0,z.jsx)(V,{variant:\`outline\`,onClick:s,children:i}),(0,z.jsx)(V,{variant:a?\`dangerSolid\`:\`default\`,autoFocus:!0,onClick:()=>{o(),s()},children:r})]})]})}function _o(e){let t=e+\`CollectionProvider\`,[n,r]=cr(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=_.useRef(null),a=_.useRef(new Map).current;return(0,z.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+\`CollectionSlot\`,c=xr(s),l=_.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=sr(t,a(s,n).collectionRef);return(0,z.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+\`CollectionItemSlot\`,d=\`data-radix-collection-item\`,f=xr(u),p=_.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=_.useRef(null),s=sr(t,o),c=a(u,n);return _.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,z.jsx)(f,{[d]:\`\`,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+\`CollectionConsumer\`,t);return _.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[{Provider:o,Slot:l,ItemSlot:p},m,r]}var vo=_.createContext(void 0);function yo(e){let t=_.useContext(vo);return e||t||\`ltr\`}var bo=[\`top\`,\`right\`,\`bottom\`,\`left\`],xo=Math.min,So=Math.max,Co=Math.round,wo=Math.floor,To=e=>({x:e,y:e}),Eo={left:\`right\`,right:\`left\`,bottom:\`top\`,top:\`bottom\`};function Do(e,t,n){return So(e,xo(t,n))}function Oo(e,t){return typeof e==\`function\`?e(t):e}function ko(e){return e.split(\`-\`)[0]}function Ao(e){return e.split(\`-\`)[1]}function jo(e){return e===\`x\`?\`y\`:\`x\`}function Mo(e){return e===\`y\`?\`height\`:\`width\`}function No(e){let t=e[0];return t===\`t\`||t===\`b\`?\`y\`:\`x\`}function Po(e){return jo(No(e))}function Fo(e,t,n){n===void 0&&(n=!1);let r=Ao(e),i=Po(e),a=Mo(i),o=i===\`x\`?r===(n?\`end\`:\`start\`)?\`right\`:\`left\`:r===\`start\`?\`bottom\`:\`top\`;return t.reference[a]>t.floating[a]&&(o=Wo(o)),[o,Wo(o)]}function Io(e){let t=Wo(e);return[Lo(e),t,Lo(t)]}function Lo(e){return e.includes(\`start\`)?e.replace(\`start\`,\`end\`):e.replace(\`end\`,\`start\`)}var Ro=[\`left\`,\`right\`],zo=[\`right\`,\`left\`],Bo=[\`top\`,\`bottom\`],Vo=[\`bottom\`,\`top\`];function Ho(e,t,n){switch(e){case\`top\`:case\`bottom\`:return n?t?zo:Ro:t?Ro:zo;case\`left\`:case\`right\`:return t?Bo:Vo;default:return[]}}function Uo(e,t,n,r){let i=Ao(e),a=Ho(ko(e),n===\`start\`,r);return i&&(a=a.map(e=>e+\`-\`+i),t&&(a=a.concat(a.map(Lo)))),a}function Wo(e){let t=ko(e);return Eo[t]+e.slice(t.length)}function Go(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ko(e){return typeof e==\`number\`?{top:e,right:e,bottom:e,left:e}:Go(e)}function qo(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 Jo(e,t,n){let{reference:r,floating:i}=e,a=No(t),o=Po(t),s=Mo(o),c=ko(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}}switch(Ao(t)){case\`start\`:p[o]-=f*(n&&l?-1:1);break;case\`end\`:p[o]+=f*(n&&l?-1:1);break}return p}async function Yo(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}=Oo(t,e),p=Ko(f),m=o[d?u===\`floating\`?\`reference\`:\`floating\`:u],h=qo(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=qo(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 Xo=50,Zo=async(e,t,n)=>{let{placement:r=\`bottom\`,strategy:i=\`absolute\`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Yo},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Jo(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<Xo&&(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}=Jo(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Qo=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}=Oo(e,t)||{};if(l==null)return{};let d=Ko(u),f={x:n,y:r},p=Po(i),m=Mo(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=xo(d[_],T),D=xo(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=Do(O,A,k),M=!c.arrow&&Ao(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),$o=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}=Oo(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=ko(r),_=No(o),v=ko(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Wo(o)]:Io(o)),x=p!==\`none\`;!d&&x&&b.push(...Uo(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=Fo(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\`&&_!==No(t))||T.every(e=>No(e.placement)===_?e.overflows[0]>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=No(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;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function es(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ts(e){return bo.some(t=>e[t]>=0)}var ns=function(e){return e===void 0&&(e={}),{name:\`hide\`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=\`referenceHidden\`,...a}=Oo(e,t);switch(i){case\`referenceHidden\`:{let e=es(await r.detectOverflow(t,{...a,elementContext:\`reference\`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:ts(e)}}}case\`escaped\`:{let e=es(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:ts(e)}}}default:return{}}}}},rs=new Set([\`left\`,\`top\`]);async function is(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=ko(n),s=Ao(n),c=No(n)===\`y\`,l=rs.has(o)?-1:1,u=a&&c?-1:1,d=Oo(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 as=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 is(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}}}}},os=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}=Oo(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=No(ko(i)),p=jo(f),m=u[p],h=u[f];if(o){let e=p===\`y\`?\`top\`:\`left\`,t=p===\`y\`?\`bottom\`:\`right\`,n=m+d[e],r=m-d[t];m=Do(n,m,r)}if(s){let e=f===\`y\`?\`top\`:\`left\`,t=f===\`y\`?\`bottom\`:\`right\`,n=h+d[e],r=h-d[t];h=Do(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},ss=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}=Oo(e,t),u={x:n,y:r},d=No(i),f=jo(d),p=u[f],m=u[d],h=Oo(s,t),g=typeof h==\`number\`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};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=rs.has(ko(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}}}},cs=function(e){return e===void 0&&(e={}),{name:\`size\`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=Oo(e,t),u=await o.detectOverflow(t,l),d=ko(i),f=Ao(i),p=No(i)===\`y\`,{width:m,height:h}=a.floating,g,_;d===\`top\`||d===\`bottom\`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?\`start\`:\`end\`)?\`left\`:\`right\`):(_=d,g=f===\`end\`?\`top\`:\`bottom\`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=xo(h-u[g],v),x=xo(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=So(u.left,0),t=So(u.right,0),n=So(u.top,0),r=So(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:So(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:So(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function ls(){return typeof window<\`u\`}function us(e){return ps(e)?(e.nodeName||\`\`).toLowerCase():\`#document\`}function ds(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function fs(e){return((ps(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function ps(e){return ls()?e instanceof Node||e instanceof ds(e).Node:!1}function ms(e){return ls()?e instanceof Element||e instanceof ds(e).Element:!1}function hs(e){return ls()?e instanceof HTMLElement||e instanceof ds(e).HTMLElement:!1}function gs(e){return!ls()||typeof ShadowRoot>\`u\`?!1:e instanceof ShadowRoot||e instanceof ds(e).ShadowRoot}function _s(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Os(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==\`inline\`&&i!==\`contents\`}function vs(e){return/^(table|td|th)$/.test(us(e))}function ys(e){try{if(e.matches(\`:popover-open\`))return!0}catch{}try{return e.matches(\`:modal\`)}catch{return!1}}var bs=/transform|translate|scale|rotate|perspective|filter/,xs=/paint|layout|strict|content/,Ss=e=>!!e&&e!==\`none\`,Cs;function ws(e){let t=ms(e)?Os(e):e;return Ss(t.transform)||Ss(t.translate)||Ss(t.scale)||Ss(t.rotate)||Ss(t.perspective)||!Es()&&(Ss(t.backdropFilter)||Ss(t.filter))||bs.test(t.willChange||\`\`)||xs.test(t.contain||\`\`)}function Ts(e){let t=As(e);for(;hs(t)&&!Ds(t);){if(ws(t))return t;if(ys(t))return null;t=As(t)}return null}function Es(){return Cs??=typeof CSS<\`u\`&&CSS.supports&&CSS.supports(\`-webkit-backdrop-filter\`,\`none\`),Cs}function Ds(e){return/^(html|body|#document)$/.test(us(e))}function Os(e){return ds(e).getComputedStyle(e)}function ks(e){return ms(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function As(e){if(us(e)===\`html\`)return e;let t=e.assignedSlot||e.parentNode||gs(e)&&e.host||fs(e);return gs(t)?t.host:t}function js(e){let t=As(e);return Ds(t)?e.ownerDocument?e.ownerDocument.body:e.body:hs(t)&&_s(t)?t:js(t)}function Ms(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=js(e),i=r===e.ownerDocument?.body,a=ds(r);if(i){let e=Ns(a);return t.concat(a,a.visualViewport||[],_s(r)?r:[],e&&n?Ms(e):[])}else return t.concat(r,Ms(r,[],n))}function Ns(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ps(e){let t=Os(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=hs(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Co(n)!==a||Co(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Fs(e){return ms(e)?e:e.contextElement}function Is(e){let t=Fs(e);if(!hs(t))return To(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Ps(t),o=(a?Co(n.width):n.width)/r,s=(a?Co(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Ls=To(0);function Rs(e){let t=ds(e);return!Es()||!t.visualViewport?Ls:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function zs(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ds(e)?!1:t}function Bs(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Fs(e),o=To(1);t&&(r?ms(r)&&(o=Is(r)):o=Is(e));let s=zs(a,n,r)?Rs(a):To(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){let e=ds(a),t=r&&ms(r)?ds(r):r,n=e,i=Ns(n);for(;i&&r&&t!==n;){let e=Is(i),t=i.getBoundingClientRect(),r=Os(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=ds(i),i=Ns(n)}}return qo({width:u,height:d,x:c,y:l})}function Vs(e,t){let n=ks(e).scrollLeft;return t?t.left+n:Bs(fs(e)).left+n}function Hs(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Vs(e,n),y:n.top+t.scrollTop}}function Us(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===\`fixed\`,o=fs(r),s=t?ys(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=To(1),u=To(0),d=hs(r);if((d||!d&&!a)&&((us(r)!==\`body\`||_s(o))&&(c=ks(r)),d)){let e=Bs(r);l=Is(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Hs(o,c):To(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 Ws(e){return Array.from(e.getClientRects())}function Gs(e){let t=fs(e),n=ks(e),r=e.ownerDocument.body,i=So(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=So(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Vs(e),s=-n.scrollTop;return Os(r).direction===\`rtl\`&&(o+=So(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Ks=25;function qs(e,t){let n=ds(e),r=fs(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Es();(!e||e&&t===\`fixed\`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Vs(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===\`CSS1Compat\`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Ks&&(a-=o)}else l<=Ks&&(a+=l);return{width:a,height:o,x:s,y:c}}function Js(e,t){let n=Bs(e,!0,t===\`fixed\`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=hs(e)?Is(e):To(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Ys(e,t,n){let r;if(t===\`viewport\`)r=qs(e,n);else if(t===\`document\`)r=Gs(fs(e));else if(ms(t))r=Js(t,n);else{let n=Rs(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return qo(r)}function Xs(e,t){let n=As(e);return n===t||!ms(n)||Ds(n)?!1:Os(n).position===\`fixed\`||Xs(n,t)}function Zs(e,t){let n=t.get(e);if(n)return n;let r=Ms(e,[],!1).filter(e=>ms(e)&&us(e)!==\`body\`),i=null,a=Os(e).position===\`fixed\`,o=a?As(e):e;for(;ms(o)&&!Ds(o);){let t=Os(o),n=ws(o);!n&&t.position===\`fixed\`&&(i=null),(a?!n&&!i:!n&&t.position===\`static\`&&i&&(i.position===\`absolute\`||i.position===\`fixed\`)||_s(o)&&!n&&Xs(e,o))?r=r.filter(e=>e!==o):i=t,o=As(o)}return t.set(e,r),r}function Qs(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===\`clippingAncestors\`?ys(t)?[]:Zs(t,this._c):[].concat(n),r],o=Ys(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=Ys(t,a[e],i);s=So(n.top,s),c=xo(n.right,c),l=xo(n.bottom,l),u=So(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function $s(e){let{width:t,height:n}=Ps(e);return{width:t,height:n}}function ec(e,t,n){let r=hs(t),i=fs(t),a=n===\`fixed\`,o=Bs(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=To(0);function l(){c.x=Vs(i)}if(r||!r&&!a)if((us(t)!==\`body\`||_s(i))&&(s=ks(t)),r){let e=Bs(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?Hs(i,s):To(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function tc(e){return Os(e).position===\`static\`}function nc(e,t){if(!hs(e)||Os(e).position===\`fixed\`)return null;if(t)return t(e);let n=e.offsetParent;return fs(e)===n&&(n=n.ownerDocument.body),n}function rc(e,t){let n=ds(e);if(ys(e))return n;if(!hs(e)){let t=As(e);for(;t&&!Ds(t);){if(ms(t)&&!tc(t))return t;t=As(t)}return n}let r=nc(e,t);for(;r&&vs(r)&&tc(r);)r=nc(r,t);return r&&Ds(r)&&tc(r)&&!ws(r)?n:r||Ts(e)||n}var ic=async function(e){let t=this.getOffsetParent||rc,n=this.getDimensions,r=await n(e.floating);return{reference:ec(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ac(e){return Os(e).direction===\`rtl\`}var oc={convertOffsetParentRelativeRectToViewportRelativeRect:Us,getDocumentElement:fs,getClippingRect:Qs,getOffsetParent:rc,getElementRects:ic,getClientRects:Ws,getDimensions:$s,getScale:Is,isElement:ms,isRTL:ac};function sc(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function cc(e,t){let n=null,r,i=fs(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=wo(d),h=wo(i.clientWidth-(u+f)),g=wo(i.clientHeight-(d+p)),_=wo(u),v={rootMargin:-m+\`px \`+-h+\`px \`+-g+\`px \`+-_+\`px\`,threshold:So(0,xo(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!sc(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function lc(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=Fs(e),u=i||a?[...l?Ms(l):[],...t?Ms(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(\`scroll\`,n,{passive:!0}),a&&e.addEventListener(\`resize\`,n)});let d=l&&s?cc(l,n):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?Bs(e):null;c&&g();function g(){let t=Bs(e);h&&!sc(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 uc=as,dc=os,fc=$o,pc=cs,mc=ns,hc=Qo,gc=ss,_c=(e,t,n)=>{let r=new Map,i={platform:oc,...n},a={...i.platform,_c:r};return Zo(e,t,{...i,platform:a})},vc=typeof document<\`u\`?_.useLayoutEffect:function(){};function yc(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(!yc(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)&&!yc(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function bc(e){return typeof window>\`u\`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function xc(e,t){let n=bc(e);return Math.round(t*n)/n}function Sc(e){let t=_.useRef(e);return vc(()=>{t.current=e}),t}function Cc(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]=_.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=_.useState(r);yc(f,r)||p(r);let[m,h]=_.useState(null),[g,v]=_.useState(null),y=_.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=_.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||m,S=o||g,C=_.useRef(null),w=_.useRef(null),T=_.useRef(u),E=c!=null,D=Sc(c),O=Sc(i),k=Sc(l),A=_.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),_c(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!yc(T.current,t)&&(T.current=t,_n.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);vc(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=_.useRef(!1);vc(()=>(j.current=!0,()=>{j.current=!1}),[]),vc(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=_.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=_.useMemo(()=>({reference:x,floating:S}),[x,S]),ee=_.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=xc(N.floating,u.x),r=xc(N.floating,u.y);return s?{...e,transform:\`translate(\`+t+\`px, \`+r+\`px)\`,...bc(N.floating)>=1.5&&{willChange:\`transform\`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return _.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:ee}),[u,A,M,N,ee])}var wc=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?{}:hc({element:r.current,padding:i}).fn(n):r?hc({element:r,padding:i}).fn(n):{}}}},Tc=(e,t)=>{let n=uc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ec=(e,t)=>{let n=dc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Dc=(e,t)=>({fn:gc(e).fn,options:[e,t]}),Oc=(e,t)=>{let n=fc(e);return{name:n.name,fn:n.fn,options:[e,t]}},kc=(e,t)=>{let n=pc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ac=(e,t)=>{let n=mc(e);return{name:n.name,fn:n.fn,options:[e,t]}},jc=(e,t)=>{let n=wc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Mc=\`Arrow\`,Nc=_.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,z.jsx)(W.svg,{...a,ref:t,width:r,height:i,viewBox:\`0 0 30 10\`,preserveAspectRatio:\`none\`,children:e.asChild?n:(0,z.jsx)(\`polygon\`,{points:\`0,0 30,0 15,10\`})})});Nc.displayName=Mc;var Pc=Nc;function Fc(e){let[t,n]=_.useState(void 0);return ur(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(\`borderBoxSize\`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:\`border-box\`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var Ic=\`Popper\`,[Lc,Rc]=cr(Ic),[zc,Bc]=Lc(Ic),Vc=e=>{let{__scopePopper:t,children:n}=e,[r,i]=_.useState(null),[a,o]=_.useState(void 0);return(0,z.jsx)(zc,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})};Vc.displayName=Ic;var Hc=\`PopperAnchor\`,Uc=_.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=Bc(Hc,n),o=_.useRef(null),s=a.onAnchorChange,c=sr(t,_.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=_.useRef(null);_.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&$c(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,z.jsx)(W.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})});Uc.displayName=Hc;var Wc=\`PopperContent\`,[Gc,Kc]=Lc(Wc),qc=_.forwardRef((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=\`partial\`,hideWhenDetached:f=!1,updatePositionStrategy:p=\`optimized\`,onPlaced:m,...h}=e,g=Bc(Wc,n),[v,y]=_.useState(null),b=sr(t,y),[x,S]=_.useState(null),C=Fc(x),w=C?.width??0,T=C?.height??0,E=r+(a===\`center\`?\`\`:\`-\`+a),D=typeof u==\`number\`?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(l)?l:[l],k=O.length>0,A={padding:D,boundary:O.filter(Zc),altBoundary:k},{refs:j,floatingStyles:M,placement:N,isPositioned:ee,middlewareData:te}=Cc({strategy:\`fixed\`,placement:E,whileElementsMounted:(...e)=>lc(...e,{animationFrame:p===\`always\`}),elements:{reference:g.anchor},middleware:[Tc({mainAxis:i+T,alignmentAxis:o}),c&&Ec({mainAxis:!0,crossAxis:!1,limiter:d===\`partial\`?Dc():void 0,...A}),c&&Oc({...A}),kc({...A,apply:({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\`)}}),x&&jc({element:x,padding:s}),Qc({arrowWidth:w,arrowHeight:T}),f&&Ac({strategy:\`referenceHidden\`,...A,boundary:k?A.boundary:void 0})]}),P=g.setPlacementState;ur(()=>(P(N),()=>{P(void 0)}),[N,P]);let[F,ne]=$c(N),re=Fr(m);ur(()=>{ee&&re?.()},[ee,re]);let ie=te.arrow?.x,ae=te.arrow?.y,oe=te.arrow?.centerOffset!==0,[I,se]=_.useState();return ur(()=>{v&&se(window.getComputedStyle(v).zIndex)},[v]),(0,z.jsx)(\`div\`,{ref:j.setFloating,"data-radix-popper-content-wrapper":\`\`,style:{...M,transform:ee?M.transform:\`translate(0, -200%)\`,minWidth:\`max-content\`,zIndex:I,"--radix-popper-transform-origin":[te.transformOrigin?.x,te.transformOrigin?.y].join(\` \`),...te.hide?.referenceHidden&&{visibility:\`hidden\`,pointerEvents:\`none\`}},dir:e.dir,children:(0,z.jsx)(Gc,{scope:n,placedSide:F,placedAlign:ne,onArrowChange:S,arrowX:ie,arrowY:ae,shouldHideArrow:oe,children:(0,z.jsx)(W.div,{"data-side":F,"data-align":ne,...h,ref:b,style:{...h.style,animation:ee?void 0:\`none\`}})})})});qc.displayName=Wc;var Jc=\`PopperArrow\`,Yc={top:\`bottom\`,right:\`left\`,bottom:\`top\`,left:\`right\`},Xc=_.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Kc(Jc,n),a=Yc[i.placedSide];return(0,z.jsx)(\`span\`,{ref:i.onArrowChange,style:{position:\`absolute\`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:\`\`,right:\`0 0\`,bottom:\`center 0\`,left:\`100% 0\`}[i.placedSide],transform:{top:\`translateY(100%)\`,right:\`translateY(50%) rotate(90deg) translateX(-50%)\`,bottom:\`rotate(180deg)\`,left:\`translateY(50%) rotate(-90deg) translateX(50%)\`}[i.placedSide],visibility:i.shouldHideArrow?\`hidden\`:void 0},children:(0,z.jsx)(Pc,{...r,ref:t,style:{...r.style,display:\`block\`}})})});Xc.displayName=Jc;function Zc(e){return e!==null}var Qc=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]=$c(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}}}});function $c(e){let[t,n=\`center\`]=e.split(\`-\`);return[t,n]}var el=Vc,tl=Uc,nl=qc,rl=Xc,il=\`rovingFocusGroup.onEntryFocus\`,al={bubbles:!1,cancelable:!0},ol=\`RovingFocusGroup\`,[sl,cl,ll]=_o(ol),[ul,dl]=cr(ol,[ll]),[fl,pl]=ul(ol),ml=_.forwardRef((e,t)=>(0,z.jsx)(sl.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,z.jsx)(sl.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,z.jsx)(hl,{...e,ref:t})})}));ml.displayName=ol;var hl=_.forwardRef((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=_.useRef(null),p=sr(t,f),m=yo(a),[h,g]=vr({prop:o,defaultProp:s??null,onChange:c,caller:ol}),[v,y]=_.useState(!1),b=Fr(l),x=cl(n),S=_.useRef(!1),[C,w]=_.useState(0);return _.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(il,b),()=>e.removeEventListener(il,b)},[b]),(0,z.jsx)(fl,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:_.useCallback(e=>g(e),[g]),onItemShiftTab:_.useCallback(()=>y(!0),[]),onFocusableItemAdd:_.useCallback(()=>w(e=>e+1),[]),onFocusableItemRemove:_.useCallback(()=>w(e=>e-1),[]),children:(0,z.jsx)(W.div,{tabIndex:v||C===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:\`none\`,...e.style},onMouseDown:U(e.onMouseDown,()=>{S.current=!0}),onFocus:U(e.onFocus,e=>{let t=!S.current;if(e.target===e.currentTarget&&t&&!v){let t=new CustomEvent(il,al);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);xl([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}S.current=!1}),onBlur:U(e.onBlur,()=>y(!1))})})}),gl=\`RovingFocusGroupItem\`,_l=_.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=pr(),l=a||c,u=pl(gl,n),d=u.currentTabStopId===l,f=cl(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u;return _.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),(0,z.jsx)(sl.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,z.jsx)(W.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:U(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:U(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:U(e.onKeyDown,e=>{if(e.key===\`Tab\`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=bl(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?Sl(n,r+1):n.slice(r+1)}setTimeout(()=>xl(n))}}),children:typeof o==\`function\`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})});_l.displayName=gl;var vl={ArrowLeft:\`prev\`,ArrowUp:\`prev\`,ArrowRight:\`next\`,ArrowDown:\`next\`,PageUp:\`first\`,Home:\`first\`,PageDown:\`last\`,End:\`last\`};function yl(e,t){return t===\`rtl\`?e===\`ArrowLeft\`?\`ArrowRight\`:e===\`ArrowRight\`?\`ArrowLeft\`:e:e}function bl(e,t,n){let r=yl(e.key,n);if(!(t===\`vertical\`&&[\`ArrowLeft\`,\`ArrowRight\`].includes(r))&&!(t===\`horizontal\`&&[\`ArrowUp\`,\`ArrowDown\`].includes(r)))return vl[r]}function xl(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Sl(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Cl=ml,wl=_l,Tl=[\`Enter\`,\` \`],El=[\`ArrowDown\`,\`PageUp\`,\`Home\`],Dl=[\`ArrowUp\`,\`PageDown\`,\`End\`],Ol=[...El,...Dl],kl={ltr:[...Tl,\`ArrowRight\`],rtl:[...Tl,\`ArrowLeft\`]},Al={ltr:[\`ArrowLeft\`],rtl:[\`ArrowRight\`]},jl=\`Menu\`,[Ml,Nl,Pl]=_o(jl),[Fl,Il]=cr(jl,[Pl,Rc,dl]),Ll=Rc(),Rl=dl(),[zl,J]=Fl(jl),[Bl,Vl]=Fl(jl),Hl=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=Ll(t),[c,l]=_.useState(null),u=_.useRef(!1),d=Fr(a),f=yo(i);return _.useEffect(()=>{let e=()=>{u.current=!0,document.addEventListener(\`pointerdown\`,t,{capture:!0,once:!0}),document.addEventListener(\`pointermove\`,t,{capture:!0,once:!0})},t=()=>u.current=!1;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})}},[]),_.useEffect(()=>{if(!n)return;let e=()=>d(!1);return window.addEventListener(\`blur\`,e),()=>window.removeEventListener(\`blur\`,e)},[n,d]),(0,z.jsx)(el,{...s,children:(0,z.jsx)(zl,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,z.jsx)(Bl,{scope:t,onClose:_.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};Hl.displayName=jl;var Ul=\`MenuAnchor\`,Wl=_.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=Ll(n);return(0,z.jsx)(tl,{...i,...r,ref:t})});Wl.displayName=Ul;var Gl=\`MenuPortal\`,[Kl,ql]=Fl(Gl,{forceMount:void 0}),Jl=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=J(Gl,t);return(0,z.jsx)(Kl,{scope:t,forceMount:n,children:(0,z.jsx)(hi,{present:n||a.open,children:(0,z.jsx)(pi,{asChild:!0,container:i,children:r})})})};Jl.displayName=Gl;var Yl=\`MenuContent\`,[Xl,Zl]=Fl(Yl),Ql=_.forwardRef((e,t)=>{let n=ql(Yl,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=J(Yl,e.__scopeMenu),o=Vl(Yl,e.__scopeMenu);return(0,z.jsx)(Ml.Provider,{scope:e.__scopeMenu,children:(0,z.jsx)(hi,{present:r||a.open,children:(0,z.jsx)(Ml.Slot,{scope:e.__scopeMenu,children:o.modal?(0,z.jsx)($l,{...i,ref:t}):(0,z.jsx)(eu,{...i,ref:t})})})})}),$l=_.forwardRef((e,t)=>{let n=J(Yl,e.__scopeMenu),r=_.useRef(null),i=sr(t,r);return _.useEffect(()=>{let e=r.current;if(e)return Va(e)},[]),(0,z.jsx)(nu,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:U(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),eu=_.forwardRef((e,t)=>{let n=J(Yl,e.__scopeMenu);return(0,z.jsx)(nu,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),tu=xr(\`MenuContent.ScrollLock\`),nu=_.forwardRef((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=J(Yl,n),v=Vl(Yl,n),y=Ll(n),b=Rl(n),x=Nl(n),[S,C]=_.useState(null),w=_.useRef(null),T=sr(t,w,g.onContentChange),E=_.useRef(0),D=_.useRef(\`\`),O=_.useRef(0),k=_.useRef(null),A=_.useRef(\`right\`),j=_.useRef(0),M=m?Ma:_.Fragment,N=m?{as:tu,allowPinchZoom:!0}:void 0,ee=e=>{let t=D.current+e,n=x().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=Bu(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){D.current=t,window.clearTimeout(E.current),t!==\`\`&&(E.current=window.setTimeout(()=>e(\`\`),1e3))})(t),o&&setTimeout(()=>o.focus())};_.useEffect(()=>()=>window.clearTimeout(E.current),[]),Ci();let te=_.useCallback(e=>A.current===k.current?.side&&Hu(e,k.current?.area),[]);return(0,z.jsx)(Xl,{scope:n,searchRef:D,onItemEnter:_.useCallback(e=>{te(e)&&e.preventDefault()},[te]),onItemLeave:_.useCallback(e=>{te(e)||(w.current?.focus(),C(null))},[te]),onTriggerLeave:_.useCallback(e=>{te(e)&&e.preventDefault()},[te]),pointerGraceTimerRef:O,onPointerGraceIntentChange:_.useCallback(e=>{k.current=e},[]),children:(0,z.jsx)(M,{...N,children:(0,z.jsx)(ei,{asChild:!0,trapped:i,onMountAutoFocus:U(a,e=>{e.preventDefault(),w.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,z.jsx)(Hr,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,z.jsx)(Cl,{asChild:!0,...b,dir:v.dir,orientation:\`vertical\`,loop:r,currentTabStopId:S,onCurrentTabStopIdChange:C,onEntryFocus:U(c,e=>{v.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,z.jsx)(nl,{role:\`menu\`,"aria-orientation":\`vertical\`,"data-state":Fu(g.open),"data-radix-menu-content":\`\`,dir:v.dir,...y,...h,ref:T,style:{outline:\`none\`,...h.style},onKeyDown:U(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&&ee(e.key));let i=w.current;if(e.target!==i||!Ol.includes(e.key))return;e.preventDefault();let a=x().filter(e=>!e.disabled).map(e=>e.ref.current);Dl.includes(e.key)&&a.reverse(),Ru(a)}),onBlur:U(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(E.current),D.current=\`\`)}),onPointerMove:U(e.onPointerMove,Uu(e=>{let t=e.target,n=j.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>j.current?\`right\`:\`left\`;A.current=t,j.current=e.clientX}}))})})})})})})});Ql.displayName=Yl;var ru=\`MenuGroup\`,iu=_.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,z.jsx)(W.div,{role:\`group\`,...r,ref:t})});iu.displayName=ru;var au=\`MenuLabel\`,ou=_.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,z.jsx)(W.div,{...r,ref:t})});ou.displayName=au;var su=\`MenuItem\`,cu=\`menu.itemSelect\`,lu=_.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=_.useRef(null),o=Vl(su,e.__scopeMenu),s=Zl(su,e.__scopeMenu),c=sr(t,a),l=_.useRef(!1),u=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(cu,{bubbles:!0,cancelable:!0});e.addEventListener(cu,e=>r?.(e),{once:!0}),Pr(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,z.jsx)(uu,{...i,ref:c,disabled:n,onClick:U(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:U(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:U(e.onKeyDown,e=>{let t=s.searchRef.current!==\`\`;n||t&&e.key===\` \`||Tl.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});lu.displayName=su;var uu=_.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=Zl(su,n),s=Rl(n),c=_.useRef(null),l=sr(t,c),[u,d]=_.useState(!1),[f,p]=_.useState(\`\`);return _.useEffect(()=>{let e=c.current;e&&p((e.textContent??\`\`).trim())},[a.children]),(0,z.jsx)(Ml.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,z.jsx)(wl,{asChild:!0,...s,focusable:!r,children:(0,z.jsx)(W.div,{role:\`menuitem\`,"data-highlighted":u?\`\`:void 0,"aria-disabled":r||void 0,"data-disabled":r?\`\`:void 0,...a,ref:l,onPointerMove:U(e.onPointerMove,Uu(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:U(e.onPointerLeave,Uu(e=>o.onItemLeave(e))),onFocus:U(e.onFocus,()=>d(!0)),onBlur:U(e.onBlur,()=>d(!1))})})})}),du=\`MenuCheckboxItem\`,fu=_.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,z.jsx)(bu,{scope:e.__scopeMenu,checked:n,children:(0,z.jsx)(lu,{role:\`menuitemcheckbox\`,"aria-checked":Iu(n)?\`mixed\`:n,...i,ref:t,"data-state":Lu(n),onSelect:U(i.onSelect,()=>r?.(Iu(n)?!0:!n),{checkForDefaultPrevented:!1})})})});fu.displayName=du;var pu=\`MenuRadioGroup\`,[mu,hu]=Fl(pu,{value:void 0,onValueChange:()=>{}}),gu=_.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=Fr(r);return(0,z.jsx)(mu,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,z.jsx)(iu,{...i,ref:t})})});gu.displayName=pu;var _u=\`MenuRadioItem\`,vu=_.forwardRef((e,t)=>{let{value:n,...r}=e,i=hu(_u,e.__scopeMenu),a=n===i.value;return(0,z.jsx)(bu,{scope:e.__scopeMenu,checked:a,children:(0,z.jsx)(lu,{role:\`menuitemradio\`,"aria-checked":a,...r,ref:t,"data-state":Lu(a),onSelect:U(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});vu.displayName=_u;var yu=\`MenuItemIndicator\`,[bu,xu]=Fl(yu,{checked:!1}),Su=_.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=xu(yu,n);return(0,z.jsx)(hi,{present:r||Iu(a.checked)||a.checked===!0,children:(0,z.jsx)(W.span,{...i,ref:t,"data-state":Lu(a.checked)})})});Su.displayName=yu;var Cu=\`MenuSeparator\`,wu=_.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,z.jsx)(W.div,{role:\`separator\`,"aria-orientation":\`horizontal\`,...r,ref:t})});wu.displayName=Cu;var Tu=\`MenuArrow\`,Eu=_.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=Ll(n);return(0,z.jsx)(rl,{...i,...r,ref:t})});Eu.displayName=Tu;var Du=\`MenuSub\`,[Ou,ku]=Fl(Du),Au=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=J(Du,t),o=Ll(t),[s,c]=_.useState(null),[l,u]=_.useState(null),d=Fr(i);return _.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,z.jsx)(el,{...o,children:(0,z.jsx)(zl,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,z.jsx)(Ou,{scope:t,contentId:pr(),triggerId:pr(),trigger:s,onTriggerChange:c,children:n})})})};Au.displayName=Du;var ju=\`MenuSubTrigger\`,Mu=_.forwardRef((e,t)=>{let n=J(ju,e.__scopeMenu),r=Vl(ju,e.__scopeMenu),i=ku(ju,e.__scopeMenu),a=Zl(ju,e.__scopeMenu),o=_.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=_.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);_.useEffect(()=>u,[u]),_.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]);let d=sr(t,i.onTriggerChange);return(0,z.jsx)(Wl,{asChild:!0,...l,children:(0,z.jsx)(uu,{id:i.triggerId,"aria-haspopup":\`menu\`,"aria-expanded":n.open,"aria-controls":n.open?i.contentId:void 0,"data-state":Fu(n.open),...e,ref:d,onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:U(e.onPointerMove,Uu(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:U(e.onPointerLeave,Uu(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===\`right\`,o=i?-5:5,c=t[i?\`left\`:\`right\`],l=t[i?\`right\`:\`left\`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:U(e.onKeyDown,t=>{let i=a.searchRef.current!==\`\`;e.disabled||i&&t.key===\` \`||kl[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});Mu.displayName=ju;var Nu=\`MenuSubContent\`,Pu=_.forwardRef((e,t)=>{let n=ql(Yl,e.__scopeMenu),{forceMount:r=n.forceMount,align:i=\`start\`,...a}=e,o=J(Yl,e.__scopeMenu),s=Vl(Yl,e.__scopeMenu),c=ku(Nu,e.__scopeMenu),l=_.useRef(null),u=sr(t,l);return(0,z.jsx)(Ml.Provider,{scope:e.__scopeMenu,children:(0,z.jsx)(hi,{present:r||o.open,children:(0,z.jsx)(Ml.Slot,{scope:e.__scopeMenu,children:(0,z.jsx)(nu,{id:c.contentId,"aria-labelledby":c.triggerId,...a,ref:u,align:i,side:s.dir===\`rtl\`?\`left\`:\`right\`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{s.isUsingKeyboardRef.current&&l.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:U(e.onFocusOutside,e=>{e.target!==c.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:U(e.onEscapeKeyDown,e=>{s.onClose(),e.preventDefault()}),onKeyDown:U(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=Al[s.dir].includes(e.key);t&&n&&(o.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())})})})})})});Pu.displayName=Nu;function Fu(e){return e?\`open\`:\`closed\`}function Iu(e){return e===\`indeterminate\`}function Lu(e){return Iu(e)?\`indeterminate\`:e?\`checked\`:\`unchecked\`}function Ru(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function zu(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Bu(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=zu(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}function Vu(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}function Hu(e,t){return t?Vu({x:e.clientX,y:e.clientY},t):!1}function Uu(e){return t=>t.pointerType===\`mouse\`?e(t):void 0}var Wu=Hl,Gu=Wl,Ku=Jl,qu=Ql,Ju=iu,Yu=ou,Xu=lu,Zu=fu,Qu=gu,$u=vu,ed=Su,td=wu,nd=Eu,rd=Au,id=Mu,ad=Pu,od=\`DropdownMenu\`,[sd,cd]=cr(od,[Il]),ld=Il(),[ud,dd]=sd(od),fd=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=ld(t),l=_.useRef(null),[u,d]=vr({prop:i,defaultProp:a??!1,onChange:o,caller:od});return(0,z.jsx)(ud,{scope:t,triggerId:pr(),triggerRef:l,contentId:pr(),open:u,onOpenChange:d,onOpenToggle:_.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,z.jsx)(Wu,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};fd.displayName=od;var pd=\`DropdownMenuTrigger\`,md=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=dd(pd,n),o=ld(n),s=sr(t,a.triggerRef);return(0,z.jsx)(Gu,{asChild:!0,...o,children:(0,z.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:U(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:U(e.onKeyDown,e=>{r||([\`Enter\`,\` \`].includes(e.key)&&a.onOpenToggle(),e.key===\`ArrowDown\`&&a.onOpenChange(!0),[\`Enter\`,\` \`,\`ArrowDown\`].includes(e.key)&&e.preventDefault())})})})});md.displayName=pd;var hd=\`DropdownMenuPortal\`,gd=e=>{let{__scopeDropdownMenu:t,...n}=e,r=ld(t);return(0,z.jsx)(Ku,{...r,...n})};gd.displayName=hd;var _d=\`DropdownMenuContent\`,vd=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=dd(_d,n),a=ld(n),o=_.useRef(!1);return(0,z.jsx)(qu,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:U(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:U(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)\`}})});vd.displayName=_d;var yd=\`DropdownMenuGroup\`,bd=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=ld(n);return(0,z.jsx)(Ju,{...i,...r,ref:t})});bd.displayName=yd;var xd=\`DropdownMenuLabel\`,Sd=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=ld(n);return(0,z.jsx)(Yu,{...i,...r,ref:t})});Sd.displayName=xd;var Cd=\`DropdownMenuItem\`,wd=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=ld(n);return(0,z.jsx)(Xu,{...i,...r,ref:t})});wd.displayName=Cd;var Td=\`DropdownMenuCheckboxItem\`,Ed=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=ld(n);return(0,z.jsx)(Zu,{...i,...r,ref:t})});Ed.displayName=Td;var Dd=\`DropdownMenuRadioGroup\`,Od=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=ld(n);return(0,z.jsx)(Qu,{...i,...r,ref:t})});Od.displayName=Dd;var kd=\`DropdownMenuRadioItem\`,Ad=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=ld(n);return(0,z.jsx)($u,{...i,...r,ref:t})});Ad.displayName=kd;var jd=\`DropdownMenuItemIndicator\`,Md=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=ld(n);return(0,z.jsx)(ed,{...i,...r,ref:t})});Md.displayName=jd;var Nd=\`DropdownMenuSeparator\`,Pd=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=ld(n);return(0,z.jsx)(td,{...i,...r,ref:t})});Pd.displayName=Nd;var Fd=\`DropdownMenuArrow\`,Id=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=ld(n);return(0,z.jsx)(nd,{...i,...r,ref:t})});Id.displayName=Fd;var Ld=e=>{let{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:i,defaultOpen:a}=e,o=ld(t),[s,c]=vr({prop:r,defaultProp:a??!1,onChange:i,caller:\`DropdownMenuSub\`});return(0,z.jsx)(rd,{...o,open:s,onOpenChange:c,children:n})},Rd=\`DropdownMenuSubTrigger\`,zd=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=ld(n);return(0,z.jsx)(id,{...i,...r,ref:t})});zd.displayName=Rd;var Bd=\`DropdownMenuSubContent\`,Vd=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=ld(n);return(0,z.jsx)(ad,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":\`var(--radix-popper-transform-origin)\`,"--radix-dropdown-menu-content-available-width":\`var(--radix-popper-available-width)\`,"--radix-dropdown-menu-content-available-height":\`var(--radix-popper-available-height)\`,"--radix-dropdown-menu-trigger-width":\`var(--radix-popper-anchor-width)\`,"--radix-dropdown-menu-trigger-height":\`var(--radix-popper-anchor-height)\`}})});Vd.displayName=Bd;var Hd=fd,Ud=md,Wd=gd,Gd=vd,Kd=Sd,qd=wd,Jd=Pd,Yd=Ld,Xd=zd,Zd=Vd,Qd=Hd,$d=Ud,ef=Yd,tf=\`z-50 min-w-[180px] rounded-md border border-input bg-popover p-1 shadow-xl animate-[fade-in_.1s_ease-out]\`;function nf({children:e,align:t=\`start\`,className:n}){return(0,z.jsx)(Wd,{children:(0,z.jsx)(Gd,{align:t,sideOffset:4,className:Zt(\`z-50 min-w-[180px] rounded-md border border-input bg-popover p-1 shadow-xl animate-[fade-in_.1s_ease-out]\`,n),children:e})})}function rf({children:e,onSelect:t,danger:n,disabled:r,shortcut:i}){return(0,z.jsxs)(qd,{disabled:r,onSelect:t,className:Zt(\`flex cursor-pointer select-none items-center gap-2 rounded px-2 py-1.5 text-[13px] outline-none\`,n?\`text-destructive data-[highlighted]:bg-destructive/10\`:\`text-foreground data-[highlighted]:bg-accent\`,r&&\`pointer-events-none opacity-40\`),children:[e,i!==void 0&&(0,z.jsx)(\`span\`,{className:\`ml-auto pl-4 text-[11px] text-muted-foreground/80\`,children:i})]})}function af({children:e}){return(0,z.jsxs)(Xd,{className:\`flex cursor-pointer select-none items-center gap-2 rounded px-2 py-1.5 text-[13px] text-foreground outline-none data-[highlighted]:bg-accent data-[state=open]:bg-accent\`,children:[e,(0,z.jsx)(ge,{size:12,className:\`ml-auto text-muted-foreground/80\`})]})}function of({children:e}){return(0,z.jsx)(Wd,{children:(0,z.jsx)(Zd,{sideOffset:6,className:tf,children:e})})}function sf(){return(0,z.jsx)(Jd,{className:\`my-1 h-px bg-accent\`})}function cf({children:e}){return(0,z.jsx)(Kd,{className:\`px-2 py-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/80\`,children:e})}function lf({children:e}){return(0,z.jsx)(\`div\`,{className:\`py-16 text-center text-[13px] text-muted-foreground/80\`,children:e})}function Y({className:e,mono:t,...n}){return(0,z.jsx)(\`input\`,{className:Zt(\`h-8 w-full rounded-md border border-input bg-field px-2.5 text-[13px] text-foreground\`,\`placeholder:text-muted-foreground/60 focus:border-brand focus:outline-none disabled:opacity-50\`,t&&\`font-mono\`,e),...n})}function uf({children:e}){return(0,z.jsx)(\`kbd\`,{className:\`inline-flex h-[18px] min-w-[18px] items-center justify-center rounded border border-input bg-accent px-1 font-mono text-[10px] text-muted-foreground\`,children:e})}function X({children:e}){return(0,z.jsx)(\`label\`,{className:\`mb-1 block text-xs font-medium text-muted-foreground\`,children:e})}function df({label:e,hint:t,value:n,danger:r,bare:i}){let[a,o]=(0,_.useState)(!r);return(0,z.jsxs)(\`div\`,{children:[!i&&(0,z.jsxs)(X,{children:[e,\` \`,(0,z.jsx)(\`span\`,{className:\`ml-1 font-normal \`+(r?\`text-destructive/80\`:\`text-muted-foreground/80\`),children:t})]}),(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-2\`,children:[(0,z.jsxs)(\`div\`,{className:\`relative min-w-0 flex-1\`,children:[(0,z.jsx)(Y,{mono:!0,readOnly:!0,type:a?\`text\`:\`password\`,value:n||\`unavailable\`,className:\`pr-9\`}),(0,z.jsx)(\`button\`,{type:\`button\`,title:a?\`Hide key\`:\`Reveal key\`,className:\`absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground/80 transition-colors hover:text-foreground\`,onClick:()=>o(e=>!e),children:a?(0,z.jsx)(ke,{size:14}):(0,z.jsx)(Ae,{size:14})})]}),(0,z.jsx)(er,{value:n,label:e,variant:\`outline\`,size:\`icon\`,iconSize:13,disabled:!n})]})]})}function ff({message:e}){return(0,z.jsxs)(\`div\`,{className:\`m-4 flex items-start gap-2 rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-[12px] text-destructive\`,children:[(0,z.jsx)(_e,{size:14,className:\`mt-0.5 shrink-0\`}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(\`span\`,{className:\`font-medium\`,children:\`Couldn't load this view.\`}),\` \`,e]})]})}function pf({open:e,onOpenChange:t,trigger:n,children:r,align:i=\`start\`,className:a}){return(0,z.jsxs)(\`div\`,{className:\`relative\`,children:[n,e&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(\`div\`,{className:\`fixed inset-0 z-40\`,onClick:()=>t(!1)}),(0,z.jsx)(\`div\`,{className:Zt(\`absolute top-full z-50 mt-1 rounded-md border border-input bg-popover shadow-xl animate-[fade-in_.1s_ease-out]\`,i===\`start\`?\`left-0\`:\`right-0\`,a),children:r})]})]})}var mf=(e,t,n)=>Math.min(n,Math.max(t,e));function hf({id:e,axis:t=\`x\`,side:n=\`left\`,defaultSize:r,min:i=180,max:a=560,className:o,children:s}){let c=\`tinbase_panel_\${e}\`,[l,u]=(0,_.useState)(()=>{let e=parseInt(localStorage.getItem(c)??\`\`,10);return mf(Number.isFinite(e)?e:r,i,a)}),d=(0,_.useRef)(l);d.current=l;let f=(0,_.useRef)(null);return(0,z.jsxs)(\`div\`,{className:Zt(\`relative shrink-0\`,o),style:t===\`x\`?{width:l}:{height:l},children:[s,(0,z.jsx)(\`div\`,{role:\`separator\`,"aria-orientation":t===\`x\`?\`vertical\`:\`horizontal\`,title:\`Drag to resize — double-click to reset\`,className:Zt(\`absolute z-20 transition-colors hover:bg-brand/40 active:bg-brand/60\`,t===\`x\`?Zt(\`inset-y-0 w-1 cursor-col-resize\`,n===\`left\`?\`-right-0.5\`:\`-left-0.5\`):Zt(\`inset-x-0 h-1 cursor-row-resize\`,n===\`left\`?\`-bottom-0.5\`:\`-top-0.5\`)),onPointerDown:e=>{e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),f.current={start:t===\`x\`?e.clientX:e.clientY,startSize:d.current}},onPointerMove:e=>{let r=f.current;if(!r)return;let o=t===\`x\`?e.clientX:e.clientY,s=n===\`left\`?o-r.start:r.start-o;u(mf(r.startSize+s,i,a))},onPointerUp:()=>{f.current=null,localStorage.setItem(c,String(d.current))},onDoubleClick:()=>{u(mf(r,i,a)),localStorage.setItem(c,String(r))}})]})}function gf(e,[t,n]){return Math.min(n,Math.max(t,e))}function _f(e){let t=_.useRef({value:e,previous:e});return _.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var vf=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\`}),yf=\`VisuallyHidden\`,bf=_.forwardRef((e,t)=>(0,z.jsx)(W.span,{...e,ref:t,style:{...vf,...e.style}}));bf.displayName=yf;var xf=bf,Sf=[\` \`,\`Enter\`,\`ArrowUp\`,\`ArrowDown\`],Cf=[\` \`,\`Enter\`],wf=\`Select\`,[Tf,Ef,Df]=_o(wf),[Of,kf]=cr(wf,[Df,Rc]),Af=Rc(),[jf,Mf]=Of(wf),[Nf,Pf]=Of(wf),Ff=\`SelectProvider\`;function If(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=Af(t),[v,y]=_.useState(null),[b,x]=_.useState(null),[S,C]=_.useState(!1),w=yo(l),[T,E]=vr({prop:r,defaultProp:i??!1,onChange:a,caller:wf}),[D,O]=vr({prop:o,defaultProp:s,onChange:c,caller:wf}),k=_.useRef(null),A=v?!!m||!!v.closest(\`form\`):!0,[j,M]=_.useState(new Set),N=pr(),ee=Array.from(j).map(e=>e.props.value).join(\`;\`),te=_.useCallback(e=>{M(t=>new Set(t).add(e))},[]),P=_.useCallback(e=>{M(t=>{let n=new Set(t);return n.delete(e),n})},[]),F={required:p,trigger:v,onTriggerChange:y,valueNode:b,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:N,value:D,onValueChange:O,open:T,onOpenChange:E,dir:w,triggerPointerDownPosRef:k,disabled:f,name:u,autoComplete:d,form:m,nativeOptions:j,nativeSelectKey:ee,isFormControl:A};return(0,z.jsx)(el,{...g,children:(0,z.jsx)(jf,{scope:t,...F,children:(0,z.jsx)(Tf.Provider,{scope:t,children:(0,z.jsx)(Nf,{scope:t,onNativeOptionAdd:te,onNativeOptionRemove:P,children:Ip(h)?h(F):n})})})})}If.displayName=Ff;var Lf=e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,z.jsx)(If,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,z.jsxs)(z.Fragment,{children:[n,e?(0,z.jsx)(Fp,{__scopeSelect:t}):null]})})};Lf.displayName=wf;var Rf=\`SelectTrigger\`,zf=_.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=Af(n),o=Mf(Rf,n),s=o.disabled||r,c=sr(t,o.onTriggerChange),l=Ef(n),u=_.useRef(\`touch\`),[d,f,p]=Rp(e=>{let t=l().filter(e=>!e.disabled),n=zp(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),m=e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,z.jsx)(tl,{asChild:!0,...a,children:(0,z.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":Lp(o.value)?\`\`:void 0,...i,ref:c,onClick:U(i.onClick,e=>{e.currentTarget.focus(),u.current!==\`mouse\`&&m(e)}),onPointerDown:U(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:U(i.onKeyDown,e=>{let t=d.current!==\`\`;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===\` \`)&&Sf.includes(e.key)&&(m(),e.preventDefault())})})})});zf.displayName=Rf;var Bf=\`SelectValue\`,Vf=_.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=\`\`,...s}=e,c=Mf(Bf,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=sr(t,c.onValueNodeChange);ur(()=>{l(u)},[l,u]);let f=Lp(c.value);return(0,z.jsx)(W.span,{...s,asChild:f?!1:s.asChild,ref:d,style:{pointerEvents:\`none\`},children:(0,z.jsx)(_.Fragment,{children:f?o:a},f?\`placeholder\`:\`value\`)})});Vf.displayName=Bf;var Hf=\`SelectIcon\`,Uf=_.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,z.jsx)(W.span,{"aria-hidden":!0,...i,ref:t,children:r||\`▼\`})});Uf.displayName=Hf;var Wf=\`SelectPortal\`,[Gf,Kf]=Of(Wf,{forceMount:void 0}),qf=e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,z.jsx)(Gf,{scope:e.__scopeSelect,forceMount:n,children:(0,z.jsx)(pi,{asChild:!0,...r})})};qf.displayName=Wf;var Jf=\`SelectContent\`,Yf=_.forwardRef((e,t)=>{let n=Kf(Jf,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=Mf(Jf,e.__scopeSelect),[o,s]=_.useState();return ur(()=>{s(new DocumentFragment)},[]),(0,z.jsx)(hi,{present:r||a.open,children:({present:e})=>e?(0,z.jsx)(np,{...i,ref:t}):(0,z.jsx)(Xf,{...i,fragment:o})})});Yf.displayName=Jf;var Xf=_.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,fragment:i}=e;return i?_n.createPortal((0,z.jsx)(Qf,{scope:n,children:(0,z.jsx)(Tf.Slot,{scope:n,children:(0,z.jsx)(\`div\`,{ref:t,children:r})})}),i):null});Xf.displayName=\`SelectContentFragment\`;var Zf=10,[Qf,$f]=Of(Jf),ep=\`SelectContentImpl\`,tp=xr(\`SelectContent.RemoveScroll\`),np=_.forwardRef((e,t)=>{let{__scopeSelect:n}=e,{position:r=\`item-aligned\`,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,...v}=e,y=Mf(Jf,n),[b,x]=_.useState(null),[S,C]=_.useState(null),w=sr(t,x),[T,E]=_.useState(null),[D,O]=_.useState(null),k=Ef(n),[A,j]=_.useState(!1),M=_.useRef(!1);_.useEffect(()=>{if(b)return Va(b)},[b]),Ci();let N=_.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&&S&&(S.scrollTop=0),n===r&&S&&(S.scrollTop=S.scrollHeight),n?.focus(),document.activeElement!==i))return},[k,S]),ee=_.useCallback(()=>N([T,b]),[N,T,b]);_.useEffect(()=>{A&&ee()},[A,ee]);let{onOpenChange:te,triggerPointerDownPosRef:P}=y;_.useEffect(()=>{if(b){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(P.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(P.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(b)||te(!1),document.removeEventListener(\`pointermove\`,t),P.current=null};return P.current!==null&&(document.addEventListener(\`pointermove\`,t),document.addEventListener(\`pointerup\`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(\`pointermove\`,t),document.removeEventListener(\`pointerup\`,n,{capture:!0})}}},[b,te,P]),_.useEffect(()=>{let e=()=>te(!1);return window.addEventListener(\`blur\`,e),window.addEventListener(\`resize\`,e),()=>{window.removeEventListener(\`blur\`,e),window.removeEventListener(\`resize\`,e)}},[te]);let[F,ne]=Rp(e=>{let t=k().filter(e=>!e.disabled),n=zp(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),re=_.useCallback((e,t,n)=>{let r=!M.current&&!n;(y.value!==void 0&&y.value===t||r)&&(E(e),r&&(M.current=!0))},[y.value]),ie=_.useCallback(()=>b?.focus(),[b]),ae=_.useCallback((e,t,n)=>{let r=!M.current&&!n;(y.value!==void 0&&y.value===t||r)&&O(e)},[y.value]),oe=r===\`popper\`?op:ip,I=oe===op?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,z.jsx)(Qf,{scope:n,content:b,viewport:S,onViewportChange:C,itemRefCallback:re,selectedItem:T,onItemLeave:ie,itemTextRefCallback:ae,focusSelectedItem:ee,selectedItemText:D,position:r,isPositioned:A,searchRef:F,children:(0,z.jsx)(Ma,{as:tp,allowPinchZoom:!0,children:(0,z.jsx)(ei,{asChild:!0,trapped:y.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:U(i,e=>{y.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,z.jsx)(Hr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:(0,z.jsx)(oe,{role:\`listbox\`,id:y.contentId,"data-state":y.open?\`open\`:\`closed\`,dir:y.dir,onContextMenu:e=>e.preventDefault(),...v,...I,onPlaced:()=>j(!0),ref:w,style:{display:\`flex\`,flexDirection:\`column\`,outline:\`none\`,...v.style},onKeyDown:U(v.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===\`Tab\`&&e.preventDefault(),!t&&e.key.length===1&&ne(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()}})})})})})})});np.displayName=ep;var rp=\`SelectItemAlignedPosition\`,ip=_.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=Mf(Jf,n),o=$f(Jf,n),[s,c]=_.useState(null),[l,u]=_.useState(null),d=sr(t,u),f=Ef(n),p=_.useRef(!1),m=_.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:v,focusSelectedItem:y}=o,b=_.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&g&&v){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=v.getBoundingClientRect();if(a.dir!==\`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-Zf,d=gf(a,[Zf,Math.max(Zf,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-Zf,d=gf(a,[Zf,Math.max(Zf,u-l)]);s.style.minWidth=c+\`px\`,s.style.right=d+\`px\`}let o=f(),c=window.innerHeight-Zf*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),_=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+_+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-Zf,D=c-E,O=g.offsetHeight/2,k=g.offsetTop+O,A=m+_+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=\`\${Zf}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,v,a.dir,r]);ur(()=>b(),[b]);let[x,S]=_.useState();return ur(()=>{l&&S(window.getComputedStyle(l).zIndex)},[l]),(0,z.jsx)(sp,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:_.useCallback(e=>{e&&m.current===!0&&(b(),y?.(),m.current=!1)},[b,y]),children:(0,z.jsx)(\`div\`,{ref:c,style:{display:\`flex\`,flexDirection:\`column\`,position:\`fixed\`,zIndex:x},children:(0,z.jsx)(W.div,{...i,ref:d,style:{boxSizing:\`border-box\`,maxHeight:\`100%\`,...i.style}})})})});ip.displayName=rp;var ap=\`SelectPopperPosition\`,op=_.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=\`start\`,collisionPadding:i=Zf,...a}=e,o=Af(n);return(0,z.jsx)(nl,{...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)\`}})});op.displayName=ap;var[sp,cp]=Of(Jf,{}),lp=\`SelectViewport\`,up=_.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=$f(lp,n),o=cp(lp,n),s=sr(t,a.onViewportChange),c=_.useRef(0);return(0,z.jsxs)(z.Fragment,{children:[(0,z.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,z.jsx)(Tf.Slot,{scope:n,children:(0,z.jsx)(W.div,{"data-radix-select-viewport":\`\`,role:\`presentation\`,...i,ref:s,style:{position:\`relative\`,flex:1,overflow:\`hidden auto\`,...i.style},onScroll:U(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-Zf*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})})})]})});up.displayName=lp;var dp=\`SelectGroup\`,[fp,pp]=Of(dp),mp=_.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=pr();return(0,z.jsx)(fp,{scope:n,id:i,children:(0,z.jsx)(W.div,{role:\`group\`,"aria-labelledby":i,...r,ref:t})})});mp.displayName=dp;var hp=\`SelectLabel\`,gp=_.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=pp(hp,n);return(0,z.jsx)(W.div,{id:i.id,...r,ref:t})});gp.displayName=hp;var _p=\`SelectItem\`,[vp,yp]=Of(_p),bp=_.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=Mf(_p,n),c=$f(_p,n),l=s.value===r,[u,d]=_.useState(a??\`\`),[f,p]=_.useState(!1),m=sr(t,Fr(e=>c.itemRefCallback?.(e,r,i))),h=pr(),g=_.useRef(\`touch\`),v=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};return(0,z.jsx)(vp,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:_.useCallback(e=>{d(t=>t||(e?.textContent??\`\`).trim())},[]),children:(0,z.jsx)(Tf.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,z.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:U(o.onFocus,()=>p(!0)),onBlur:U(o.onBlur,()=>p(!1)),onClick:U(o.onClick,()=>{g.current!==\`mouse\`&&v()}),onPointerUp:U(o.onPointerUp,()=>{g.current===\`mouse\`&&v()}),onPointerDown:U(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:U(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===\`mouse\`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:U(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:U(o.onKeyDown,e=>{c.searchRef?.current!==\`\`&&e.key===\` \`||(Cf.includes(e.key)&&v(),e.key===\` \`&&e.preventDefault())})})})})});bp.displayName=_p;var xp=\`SelectItemText\`,Sp=_.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=Mf(xp,n),s=$f(xp,n),c=yp(xp,n),l=Pf(xp,n),[u,d]=_.useState(null),f=Fr(e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=sr(t,d,c.onItemTextChange,f),m=u?.textContent,h=_.useMemo(()=>(0,z.jsx)(\`option\`,{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:v}=l;return ur(()=>(g(h),()=>v(h)),[g,v,h]),(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(W.span,{id:c.textId,...a,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!Lp(o.value)?_n.createPortal(a.children,o.valueNode):null]})});Sp.displayName=xp;var Cp=\`SelectItemIndicator\`,wp=_.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return yp(Cp,n).isSelected?(0,z.jsx)(W.span,{"aria-hidden":!0,...r,ref:t}):null});wp.displayName=Cp;var Tp=\`SelectScrollUpButton\`,Ep=_.forwardRef((e,t)=>{let n=$f(Tp,e.__scopeSelect),r=cp(Tp,e.__scopeSelect),[i,a]=_.useState(!1),o=sr(t,r.onScrollButtonChange);return ur(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollTop>0;a(e)},t=n.viewport;return e(),t.addEventListener(\`scroll\`,e),()=>t.removeEventListener(\`scroll\`,e)}},[n.viewport,n.isPositioned]),i?(0,z.jsx)(kp,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});Ep.displayName=Tp;var Dp=\`SelectScrollDownButton\`,Op=_.forwardRef((e,t)=>{let n=$f(Dp,e.__scopeSelect),r=cp(Dp,e.__scopeSelect),[i,a]=_.useState(!1),o=sr(t,r.onScrollButtonChange);return ur(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;a(n)},t=n.viewport;return e(),t.addEventListener(\`scroll\`,e),()=>t.removeEventListener(\`scroll\`,e)}},[n.viewport,n.isPositioned]),i?(0,z.jsx)(kp,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});Op.displayName=Dp;var kp=_.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=$f(\`SelectScrollButton\`,n),o=_.useRef(null),s=Ef(n),c=_.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return _.useEffect(()=>()=>c(),[c]),ur(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:\`nearest\`})},[s]),(0,z.jsx)(W.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:U(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:U(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:U(i.onPointerLeave,()=>{c()})})}),Ap=\`SelectSeparator\`,jp=_.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,z.jsx)(W.div,{"aria-hidden":!0,...r,ref:t})});jp.displayName=Ap;var Mp=\`SelectArrow\`,Np=_.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Af(n);return $f(Mp,n).position===\`popper\`?(0,z.jsx)(rl,{...i,...r,ref:t}):null});Np.displayName=Mp;var Pp=\`SelectBubbleInput\`,Fp=_.forwardRef(({__scopeSelect:e,...t},n)=>{let r=Mf(Pp,e),{value:i,onValueChange:a,required:o,disabled:s,name:c,autoComplete:l,form:u}=r,{nativeOptions:d,nativeSelectKey:f}=r,p=_.useRef(null),m=sr(n,p),h=i??\`\`,g=_f(h),v=Array.from(d).some(e=>(e.props.value??\`\`)===\`\`);return _.useEffect(()=>{let e=p.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,\`value\`).set;if(g!==h&&n){let t=new Event(\`change\`,{bubbles:!0});n.call(e,h),e.dispatchEvent(t)}},[g,h]),(0,z.jsxs)(W.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:u,onChange:e=>a(e.target.value),...t,style:{...vf,...t.style},ref:m,defaultValue:h,children:[Lp(i)&&!v?(0,z.jsx)(\`option\`,{value:\`\`}):null,Array.from(d)]},f)});Fp.displayName=Pp;function Ip(e){return typeof e==\`function\`}function Lp(e){return e===\`\`||e===void 0}function Rp(e){let t=Fr(e),n=_.useRef(\`\`),r=_.useRef(0),i=_.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==\`\`&&(r.current=window.setTimeout(()=>e(\`\`),1e3))})(i)},[t]),a=_.useCallback(()=>{n.current=\`\`,window.clearTimeout(r.current)},[]);return _.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function zp(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=Bp(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}function Bp(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Vp=\`__select-empty__\`,Hp=e=>e===\`\`?Vp:e,Up=e=>e===Vp?\`\`:e;function Wp({value:e,onValueChange:t,options:n,placeholder:r=\`Select…\`,disabled:i,autoFocus:a,mono:o,size:s=\`sm\`,className:c=\`w-full\`}){return(0,z.jsxs)(Lf,{value:Hp(e),onValueChange:e=>t(Up(e)),disabled:i,children:[(0,z.jsxs)(zf,{autoFocus:a,className:Zt(\`flex cursor-pointer items-center gap-1.5 rounded-md border border-input bg-field text-left text-foreground\`,s===\`xs\`?\`h-6 px-2 text-xs\`:\`h-8 px-2.5 text-[13px]\`,\`transition-colors hover:border-muted-foreground focus:border-brand focus:outline-none disabled:pointer-events-none disabled:opacity-50\`,\`data-placeholder:text-muted-foreground/60\`,o&&\`font-mono\`,c),children:[(0,z.jsx)(\`span\`,{className:\`min-w-0 flex-1 truncate\`,children:(0,z.jsx)(Vf,{placeholder:r})}),(0,z.jsx)(Uf,{children:(0,z.jsx)(me,{size:13,className:\`shrink-0 text-muted-foreground/80\`})})]}),(0,z.jsx)(qf,{children:(0,z.jsx)(Yf,{position:\`popper\`,sideOffset:4,className:\`z-90 max-h-64 min-w-(--radix-select-trigger-width) overflow-hidden rounded-md border border-input bg-popover shadow-xl animate-[fade-in_.1s_ease-out]\`,children:(0,z.jsx)(up,{className:\`p-1\`,children:n.map(e=>(0,z.jsxs)(bp,{value:Hp(e.value),disabled:e.disabled,className:Zt(\`flex cursor-pointer select-none items-center gap-2 rounded px-2 py-1.5 text-[13px] text-foreground outline-none\`,\`data-highlighted:bg-accent data-disabled:pointer-events-none data-disabled:opacity-40\`,o&&\`font-mono\`),children:[(0,z.jsx)(\`span\`,{className:\`min-w-0 flex-1 truncate\`,children:(0,z.jsx)(Sp,{children:e.label??e.value})}),(0,z.jsx)(wp,{children:(0,z.jsx)(pe,{size:12,className:\`shrink-0 text-brand\`})})]},e.value))})})})]})}var Gp=200,Kp=mo;function qp({open:e,onClose:t,title:n,children:r,footer:i,actions:a,flush:o,hideHeader:s,width:c=\`w-[500px]\`}){let[l,u]=(0,_.useState)(e),d=(0,_.useRef)(void 0);(0,_.useEffect)(()=>(e&&u(!0),()=>clearTimeout(d.current)),[e]);let f=()=>{l&&(u(!1),d.current=setTimeout(t,Gp))};return(0,z.jsx)(qa,{open:e&&l,onOpenChange:e=>!e&&f(),children:(0,z.jsxs)($a,{children:[(0,z.jsx)(to,{className:\`fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-[fade-in_.15s_ease-out] data-[state=closed]:animate-[fade-out_.2s_ease-in]\`}),(0,z.jsxs)(ao,{className:Zt(\`fixed inset-y-0 right-0 z-50 flex max-w-[92vw] flex-col border-l border-border bg-background shadow-2xl\`,\`transition-[width] duration-300 ease-[cubic-bezier(0.16,1,0.3,1)]\`,\`data-[state=open]:animate-[sheet-in_.25s_cubic-bezier(0.16,1,0.3,1)] data-[state=closed]:animate-[sheet-out_.2s_ease-in]\`,\`focus:outline-none\`,c),children:[s?(0,z.jsx)(lo,{className:\`sr-only\`,children:n}):(0,z.jsxs)(\`div\`,{className:\`flex shrink-0 items-center justify-between border-b border-border px-5 py-3.5\`,children:[(0,z.jsx)(lo,{className:\`text-sm font-medium text-foreground\`,children:n}),(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-1\`,children:[a,(0,z.jsx)(mo,{className:\`rounded p-0.5 text-muted-foreground/80 hover:bg-accent hover:text-foreground\`,children:(0,z.jsx)(Lt,{size:16})})]})]}),(0,z.jsx)(\`div\`,{className:Zt(\`min-h-0 flex-1\`,o?\`overflow-hidden\`:\`overflow-y-auto px-5 py-4\`),children:r}),i&&(0,z.jsx)(\`div\`,{className:\`flex shrink-0 items-center gap-2 border-t border-border bg-card px-5 py-3\`,children:i})]})]})})}function Jp(){return(0,z.jsx)(\`div\`,{className:\`flex items-center justify-center py-16 text-muted-foreground/80\`,children:(0,z.jsx)(\`div\`,{className:\`size-5 animate-spin rounded-full border-2 border-input border-t-brand\`})})}function Yp({checked:e,onChange:t,disabled:n}){return(0,z.jsx)(\`button\`,{type:\`button\`,role:\`switch\`,"aria-checked":e,disabled:n,onClick:()=>t?.(!e),className:Zt(\`relative h-4.5 w-8 shrink-0 rounded-full transition-colors\`,e?\`bg-brand\`:\`bg-muted\`,n&&\`pointer-events-none opacity-40\`),children:(0,z.jsx)(\`span\`,{className:Zt(\`absolute left-0 top-0.5 size-3.5 rounded-full bg-white transition-transform\`,e?\`translate-x-4\`:\`translate-x-0.5\`)})})}function Xp({children:e,className:t}){return(0,z.jsx)(\`table\`,{className:Zt(\`w-full border-collapse text-[13px]\`,t),children:e})}function Zp({children:e}){return(0,z.jsx)(\`thead\`,{className:\`sticky top-0 z-10 bg-card\`,children:e})}function Z({className:e,...t}){return(0,z.jsx)(\`th\`,{className:Zt(\`whitespace-nowrap border-b border-border px-3 py-2 text-left font-medium text-muted-foreground\`,e),...t})}function Qp({className:e,...t}){return(0,z.jsx)(\`tr\`,{className:Zt(\`group border-b border-border/60 transition-colors hover:bg-accent/30\`,e),...t})}function Q({className:e,...t}){return(0,z.jsx)(\`td\`,{className:Zt(\`px-3 py-1.5 align-middle\`,e),...t})}function $p({tabs:e,active:t,onSelect:n}){return(0,z.jsx)(\`div\`,{className:\`flex gap-5 border-b border-border\`,children:e.map(e=>(0,z.jsx)(\`button\`,{onClick:()=>n(e.id),className:\`-mb-px border-b-2 pb-2 text-[13px] transition-colors \`+(t===e.id?\`border-foreground font-medium text-foreground\`:\`border-transparent text-muted-foreground hover:text-foreground\`),children:e.label},e.id))})}function em({className:e,...t}){return(0,z.jsx)(\`textarea\`,{className:Zt(\`w-full rounded-md border border-input bg-field p-2.5 font-mono text-[13px] text-foreground\`,\`placeholder:text-muted-foreground/60 focus:border-brand focus:outline-none disabled:opacity-50\`,e),...t})}var[tm,nm]=cr(\`Tooltip\`,[Rc]),rm=Rc(),im=\`TooltipProvider\`,am=700,om=\`tooltip.open\`,[sm,cm]=tm(im),lm=e=>{let{__scopeTooltip:t,delayDuration:n=am,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=_.useRef(!0),s=_.useRef(!1),c=_.useRef(0);return _.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,z.jsx)(sm,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:_.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:_.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:_.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};lm.displayName=im;var um=\`Tooltip\`,[dm,fm]=tm(um),pm=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=cm(um,e.__scopeTooltip),l=rm(t),[u,d]=_.useState(null),f=pr(),p=_.useRef(0),m=o??c.disableHoverableContent,h=s??c.delayDuration,g=_.useRef(!1),[v,y]=vr({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(om))):c.onClose(),a?.(e)},caller:um}),b=_.useMemo(()=>v?g.current?\`delayed-open\`:\`instant-open\`:\`closed\`,[v]),x=_.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g.current=!1,y(!0)},[y]),S=_.useCallback(()=>{window.clearTimeout(p.current),p.current=0,y(!1)},[y]),C=_.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{g.current=!0,y(!0),p.current=0},h)},[h,y]);return _.useEffect(()=>()=>{p.current&&=(window.clearTimeout(p.current),0)},[]),(0,z.jsx)(el,{...l,children:(0,z.jsx)(dm,{scope:t,contentId:f,open:v,stateAttribute:b,trigger:u,onTriggerChange:d,onTriggerEnter:_.useCallback(()=>{c.isOpenDelayedRef.current?C():x()},[c.isOpenDelayedRef,C,x]),onTriggerLeave:_.useCallback(()=>{m?S():(window.clearTimeout(p.current),p.current=0)},[S,m]),onOpen:x,onClose:S,disableHoverableContent:m,children:n})})};pm.displayName=um;var mm=\`TooltipTrigger\`,hm=_.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=fm(mm,n),a=cm(mm,n),o=rm(n),s=sr(t,_.useRef(null),i.onTriggerChange),c=_.useRef(!1),l=_.useRef(!1),u=_.useCallback(()=>c.current=!1,[]);return _.useEffect(()=>()=>document.removeEventListener(\`pointerup\`,u),[u]),(0,z.jsx)(tl,{asChild:!0,...o,children:(0,z.jsx)(W.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:U(e.onPointerMove,e=>{e.pointerType!==\`touch\`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:U(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:U(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(\`pointerup\`,u,{once:!0})}),onFocus:U(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:U(e.onBlur,i.onClose),onClick:U(e.onClick,i.onClose)})})});hm.displayName=mm;var gm=\`TooltipPortal\`,[_m,vm]=tm(gm,{forceMount:void 0}),ym=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=fm(gm,t);return(0,z.jsx)(_m,{scope:t,forceMount:n,children:(0,z.jsx)(hi,{present:n||a.open,children:(0,z.jsx)(pi,{asChild:!0,container:i,children:r})})})};ym.displayName=gm;var bm=\`TooltipContent\`,xm=_.forwardRef((e,t)=>{let n=vm(bm,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=\`top\`,...a}=e,o=fm(bm,e.__scopeTooltip);return(0,z.jsx)(hi,{present:r||o.open,children:o.disableHoverableContent?(0,z.jsx)(Em,{side:i,...a,ref:t}):(0,z.jsx)(Sm,{side:i,...a,ref:t})})}),Sm=_.forwardRef((e,t)=>{let n=fm(bm,e.__scopeTooltip),r=cm(bm,e.__scopeTooltip),i=_.useRef(null),a=sr(t,i),[o,s]=_.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=_.useCallback(()=>{s(null),d(!1)},[d]),p=_.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=Am(r,km(r,n.getBoundingClientRect())),a=jm(t.getBoundingClientRect()),o=Nm([...i,...a]);s(o),d(!0)},[d]);return _.useEffect(()=>()=>f(),[f]),_.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(\`pointerleave\`,e),u.addEventListener(\`pointerleave\`,t),()=>{c.removeEventListener(\`pointerleave\`,e),u.removeEventListener(\`pointerleave\`,t)}}},[c,u,p,f]),_.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!Mm(n,o);r?f():i&&(f(),l())};return document.addEventListener(\`pointermove\`,e),()=>document.removeEventListener(\`pointermove\`,e)}},[c,u,o,l,f]),(0,z.jsx)(Em,{...e,ref:a})}),[Cm,wm]=tm(um,{isInside:!1}),Tm=Cr(\`TooltipContent\`),Em=_.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=fm(bm,n),l=rm(n),{onClose:u}=c;return _.useEffect(()=>(document.addEventListener(om,u),()=>document.removeEventListener(om,u)),[u]),_.useEffect(()=>{if(c.trigger){let e=e=>{e.target instanceof Node&&e.target.contains(c.trigger)&&u()};return window.addEventListener(\`scroll\`,e,{capture:!0}),()=>window.removeEventListener(\`scroll\`,e,{capture:!0})}},[c.trigger,u]),(0,z.jsx)(Hr,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,z.jsxs)(nl,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.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,z.jsx)(Tm,{children:r}),(0,z.jsx)(Cm,{scope:n,isInside:!0,children:(0,z.jsx)(xf,{id:c.contentId,role:\`tooltip\`,children:i||r})})]})})});xm.displayName=bm;var Dm=\`TooltipArrow\`,Om=_.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=rm(n);return wm(Dm,n).isInside?null:(0,z.jsx)(rl,{...i,...r,ref:t})});Om.displayName=Dm;function km(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\`)}}function Am(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});break}return r}function jm(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}]}function Mm(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}function Nm(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)),Pm(t)}function Pm(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)}var Fm=lm,Im=pm,Lm=hm,Rm=ym,zm=xm;function Bm({content:e,children:t,side:n=\`top\`}){return(0,z.jsx)(Fm,{delayDuration:250,children:(0,z.jsxs)(Im,{children:[(0,z.jsx)(Lm,{asChild:!0,children:t}),(0,z.jsx)(Rm,{children:(0,z.jsx)(zm,{side:n,sideOffset:5,className:\`z-[60] max-w-[300px] rounded-md border border-input bg-field px-2 py-1 text-xs text-foreground shadow-xl animate-[fade-in_.1s_ease-out]\`,children:e})})]})})}var Vm=e=>String(e).padStart(2,\`0\`),Hm=e=>e.toLocaleDateString(void 0,{day:\`2-digit\`,month:\`short\`,year:\`2-digit\`}),Um=e=>\`\${Vm(e.getHours())}:\${Vm(e.getMinutes())}:\${Vm(e.getSeconds())}\`,Wm=e=>{let t=e.toISOString();return\`\${t.slice(8,10)} \${e.toLocaleDateString(\`en\`,{month:\`short\`,timeZone:\`UTC\`})} \${t.slice(2,4)} \${t.slice(11,19)}\`};function Gm(e){let t=e.getTime()-Date.now(),n=Math.abs(t);if(n<1e4)return\`a few seconds ago\`;for(let[e,r]of[[31536e6,\`year\`],[2592e6,\`month\`],[864e5,\`day\`],[36e5,\`hour\`],[6e4,\`minute\`],[1e3,\`second\`]])if(n>=e){let i=Math.round(n/e);return t<0?\`\${i} \${r}\${i>1?\`s\`:\`\`} ago\`:\`in \${i} \${r}\${i>1?\`s\`:\`\`}\`}return\`just now\`}function Km({label:e,value:t}){return(0,z.jsxs)(\`div\`,{className:\`flex items-baseline gap-2 font-mono text-[11px]\`,children:[(0,z.jsx)(\`span\`,{className:\`shrink-0 text-muted-foreground\`,children:e}),(0,z.jsx)(\`span\`,{className:\`min-w-4 flex-1 border-b border-dotted border-muted-foreground/30\`}),(0,z.jsx)(\`span\`,{className:\`shrink-0 tabular-nums text-foreground/90\`,children:t})]})}function qm({value:e,format:t=\`datetime\`,className:n=\`\`}){if(e==null||e===\`\`)return(0,z.jsx)(\`span\`,{className:n,children:\`—\`});let r=e instanceof Date?e:new Date(e);if(Number.isNaN(r.getTime()))return(0,z.jsx)(\`span\`,{className:n,children:String(e)});let i=t===\`time\`?Um(r):t===\`date\`?Hm(r):t===\`relative\`?Gm(r):\`\${Hm(r)} \${Um(r)}\`,a=Intl.DateTimeFormat().resolvedOptions().timeZone;return(0,z.jsx)(Bm,{side:\`top\`,content:(0,z.jsxs)(\`div\`,{className:\`w-72 space-y-1 p-1\`,children:[(0,z.jsx)(Km,{label:\`UTC\`,value:Wm(r)}),(0,z.jsx)(Km,{label:a,value:\`\${Hm(r)} \${Um(r)}\`}),(0,z.jsx)(Km,{label:\`Relative\`,value:Gm(r)}),(0,z.jsx)(Km,{label:\`Timestamp\`,value:r.getTime()})]}),children:(0,z.jsx)(\`span\`,{className:\`cursor-default whitespace-nowrap tabular-nums underline decoration-dotted decoration-muted-foreground/40 underline-offset-2 \`+n,children:i})})}function Jm({value:e}){return e==null?(0,z.jsx)(\`span\`,{className:\`select-none text-muted-foreground/60\`,children:\`NULL\`}):e===\`\`?(0,z.jsx)(\`span\`,{className:\`select-none italic text-muted-foreground/60\`,children:\`empty\`}):typeof e==\`boolean\`?(0,z.jsx)(\`span\`,{className:\`text-info\`,children:String(e)}):typeof e==\`object\`?(0,z.jsx)(\`span\`,{className:\`text-warning/90\`,children:JSON.stringify(e)}):(0,z.jsx)(z.Fragment,{children:String(e)})}function Ym(e){if(e==null)return;let t=typeof e==\`object\`?JSON.stringify(e):String(e);return t.length>40?t:void 0}var $=({children:e})=>(0,z.jsx)(\`code\`,{className:\`rounded bg-accent px-1 py-px font-mono text-[12px] text-foreground/90\`,children:e}),Xm=/auth\\.(uid|jwt|role|email)\\(\\)/i,Zm=/\\(\\s*select\\s+(auth\\.|current_setting)/i;async function Qm(){let[e,t,n,r,i,a,o,s,c,l,u,d,f,p,m]=await Promise.allSettled([N.sql(\`select c.relname as name, c.relrowsecurity as rls,
|
|
1451
1451
|
exists(select 1 from pg_index i where i.indrelid = c.oid and i.indisprimary) as has_pk,
|
|
1452
1452
|
(select count(*)::int from pg_policies p where p.schemaname = 'public' and p.tablename = c.relname) as policies
|
|
1453
1453
|
from pg_class c join pg_namespace n on n.oid = c.relnamespace
|
|
@@ -1505,45 +1505,45 @@ const supabase = createClient('http://localhost', backend.anonKey, {
|
|
|
1505
1505
|
|
|
1506
1506
|
// query it like any Supabase project — swap in your table and columns
|
|
1507
1507
|
await supabase.from('YOUR_TABLE').insert({ some_column: 'value' })
|
|
1508
|
-
const { data } = await supabase.from('YOUR_TABLE').select()\`}function dh({size:e=24}){let t=(0,_.useId)(),n=\`\${t}-body\`,r=\`\${t}-lid\`;return(0,z.jsxs)(\`svg\`,{width:e,height:e,viewBox:\`0 0 120 120\`,fill:\`none\`,xmlns:\`http://www.w3.org/2000/svg\`,children:[(0,z.jsxs)(\`defs\`,{children:[(0,z.jsxs)(\`linearGradient\`,{id:n,x1:\`30\`,y1:\`30\`,x2:\`92\`,y2:\`102\`,gradientUnits:\`userSpaceOnUse\`,children:[(0,z.jsx)(\`stop\`,{stopColor:\`#10b981\`}),(0,z.jsx)(\`stop\`,{offset:\`1\`,stopColor:\`#047857\`})]}),(0,z.jsxs)(\`linearGradient\`,{id:r,x1:\`26\`,y1:\`19\`,x2:\`94\`,y2:\`49\`,gradientUnits:\`userSpaceOnUse\`,children:[(0,z.jsx)(\`stop\`,{stopColor:\`#6ee7b7\`}),(0,z.jsx)(\`stop\`,{offset:\`1\`,stopColor:\`#34d399\`})]})]}),(0,z.jsx)(\`path\`,{d:\`M26 34v52c0 8.4 15.2 15.2 34 15.2s34-6.8 34-15.2V34Z\`,fill:\`url(#\${n})\`}),(0,z.jsx)(\`path\`,{d:\`M26 60c0 8.4 15.2 15.2 34 15.2S94 68.4 94 60\`,stroke:\`#6ee7b7\`,strokeWidth:\`3\`,fill:\`none\`}),(0,z.jsx)(\`ellipse\`,{cx:\`60\`,cy:\`34\`,rx:\`34\`,ry:\`15\`,fill:\`url(#\${r})\`}),(0,z.jsx)(\`ellipse\`,{cx:\`60\`,cy:\`34\`,rx:\`25\`,ry:\`10\`,fill:\`none\`,stroke:\`#059669\`,strokeOpacity:\`0.5\`,strokeWidth:\`2.5\`})]})}function fh({onLogout:e}){let[t,n]=(0,_.useState)(!1),r=lh(),i=$n(r,\`API URL\`);return(0,z.jsxs)(\`header\`,{className:\`flex h-12 shrink-0 items-center gap-2 border-b border-border bg-card px-3\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-2 pl-1\`,children:[(0,z.jsx)(dh,{size:22}),(0,z.jsx)(\`span\`,{className:\`text-[13px] font-semibold text-foreground\`,children:\`tinbase\`}),(0,z.jsx)(B,{variant:\`outline\`,children:\`studio\`})]}),(0,z.jsx)(\`span\`,{className:\`text-muted-foreground\`,children:\`/\`}),(0,z.jsxs)(\`button\`,{onClick:i.copy,title:i.copied?\`Copied!\`:\`Copy API URL\`,className:\`group flex items-center gap-1.5 rounded-md px-2 py-1 font-mono text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground\`,children:[r.replace(/^https?:\\/\\//,\`\`),i.copied?(0,z.jsx)(pe,{size:11,className:\`text-brand\`}):(0,z.jsx)(Se,{size:11,className:\`opacity-0 transition-opacity group-hover:opacity-100\`})]}),(0,z.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-1.5\`,children:[(0,z.jsxs)(\`button\`,{onClick:()=>window.dispatchEvent(new KeyboardEvent(\`keydown\`,{key:\`k\`,ctrlKey:!0})),className:\`flex h-7 items-center gap-2 rounded-md border border-input bg-field px-2.5 text-xs text-muted-foreground/80 transition-colors hover:border-muted-foreground hover:text-foreground\`,title:\`Search (Ctrl+K)\`,children:[(0,z.jsx)(vt,{size:12}),\`Search…\`,(0,z.jsx)(uf,{children:\`⌘K\`})]}),(0,z.jsxs)(V,{size:\`xs\`,className:\`h-7\`,onClick:()=>n(!0),children:[(0,z.jsx)(pt,{size:12}),\` Connect\`]}),(0,z.jsx)(ih,{}),(0,z.jsx)(V,{variant:\`outline\`,size:\`icon\`,className:\`size-7\`,title:\`Log out\`,onClick:e,children:(0,z.jsx)($e,{size:13})})]}),(0,z.jsx)(ph,{open:t,onClose:()=>n(!1)})]})}function ph({open:e,onClose:t}){let n=lh(),r=x(),[i,a]=(0,_.useState)(\`\`);return(0,_.useEffect)(()=>{e&&N.keys().then(e=>a(e.anonKey??\`\`),()=>a(\`\`))},[e]),(0,z.jsx)(go,{open:e,onClose:t,title:\`Connect to tinbase\`,wide:!0,children:(0,z.jsxs)(\`div\`,{className:\`space-y-4\`,children:[(0,z.jsxs)(\`p\`,{className:\`text-xs text-muted-foreground/80\`,children:[\`tinbase is a\`,\` \`,(0,z.jsx)(\`span\`,{className:\`text-foreground/80\`,children:\`Supabase-compatible\`}),\` backend in one process — REST, Auth, Storage, and Realtime speak the same wire protocols, so the official\`,\` \`,(0,z.jsx)(\`span\`,{className:\`text-foreground/80\`,children:\`supabase-js\`}),\` SDK connects unchanged.\`]}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`API URL\`}),(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-2\`,children:[(0,z.jsx)(lf,{mono:!0,readOnly:!0,value:n}),(0,z.jsx)(er,{value:n,label:\`API URL\`,variant:\`outline\`,size:\`icon\`,iconSize:13})]})]}),(0,z.jsx)(df,{label:\`anon key\`,hint:\`safe for browsers — RLS applies\`,value:i}),(0,z.jsx)(df,{label:\`service_role key\`,hint:\`server-side only — bypasses RLS\`,value:r,danger:!0}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Get Started\`}),(0,z.jsx)(rr,{code:uh(),lang:\`js\`})]})]})})}function mh({onOk:e}){let[t,n]=(0,_.useState)(\`\`),[r,i]=(0,_.useState)(\`\`),[a,o]=(0,_.useState)(!1);async function s(){o(!0),i(\`\`),S(t.trim());try{await N.ping(),e()}catch(e){C(),i(\`Invalid service_role key: \`+e.message)}finally{o(!1)}}return(0,z.jsx)(\`div\`,{className:\`flex h-full items-center justify-center\`,children:(0,z.jsxs)(\`div\`,{className:\`w-[400px] text-center\`,children:[(0,z.jsx)(\`div\`,{className:\`mb-4 flex justify-center\`,children:(0,z.jsx)(dh,{size:48})}),(0,z.jsx)(\`h1\`,{className:\`text-lg font-semibold\`,children:\`tinbase studio\`}),(0,z.jsxs)(\`p\`,{className:\`mt-1 text-[13px] text-muted-foreground/80\`,children:[\`Sign in with the \`,(0,z.jsx)(\`span\`,{className:\`text-foreground/80\`,children:\`service_role\`}),\` key printed when tinbase started.\`]}),(0,z.jsxs)(\`div\`,{className:\`mt-5 space-y-3 text-left\`,children:[(0,z.jsx)(lf,{type:\`password\`,placeholder:\`service_role key (eyJ…)\`,value:t,onChange:e=>n(e.target.value),onKeyDown:e=>e.key===\`Enter\`&&s()}),(0,z.jsx)(V,{className:\`w-full\`,onClick:s,disabled:a||!t.trim(),children:a?\`Checking…\`:\`Continue\`}),r&&(0,z.jsx)(\`p\`,{className:\`text-xs text-destructive\`,children:r})]})]})})}var hh=52,gh=224,_h=[{id:\`expanded\`,label:\`Expanded\`},{id:\`collapsed\`,label:\`Collapsed\`},{id:\`hover\`,label:\`Expand on hover\`}];function vh({tab:e,onTab:t}){let[n,r]=gn(),[i,a]=(0,_.useState)(!1),[o,s]=(0,_.useState)(!1),c=(0,_.useRef)(void 0),l=i||o,u=n===\`expanded\`||n===\`hover\`&&l,d=n===\`hover\`&&l,f=e=>{r(e),a(!1)};return(0,z.jsx)(\`aside\`,{className:\`relative shrink-0 transition-[width] duration-200 ease-[cubic-bezier(0.16,1,0.3,1)]\`,style:{width:n===\`expanded\`?gh:hh},children:(0,z.jsxs)(\`div\`,{onMouseEnter:()=>{n===\`hover\`&&(clearTimeout(c.current),c.current=setTimeout(()=>a(!0),60))},onMouseLeave:()=>{clearTimeout(c.current),c.current=setTimeout(()=>a(!1),120)},className:\`absolute inset-y-0 left-0 z-40 flex flex-col overflow-hidden border-r border-border bg-sidebar transition-[width,box-shadow] duration-200 ease-[cubic-bezier(0.16,1,0.3,1)] \`+(d?\`shadow-[12px_0_32px_rgba(0,0,0,0.45)]\`:\`\`),style:{width:u?gh:hh},children:[(0,z.jsx)(\`nav\`,{className:\`flex-1 overflow-y-auto overflow-x-hidden py-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden\`,children:Bt.map((n,r)=>(0,z.jsxs)(\`div\`,{children:[n.title&&(0,z.jsx)(yh,{title:n.title,expanded:u}),n.items.map(n=>(0,z.jsx)(bh,{icon:n.icon,label:n.label,active:e===n.id,expanded:u,onClick:()=>t(n.id)},n.id))]},r))}),(0,z.jsx)(\`div\`,{className:\`shrink-0 border-t border-border py-2\`,children:(0,z.jsxs)(Zd,{open:o,onOpenChange:s,children:[(0,z.jsx)(Qd,{asChild:!0,children:(0,z.jsxs)(\`button\`,{title:u?void 0:\`Sidebar control\`,className:\`mx-1.5 my-px flex h-8 items-center rounded-md text-[13px] text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground data-[state=open]:bg-accent data-[state=open]:text-foreground\`,style:{width:\`calc(100% - 12px)\`},children:[(0,z.jsx)(\`span\`,{className:\`flex w-10 shrink-0 items-center justify-center\`,children:u?(0,z.jsx)(it,{size:16}):(0,z.jsx)(at,{size:16})}),(0,z.jsx)(\`span\`,{className:\`whitespace-nowrap transition-[opacity,transform] duration-200 \`+(u?\`translate-x-0 opacity-100\`:\`pointer-events-none -translate-x-2 opacity-0\`),children:\`Sidebar control\`})]})}),(0,z.jsxs)(tf,{align:\`start\`,className:\`w-48\`,children:[(0,z.jsx)(sf,{children:\`Sidebar control\`}),_h.map(e=>(0,z.jsxs)(nf,{onSelect:()=>f(e.id),children:[(0,z.jsx)(\`span\`,{className:\`size-1.5 shrink-0 rounded-full \`+(n===e.id?\`bg-foreground\`:\`bg-transparent\`)}),e.label]},e.id))]})]})})]})})}function yh({title:e,expanded:t}){return(0,z.jsxs)(\`div\`,{className:\`relative mx-3 mb-1 mt-3 flex h-4 items-center\`,children:[(0,z.jsx)(\`div\`,{className:\`h-px w-full bg-accent transition-opacity duration-200 \`+(t?\`opacity-0\`:\`opacity-100\`)}),(0,z.jsx)(\`span\`,{className:\`absolute left-0.5 whitespace-nowrap text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/80 transition-opacity duration-200 \`+(t?\`opacity-100\`:\`opacity-0\`),children:e})]})}function bh({icon:e,label:t,active:n,expanded:r,onClick:i}){return(0,z.jsxs)(\`button\`,{onClick:i,title:r?void 0:t,className:\`mx-1.5 my-px flex h-8 items-center rounded-md text-[13px] transition-colors \`+(n?\`bg-accent text-foreground\`:\`text-muted-foreground hover:bg-accent/60 hover:text-foreground\`),style:{width:\`calc(100% - 12px)\`},children:[(0,z.jsx)(\`span\`,{className:\`flex w-10 shrink-0 items-center justify-center\`,children:(0,z.jsx)(e,{size:16,className:n?\`text-brand\`:\`\`})}),(0,z.jsx)(\`span\`,{className:\`whitespace-nowrap transition-[opacity,transform] duration-200 \`+(r?\`translate-x-0 opacity-100\`:\`pointer-events-none -translate-x-2 opacity-0\`),children:t})]})}function xh({title:e,children:t}){return(0,z.jsxs)(\`div\`,{className:\`mx-auto max-w-4xl px-10 py-8\`,children:[(0,z.jsx)(\`h1\`,{className:\`border-b border-border pb-4 text-xl font-semibold text-foreground\`,children:e}),t]})}function Sh({title:e,description:t,children:n}){return(0,z.jsxs)(\`div\`,{className:\`border-b border-border pb-2 last:border-0\`,children:[(0,z.jsxs)(\`div\`,{className:\`pb-1 pt-6 first:pt-0\`,children:[(0,z.jsx)(\`h2\`,{className:\`text-[15px] font-semibold text-foreground\`,children:e}),t&&(0,z.jsx)(\`p\`,{className:\`mt-0.5 text-[13px] text-muted-foreground/80\`,children:t})]}),(0,z.jsx)(\`div\`,{className:\`divide-y divide-border/70\`,children:n})]})}function Ch({label:e,description:t,children:n,wide:r}){return(0,z.jsxs)(\`div\`,{className:\`flex flex-col gap-4 py-6 sm:flex-row sm:items-start sm:gap-10\`,children:[(0,z.jsxs)(\`div\`,{className:\`w-64 shrink-0\`,children:[(0,z.jsx)(\`p\`,{className:\`text-[13px] font-medium text-foreground\`,children:e}),t&&(0,z.jsx)(\`p\`,{className:\`mt-1 text-xs leading-relaxed text-muted-foreground/80\`,children:t})]}),(0,z.jsx)(\`div\`,{className:\`min-w-0 flex-1 \`+(r?\`\`:\`max-w-md\`),children:n})]})}function wh({label:e,value:t}){return(0,z.jsxs)(\`div\`,{className:\`flex items-center justify-between gap-6 py-1.5 text-[13px]\`,children:[(0,z.jsx)(\`span\`,{className:\`text-muted-foreground\`,children:e}),(0,z.jsx)(\`span\`,{className:\`text-right font-mono text-foreground/90\`,children:t})]})}function Th({title:e,groups:t,active:n,onSelect:r,footer:i}){return(0,z.jsxs)(hf,{id:\`sub-nav\`,side:\`left\`,defaultSize:224,min:176,max:340,className:\`flex flex-col border-r border-border bg-card\`,children:[(0,z.jsx)(\`div\`,{className:\`px-4 pb-1 pt-4 text-sm font-semibold text-foreground\`,children:e}),(0,z.jsx)(\`nav\`,{className:\`min-h-0 flex-1 overflow-y-auto px-2 pb-3\`,children:t.map((e,t)=>(0,z.jsxs)(\`div\`,{className:\`pt-3 first:pt-2\`,children:[e.title&&(0,z.jsx)(\`p\`,{className:\`px-2.5 pb-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/60\`,children:e.title}),e.items.map(e=>(0,z.jsxs)(\`button\`,{onClick:()=>r(e.id),className:\`mb-px flex w-full items-center gap-2 rounded-md px-2.5 py-1.5 text-left text-[13px] transition-colors \`+(n===e.id?\`bg-accent text-foreground\`:\`text-muted-foreground hover:bg-accent/50 hover:text-foreground\`),children:[(0,z.jsx)(\`span\`,{className:\`min-w-0 flex-1 truncate\`,children:e.label}),e.badge]},e.id))]},t))}),i&&(0,z.jsx)(\`div\`,{className:\`shrink-0 border-t border-border p-3\`,children:i})]})}function Eh(){let[e,t]=(0,_.useState)(null);if((0,_.useEffect)(()=>{N.authConfig().then(t,()=>t({providers:[],inbox:!1,settings:null}))},[]),e===null)return(0,z.jsx)(Jp,{});let n=e.settings;async function r(e){if(!n)return;let r={...n,disabledProviders:[...n.disabledProviders]};t(t=>t&&t.settings?{...t,settings:{...t.settings,...e}}:t);try{let n=await N.updateAuthSettings(e);t(e=>e&&{...e,settings:n})}catch(e){t(e=>e&&{...e,settings:r}),H.error(e.message)}}async function i(e,r){if(n)try{let n=await N.updateAuthSettings({smsTwilio:{[e]:r}});t(e=>e&&{...e,settings:n}),H.success(\`Saved\`)}catch(e){H.error(e.message)}}let a=n?.phoneEnabled??!1,o=!!n?.smsTwilio?.accountSid&&!!n?.smsTwilioAuthTokenSet,s=(()=>{try{return new URL(e.sms?.apiUrl??\`https://api.twilio.com\`).host}catch{return e.sms?.apiUrl??\`api.twilio.com\`}})();return(0,z.jsx)(\`div\`,{className:\`h-full overflow-y-auto\`,children:(0,z.jsxs)(\`div\`,{className:\`mx-auto max-w-3xl px-8 py-8\`,children:[(0,z.jsx)(\`h1\`,{className:\`text-lg font-semibold text-foreground\`,children:\`Sign In / Providers\`}),(0,z.jsx)(\`p\`,{className:\`mt-0.5 text-[13px] text-muted-foreground/80\`,children:\`Changes apply instantly to the running instance and persist across restarts.\`}),(0,z.jsx)(\`h2\`,{className:\`mb-2 mt-7 text-sm font-medium text-foreground\`,children:\`User signups\`}),(0,z.jsxs)(\`div\`,{className:\`divide-y divide-border rounded-md border border-border bg-card\`,children:[(0,z.jsx)(Dh,{title:\`Allow new users to sign up\`,description:\`If disabled, new email/password and OTP signups are rejected; existing users can still sign in.\`,children:(0,z.jsx)(Yp,{checked:n?!n.disableSignup:!0,onChange:e=>void r({disableSignup:!e}),disabled:!n})}),(0,z.jsx)(Dh,{title:\`Allow anonymous sign-ins\`,description:\`Enable signInAnonymously() — temporary users without credentials.\`,children:(0,z.jsx)(Yp,{checked:n?.anonymousUsers??!0,onChange:e=>void r({anonymousUsers:e}),disabled:!n})}),(0,z.jsx)(Dh,{title:\`Confirm email\`,description:\`Require users to verify their email address (via the emailed link or code) before they can sign in.\`,children:(0,z.jsx)(Yp,{checked:n?!n.autoconfirm:!1,onChange:e=>void r({autoconfirm:!e}),disabled:!n})}),(0,z.jsx)(Dh,{title:\`Minimum password length\`,description:\`Passwords shorter than this are rejected on signup and password change (4–72).\`,children:(0,z.jsx)(kh,{value:n?.minPasswordLength??6,disabled:!n,onSave:e=>void r({minPasswordLength:e})})})]}),(0,z.jsx)(\`h2\`,{className:\`mb-2 mt-8 text-sm font-medium text-foreground\`,children:\`Auth methods\`}),(0,z.jsxs)(\`div\`,{className:\`divide-y divide-border rounded-md border border-border bg-card\`,children:[(0,z.jsx)(Oh,{icon:et,name:\`Email\`,description:\`Email/password, OTP codes, magic links, and password recovery.\`,children:(0,z.jsx)(B,{variant:\`brand\`,children:\`Enabled\`})}),(0,z.jsx)(Oh,{icon:Tt,name:\`Phone\`,description:\`signInWithOtp({ phone }), signUp({ phone, password }) and phone changes, confirmed by a texted code.\`,children:(0,z.jsx)(Yp,{checked:a,onChange:e=>void r({phoneEnabled:e}),disabled:!n})}),(0,z.jsx)(Oh,{icon:Ke,name:\`PKCE flows\`,description:\`OAuth and magic links support the PKCE flow out of the box.\`,children:(0,z.jsx)(B,{variant:\`brand\`,children:\`Enabled\`})}),(0,z.jsx)(Oh,{icon:Nt,name:\`Anonymous\`,description:\`Temporary users without credentials — controlled by the toggle above.\`,children:n?.anonymousUsers===!1?(0,z.jsx)(B,{variant:\`neutral\`,children:\`Disabled\`}):(0,z.jsx)(B,{variant:\`brand\`,children:\`Enabled\`})})]}),a&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(\`h2\`,{className:\`mb-2 mt-8 text-sm font-medium text-foreground\`,children:\`Phone\`}),(0,z.jsxs)(\`div\`,{className:\`divide-y divide-border rounded-md border border-border bg-card\`,children:[(0,z.jsx)(Dh,{title:\`Confirm phone\`,description:\`Require users to verify their number with the texted code before a phone signup can sign in.\`,children:(0,z.jsx)(Yp,{checked:n?!n.smsAutoconfirm:!1,onChange:e=>void r({smsAutoconfirm:!e}),disabled:!n})}),(0,z.jsx)(Dh,{title:\`Code length\`,description:\`Digits in texted codes (6–10).\`,children:(0,z.jsx)(Ah,{value:n?.smsOtpLength??6,min:6,max:10,disabled:!n,onSave:e=>void r({smsOtpLength:e})})}),(0,z.jsx)(Dh,{title:\`Code expiry (seconds)\`,description:\`How long a texted code stays valid.\`,children:(0,z.jsx)(Ah,{value:n?.smsOtpExpirySeconds??60,min:1,max:86400,disabled:!n,onSave:e=>void r({smsOtpExpirySeconds:e})})}),(0,z.jsx)(Dh,{title:\`Minimum interval (seconds)\`,description:\`Shortest gap between texts to the same number. 0 turns the limit off.\`,children:(0,z.jsx)(Ah,{value:n?.maxSmsFrequencySeconds??60,min:0,max:3600,disabled:!n,onSave:e=>void r({maxSmsFrequencySeconds:e})})})]}),(0,z.jsx)(\`h2\`,{className:\`mb-2 mt-8 text-sm font-medium text-foreground\`,children:\`SMS provider\`}),e.sms?.custom?(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-3 rounded-md border border-border bg-card p-4\`,children:[(0,z.jsx)(Tt,{size:16,className:\`shrink-0 text-muted-foreground\`}),(0,z.jsxs)(\`div\`,{className:\`min-w-0 flex-1\`,children:[(0,z.jsx)(\`p\`,{className:\`text-[13px] text-foreground\`,children:\`Custom sender\`}),(0,z.jsx)(\`p\`,{className:\`text-[11px] text-muted-foreground/80\`,children:\`An SMS sender was provided to createBackend; texts are delivered through it.\`})]})]}):(0,z.jsxs)(\`div\`,{className:\`rounded-md border border-border bg-card\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-3 border-b border-border p-4\`,children:[(0,z.jsx)(Tt,{size:16,className:\`shrink-0 text-muted-foreground\`}),(0,z.jsxs)(\`div\`,{className:\`min-w-0 flex-1\`,children:[(0,z.jsxs)(\`p\`,{className:\`flex items-center gap-2 text-[13px] text-foreground\`,children:[\`Twilio\`,o?(0,z.jsx)(B,{variant:\`brand\`,children:\`configured\`}):(0,z.jsx)(B,{variant:\`neutral\`,children:\`dev inbox\`})]}),(0,z.jsxs)(\`p\`,{className:\`text-[11px] text-muted-foreground/80\`,children:[o?\`Codes are sent through \${s}.\`:\`No credentials — texted codes are captured in the local inbox instead of being sent.\`,\` \`,\`The same fields as \`,(0,z.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`[auth.sms.twilio]\`}),\` in config.toml; a value here overrides it.\`]})]})]}),(0,z.jsxs)(\`div\`,{className:\`divide-y divide-border\`,children:[(0,z.jsx)(Dh,{title:\`Account SID\`,description:\`ACxxxxxxxx from the Twilio console.\`,children:(0,z.jsx)(jh,{value:n?.smsTwilio?.accountSid??\`\`,placeholder:\`AC…\`,disabled:!n,onSave:e=>void i(\`accountSid\`,e)})}),(0,z.jsx)(Dh,{title:\`Auth token\`,description:n?.smsTwilioAuthTokenSet?\`Set. Never shown again; paste a new one to replace it.\`:\`The account auth token (secret).\`,children:(0,z.jsx)(jh,{value:\`\`,placeholder:n?.smsTwilioAuthTokenSet?\`••••••••\`:\`auth token\`,secret:!0,disabled:!n,onSave:e=>void i(\`authToken\`,e)})}),(0,z.jsx)(Dh,{title:\`Messaging Service SID\`,description:\`MGxxxxxxxx; the Messaging Service texts are sent through.\`,children:(0,z.jsx)(jh,{value:n?.smsTwilio?.messageServiceSid??\`\`,placeholder:\`MG…\`,disabled:!n,onSave:e=>void i(\`messageServiceSid\`,e)})})]})]})]}),(0,z.jsx)(\`h2\`,{className:\`mb-2 mt-8 text-sm font-medium text-foreground\`,children:\`OAuth providers\`}),e.providers.length>0?(0,z.jsx)(\`div\`,{className:\`divide-y divide-border rounded-md border border-border bg-card\`,children:e.providers.map(e=>(0,z.jsx)(Oh,{icon:ze,name:e,description:\`signInWithOAuth() with identity linking.\`,oauth:!0,children:(0,z.jsx)(Yp,{checked:!n?.disabledProviders.includes(e),disabled:!n,onChange:t=>{n&&r({disabledProviders:t?n.disabledProviders.filter(t=>t!==e):[...n.disabledProviders,e]})}})},e))}):(0,z.jsxs)(\`div\`,{className:\`rounded-md border border-dashed border-border p-4 text-xs text-muted-foreground/80\`,children:[\`No OAuth providers configured. Add Google/GitHub (or a generic provider) to\`,\` \`,(0,z.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`supabase/config.toml\`}),\` and restart — they appear here with a toggle.\`]}),(0,z.jsx)(\`h2\`,{className:\`mb-2 mt-8 text-sm font-medium text-foreground\`,children:\`Email delivery\`}),(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-3 rounded-md border border-border bg-card p-4\`,children:[(0,z.jsx)(We,{size:16,className:\`shrink-0 text-muted-foreground\`}),(0,z.jsxs)(\`div\`,{className:\`min-w-0 flex-1\`,children:[(0,z.jsxs)(\`p\`,{className:\`text-[13px] text-foreground\`,children:[e.inbox?\`Local dev inbox\`:\`Custom mailer\`,\` \`,e.inbox&&(0,z.jsx)(B,{variant:\`brand\`,children:\`active\`})]}),(0,z.jsx)(\`p\`,{className:\`text-[11px] text-muted-foreground/80\`,children:e.inbox?\`No mailer configured — OTP codes, magic links and confirmations are captured locally instead of being sent.\`:\`A mailer was provided to createBackend; emails are delivered through it.\`})]}),e.inbox&&(0,z.jsxs)(\`a\`,{href:\`\${lh()}/inbox\`,target:\`_blank\`,rel:\`noreferrer\`,className:\`flex shrink-0 items-center gap-1.5 rounded-md border border-input px-2.5 py-1.5 text-xs text-foreground/80 transition-colors hover:border-muted-foreground hover:text-foreground\`,children:[\`Open inbox \`,(0,z.jsx)(Oe,{size:11})]})]}),n===null&&(0,z.jsx)(\`p\`,{className:\`mt-6 rounded-md border border-warning/30 bg-warning/10 px-3 py-2 text-xs text-warning\`,children:\`This server predates runtime auth settings — restart tinbase after updating to enable the toggles.\`})]})})}function Dh({title:e,description:t,children:n}){return(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-4 p-4\`,children:[(0,z.jsxs)(\`div\`,{className:\`min-w-0 flex-1\`,children:[(0,z.jsx)(\`p\`,{className:\`text-[13px] text-foreground\`,children:e}),(0,z.jsx)(\`p\`,{className:\`mt-0.5 text-[11px] leading-relaxed text-muted-foreground/80\`,children:t})]}),(0,z.jsx)(\`div\`,{className:\`shrink-0\`,children:n})]})}function Oh({icon:e,name:t,description:n,oauth:r,children:i}){return(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-3 p-4\`,children:[(0,z.jsx)(e,{size:16,className:\`shrink-0 text-muted-foreground\`}),(0,z.jsxs)(\`div\`,{className:\`min-w-0 flex-1\`,children:[(0,z.jsxs)(\`p\`,{className:\`flex items-center gap-2 text-[13px] capitalize text-foreground\`,children:[t,r&&(0,z.jsx)(B,{variant:\`blue\`,children:\`oauth\`})]}),(0,z.jsx)(\`p\`,{className:\`text-[11px] text-muted-foreground/80\`,children:n})]}),(0,z.jsx)(\`div\`,{className:\`shrink-0\`,children:i})]})}function kh({value:e,disabled:t,onSave:n}){return(0,z.jsx)(Ah,{value:e,min:4,max:72,disabled:t,onSave:n})}function Ah({value:e,min:t,max:n,disabled:r,onSave:i}){let[a,o]=(0,_.useState)(String(e));(0,_.useEffect)(()=>o(String(e)),[e]);function s(){let r=parseInt(a,10);if(!Number.isFinite(r)||r<t||r>n){o(String(e));return}r!==e&&i(r)}return(0,z.jsx)(lf,{mono:!0,className:\`w-16 text-center\`,value:a,disabled:r,onChange:e=>o(e.target.value.replace(/[^0-9]/g,\`\`)),onBlur:s,onKeyDown:e=>e.key===\`Enter\`&&e.target.blur()})}function jh({value:e,placeholder:t,secret:n,disabled:r,onSave:i}){let[a,o]=(0,_.useState)(e);(0,_.useEffect)(()=>o(e),[e]);function s(){let t=a.trim();t===e||n&&t===\`\`||(i(t),n&&o(\`\`))}return(0,z.jsx)(lf,{mono:!0,type:n?\`password\`:\`text\`,autoComplete:\`off\`,className:\`w-64\`,value:a,placeholder:t,disabled:r,onChange:e=>o(e.target.value),onBlur:s,onKeyDown:e=>e.key===\`Enter\`&&e.target.blur()})}function Mh({user:e,onClose:t,onChanged:n}){let[r,i]=(0,_.useState)(\`overview\`),[a,o]=(0,_.useState)(!1),[s,c]=(0,_.useState)(!1);async function l(){try{await N.deleteUser(e.id),H.success(\`User deleted\`),n()}catch(e){H.error(e.message)}}async function u(){if(e.email)try{await N.sendMagicLink(e.email),H.success(\`Magic link sent — check /inbox in dev\`)}catch(e){H.error(e.message)}}return(0,z.jsxs)(qp,{open:!0,onClose:t,width:\`w-[480px]\`,title:(0,z.jsxs)(\`span\`,{className:\`flex items-center gap-2\`,children:[(0,z.jsx)(\`span\`,{className:\`truncate\`,children:e.email||(e.is_anonymous?\`Anonymous user\`:e.id.slice(0,12))}),e.is_anonymous&&(0,z.jsx)(B,{variant:\`neutral\`,children:\`anon\`})]}),footer:(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(V,{variant:\`danger\`,onClick:()=>c(!0),children:[(0,z.jsx)(At,{size:13}),\` Delete user\`]}),(0,z.jsx)(Kp,{asChild:!0,children:(0,z.jsx)(V,{variant:\`outline\`,className:\`ml-auto\`,children:\`Done\`})})]}),children:[(0,z.jsx)($p,{tabs:[{id:\`overview\`,label:\`Overview\`},{id:\`json\`,label:\`Raw JSON\`}],active:r,onSelect:i}),r===\`overview\`&&(0,z.jsxs)(\`div\`,{className:\`mt-4 space-y-5\`,children:[(0,z.jsx)(\`div\`,{children:[[\`User UID\`,e.id,!0],[\`Email\`,e.email??\`—\`,!1],[\`Created at\`,(0,z.jsx)(qm,{value:e.created_at}),!1],[\`Updated at\`,(0,z.jsx)(qm,{value:e.updated_at}),!1],[\`Confirmation sent at\`,(0,z.jsx)(qm,{value:e.confirmation_sent_at}),!1],[\`Confirmed at\`,(0,z.jsx)(qm,{value:e.email_confirmed_at}),!1],[\`Last signed in\`,(0,z.jsx)(qm,{value:e.last_sign_in_at}),!1]].map(([e,t,n])=>(0,z.jsxs)(\`div\`,{className:\`flex items-center justify-between gap-4 border-b border-border/60 py-2 text-[13px] last:border-0\`,children:[(0,z.jsx)(\`span\`,{className:\`shrink-0 text-muted-foreground\`,children:e}),(0,z.jsxs)(\`span\`,{className:\`flex min-w-0 items-center gap-1 font-mono text-foreground/90\`,children:[(0,z.jsx)(\`span\`,{className:\`truncate\`,children:t}),n&&(0,z.jsx)(er,{value:String(t),label:e,iconSize:11})]})]},e))}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(\`p\`,{className:\`mb-2 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/60\`,children:\`Provider information\`}),(0,z.jsxs)(\`div\`,{className:\`rounded-md border border-border bg-card p-3.5\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-2\`,children:[(0,z.jsx)(\`span\`,{className:\`text-[13px] font-medium capitalize text-foreground\`,children:e.app_metadata?.provider??(e.is_anonymous?\`anonymous\`:\`email\`)}),(0,z.jsx)(B,{variant:\`brand\`,children:\`enabled\`})]}),(0,z.jsx)(\`p\`,{className:\`mt-1 text-[11px] text-muted-foreground/80\`,children:e.is_anonymous?\`Signed in anonymously — no credentials attached.\`:\`How this user authenticates with your project.\`})]})]}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(\`p\`,{className:\`mb-2 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/60\`,children:\`Actions\`}),(0,z.jsx)(\`div\`,{className:\`space-y-2\`,children:!e.is_anonymous&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Nh,{icon:Ke,title:\`Reset password\`,description:\`Set a new password for the user directly.\`,action:(0,z.jsx)(V,{variant:\`outline\`,size:\`xs\`,onClick:()=>o(!0),children:\`Reset password\`})}),(0,z.jsx)(Nh,{icon:et,title:\`Send magic link\`,description:\`Send a passwordless sign-in link to the user.\`,action:(0,z.jsx)(V,{variant:\`outline\`,size:\`xs\`,onClick:()=>void u(),disabled:!e.email,children:\`Send magic link\`})})]})})]})]}),r===\`json\`&&(0,z.jsx)(\`div\`,{className:\`mt-4\`,children:(0,z.jsx)(nr,{value:JSON.stringify(e,null,2),lang:\`js\`,readOnly:!0,minLines:10,maxLines:400})}),a&&(0,z.jsx)(Ph,{user:e,onClose:()=>o(!1),onDone:()=>{o(!1),H.success(\`Password updated\`)}}),s&&(0,z.jsx)(q,{open:!0,danger:!0,title:\`Delete user \${e.email||e.id.slice(0,8)}?\`,description:\`The user and their sessions will be permanently removed.\`,confirmLabel:\`Delete user\`,onConfirm:()=>void l(),onClose:()=>c(!1)})]})}function Nh({icon:e,title:t,description:n,action:r}){return(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-3 rounded-md border border-border bg-card p-3.5\`,children:[(0,z.jsx)(e,{size:15,className:\`shrink-0 text-muted-foreground\`}),(0,z.jsxs)(\`div\`,{className:\`min-w-0 flex-1\`,children:[(0,z.jsx)(\`p\`,{className:\`text-[13px] text-foreground\`,children:t}),(0,z.jsx)(\`p\`,{className:\`text-[11px] text-muted-foreground/80\`,children:n})]}),r]})}function Ph({user:e,onClose:t,onDone:n}){let[r,i]=(0,_.useState)(\`\`),[a,o]=(0,_.useState)(\`\`),[s,c]=(0,_.useState)(!1);async function l(){c(!0),o(\`\`);try{await N.updateUser(e.id,{password:r}),n()}catch(e){o(e.message),c(!1)}}return(0,z.jsx)(go,{open:!0,onClose:t,title:\`Reset password · \${e.email||e.id.slice(0,8)}\`,children:(0,z.jsxs)(\`div\`,{className:\`space-y-3\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`New password (min 6 characters)\`}),(0,z.jsx)(lf,{type:\`password\`,value:r,autoFocus:!0,onChange:e=>i(e.target.value),onKeyDown:e=>e.key===\`Enter\`&&r.length>=6&&void l()})]}),a&&(0,z.jsx)(\`p\`,{className:\`text-xs text-destructive\`,children:a}),(0,z.jsxs)(\`div\`,{className:\`flex justify-end gap-2\`,children:[(0,z.jsx)(V,{variant:\`outline\`,onClick:t,children:\`Cancel\`}),(0,z.jsx)(V,{onClick:()=>void l(),disabled:s||r.length<6,children:s?\`Saving…\`:\`Update password\`})]})]})})}var Fh=50;function Ih(e){return e.app_metadata?.provider||(e.is_anonymous?\`anonymous\`:\`email\`)}function Lh({provider:e}){return e===\`email\`?(0,z.jsx)(et,{size:12,className:\`text-muted-foreground\`}):e===\`anonymous\`?(0,z.jsx)(Nt,{size:12,className:\`text-muted-foreground\`}):(0,z.jsx)(ze,{size:12,className:\`text-muted-foreground\`})}function Rh(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(\`\`),[i,a]=(0,_.useState)(\`all\`),[o,s]=(0,_.useState)(0),[c,l]=(0,_.useState)(null),[u,d]=(0,_.useState)(!1),[f,p]=(0,_.useState)(!1),m=(0,_.useCallback)(()=>{N.users().then(e=>t(e),()=>t([]))},[]);(0,_.useEffect)(()=>{m()},[m]);let h=(0,_.useMemo)(()=>{if(!e)return[];let t=n.toLowerCase().trim();return e.filter(e=>i===\`anonymous\`&&!e.is_anonymous||i===\`verified\`&&!e.email_confirmed_at?!1:t?(e.email??\`\`).toLowerCase().includes(t)||e.id.toLowerCase().includes(t):!0)},[e,n,i]);if((0,_.useEffect)(()=>s(0),[n,i]),e===null)return(0,z.jsx)(Jp,{});let g=Math.max(1,Math.ceil(h.length/Fh)),v=h.slice(o*Fh,(o+1)*Fh);return(0,z.jsxs)(\`div\`,{className:\`flex h-full\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex min-w-0 flex-1 flex-col\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex shrink-0 items-center gap-2 border-b border-border px-4 py-2.5\`,children:[(0,z.jsx)(\`h1\`,{className:\`text-sm font-semibold text-foreground\`,children:\`Users\`}),(0,z.jsx)(B,{variant:\`neutral\`,children:e.length}),(0,z.jsxs)(\`div\`,{className:\`relative ml-2 w-64\`,children:[(0,z.jsx)(vt,{size:13,className:\`pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground/60\`}),(0,z.jsx)(\`input\`,{value:n,onChange:e=>r(e.target.value),placeholder:\`Search by email or UID…\`,className:\`h-8 w-full rounded-md border border-input bg-field pl-8 pr-2 text-[13px] text-foreground placeholder:text-muted-foreground/60 focus:border-brand focus:outline-none\`})]}),(0,z.jsx)(Wp,{className:\`w-36 shrink-0\`,value:i,onValueChange:e=>a(e),options:[{value:\`all\`,label:\`All users\`},{value:\`verified\`,label:\`Verified\`},{value:\`anonymous\`,label:\`Anonymous\`}]}),(0,z.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-1.5\`,children:[(0,z.jsx)(V,{variant:\`ghost\`,size:\`iconXs\`,title:\`Refresh\`,onClick:m,children:(0,z.jsx)(gt,{size:13})}),(0,z.jsxs)(Zd,{children:[(0,z.jsx)(Qd,{asChild:!0,children:(0,z.jsxs)(V,{size:\`xs\`,children:[(0,z.jsx)(mt,{size:12}),\` Add user \`,(0,z.jsx)(me,{size:11})]})}),(0,z.jsxs)(tf,{align:\`end\`,children:[(0,z.jsxs)(nf,{onSelect:()=>d(!0),children:[(0,z.jsx)(Ke,{size:13}),\` Create with password\`]}),(0,z.jsxs)(nf,{onSelect:()=>p(!0),children:[(0,z.jsx)(et,{size:13}),\` Invite via magic link\`]})]})]})]})]}),(0,z.jsxs)(\`div\`,{className:\`min-h-0 flex-1 overflow-auto\`,children:[(0,z.jsxs)(Xp,{children:[(0,z.jsx)(Zp,{children:(0,z.jsxs)(\`tr\`,{children:[(0,z.jsx)(Z,{children:\`Email\`}),(0,z.jsx)(Z,{children:\`UID\`}),(0,z.jsx)(Z,{children:\`Provider\`}),(0,z.jsx)(Z,{children:\`Created\`}),(0,z.jsx)(Z,{children:\`Last sign in\`})]})}),(0,z.jsx)(\`tbody\`,{children:v.map(e=>{let t=Ih(e);return(0,z.jsxs)(Qp,{className:\`cursor-pointer\`,onClick:()=>l(e),children:[(0,z.jsx)(Q,{className:\`text-foreground/90\`,children:(0,z.jsxs)(\`span\`,{className:\`flex items-center gap-2\`,children:[e.email||(0,z.jsx)(\`span\`,{className:\`italic text-muted-foreground/60\`,children:e.is_anonymous?\`anonymous\`:\`—\`}),e.is_anonymous&&(0,z.jsx)(B,{variant:\`neutral\`,children:\`anon\`}),e.email&&!e.email_confirmed_at&&(0,z.jsx)(B,{variant:\`amber\`,children:\`unverified\`})]})}),(0,z.jsxs)(Q,{className:\`font-mono text-[11px] text-muted-foreground/80\`,children:[e.id.slice(0,8),\`…\`]}),(0,z.jsx)(Q,{children:(0,z.jsxs)(\`span\`,{className:\`flex items-center gap-1.5 text-muted-foreground\`,children:[(0,z.jsx)(Lh,{provider:t}),t]})}),(0,z.jsx)(Q,{className:\`text-muted-foreground\`,children:(0,z.jsx)(qm,{value:e.created_at,format:\`date\`})}),(0,z.jsx)(Q,{className:\`text-muted-foreground\`,children:(0,z.jsx)(qm,{value:e.last_sign_in_at})})]},e.id)})})]}),v.length===0&&(0,z.jsx)(cf,{children:e.length===0?\`No users yet — add one or invite via magic link.\`:\`No match.\`})]}),(0,z.jsxs)(\`div\`,{className:\`flex shrink-0 items-center gap-3 border-t border-border bg-card px-4 py-1.5 text-xs text-muted-foreground/80\`,children:[(0,z.jsxs)(\`span\`,{children:[h.length.toLocaleString(),\` user\`,h.length===1?\`\`:\`s\`]}),g>1&&(0,z.jsxs)(\`span\`,{className:\`ml-auto flex items-center gap-2\`,children:[(0,z.jsx)(V,{variant:\`ghost\`,size:\`xs\`,disabled:o===0,onClick:()=>s(e=>e-1),children:\`Prev\`}),\`Page \`,o+1,\` of \`,g,(0,z.jsx)(V,{variant:\`ghost\`,size:\`xs\`,disabled:o+1>=g,onClick:()=>s(e=>e+1),children:\`Next\`})]})]})]}),c&&(0,z.jsx)(Mh,{user:c,onClose:()=>l(null),onChanged:()=>{m(),l(null)}}),u&&(0,z.jsx)(zh,{onClose:()=>d(!1),onDone:()=>{d(!1),m()}}),f&&(0,z.jsx)(Bh,{onClose:()=>p(!1),onDone:()=>{p(!1),m()}})]})}function zh({onClose:e,onDone:t}){let[n,r]=(0,_.useState)(\`\`),[i,a]=(0,_.useState)(\`\`),[o,s]=(0,_.useState)(\`\`),[c,l]=(0,_.useState)(!1);async function u(){l(!0),s(\`\`);try{await N.createUser({email:n,password:i||void 0,email_confirm:!0}),H.success(\`Created \${n}\`),t()}catch(e){s(e.message),l(!1)}}return(0,z.jsx)(go,{open:!0,onClose:e,title:\`Create user\`,children:(0,z.jsxs)(\`div\`,{className:\`space-y-3\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Email\`}),(0,z.jsx)(lf,{value:n,autoFocus:!0,placeholder:\`user@example.com\`,onChange:e=>r(e.target.value)})]}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Password (optional — leave empty for passwordless)\`}),(0,z.jsx)(lf,{type:\`password\`,value:i,onChange:e=>a(e.target.value)})]}),o&&(0,z.jsx)(\`p\`,{className:\`text-xs text-destructive\`,children:o}),(0,z.jsxs)(\`div\`,{className:\`flex justify-end gap-2\`,children:[(0,z.jsx)(V,{variant:\`outline\`,onClick:e,children:\`Cancel\`}),(0,z.jsx)(V,{onClick:()=>void u(),disabled:c||!n.includes(\`@\`),children:c?\`Creating…\`:\`Create user\`})]})]})})}function Bh({onClose:e,onDone:t}){let[n,r]=(0,_.useState)(\`\`),[i,a]=(0,_.useState)(\`\`),[o,s]=(0,_.useState)(!1);async function c(){s(!0),a(\`\`);try{await N.sendMagicLink(n),H.success(\`Magic link sent to \${n} — check /inbox in dev\`),t()}catch(e){a(e.message),s(!1)}}return(0,z.jsx)(go,{open:!0,onClose:e,title:\`Invite via magic link\`,children:(0,z.jsxs)(\`div\`,{className:\`space-y-3\`,children:[(0,z.jsxs)(\`p\`,{className:\`text-xs text-muted-foreground/80\`,children:[\`Sends a sign-in link (creating the user if needed). Without a configured mailer, the email lands in the local dev inbox at \`,(0,z.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`/inbox\`}),\`.\`]}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Email\`}),(0,z.jsx)(lf,{value:n,autoFocus:!0,placeholder:\`user@example.com\`,onChange:e=>r(e.target.value),onKeyDown:e=>e.key===\`Enter\`&&n.includes(\`@\`)&&void c()})]}),i&&(0,z.jsx)(\`p\`,{className:\`text-xs text-destructive\`,children:i}),(0,z.jsxs)(\`div\`,{className:\`flex justify-end gap-2\`,children:[(0,z.jsx)(V,{variant:\`outline\`,onClick:e,children:\`Cancel\`}),(0,z.jsx)(V,{onClick:()=>void c(),disabled:o||!n.includes(\`@\`),children:o?\`Sending…\`:\`Send invite\`})]})]})})}var Vh=[{id:\`users\`,label:\`Users\`,group:\`Manage\`,component:Rh},{id:\`providers\`,label:\`Sign In / Providers\`,group:\`Configuration\`,component:Eh}];function Hh(){let{section:e}=Yt(),t=Vh.some(t=>t.id===e)?e:\`users\`,n=Vh.find(e=>e.id===t).component;return(0,z.jsxs)(\`div\`,{className:\`flex h-full\`,children:[(0,z.jsx)(Th,{title:\`Authentication\`,active:t,onSelect:e=>R(\`auth\`,e),groups:[{title:\`Manage\`,items:[{id:\`users\`,label:\`Users\`}]},{title:\`Configuration\`,items:[{id:\`providers\`,label:\`Sign In / Providers\`}]}]}),(0,z.jsx)(\`div\`,{className:\`min-w-0 flex-1 overflow-hidden\`,children:(0,z.jsx)(n,{})})]})}var Uh=\`tinbase_db_schema\`,Wh=localStorage.getItem(Uh)||\`public\`,Gh=new Set;function Kh(){return[(0,_.useSyncExternalStore)(e=>(Gh.add(e),()=>Gh.delete(e)),()=>Wh),qh]}function qh(e){Wh=e,localStorage.setItem(Uh,e),Gh.forEach(e=>e())}function Jh(e,t){let n=e=>\`"\`+e.replace(/"/g,\`""\`)+\`"\`;return e===\`public\`?n(t):\`\${n(e)}.\${n(t)}\`}var Yh=new Set([\`auth\`,\`storage\`,\`realtime\`,\`vault\`,\`cron\`,\`pgmq\`,\`net\`,\`extensions\`,\`graphql\`,\`supabase_migrations\`,\`supabase_functions\`,\`information_schema\`]);function Xh(e){return Yh.has(e)||e.startsWith(\`pg_\`)}function Zh({className:e=\`w-44 shrink-0\`,size:t}){let[n,r]=Kh(),[i,a]=(0,_.useState)([n]);return(0,_.useEffect)(()=>{N.schemas().then(e=>{a(e),e.includes(n)||qh(e.includes(\`public\`)?\`public\`:e[0]??\`public\`)},()=>{})},[]),(0,z.jsx)(Wp,{className:e,size:t,mono:!0,value:n,onValueChange:r,options:i.map(e=>({value:e,label:(0,z.jsxs)(\`span\`,{className:\`inline-flex items-center gap-1.5\`,children:[(0,z.jsx)(\`span\`,{className:\`font-sans text-muted-foreground/70\`,children:\`schema \`}),e,Xh(e)&&(0,z.jsx)(Ze,{size:10,className:\`text-muted-foreground/60\`})]})}))})}function Qh({title:e,description:t,search:n,onSearch:r,onRefresh:i,actions:a,schemaPicker:o,filters:s}){return(0,z.jsxs)(\`div\`,{className:\`border-b border-border px-6 pb-4 pt-5\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex items-start justify-between gap-4\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(\`h1\`,{className:\`text-lg font-semibold text-foreground\`,children:e}),(0,z.jsx)(\`p\`,{className:\`mt-0.5 text-[13px] text-muted-foreground/80\`,children:t})]}),(0,z.jsxs)(\`div\`,{className:\`flex shrink-0 items-center gap-1.5 pt-1\`,children:[i&&(0,z.jsx)(V,{variant:\`ghost\`,size:\`iconXs\`,title:\`Refresh\`,onClick:i,children:(0,z.jsx)(gt,{size:13})}),a]})]}),(r||o||s)&&(0,z.jsxs)(\`div\`,{className:\`mt-3 flex items-center gap-2\`,children:[o&&(0,z.jsx)(Zh,{}),r&&(0,z.jsxs)(\`div\`,{className:\`relative w-full max-w-xs\`,children:[(0,z.jsx)(vt,{size:13,className:\`pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground/60\`}),(0,z.jsx)(\`input\`,{value:n,onChange:e=>r(e.target.value),placeholder:\`Search…\`,className:\`h-8 w-full rounded-md border border-input bg-field pl-8 pr-2 text-[13px] text-foreground placeholder:text-muted-foreground/60 focus:border-brand focus:outline-none\`})]}),s]})]})}var $h=e=>\`"\`+e.replace(/"/g,\`""\`)+\`"\`,eg=e=>\`'\`+e.replace(/'/g,\`''\`)+\`'\`;function tg(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)([]),[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(!1),[c,l]=(0,_.useState)(null),u=(0,_.useCallback)(async()=>{let[e,n]=await Promise.all([N.sql(\`select jobid, jobname, schedule, command, active from cron.job order by jobid\`),N.sql(\`select jobid, status, return_message, start_time, end_time from cron.job_run_details order by start_time desc limit 50\`)]);if(!e.ok||!n.ok){a(e.error??n.error??\`Query failed\`),t(e=>e??[]),e.ok&&t(e.rows??[]),n.ok&&r(n.rows??[]);return}a(null),t(e.rows??[]),r(n.rows??[])},[]);(0,_.useEffect)(()=>{u()},[u]);async function d(e){let t=await N.sql(\`select cron.unschedule(\${eg(e.jobname??String(e.jobid))})\`);if(!t.ok){H.error(t.error??\`Unschedule failed\`);return}H.success(\`Unscheduled \${e.jobname??e.jobid}\`),await u()}return e===null?(0,z.jsx)(Jp,{}):(0,z.jsxs)(\`div\`,{className:\`flex h-full flex-col\`,children:[(0,z.jsx)(Qh,{title:\`Cron\`,description:\`Scheduled SQL, pg_cron-compatible — jobs run in UTC with service-role privileges while tinbase is up.\`,onRefresh:()=>void u(),actions:(0,z.jsxs)(V,{size:\`xs\`,onClick:()=>s(!0),children:[(0,z.jsx)(mt,{size:12}),\` Schedule job\`]})}),i&&(0,z.jsx)(ff,{message:i}),(0,z.jsxs)(\`div\`,{className:\`min-h-0 flex-1 overflow-y-auto\`,children:[(0,z.jsxs)(Xp,{children:[(0,z.jsx)(Zp,{children:(0,z.jsxs)(\`tr\`,{children:[(0,z.jsx)(Z,{children:\`Name\`}),(0,z.jsx)(Z,{children:\`Schedule\`}),(0,z.jsx)(Z,{children:\`Command\`}),(0,z.jsx)(Z,{children:\`Status\`}),(0,z.jsx)(Z,{className:\`w-12\`})]})}),(0,z.jsx)(\`tbody\`,{children:e.map(e=>(0,z.jsxs)(Qp,{children:[(0,z.jsx)(Q,{className:\`font-mono text-foreground/90\`,children:e.jobname??\`#\${e.jobid}\`}),(0,z.jsx)(Q,{className:\`font-mono text-brand\`,children:e.schedule}),(0,z.jsx)(Q,{className:\`max-w-90 truncate font-mono text-[11px] text-muted-foreground/80\`,title:e.command,children:e.command}),(0,z.jsx)(Q,{children:e.active?(0,z.jsx)(B,{variant:\`brand\`,children:\`active\`}):(0,z.jsx)(B,{variant:\`neutral\`,children:\`inactive\`})}),(0,z.jsx)(Q,{children:(0,z.jsx)(\`button\`,{className:\`p-1 text-muted-foreground/80 opacity-0 hover:text-destructive group-hover:opacity-100\`,title:\`Unschedule\`,onClick:()=>l(e),children:(0,z.jsx)(At,{size:13})})})]},e.jobid))})]}),e.length===0&&(0,z.jsxs)(cf,{children:[\`No jobs scheduled. \`,(0,z.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`select cron.schedule('name', '*/5 * * * *', 'select 1')\`}),\` \`,\`also works from SQL.\`]}),n.length>0&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(\`h2\`,{className:\`border-b border-border px-6 pb-2 pt-6 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground/80\`,children:\`Recent runs\`}),(0,z.jsxs)(Xp,{children:[(0,z.jsx)(Zp,{children:(0,z.jsxs)(\`tr\`,{children:[(0,z.jsx)(Z,{children:\`Job\`}),(0,z.jsx)(Z,{children:\`Status\`}),(0,z.jsx)(Z,{children:\`Started\`}),(0,z.jsx)(Z,{children:\`Message\`})]})}),(0,z.jsx)(\`tbody\`,{children:n.map((t,n)=>(0,z.jsxs)(Qp,{children:[(0,z.jsx)(Q,{className:\`font-mono text-muted-foreground\`,children:e.find(e=>e.jobid===t.jobid)?.jobname??\`#\${t.jobid}\`}),(0,z.jsx)(Q,{children:t.status===\`succeeded\`?(0,z.jsx)(B,{variant:\`brand\`,children:\`succeeded\`}):(0,z.jsx)(B,{variant:\`red\`,children:t.status})}),(0,z.jsx)(Q,{className:\`text-muted-foreground\`,children:(0,z.jsx)(qm,{value:t.start_time})}),(0,z.jsx)(Q,{className:\`max-w-90 truncate font-mono text-[11px] text-muted-foreground/80\`,title:t.return_message??\`\`,children:t.return_message??\`—\`})]},n))})]})]})]}),o&&(0,z.jsx)(ng,{onClose:()=>s(!1),onDone:async()=>{s(!1),await u()}}),c&&(0,z.jsx)(q,{open:!0,danger:!0,title:\`Unschedule "\${c.jobname??c.jobid}"?\`,description:\`The job stops running immediately. Run history is kept.\`,confirmLabel:\`Unschedule\`,onConfirm:()=>void d(c),onClose:()=>l(null)})]})}function ng({onClose:e,onDone:t}){let[n,r]=(0,_.useState)(\`\`),[i,a]=(0,_.useState)(\`*/5 * * * *\`),[o,s]=(0,_.useState)(\`select net.http_post('https://example.com/hook', '{}'::jsonb)\`),[c,l]=(0,_.useState)(\`\`),[u,d]=(0,_.useState)(!1);async function f(){if(!n.trim()||!i.trim()||!o.trim())return l(\`All fields are required.\`);d(!0),l(\`\`);let e=await N.sql(\`select cron.schedule(\${eg(n.trim())}, \${eg(i.trim())}, \${eg(o)})\`);if(!e.ok){l(e.error??\`Schedule failed\`),d(!1);return}H.success(\`Scheduled \${n.trim()}\`),await t()}return(0,z.jsx)(qp,{open:!0,onClose:e,width:\`w-140\`,title:\`Schedule a new job\`,footer:(0,z.jsxs)(z.Fragment,{children:[c&&(0,z.jsx)(\`p\`,{className:\`min-w-0 truncate text-xs text-destructive\`,children:c}),(0,z.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-2\`,children:[(0,z.jsx)(Kp,{asChild:!0,children:(0,z.jsx)(V,{variant:\`outline\`,children:\`Cancel\`})}),(0,z.jsx)(V,{onClick:()=>void f(),disabled:u,children:u?\`Scheduling…\`:\`Schedule job\`})]})]}),children:(0,z.jsxs)(\`div\`,{className:\`space-y-3\`,children:[(0,z.jsxs)(\`div\`,{className:\`grid grid-cols-2 gap-3\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Name\`}),(0,z.jsx)(lf,{mono:!0,value:n,autoFocus:!0,placeholder:\`cleanup\`,onChange:e=>r(e.target.value)})]}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Schedule — cron (UTC) or "N seconds"\`}),(0,z.jsx)(lf,{mono:!0,value:i,placeholder:\`*/5 * * * *\`,onChange:e=>a(e.target.value)})]})]}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`SQL command\`}),(0,z.jsx)(ir,{lang:\`sql\`,className:\`h-40\`,value:o,onChange:s,onCmdEnter:()=>void f()})]})]})})}var rg=/^[a-z_][a-z0-9_-]{0,46}$/i;function ig(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(null),[i,a]=(0,_.useState)(!1),[o,s]=(0,_.useState)(null),[c,l]=(0,_.useState)(null),[u,d]=(0,_.useState)(null),f=(0,_.useCallback)(async()=>{let e=await N.sql(\`select replace(t.table_name, 'q_', '') as name,
|
|
1508
|
+
const { data } = await supabase.from('YOUR_TABLE').select()\`}function dh({size:e=24}){let t=(0,_.useId)(),n=\`\${t}-body\`,r=\`\${t}-lid\`;return(0,z.jsxs)(\`svg\`,{width:e,height:e,viewBox:\`0 0 120 120\`,fill:\`none\`,xmlns:\`http://www.w3.org/2000/svg\`,children:[(0,z.jsxs)(\`defs\`,{children:[(0,z.jsxs)(\`linearGradient\`,{id:n,x1:\`30\`,y1:\`30\`,x2:\`92\`,y2:\`102\`,gradientUnits:\`userSpaceOnUse\`,children:[(0,z.jsx)(\`stop\`,{stopColor:\`#10b981\`}),(0,z.jsx)(\`stop\`,{offset:\`1\`,stopColor:\`#047857\`})]}),(0,z.jsxs)(\`linearGradient\`,{id:r,x1:\`26\`,y1:\`19\`,x2:\`94\`,y2:\`49\`,gradientUnits:\`userSpaceOnUse\`,children:[(0,z.jsx)(\`stop\`,{stopColor:\`#6ee7b7\`}),(0,z.jsx)(\`stop\`,{offset:\`1\`,stopColor:\`#34d399\`})]})]}),(0,z.jsx)(\`path\`,{d:\`M26 34v52c0 8.4 15.2 15.2 34 15.2s34-6.8 34-15.2V34Z\`,fill:\`url(#\${n})\`}),(0,z.jsx)(\`path\`,{d:\`M26 60c0 8.4 15.2 15.2 34 15.2S94 68.4 94 60\`,stroke:\`#6ee7b7\`,strokeWidth:\`3\`,fill:\`none\`}),(0,z.jsx)(\`ellipse\`,{cx:\`60\`,cy:\`34\`,rx:\`34\`,ry:\`15\`,fill:\`url(#\${r})\`}),(0,z.jsx)(\`ellipse\`,{cx:\`60\`,cy:\`34\`,rx:\`25\`,ry:\`10\`,fill:\`none\`,stroke:\`#059669\`,strokeOpacity:\`0.5\`,strokeWidth:\`2.5\`})]})}function fh({onLogout:e}){let[t,n]=(0,_.useState)(!1),r=lh(),i=$n(r,\`API URL\`);return(0,z.jsxs)(\`header\`,{className:\`flex h-12 shrink-0 items-center gap-2 border-b border-border bg-card px-3\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-2 pl-1\`,children:[(0,z.jsx)(dh,{size:22}),(0,z.jsx)(\`span\`,{className:\`text-[13px] font-semibold text-foreground\`,children:\`tinbase\`}),(0,z.jsx)(B,{variant:\`outline\`,children:\`studio\`})]}),(0,z.jsx)(\`span\`,{className:\`text-muted-foreground\`,children:\`/\`}),(0,z.jsxs)(\`button\`,{onClick:i.copy,title:i.copied?\`Copied!\`:\`Copy API URL\`,className:\`group flex items-center gap-1.5 rounded-md px-2 py-1 font-mono text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground\`,children:[r.replace(/^https?:\\/\\//,\`\`),i.copied?(0,z.jsx)(pe,{size:11,className:\`text-brand\`}):(0,z.jsx)(Se,{size:11,className:\`opacity-0 transition-opacity group-hover:opacity-100\`})]}),(0,z.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-1.5\`,children:[(0,z.jsxs)(\`button\`,{onClick:()=>window.dispatchEvent(new KeyboardEvent(\`keydown\`,{key:\`k\`,ctrlKey:!0})),className:\`flex h-7 items-center gap-2 rounded-md border border-input bg-field px-2.5 text-xs text-muted-foreground/80 transition-colors hover:border-muted-foreground hover:text-foreground\`,title:\`Search (Ctrl+K)\`,children:[(0,z.jsx)(vt,{size:12}),\`Search…\`,(0,z.jsx)(uf,{children:\`⌘K\`})]}),(0,z.jsxs)(V,{size:\`xs\`,className:\`h-7\`,onClick:()=>n(!0),children:[(0,z.jsx)(pt,{size:12}),\` Connect\`]}),(0,z.jsx)(ih,{}),(0,z.jsx)(V,{variant:\`outline\`,size:\`icon\`,className:\`size-7\`,title:\`Log out\`,onClick:e,children:(0,z.jsx)($e,{size:13})})]}),(0,z.jsx)(ph,{open:t,onClose:()=>n(!1)})]})}function ph({open:e,onClose:t}){let n=lh(),r=x(),[i,a]=(0,_.useState)(\`\`);return(0,_.useEffect)(()=>{e&&N.keys().then(e=>a(e.anonKey??\`\`),()=>a(\`\`))},[e]),(0,z.jsx)(go,{open:e,onClose:t,title:\`Connect to tinbase\`,wide:!0,children:(0,z.jsxs)(\`div\`,{className:\`space-y-4\`,children:[(0,z.jsxs)(\`p\`,{className:\`text-xs text-muted-foreground/80\`,children:[\`tinbase is a\`,\` \`,(0,z.jsx)(\`span\`,{className:\`text-foreground/80\`,children:\`Supabase-compatible\`}),\` backend in one process — REST, Auth, Storage, and Realtime speak the same wire protocols, so the official\`,\` \`,(0,z.jsx)(\`span\`,{className:\`text-foreground/80\`,children:\`supabase-js\`}),\` SDK connects unchanged.\`]}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`API URL\`}),(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-2\`,children:[(0,z.jsx)(Y,{mono:!0,readOnly:!0,value:n}),(0,z.jsx)(er,{value:n,label:\`API URL\`,variant:\`outline\`,size:\`icon\`,iconSize:13})]})]}),(0,z.jsx)(df,{label:\`anon key\`,hint:\`safe for browsers — RLS applies\`,value:i}),(0,z.jsx)(df,{label:\`service_role key\`,hint:\`server-side only — bypasses RLS\`,value:r,danger:!0}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Get Started\`}),(0,z.jsx)(rr,{code:uh(),lang:\`js\`})]})]})})}function mh({onOk:e}){let[t,n]=(0,_.useState)(\`\`),[r,i]=(0,_.useState)(\`\`),[a,o]=(0,_.useState)(!1);async function s(){o(!0),i(\`\`),S(t.trim());try{await N.ping(),e()}catch(e){C(),i(\`Invalid service_role key: \`+e.message)}finally{o(!1)}}return(0,z.jsx)(\`div\`,{className:\`flex h-full items-center justify-center\`,children:(0,z.jsxs)(\`div\`,{className:\`w-[400px] text-center\`,children:[(0,z.jsx)(\`div\`,{className:\`mb-4 flex justify-center\`,children:(0,z.jsx)(dh,{size:48})}),(0,z.jsx)(\`h1\`,{className:\`text-lg font-semibold\`,children:\`tinbase studio\`}),(0,z.jsxs)(\`p\`,{className:\`mt-1 text-[13px] text-muted-foreground/80\`,children:[\`Sign in with the \`,(0,z.jsx)(\`span\`,{className:\`text-foreground/80\`,children:\`service_role\`}),\` key printed when tinbase started.\`]}),(0,z.jsxs)(\`div\`,{className:\`mt-5 space-y-3 text-left\`,children:[(0,z.jsx)(Y,{type:\`password\`,placeholder:\`service_role key (eyJ…)\`,value:t,onChange:e=>n(e.target.value),onKeyDown:e=>e.key===\`Enter\`&&s()}),(0,z.jsx)(V,{className:\`w-full\`,onClick:s,disabled:a||!t.trim(),children:a?\`Checking…\`:\`Continue\`}),r&&(0,z.jsx)(\`p\`,{className:\`text-xs text-destructive\`,children:r})]})]})})}var hh=52,gh=224,_h=[{id:\`expanded\`,label:\`Expanded\`},{id:\`collapsed\`,label:\`Collapsed\`},{id:\`hover\`,label:\`Expand on hover\`}];function vh({tab:e,onTab:t}){let[n,r]=gn(),[i,a]=(0,_.useState)(!1),[o,s]=(0,_.useState)(!1),c=(0,_.useRef)(void 0),l=i||o,u=n===\`expanded\`||n===\`hover\`&&l,d=n===\`hover\`&&l,f=e=>{r(e),a(!1)};return(0,z.jsx)(\`aside\`,{className:\`relative shrink-0 transition-[width] duration-200 ease-[cubic-bezier(0.16,1,0.3,1)]\`,style:{width:n===\`expanded\`?gh:hh},children:(0,z.jsxs)(\`div\`,{onMouseEnter:()=>{n===\`hover\`&&(clearTimeout(c.current),c.current=setTimeout(()=>a(!0),60))},onMouseLeave:()=>{clearTimeout(c.current),c.current=setTimeout(()=>a(!1),120)},className:\`absolute inset-y-0 left-0 z-40 flex flex-col overflow-hidden border-r border-border bg-sidebar transition-[width,box-shadow] duration-200 ease-[cubic-bezier(0.16,1,0.3,1)] \`+(d?\`shadow-[12px_0_32px_rgba(0,0,0,0.45)]\`:\`\`),style:{width:u?gh:hh},children:[(0,z.jsx)(\`nav\`,{className:\`flex-1 overflow-y-auto overflow-x-hidden py-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden\`,children:Bt.map((n,r)=>(0,z.jsxs)(\`div\`,{children:[n.title&&(0,z.jsx)(yh,{title:n.title,expanded:u}),n.items.map(n=>(0,z.jsx)(bh,{icon:n.icon,label:n.label,active:e===n.id,expanded:u,onClick:()=>t(n.id)},n.id))]},r))}),(0,z.jsx)(\`div\`,{className:\`shrink-0 border-t border-border py-2\`,children:(0,z.jsxs)(Qd,{open:o,onOpenChange:s,children:[(0,z.jsx)($d,{asChild:!0,children:(0,z.jsxs)(\`button\`,{title:u?void 0:\`Sidebar control\`,className:\`mx-1.5 my-px flex h-8 items-center rounded-md text-[13px] text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground data-[state=open]:bg-accent data-[state=open]:text-foreground\`,style:{width:\`calc(100% - 12px)\`},children:[(0,z.jsx)(\`span\`,{className:\`flex w-10 shrink-0 items-center justify-center\`,children:u?(0,z.jsx)(it,{size:16}):(0,z.jsx)(at,{size:16})}),(0,z.jsx)(\`span\`,{className:\`whitespace-nowrap transition-[opacity,transform] duration-200 \`+(u?\`translate-x-0 opacity-100\`:\`pointer-events-none -translate-x-2 opacity-0\`),children:\`Sidebar control\`})]})}),(0,z.jsxs)(nf,{align:\`start\`,className:\`w-48\`,children:[(0,z.jsx)(cf,{children:\`Sidebar control\`}),_h.map(e=>(0,z.jsxs)(rf,{onSelect:()=>f(e.id),children:[(0,z.jsx)(\`span\`,{className:\`size-1.5 shrink-0 rounded-full \`+(n===e.id?\`bg-foreground\`:\`bg-transparent\`)}),e.label]},e.id))]})]})})]})})}function yh({title:e,expanded:t}){return(0,z.jsxs)(\`div\`,{className:\`relative mx-3 mb-1 mt-3 flex h-4 items-center\`,children:[(0,z.jsx)(\`div\`,{className:\`h-px w-full bg-accent transition-opacity duration-200 \`+(t?\`opacity-0\`:\`opacity-100\`)}),(0,z.jsx)(\`span\`,{className:\`absolute left-0.5 whitespace-nowrap text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/80 transition-opacity duration-200 \`+(t?\`opacity-100\`:\`opacity-0\`),children:e})]})}function bh({icon:e,label:t,active:n,expanded:r,onClick:i}){return(0,z.jsxs)(\`button\`,{onClick:i,title:r?void 0:t,className:\`mx-1.5 my-px flex h-8 items-center rounded-md text-[13px] transition-colors \`+(n?\`bg-accent text-foreground\`:\`text-muted-foreground hover:bg-accent/60 hover:text-foreground\`),style:{width:\`calc(100% - 12px)\`},children:[(0,z.jsx)(\`span\`,{className:\`flex w-10 shrink-0 items-center justify-center\`,children:(0,z.jsx)(e,{size:16,className:n?\`text-brand\`:\`\`})}),(0,z.jsx)(\`span\`,{className:\`whitespace-nowrap transition-[opacity,transform] duration-200 \`+(r?\`translate-x-0 opacity-100\`:\`pointer-events-none -translate-x-2 opacity-0\`),children:t})]})}function xh({title:e,children:t}){return(0,z.jsxs)(\`div\`,{className:\`mx-auto max-w-4xl px-10 py-8\`,children:[(0,z.jsx)(\`h1\`,{className:\`border-b border-border pb-4 text-xl font-semibold text-foreground\`,children:e}),t]})}function Sh({title:e,description:t,children:n}){return(0,z.jsxs)(\`div\`,{className:\`border-b border-border pb-2 last:border-0\`,children:[(0,z.jsxs)(\`div\`,{className:\`pb-1 pt-6 first:pt-0\`,children:[(0,z.jsx)(\`h2\`,{className:\`text-[15px] font-semibold text-foreground\`,children:e}),t&&(0,z.jsx)(\`p\`,{className:\`mt-0.5 text-[13px] text-muted-foreground/80\`,children:t})]}),(0,z.jsx)(\`div\`,{className:\`divide-y divide-border/70\`,children:n})]})}function Ch({label:e,description:t,children:n,wide:r}){return(0,z.jsxs)(\`div\`,{className:\`flex flex-col gap-4 py-6 sm:flex-row sm:items-start sm:gap-10\`,children:[(0,z.jsxs)(\`div\`,{className:\`w-64 shrink-0\`,children:[(0,z.jsx)(\`p\`,{className:\`text-[13px] font-medium text-foreground\`,children:e}),t&&(0,z.jsx)(\`p\`,{className:\`mt-1 text-xs leading-relaxed text-muted-foreground/80\`,children:t})]}),(0,z.jsx)(\`div\`,{className:\`min-w-0 flex-1 \`+(r?\`\`:\`max-w-md\`),children:n})]})}function wh({label:e,value:t}){return(0,z.jsxs)(\`div\`,{className:\`flex items-center justify-between gap-6 py-1.5 text-[13px]\`,children:[(0,z.jsx)(\`span\`,{className:\`text-muted-foreground\`,children:e}),(0,z.jsx)(\`span\`,{className:\`text-right font-mono text-foreground/90\`,children:t})]})}function Th({title:e,groups:t,active:n,onSelect:r,footer:i}){return(0,z.jsxs)(hf,{id:\`sub-nav\`,side:\`left\`,defaultSize:224,min:176,max:340,className:\`flex flex-col border-r border-border bg-card\`,children:[(0,z.jsx)(\`div\`,{className:\`px-4 pb-1 pt-4 text-sm font-semibold text-foreground\`,children:e}),(0,z.jsx)(\`nav\`,{className:\`min-h-0 flex-1 overflow-y-auto px-2 pb-3\`,children:t.map((e,t)=>(0,z.jsxs)(\`div\`,{className:\`pt-3 first:pt-2\`,children:[e.title&&(0,z.jsx)(\`p\`,{className:\`px-2.5 pb-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/60\`,children:e.title}),e.items.map(e=>(0,z.jsxs)(\`button\`,{onClick:()=>r(e.id),className:\`mb-px flex w-full items-center gap-2 rounded-md px-2.5 py-1.5 text-left text-[13px] transition-colors \`+(n===e.id?\`bg-accent text-foreground\`:\`text-muted-foreground hover:bg-accent/50 hover:text-foreground\`),children:[(0,z.jsx)(\`span\`,{className:\`min-w-0 flex-1 truncate\`,children:e.label}),e.badge]},e.id))]},t))}),i&&(0,z.jsx)(\`div\`,{className:\`shrink-0 border-t border-border p-3\`,children:i})]})}function Eh(){let[e,t]=(0,_.useState)(null);if((0,_.useEffect)(()=>{N.authConfig().then(t,()=>t({providers:[],inbox:!1,settings:null}))},[]),e===null)return(0,z.jsx)(Jp,{});let n=e.settings;async function r(e){if(!n)return;let r={...n,disabledProviders:[...n.disabledProviders]};t(t=>t&&t.settings?{...t,settings:{...t.settings,...e}}:t);try{let n=await N.updateAuthSettings(e);t(e=>e&&{...e,settings:n})}catch(e){t(e=>e&&{...e,settings:r}),H.error(e.message)}}async function i(e,r){if(n)try{let n=await N.updateAuthSettings({smsTwilio:{[e]:r}});t(e=>e&&{...e,settings:n}),H.success(\`Saved\`)}catch(e){H.error(e.message)}}let a=n?.phoneEnabled??!1,o=!!n?.smsTwilio?.accountSid&&!!n?.smsTwilioAuthTokenSet,s=(()=>{try{return new URL(e.sms?.apiUrl??\`https://api.twilio.com\`).host}catch{return e.sms?.apiUrl??\`api.twilio.com\`}})();return(0,z.jsx)(\`div\`,{className:\`h-full overflow-y-auto\`,children:(0,z.jsxs)(\`div\`,{className:\`mx-auto max-w-3xl px-8 py-8\`,children:[(0,z.jsx)(\`h1\`,{className:\`text-lg font-semibold text-foreground\`,children:\`Sign In / Providers\`}),(0,z.jsx)(\`p\`,{className:\`mt-0.5 text-[13px] text-muted-foreground/80\`,children:\`Changes apply instantly to the running instance and persist across restarts.\`}),(0,z.jsx)(\`h2\`,{className:\`mb-2 mt-7 text-sm font-medium text-foreground\`,children:\`User signups\`}),(0,z.jsxs)(\`div\`,{className:\`divide-y divide-border rounded-md border border-border bg-card\`,children:[(0,z.jsx)(Oh,{title:\`Allow new users to sign up\`,description:\`If disabled, new email/password and OTP signups are rejected; existing users can still sign in.\`,children:(0,z.jsx)(Yp,{checked:n?!n.disableSignup:!0,onChange:e=>void r({disableSignup:!e}),disabled:!n})}),(0,z.jsx)(Oh,{title:\`Allow anonymous sign-ins\`,description:\`Enable signInAnonymously() — temporary users without credentials.\`,children:(0,z.jsx)(Yp,{checked:n?.anonymousUsers??!0,onChange:e=>void r({anonymousUsers:e}),disabled:!n})}),(0,z.jsx)(Oh,{title:\`Confirm email\`,description:\`Require users to verify their email address (via the emailed link or code) before they can sign in.\`,children:(0,z.jsx)(Yp,{checked:n?!n.autoconfirm:!1,onChange:e=>void r({autoconfirm:!e}),disabled:!n})}),(0,z.jsx)(Oh,{title:\`Minimum password length\`,description:\`Passwords shorter than this are rejected on signup and password change (4–72).\`,children:(0,z.jsx)(Ah,{value:n?.minPasswordLength??6,disabled:!n,onSave:e=>void r({minPasswordLength:e})})})]}),(0,z.jsx)(\`h2\`,{className:\`mb-2 mt-8 text-sm font-medium text-foreground\`,children:\`Auth methods\`}),(0,z.jsxs)(\`div\`,{className:\`divide-y divide-border rounded-md border border-border bg-card\`,children:[(0,z.jsx)(kh,{icon:et,name:\`Email\`,description:\`Email/password, OTP codes, magic links, and password recovery.\`,children:(0,z.jsx)(B,{variant:\`brand\`,children:\`Enabled\`})}),(0,z.jsx)(kh,{icon:Tt,name:\`Phone\`,description:\`signInWithOtp({ phone }), signUp({ phone, password }) and phone changes, confirmed by a texted code.\`,children:(0,z.jsx)(Yp,{checked:a,onChange:e=>void r({phoneEnabled:e}),disabled:!n})}),(0,z.jsx)(kh,{icon:Ke,name:\`PKCE flows\`,description:\`OAuth and magic links support the PKCE flow out of the box.\`,children:(0,z.jsx)(B,{variant:\`brand\`,children:\`Enabled\`})}),(0,z.jsx)(kh,{icon:Nt,name:\`Anonymous\`,description:\`Temporary users without credentials — controlled by the toggle above.\`,children:n?.anonymousUsers===!1?(0,z.jsx)(B,{variant:\`neutral\`,children:\`Disabled\`}):(0,z.jsx)(B,{variant:\`brand\`,children:\`Enabled\`})})]}),a&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(\`h2\`,{className:\`mb-2 mt-8 text-sm font-medium text-foreground\`,children:\`Phone\`}),(0,z.jsxs)(\`div\`,{className:\`divide-y divide-border rounded-md border border-border bg-card\`,children:[(0,z.jsx)(Oh,{title:\`Confirm phone\`,description:\`Require users to verify their number with the texted code before a phone signup can sign in.\`,children:(0,z.jsx)(Yp,{checked:n?!n.smsAutoconfirm:!1,onChange:e=>void r({smsAutoconfirm:!e}),disabled:!n})}),(0,z.jsx)(Oh,{title:\`Code length\`,description:\`Digits in texted codes (6–10).\`,children:(0,z.jsx)(jh,{value:n?.smsOtpLength??6,min:6,max:10,disabled:!n,onSave:e=>void r({smsOtpLength:e})})}),(0,z.jsx)(Oh,{title:\`Code expiry (seconds)\`,description:\`How long a texted code stays valid.\`,children:(0,z.jsx)(jh,{value:n?.smsOtpExpirySeconds??60,min:1,max:86400,disabled:!n,onSave:e=>void r({smsOtpExpirySeconds:e})})}),(0,z.jsx)(Oh,{title:\`Minimum interval (seconds)\`,description:\`Shortest gap between texts to the same number. 0 turns the limit off.\`,children:(0,z.jsx)(jh,{value:n?.maxSmsFrequencySeconds??60,min:0,max:3600,disabled:!n,onSave:e=>void r({maxSmsFrequencySeconds:e})})})]}),(0,z.jsx)(\`h2\`,{className:\`mb-2 mt-8 text-sm font-medium text-foreground\`,children:\`Test phone numbers\`}),(0,z.jsxs)(\`div\`,{className:\`rounded-md border border-border bg-card\`,children:[(0,z.jsxs)(\`div\`,{className:\`border-b border-border p-4\`,children:[(0,z.jsx)(\`p\`,{className:\`text-[13px] text-foreground\`,children:\`Numbers that are never texted\`}),(0,z.jsxs)(\`p\`,{className:\`mt-0.5 text-[11px] leading-relaxed text-muted-foreground/80\`,children:[\`A listed number always accepts its fixed code — for app-store reviewers and QA on the live app. Expiry, the five-try lock and the minimum interval still apply. The same as \`,(0,z.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`[auth.sms.test_otp]\`}),\` in config.toml.\`]})]}),(0,z.jsx)(Dh,{value:n?.smsTestOtp??{},disabled:!n,onSave:e=>void r({smsTestOtp:e})})]}),(0,z.jsx)(\`h2\`,{className:\`mb-2 mt-8 text-sm font-medium text-foreground\`,children:\`SMS provider\`}),e.sms?.custom?(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-3 rounded-md border border-border bg-card p-4\`,children:[(0,z.jsx)(Tt,{size:16,className:\`shrink-0 text-muted-foreground\`}),(0,z.jsxs)(\`div\`,{className:\`min-w-0 flex-1\`,children:[(0,z.jsx)(\`p\`,{className:\`text-[13px] text-foreground\`,children:\`Custom sender\`}),(0,z.jsx)(\`p\`,{className:\`text-[11px] text-muted-foreground/80\`,children:\`An SMS sender was provided to createBackend; texts are delivered through it.\`})]})]}):(0,z.jsxs)(\`div\`,{className:\`rounded-md border border-border bg-card\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-3 border-b border-border p-4\`,children:[(0,z.jsx)(Tt,{size:16,className:\`shrink-0 text-muted-foreground\`}),(0,z.jsxs)(\`div\`,{className:\`min-w-0 flex-1\`,children:[(0,z.jsxs)(\`p\`,{className:\`flex items-center gap-2 text-[13px] text-foreground\`,children:[\`Twilio\`,o?(0,z.jsx)(B,{variant:\`brand\`,children:\`configured\`}):(0,z.jsx)(B,{variant:\`neutral\`,children:\`dev inbox\`})]}),(0,z.jsxs)(\`p\`,{className:\`text-[11px] text-muted-foreground/80\`,children:[o?\`Codes are sent through \${s}.\`:\`No credentials — texted codes are captured in the local inbox instead of being sent.\`,\` \`,\`The same fields as \`,(0,z.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`[auth.sms.twilio]\`}),\` in config.toml; a value here overrides it.\`]})]})]}),(0,z.jsxs)(\`div\`,{className:\`divide-y divide-border\`,children:[(0,z.jsx)(Oh,{title:\`Account SID\`,description:\`ACxxxxxxxx from the Twilio console.\`,children:(0,z.jsx)(Mh,{value:n?.smsTwilio?.accountSid??\`\`,placeholder:\`AC…\`,disabled:!n,onSave:e=>void i(\`accountSid\`,e)})}),(0,z.jsx)(Oh,{title:\`Auth token\`,description:n?.smsTwilioAuthTokenSet?\`Set. Never shown again; paste a new one to replace it.\`:\`The account auth token (secret).\`,children:(0,z.jsx)(Mh,{value:\`\`,placeholder:n?.smsTwilioAuthTokenSet?\`••••••••\`:\`auth token\`,secret:!0,disabled:!n,onSave:e=>void i(\`authToken\`,e)})}),(0,z.jsx)(Oh,{title:\`Messaging Service SID\`,description:\`MGxxxxxxxx; the Messaging Service texts are sent through.\`,children:(0,z.jsx)(Mh,{value:n?.smsTwilio?.messageServiceSid??\`\`,placeholder:\`MG…\`,disabled:!n,onSave:e=>void i(\`messageServiceSid\`,e)})})]})]})]}),(0,z.jsx)(\`h2\`,{className:\`mb-2 mt-8 text-sm font-medium text-foreground\`,children:\`OAuth providers\`}),e.providers.length>0?(0,z.jsx)(\`div\`,{className:\`divide-y divide-border rounded-md border border-border bg-card\`,children:e.providers.map(e=>(0,z.jsx)(kh,{icon:ze,name:e,description:\`signInWithOAuth() with identity linking.\`,oauth:!0,children:(0,z.jsx)(Yp,{checked:!n?.disabledProviders.includes(e),disabled:!n,onChange:t=>{n&&r({disabledProviders:t?n.disabledProviders.filter(t=>t!==e):[...n.disabledProviders,e]})}})},e))}):(0,z.jsxs)(\`div\`,{className:\`rounded-md border border-dashed border-border p-4 text-xs text-muted-foreground/80\`,children:[\`No OAuth providers configured. Add Google/GitHub (or a generic provider) to\`,\` \`,(0,z.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`supabase/config.toml\`}),\` and restart — they appear here with a toggle.\`]}),(0,z.jsx)(\`h2\`,{className:\`mb-2 mt-8 text-sm font-medium text-foreground\`,children:\`Email delivery\`}),(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-3 rounded-md border border-border bg-card p-4\`,children:[(0,z.jsx)(We,{size:16,className:\`shrink-0 text-muted-foreground\`}),(0,z.jsxs)(\`div\`,{className:\`min-w-0 flex-1\`,children:[(0,z.jsxs)(\`p\`,{className:\`text-[13px] text-foreground\`,children:[e.inbox?\`Local dev inbox\`:\`Custom mailer\`,\` \`,e.inbox&&(0,z.jsx)(B,{variant:\`brand\`,children:\`active\`})]}),(0,z.jsx)(\`p\`,{className:\`text-[11px] text-muted-foreground/80\`,children:e.inbox?\`No mailer configured — OTP codes, magic links and confirmations are captured locally instead of being sent.\`:\`A mailer was provided to createBackend; emails are delivered through it.\`})]}),e.inbox&&(0,z.jsxs)(\`a\`,{href:\`\${lh()}/inbox\`,target:\`_blank\`,rel:\`noreferrer\`,className:\`flex shrink-0 items-center gap-1.5 rounded-md border border-input px-2.5 py-1.5 text-xs text-foreground/80 transition-colors hover:border-muted-foreground hover:text-foreground\`,children:[\`Open inbox \`,(0,z.jsx)(Oe,{size:11})]})]}),n===null&&(0,z.jsx)(\`p\`,{className:\`mt-6 rounded-md border border-warning/30 bg-warning/10 px-3 py-2 text-xs text-warning\`,children:\`This server predates runtime auth settings — restart tinbase after updating to enable the toggles.\`})]})})}function Dh({value:e,disabled:t,onSave:n}){let[r,i]=(0,_.useState)(\`\`),[a,o]=(0,_.useState)(\`\`),s=Object.entries(e),c=!t&&/^\\+?[1-9][\\d\\s().-]{1,20}$/.test(r.trim())&&/^\\d{4,10}$/.test(a.trim());function l(){c&&(n({...e,[r.trim()]:a.trim()}),i(\`\`),o(\`\`))}function u(t){let r={...e};delete r[t],n(r)}return(0,z.jsxs)(\`div\`,{className:\`divide-y divide-border\`,children:[s.map(([e,n])=>(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-4 p-4\`,children:[(0,z.jsxs)(\`code\`,{className:\`min-w-0 flex-1 text-[13px] text-foreground\`,children:[\`+\`,e]}),(0,z.jsx)(\`code\`,{className:\`text-[13px] text-muted-foreground\`,children:n}),(0,z.jsx)(\`button\`,{type:\`button\`,className:\`text-[11px] text-muted-foreground hover:text-foreground disabled:opacity-50\`,disabled:t,onClick:()=>u(e),children:\`Remove\`})]},e)),(0,z.jsxs)(\`div\`,{className:\`flex flex-wrap items-center gap-2 p-4\`,children:[(0,z.jsx)(Y,{mono:!0,className:\`w-48\`,placeholder:\`+15005550006\`,autoComplete:\`off\`,value:r,disabled:t,onChange:e=>i(e.target.value)}),(0,z.jsx)(Y,{mono:!0,className:\`w-28\`,placeholder:\`123456\`,autoComplete:\`off\`,value:a,disabled:t,onChange:e=>o(e.target.value),onKeyDown:e=>e.key===\`Enter\`&&l()}),(0,z.jsx)(V,{variant:\`outline\`,disabled:!c,onClick:l,children:\`Add\`}),s.length===0&&(0,z.jsx)(\`span\`,{className:\`text-[11px] text-muted-foreground/80\`,children:\`None yet. Codes are 4–10 digits.\`})]})]})}function Oh({title:e,description:t,children:n}){return(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-4 p-4\`,children:[(0,z.jsxs)(\`div\`,{className:\`min-w-0 flex-1\`,children:[(0,z.jsx)(\`p\`,{className:\`text-[13px] text-foreground\`,children:e}),(0,z.jsx)(\`p\`,{className:\`mt-0.5 text-[11px] leading-relaxed text-muted-foreground/80\`,children:t})]}),(0,z.jsx)(\`div\`,{className:\`shrink-0\`,children:n})]})}function kh({icon:e,name:t,description:n,oauth:r,children:i}){return(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-3 p-4\`,children:[(0,z.jsx)(e,{size:16,className:\`shrink-0 text-muted-foreground\`}),(0,z.jsxs)(\`div\`,{className:\`min-w-0 flex-1\`,children:[(0,z.jsxs)(\`p\`,{className:\`flex items-center gap-2 text-[13px] capitalize text-foreground\`,children:[t,r&&(0,z.jsx)(B,{variant:\`blue\`,children:\`oauth\`})]}),(0,z.jsx)(\`p\`,{className:\`text-[11px] text-muted-foreground/80\`,children:n})]}),(0,z.jsx)(\`div\`,{className:\`shrink-0\`,children:i})]})}function Ah({value:e,disabled:t,onSave:n}){return(0,z.jsx)(jh,{value:e,min:4,max:72,disabled:t,onSave:n})}function jh({value:e,min:t,max:n,disabled:r,onSave:i}){let[a,o]=(0,_.useState)(String(e));(0,_.useEffect)(()=>o(String(e)),[e]);function s(){let r=parseInt(a,10);if(!Number.isFinite(r)||r<t||r>n){o(String(e));return}r!==e&&i(r)}return(0,z.jsx)(Y,{mono:!0,className:\`w-16 text-center\`,value:a,disabled:r,onChange:e=>o(e.target.value.replace(/[^0-9]/g,\`\`)),onBlur:s,onKeyDown:e=>e.key===\`Enter\`&&e.target.blur()})}function Mh({value:e,placeholder:t,secret:n,disabled:r,onSave:i}){let[a,o]=(0,_.useState)(e);(0,_.useEffect)(()=>o(e),[e]);function s(){let t=a.trim();t===e||n&&t===\`\`||(i(t),n&&o(\`\`))}return(0,z.jsx)(Y,{mono:!0,type:n?\`password\`:\`text\`,autoComplete:\`off\`,className:\`w-64\`,value:a,placeholder:t,disabled:r,onChange:e=>o(e.target.value),onBlur:s,onKeyDown:e=>e.key===\`Enter\`&&e.target.blur()})}function Nh({user:e,onClose:t,onChanged:n}){let[r,i]=(0,_.useState)(\`overview\`),[a,o]=(0,_.useState)(!1),[s,c]=(0,_.useState)(!1);async function l(){try{await N.deleteUser(e.id),H.success(\`User deleted\`),n()}catch(e){H.error(e.message)}}async function u(){if(e.email)try{await N.sendMagicLink(e.email),H.success(\`Magic link sent — check /inbox in dev\`)}catch(e){H.error(e.message)}}return(0,z.jsxs)(qp,{open:!0,onClose:t,width:\`w-[480px]\`,title:(0,z.jsxs)(\`span\`,{className:\`flex items-center gap-2\`,children:[(0,z.jsx)(\`span\`,{className:\`truncate\`,children:e.email||(e.is_anonymous?\`Anonymous user\`:e.id.slice(0,12))}),e.is_anonymous&&(0,z.jsx)(B,{variant:\`neutral\`,children:\`anon\`})]}),footer:(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(V,{variant:\`danger\`,onClick:()=>c(!0),children:[(0,z.jsx)(At,{size:13}),\` Delete user\`]}),(0,z.jsx)(Kp,{asChild:!0,children:(0,z.jsx)(V,{variant:\`outline\`,className:\`ml-auto\`,children:\`Done\`})})]}),children:[(0,z.jsx)($p,{tabs:[{id:\`overview\`,label:\`Overview\`},{id:\`json\`,label:\`Raw JSON\`}],active:r,onSelect:i}),r===\`overview\`&&(0,z.jsxs)(\`div\`,{className:\`mt-4 space-y-5\`,children:[(0,z.jsx)(\`div\`,{children:[[\`User UID\`,e.id,!0],[\`Email\`,e.email??\`—\`,!1],[\`Created at\`,(0,z.jsx)(qm,{value:e.created_at}),!1],[\`Updated at\`,(0,z.jsx)(qm,{value:e.updated_at}),!1],[\`Confirmation sent at\`,(0,z.jsx)(qm,{value:e.confirmation_sent_at}),!1],[\`Confirmed at\`,(0,z.jsx)(qm,{value:e.email_confirmed_at}),!1],[\`Last signed in\`,(0,z.jsx)(qm,{value:e.last_sign_in_at}),!1]].map(([e,t,n])=>(0,z.jsxs)(\`div\`,{className:\`flex items-center justify-between gap-4 border-b border-border/60 py-2 text-[13px] last:border-0\`,children:[(0,z.jsx)(\`span\`,{className:\`shrink-0 text-muted-foreground\`,children:e}),(0,z.jsxs)(\`span\`,{className:\`flex min-w-0 items-center gap-1 font-mono text-foreground/90\`,children:[(0,z.jsx)(\`span\`,{className:\`truncate\`,children:t}),n&&(0,z.jsx)(er,{value:String(t),label:e,iconSize:11})]})]},e))}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(\`p\`,{className:\`mb-2 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/60\`,children:\`Provider information\`}),(0,z.jsxs)(\`div\`,{className:\`rounded-md border border-border bg-card p-3.5\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-2\`,children:[(0,z.jsx)(\`span\`,{className:\`text-[13px] font-medium capitalize text-foreground\`,children:e.app_metadata?.provider??(e.is_anonymous?\`anonymous\`:\`email\`)}),(0,z.jsx)(B,{variant:\`brand\`,children:\`enabled\`})]}),(0,z.jsx)(\`p\`,{className:\`mt-1 text-[11px] text-muted-foreground/80\`,children:e.is_anonymous?\`Signed in anonymously — no credentials attached.\`:\`How this user authenticates with your project.\`})]})]}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(\`p\`,{className:\`mb-2 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/60\`,children:\`Actions\`}),(0,z.jsx)(\`div\`,{className:\`space-y-2\`,children:!e.is_anonymous&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Ph,{icon:Ke,title:\`Reset password\`,description:\`Set a new password for the user directly.\`,action:(0,z.jsx)(V,{variant:\`outline\`,size:\`xs\`,onClick:()=>o(!0),children:\`Reset password\`})}),(0,z.jsx)(Ph,{icon:et,title:\`Send magic link\`,description:\`Send a passwordless sign-in link to the user.\`,action:(0,z.jsx)(V,{variant:\`outline\`,size:\`xs\`,onClick:()=>void u(),disabled:!e.email,children:\`Send magic link\`})})]})})]})]}),r===\`json\`&&(0,z.jsx)(\`div\`,{className:\`mt-4\`,children:(0,z.jsx)(nr,{value:JSON.stringify(e,null,2),lang:\`js\`,readOnly:!0,minLines:10,maxLines:400})}),a&&(0,z.jsx)(Fh,{user:e,onClose:()=>o(!1),onDone:()=>{o(!1),H.success(\`Password updated\`)}}),s&&(0,z.jsx)(q,{open:!0,danger:!0,title:\`Delete user \${e.email||e.id.slice(0,8)}?\`,description:\`The user and their sessions will be permanently removed.\`,confirmLabel:\`Delete user\`,onConfirm:()=>void l(),onClose:()=>c(!1)})]})}function Ph({icon:e,title:t,description:n,action:r}){return(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-3 rounded-md border border-border bg-card p-3.5\`,children:[(0,z.jsx)(e,{size:15,className:\`shrink-0 text-muted-foreground\`}),(0,z.jsxs)(\`div\`,{className:\`min-w-0 flex-1\`,children:[(0,z.jsx)(\`p\`,{className:\`text-[13px] text-foreground\`,children:t}),(0,z.jsx)(\`p\`,{className:\`text-[11px] text-muted-foreground/80\`,children:n})]}),r]})}function Fh({user:e,onClose:t,onDone:n}){let[r,i]=(0,_.useState)(\`\`),[a,o]=(0,_.useState)(\`\`),[s,c]=(0,_.useState)(!1);async function l(){c(!0),o(\`\`);try{await N.updateUser(e.id,{password:r}),n()}catch(e){o(e.message),c(!1)}}return(0,z.jsx)(go,{open:!0,onClose:t,title:\`Reset password · \${e.email||e.id.slice(0,8)}\`,children:(0,z.jsxs)(\`div\`,{className:\`space-y-3\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`New password (min 6 characters)\`}),(0,z.jsx)(Y,{type:\`password\`,value:r,autoFocus:!0,onChange:e=>i(e.target.value),onKeyDown:e=>e.key===\`Enter\`&&r.length>=6&&void l()})]}),a&&(0,z.jsx)(\`p\`,{className:\`text-xs text-destructive\`,children:a}),(0,z.jsxs)(\`div\`,{className:\`flex justify-end gap-2\`,children:[(0,z.jsx)(V,{variant:\`outline\`,onClick:t,children:\`Cancel\`}),(0,z.jsx)(V,{onClick:()=>void l(),disabled:s||r.length<6,children:s?\`Saving…\`:\`Update password\`})]})]})})}var Ih=50;function Lh(e){return e.app_metadata?.provider||(e.is_anonymous?\`anonymous\`:\`email\`)}function Rh({provider:e}){return e===\`email\`?(0,z.jsx)(et,{size:12,className:\`text-muted-foreground\`}):e===\`anonymous\`?(0,z.jsx)(Nt,{size:12,className:\`text-muted-foreground\`}):(0,z.jsx)(ze,{size:12,className:\`text-muted-foreground\`})}function zh(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(\`\`),[i,a]=(0,_.useState)(\`all\`),[o,s]=(0,_.useState)(0),[c,l]=(0,_.useState)(null),[u,d]=(0,_.useState)(!1),[f,p]=(0,_.useState)(!1),m=(0,_.useCallback)(()=>{N.users().then(e=>t(e),()=>t([]))},[]);(0,_.useEffect)(()=>{m()},[m]);let h=(0,_.useMemo)(()=>{if(!e)return[];let t=n.toLowerCase().trim();return e.filter(e=>i===\`anonymous\`&&!e.is_anonymous||i===\`verified\`&&!e.email_confirmed_at?!1:t?(e.email??\`\`).toLowerCase().includes(t)||e.id.toLowerCase().includes(t):!0)},[e,n,i]);if((0,_.useEffect)(()=>s(0),[n,i]),e===null)return(0,z.jsx)(Jp,{});let g=Math.max(1,Math.ceil(h.length/Ih)),v=h.slice(o*Ih,(o+1)*Ih);return(0,z.jsxs)(\`div\`,{className:\`flex h-full\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex min-w-0 flex-1 flex-col\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex shrink-0 items-center gap-2 border-b border-border px-4 py-2.5\`,children:[(0,z.jsx)(\`h1\`,{className:\`text-sm font-semibold text-foreground\`,children:\`Users\`}),(0,z.jsx)(B,{variant:\`neutral\`,children:e.length}),(0,z.jsxs)(\`div\`,{className:\`relative ml-2 w-64\`,children:[(0,z.jsx)(vt,{size:13,className:\`pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground/60\`}),(0,z.jsx)(\`input\`,{value:n,onChange:e=>r(e.target.value),placeholder:\`Search by email or UID…\`,className:\`h-8 w-full rounded-md border border-input bg-field pl-8 pr-2 text-[13px] text-foreground placeholder:text-muted-foreground/60 focus:border-brand focus:outline-none\`})]}),(0,z.jsx)(Wp,{className:\`w-36 shrink-0\`,value:i,onValueChange:e=>a(e),options:[{value:\`all\`,label:\`All users\`},{value:\`verified\`,label:\`Verified\`},{value:\`anonymous\`,label:\`Anonymous\`}]}),(0,z.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-1.5\`,children:[(0,z.jsx)(V,{variant:\`ghost\`,size:\`iconXs\`,title:\`Refresh\`,onClick:m,children:(0,z.jsx)(gt,{size:13})}),(0,z.jsxs)(Qd,{children:[(0,z.jsx)($d,{asChild:!0,children:(0,z.jsxs)(V,{size:\`xs\`,children:[(0,z.jsx)(mt,{size:12}),\` Add user \`,(0,z.jsx)(me,{size:11})]})}),(0,z.jsxs)(nf,{align:\`end\`,children:[(0,z.jsxs)(rf,{onSelect:()=>d(!0),children:[(0,z.jsx)(Ke,{size:13}),\` Create with password\`]}),(0,z.jsxs)(rf,{onSelect:()=>p(!0),children:[(0,z.jsx)(et,{size:13}),\` Invite via magic link\`]})]})]})]})]}),(0,z.jsxs)(\`div\`,{className:\`min-h-0 flex-1 overflow-auto\`,children:[(0,z.jsxs)(Xp,{children:[(0,z.jsx)(Zp,{children:(0,z.jsxs)(\`tr\`,{children:[(0,z.jsx)(Z,{children:\`Email\`}),(0,z.jsx)(Z,{children:\`UID\`}),(0,z.jsx)(Z,{children:\`Provider\`}),(0,z.jsx)(Z,{children:\`Created\`}),(0,z.jsx)(Z,{children:\`Last sign in\`})]})}),(0,z.jsx)(\`tbody\`,{children:v.map(e=>{let t=Lh(e);return(0,z.jsxs)(Qp,{className:\`cursor-pointer\`,onClick:()=>l(e),children:[(0,z.jsx)(Q,{className:\`text-foreground/90\`,children:(0,z.jsxs)(\`span\`,{className:\`flex items-center gap-2\`,children:[e.email||(0,z.jsx)(\`span\`,{className:\`italic text-muted-foreground/60\`,children:e.is_anonymous?\`anonymous\`:\`—\`}),e.is_anonymous&&(0,z.jsx)(B,{variant:\`neutral\`,children:\`anon\`}),e.email&&!e.email_confirmed_at&&(0,z.jsx)(B,{variant:\`amber\`,children:\`unverified\`})]})}),(0,z.jsxs)(Q,{className:\`font-mono text-[11px] text-muted-foreground/80\`,children:[e.id.slice(0,8),\`…\`]}),(0,z.jsx)(Q,{children:(0,z.jsxs)(\`span\`,{className:\`flex items-center gap-1.5 text-muted-foreground\`,children:[(0,z.jsx)(Rh,{provider:t}),t]})}),(0,z.jsx)(Q,{className:\`text-muted-foreground\`,children:(0,z.jsx)(qm,{value:e.created_at,format:\`date\`})}),(0,z.jsx)(Q,{className:\`text-muted-foreground\`,children:(0,z.jsx)(qm,{value:e.last_sign_in_at})})]},e.id)})})]}),v.length===0&&(0,z.jsx)(lf,{children:e.length===0?\`No users yet — add one or invite via magic link.\`:\`No match.\`})]}),(0,z.jsxs)(\`div\`,{className:\`flex shrink-0 items-center gap-3 border-t border-border bg-card px-4 py-1.5 text-xs text-muted-foreground/80\`,children:[(0,z.jsxs)(\`span\`,{children:[h.length.toLocaleString(),\` user\`,h.length===1?\`\`:\`s\`]}),g>1&&(0,z.jsxs)(\`span\`,{className:\`ml-auto flex items-center gap-2\`,children:[(0,z.jsx)(V,{variant:\`ghost\`,size:\`xs\`,disabled:o===0,onClick:()=>s(e=>e-1),children:\`Prev\`}),\`Page \`,o+1,\` of \`,g,(0,z.jsx)(V,{variant:\`ghost\`,size:\`xs\`,disabled:o+1>=g,onClick:()=>s(e=>e+1),children:\`Next\`})]})]})]}),c&&(0,z.jsx)(Nh,{user:c,onClose:()=>l(null),onChanged:()=>{m(),l(null)}}),u&&(0,z.jsx)(Bh,{onClose:()=>d(!1),onDone:()=>{d(!1),m()}}),f&&(0,z.jsx)(Vh,{onClose:()=>p(!1),onDone:()=>{p(!1),m()}})]})}function Bh({onClose:e,onDone:t}){let[n,r]=(0,_.useState)(\`\`),[i,a]=(0,_.useState)(\`\`),[o,s]=(0,_.useState)(\`\`),[c,l]=(0,_.useState)(!1);async function u(){l(!0),s(\`\`);try{await N.createUser({email:n,password:i||void 0,email_confirm:!0}),H.success(\`Created \${n}\`),t()}catch(e){s(e.message),l(!1)}}return(0,z.jsx)(go,{open:!0,onClose:e,title:\`Create user\`,children:(0,z.jsxs)(\`div\`,{className:\`space-y-3\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Email\`}),(0,z.jsx)(Y,{value:n,autoFocus:!0,placeholder:\`user@example.com\`,onChange:e=>r(e.target.value)})]}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Password (optional — leave empty for passwordless)\`}),(0,z.jsx)(Y,{type:\`password\`,value:i,onChange:e=>a(e.target.value)})]}),o&&(0,z.jsx)(\`p\`,{className:\`text-xs text-destructive\`,children:o}),(0,z.jsxs)(\`div\`,{className:\`flex justify-end gap-2\`,children:[(0,z.jsx)(V,{variant:\`outline\`,onClick:e,children:\`Cancel\`}),(0,z.jsx)(V,{onClick:()=>void u(),disabled:c||!n.includes(\`@\`),children:c?\`Creating…\`:\`Create user\`})]})]})})}function Vh({onClose:e,onDone:t}){let[n,r]=(0,_.useState)(\`\`),[i,a]=(0,_.useState)(\`\`),[o,s]=(0,_.useState)(!1);async function c(){s(!0),a(\`\`);try{await N.sendMagicLink(n),H.success(\`Magic link sent to \${n} — check /inbox in dev\`),t()}catch(e){a(e.message),s(!1)}}return(0,z.jsx)(go,{open:!0,onClose:e,title:\`Invite via magic link\`,children:(0,z.jsxs)(\`div\`,{className:\`space-y-3\`,children:[(0,z.jsxs)(\`p\`,{className:\`text-xs text-muted-foreground/80\`,children:[\`Sends a sign-in link (creating the user if needed). Without a configured mailer, the email lands in the local dev inbox at \`,(0,z.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`/inbox\`}),\`.\`]}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Email\`}),(0,z.jsx)(Y,{value:n,autoFocus:!0,placeholder:\`user@example.com\`,onChange:e=>r(e.target.value),onKeyDown:e=>e.key===\`Enter\`&&n.includes(\`@\`)&&void c()})]}),i&&(0,z.jsx)(\`p\`,{className:\`text-xs text-destructive\`,children:i}),(0,z.jsxs)(\`div\`,{className:\`flex justify-end gap-2\`,children:[(0,z.jsx)(V,{variant:\`outline\`,onClick:e,children:\`Cancel\`}),(0,z.jsx)(V,{onClick:()=>void c(),disabled:o||!n.includes(\`@\`),children:o?\`Sending…\`:\`Send invite\`})]})]})})}var Hh=[{id:\`users\`,label:\`Users\`,group:\`Manage\`,component:zh},{id:\`providers\`,label:\`Sign In / Providers\`,group:\`Configuration\`,component:Eh}];function Uh(){let{section:e}=Yt(),t=Hh.some(t=>t.id===e)?e:\`users\`,n=Hh.find(e=>e.id===t).component;return(0,z.jsxs)(\`div\`,{className:\`flex h-full\`,children:[(0,z.jsx)(Th,{title:\`Authentication\`,active:t,onSelect:e=>R(\`auth\`,e),groups:[{title:\`Manage\`,items:[{id:\`users\`,label:\`Users\`}]},{title:\`Configuration\`,items:[{id:\`providers\`,label:\`Sign In / Providers\`}]}]}),(0,z.jsx)(\`div\`,{className:\`min-w-0 flex-1 overflow-hidden\`,children:(0,z.jsx)(n,{})})]})}var Wh=\`tinbase_db_schema\`,Gh=localStorage.getItem(Wh)||\`public\`,Kh=new Set;function qh(){return[(0,_.useSyncExternalStore)(e=>(Kh.add(e),()=>Kh.delete(e)),()=>Gh),Jh]}function Jh(e){Gh=e,localStorage.setItem(Wh,e),Kh.forEach(e=>e())}function Yh(e,t){let n=e=>\`"\`+e.replace(/"/g,\`""\`)+\`"\`;return e===\`public\`?n(t):\`\${n(e)}.\${n(t)}\`}var Xh=new Set([\`auth\`,\`storage\`,\`realtime\`,\`vault\`,\`cron\`,\`pgmq\`,\`net\`,\`extensions\`,\`graphql\`,\`supabase_migrations\`,\`supabase_functions\`,\`information_schema\`]);function Zh(e){return Xh.has(e)||e.startsWith(\`pg_\`)}function Qh({className:e=\`w-44 shrink-0\`,size:t}){let[n,r]=qh(),[i,a]=(0,_.useState)([n]);return(0,_.useEffect)(()=>{N.schemas().then(e=>{a(e),e.includes(n)||Jh(e.includes(\`public\`)?\`public\`:e[0]??\`public\`)},()=>{})},[]),(0,z.jsx)(Wp,{className:e,size:t,mono:!0,value:n,onValueChange:r,options:i.map(e=>({value:e,label:(0,z.jsxs)(\`span\`,{className:\`inline-flex items-center gap-1.5\`,children:[(0,z.jsx)(\`span\`,{className:\`font-sans text-muted-foreground/70\`,children:\`schema \`}),e,Zh(e)&&(0,z.jsx)(Ze,{size:10,className:\`text-muted-foreground/60\`})]})}))})}function $h({title:e,description:t,search:n,onSearch:r,onRefresh:i,actions:a,schemaPicker:o,filters:s}){return(0,z.jsxs)(\`div\`,{className:\`border-b border-border px-6 pb-4 pt-5\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex items-start justify-between gap-4\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(\`h1\`,{className:\`text-lg font-semibold text-foreground\`,children:e}),(0,z.jsx)(\`p\`,{className:\`mt-0.5 text-[13px] text-muted-foreground/80\`,children:t})]}),(0,z.jsxs)(\`div\`,{className:\`flex shrink-0 items-center gap-1.5 pt-1\`,children:[i&&(0,z.jsx)(V,{variant:\`ghost\`,size:\`iconXs\`,title:\`Refresh\`,onClick:i,children:(0,z.jsx)(gt,{size:13})}),a]})]}),(r||o||s)&&(0,z.jsxs)(\`div\`,{className:\`mt-3 flex items-center gap-2\`,children:[o&&(0,z.jsx)(Qh,{}),r&&(0,z.jsxs)(\`div\`,{className:\`relative w-full max-w-xs\`,children:[(0,z.jsx)(vt,{size:13,className:\`pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground/60\`}),(0,z.jsx)(\`input\`,{value:n,onChange:e=>r(e.target.value),placeholder:\`Search…\`,className:\`h-8 w-full rounded-md border border-input bg-field pl-8 pr-2 text-[13px] text-foreground placeholder:text-muted-foreground/60 focus:border-brand focus:outline-none\`})]}),s]})]})}var eg=e=>\`"\`+e.replace(/"/g,\`""\`)+\`"\`,tg=e=>\`'\`+e.replace(/'/g,\`''\`)+\`'\`;function ng(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)([]),[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(!1),[c,l]=(0,_.useState)(null),u=(0,_.useCallback)(async()=>{let[e,n]=await Promise.all([N.sql(\`select jobid, jobname, schedule, command, active from cron.job order by jobid\`),N.sql(\`select jobid, status, return_message, start_time, end_time from cron.job_run_details order by start_time desc limit 50\`)]);if(!e.ok||!n.ok){a(e.error??n.error??\`Query failed\`),t(e=>e??[]),e.ok&&t(e.rows??[]),n.ok&&r(n.rows??[]);return}a(null),t(e.rows??[]),r(n.rows??[])},[]);(0,_.useEffect)(()=>{u()},[u]);async function d(e){let t=await N.sql(\`select cron.unschedule(\${tg(e.jobname??String(e.jobid))})\`);if(!t.ok){H.error(t.error??\`Unschedule failed\`);return}H.success(\`Unscheduled \${e.jobname??e.jobid}\`),await u()}return e===null?(0,z.jsx)(Jp,{}):(0,z.jsxs)(\`div\`,{className:\`flex h-full flex-col\`,children:[(0,z.jsx)($h,{title:\`Cron\`,description:\`Scheduled SQL, pg_cron-compatible — jobs run in UTC with service-role privileges while tinbase is up.\`,onRefresh:()=>void u(),actions:(0,z.jsxs)(V,{size:\`xs\`,onClick:()=>s(!0),children:[(0,z.jsx)(mt,{size:12}),\` Schedule job\`]})}),i&&(0,z.jsx)(ff,{message:i}),(0,z.jsxs)(\`div\`,{className:\`min-h-0 flex-1 overflow-y-auto\`,children:[(0,z.jsxs)(Xp,{children:[(0,z.jsx)(Zp,{children:(0,z.jsxs)(\`tr\`,{children:[(0,z.jsx)(Z,{children:\`Name\`}),(0,z.jsx)(Z,{children:\`Schedule\`}),(0,z.jsx)(Z,{children:\`Command\`}),(0,z.jsx)(Z,{children:\`Status\`}),(0,z.jsx)(Z,{className:\`w-12\`})]})}),(0,z.jsx)(\`tbody\`,{children:e.map(e=>(0,z.jsxs)(Qp,{children:[(0,z.jsx)(Q,{className:\`font-mono text-foreground/90\`,children:e.jobname??\`#\${e.jobid}\`}),(0,z.jsx)(Q,{className:\`font-mono text-brand\`,children:e.schedule}),(0,z.jsx)(Q,{className:\`max-w-90 truncate font-mono text-[11px] text-muted-foreground/80\`,title:e.command,children:e.command}),(0,z.jsx)(Q,{children:e.active?(0,z.jsx)(B,{variant:\`brand\`,children:\`active\`}):(0,z.jsx)(B,{variant:\`neutral\`,children:\`inactive\`})}),(0,z.jsx)(Q,{children:(0,z.jsx)(\`button\`,{className:\`p-1 text-muted-foreground/80 opacity-0 hover:text-destructive group-hover:opacity-100\`,title:\`Unschedule\`,onClick:()=>l(e),children:(0,z.jsx)(At,{size:13})})})]},e.jobid))})]}),e.length===0&&(0,z.jsxs)(lf,{children:[\`No jobs scheduled. \`,(0,z.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`select cron.schedule('name', '*/5 * * * *', 'select 1')\`}),\` \`,\`also works from SQL.\`]}),n.length>0&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(\`h2\`,{className:\`border-b border-border px-6 pb-2 pt-6 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground/80\`,children:\`Recent runs\`}),(0,z.jsxs)(Xp,{children:[(0,z.jsx)(Zp,{children:(0,z.jsxs)(\`tr\`,{children:[(0,z.jsx)(Z,{children:\`Job\`}),(0,z.jsx)(Z,{children:\`Status\`}),(0,z.jsx)(Z,{children:\`Started\`}),(0,z.jsx)(Z,{children:\`Message\`})]})}),(0,z.jsx)(\`tbody\`,{children:n.map((t,n)=>(0,z.jsxs)(Qp,{children:[(0,z.jsx)(Q,{className:\`font-mono text-muted-foreground\`,children:e.find(e=>e.jobid===t.jobid)?.jobname??\`#\${t.jobid}\`}),(0,z.jsx)(Q,{children:t.status===\`succeeded\`?(0,z.jsx)(B,{variant:\`brand\`,children:\`succeeded\`}):(0,z.jsx)(B,{variant:\`red\`,children:t.status})}),(0,z.jsx)(Q,{className:\`text-muted-foreground\`,children:(0,z.jsx)(qm,{value:t.start_time})}),(0,z.jsx)(Q,{className:\`max-w-90 truncate font-mono text-[11px] text-muted-foreground/80\`,title:t.return_message??\`\`,children:t.return_message??\`—\`})]},n))})]})]})]}),o&&(0,z.jsx)(rg,{onClose:()=>s(!1),onDone:async()=>{s(!1),await u()}}),c&&(0,z.jsx)(q,{open:!0,danger:!0,title:\`Unschedule "\${c.jobname??c.jobid}"?\`,description:\`The job stops running immediately. Run history is kept.\`,confirmLabel:\`Unschedule\`,onConfirm:()=>void d(c),onClose:()=>l(null)})]})}function rg({onClose:e,onDone:t}){let[n,r]=(0,_.useState)(\`\`),[i,a]=(0,_.useState)(\`*/5 * * * *\`),[o,s]=(0,_.useState)(\`select net.http_post('https://example.com/hook', '{}'::jsonb)\`),[c,l]=(0,_.useState)(\`\`),[u,d]=(0,_.useState)(!1);async function f(){if(!n.trim()||!i.trim()||!o.trim())return l(\`All fields are required.\`);d(!0),l(\`\`);let e=await N.sql(\`select cron.schedule(\${tg(n.trim())}, \${tg(i.trim())}, \${tg(o)})\`);if(!e.ok){l(e.error??\`Schedule failed\`),d(!1);return}H.success(\`Scheduled \${n.trim()}\`),await t()}return(0,z.jsx)(qp,{open:!0,onClose:e,width:\`w-140\`,title:\`Schedule a new job\`,footer:(0,z.jsxs)(z.Fragment,{children:[c&&(0,z.jsx)(\`p\`,{className:\`min-w-0 truncate text-xs text-destructive\`,children:c}),(0,z.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-2\`,children:[(0,z.jsx)(Kp,{asChild:!0,children:(0,z.jsx)(V,{variant:\`outline\`,children:\`Cancel\`})}),(0,z.jsx)(V,{onClick:()=>void f(),disabled:u,children:u?\`Scheduling…\`:\`Schedule job\`})]})]}),children:(0,z.jsxs)(\`div\`,{className:\`space-y-3\`,children:[(0,z.jsxs)(\`div\`,{className:\`grid grid-cols-2 gap-3\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Name\`}),(0,z.jsx)(Y,{mono:!0,value:n,autoFocus:!0,placeholder:\`cleanup\`,onChange:e=>r(e.target.value)})]}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Schedule — cron (UTC) or "N seconds"\`}),(0,z.jsx)(Y,{mono:!0,value:i,placeholder:\`*/5 * * * *\`,onChange:e=>a(e.target.value)})]})]}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`SQL command\`}),(0,z.jsx)(ir,{lang:\`sql\`,className:\`h-40\`,value:o,onChange:s,onCmdEnter:()=>void f()})]})]})})}var ig=/^[a-z_][a-z0-9_-]{0,46}$/i;function ag(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(null),[i,a]=(0,_.useState)(!1),[o,s]=(0,_.useState)(null),[c,l]=(0,_.useState)(null),[u,d]=(0,_.useState)(null),f=(0,_.useCallback)(async()=>{let e=await N.sql(\`select replace(t.table_name, 'q_', '') as name,
|
|
1509
1509
|
(xpath('/row/cnt/text()', query_to_xml('select count(*) as cnt from pgmq.' || quote_ident(t.table_name), false, true, '')))[1]::text::int as depth
|
|
1510
1510
|
from information_schema.tables t
|
|
1511
1511
|
where t.table_schema = 'pgmq' and t.table_name like 'q\\\\_%' order by 1\`);if(e.ok){r(null),t((e.rows??[]).map(e=>({...e,archived:0})));return}let n=await N.sql(\`select replace(table_name, 'q_', '') as name from information_schema.tables
|
|
1512
|
-
where table_schema = 'pgmq' and table_name like 'q\\\\_%' order by 1\`);if(!n.ok){r(n.error??\`Query failed\`),t(e=>e??[]);return}r(null);let i=[];for(let e of n.rows??[]){if(!rg.test(e.name))continue;let t=await N.sql(\`select count(*)::int as depth from pgmq.\${$h(\`q_\`+e.name)}\`);i.push({name:e.name,depth:t.ok?t.rows?.[0]?.depth??0:0,archived:0})}t(i)},[]);(0,_.useEffect)(()=>{f()},[f]);async function p(e){if(!rg.test(e.name)){H.error(\`Invalid queue name\`);return}let t=await N.sql(\`delete from pgmq.\${$h(\`q_\`+e.name)}\`);if(!t.ok){H.error(t.error??\`Purge failed\`);return}H.success(\`Purged queue \${e.name}\`),await f()}return e===null?(0,z.jsx)(Jp,{}):(0,z.jsxs)(\`div\`,{className:\`flex h-full flex-col\`,children:[(0,z.jsx)(Qh,{title:\`Queues\`,description:\`pgmq-compatible message queues — send/read/pop from SQL or supabase.schema('pgmq').rpc(…).\`,onRefresh:()=>void f(),actions:(0,z.jsxs)(V,{size:\`xs\`,onClick:()=>a(!0),children:[(0,z.jsx)(mt,{size:12}),\` New queue\`]})}),n&&(0,z.jsx)(ff,{message:n}),(0,z.jsxs)(\`div\`,{className:\`min-h-0 flex-1 overflow-auto\`,children:[(0,z.jsxs)(Xp,{children:[(0,z.jsx)(Zp,{children:(0,z.jsxs)(\`tr\`,{children:[(0,z.jsx)(Z,{children:\`Queue\`}),(0,z.jsx)(Z,{children:\`Depth\`}),(0,z.jsx)(Z,{className:\`w-28\`})]})}),(0,z.jsx)(\`tbody\`,{children:e.map(e=>(0,z.jsxs)(Qp,{children:[(0,z.jsx)(Q,{className:\`font-mono text-foreground/90\`,children:e.name}),(0,z.jsx)(Q,{className:\`tabular-nums text-muted-foreground\`,children:e.depth}),(0,z.jsx)(Q,{children:(0,z.jsxs)(\`div\`,{className:\`flex justify-end gap-0.5 opacity-0 group-hover:opacity-100\`,children:[(0,z.jsx)(\`button\`,{className:\`p-1 text-muted-foreground/80 hover:text-foreground\`,title:\`Peek messages\`,onClick:()=>l(e),children:(0,z.jsx)(Ae,{size:13})}),(0,z.jsx)(\`button\`,{className:\`p-1 text-muted-foreground/80 hover:text-foreground\`,title:\`Send test message\`,onClick:()=>s(e),children:(0,z.jsx)(yt,{size:13})}),(0,z.jsx)(\`button\`,{className:\`p-1 text-muted-foreground/80 hover:text-destructive\`,title:\`Purge queue\`,onClick:()=>d(e),children:(0,z.jsx)(At,{size:13})})]})})]},e.name))})]}),e.length===0&&(0,z.jsxs)(cf,{children:[\`No queues yet. Create one here or via\`,\` \`,(0,z.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`select pgmq.create('jobs')\`}),\`.\`]})]}),i&&(0,z.jsx)(ag,{onClose:()=>a(!1),onDone:async()=>{a(!1),await f()}}),o&&(0,z.jsx)(og,{queue:o,onClose:()=>s(null),onDone:async()=>{s(null),await f()}}),c&&(0,z.jsx)(sg,{queue:c,onClose:()=>l(null)}),u&&(0,z.jsx)(q,{open:!0,danger:!0,title:\`Purge queue "\${u.name}"?\`,description:\`All \${u.depth} pending messages are permanently deleted.\`,confirmLabel:\`Purge\`,onConfirm:()=>void p(u),onClose:()=>d(null)})]})}function ag({onClose:e,onDone:t}){let[n,r]=(0,_.useState)(\`\`),[i,a]=(0,_.useState)(\`\`),[o,s]=(0,_.useState)(!1);async function c(){if(!rg.test(n))return a(\`Letters, digits, underscores and hyphens only.\`);s(!0),a(\`\`);let e=await N.sql(\`select pgmq.create(\${eg(n)})\`);if(!e.ok){a(e.error??\`Create failed\`),s(!1);return}H.success(\`Created queue \${n}\`),await t()}return(0,z.jsx)(qp,{open:!0,onClose:e,width:\`w-120\`,title:\`Create a new queue\`,footer:(0,z.jsxs)(z.Fragment,{children:[i&&(0,z.jsx)(\`p\`,{className:\`min-w-0 truncate text-xs text-destructive\`,children:i}),(0,z.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-2\`,children:[(0,z.jsx)(Kp,{asChild:!0,children:(0,z.jsx)(V,{variant:\`outline\`,children:\`Cancel\`})}),(0,z.jsx)(V,{onClick:()=>void c(),disabled:o||!n,children:o?\`Creating…\`:\`Create queue\`})]})]}),children:(0,z.jsx)(\`div\`,{className:\`space-y-3\`,children:(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Name\`}),(0,z.jsx)(lf,{mono:!0,value:n,autoFocus:!0,placeholder:\`jobs\`,onChange:e=>r(e.target.value),onKeyDown:e=>e.key===\`Enter\`&&void c()}),(0,z.jsx)(\`p\`,{className:\`mt-1 text-[11px] text-muted-foreground/60\`,children:\`Lowercase letters, digits and underscores.\`})]})})})}function og({queue:e,onClose:t,onDone:n}){let[r,i]=(0,_.useState)(\`{ "task": "hello" }\`),[a,o]=(0,_.useState)(\`\`),[s,c]=(0,_.useState)(!1);async function l(){try{JSON.parse(r)}catch{return o(\`Payload must be valid JSON.\`)}c(!0),o(\`\`);let t=await N.sql(\`select pgmq.send(\${eg(e.name)}, \${eg(r)}::jsonb)\`);if(!t.ok){o(t.error??\`Send failed\`),c(!1);return}H.success(\`Sent to \${e.name}\`),await n()}return(0,z.jsx)(qp,{open:!0,onClose:t,width:\`w-120\`,title:(0,z.jsxs)(\`span\`,{children:[\`Send message to\`,\` \`,(0,z.jsx)(\`code\`,{className:\`rounded bg-accent px-1.5 py-0.5 font-mono text-xs text-foreground\`,children:e.name})]}),footer:(0,z.jsxs)(z.Fragment,{children:[a&&(0,z.jsx)(\`p\`,{className:\`min-w-0 truncate text-xs text-destructive\`,children:a}),(0,z.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-2\`,children:[(0,z.jsx)(Kp,{asChild:!0,children:(0,z.jsx)(V,{variant:\`outline\`,children:\`Cancel\`})}),(0,z.jsx)(V,{onClick:()=>void l(),disabled:s,children:s?\`Sending…\`:\`Send message\`})]})]}),children:(0,z.jsx)(\`div\`,{className:\`space-y-3\`,children:(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Message (JSON)\`}),(0,z.jsx)(em,{rows:6,value:r,onChange:e=>i(e.target.value)})]})})})}function sg({queue:e,onClose:t}){let[n,r]=(0,_.useState)(null);return(0,_.useEffect)(()=>{N.sql(\`select msg_id, read_ct, enqueued_at, vt, message from pgmq.\${\`q_\`+e.name} order by msg_id desc limit 50\`).then(e=>r(e.ok?e.rows??[]:[]))},[e.name]),(0,z.jsx)(qp,{open:!0,onClose:t,flush:!0,width:\`w-[620px]\`,title:(0,z.jsxs)(\`span\`,{children:[\`Messages in\`,\` \`,(0,z.jsx)(\`code\`,{className:\`rounded bg-accent px-1.5 py-0.5 font-mono text-xs text-foreground\`,children:e.name})]}),footer:(0,z.jsx)(Kp,{asChild:!0,children:(0,z.jsx)(V,{variant:\`outline\`,className:\`ml-auto\`,children:\`Done\`})}),children:n===null?(0,z.jsx)(\`div\`,{className:\`p-5\`,children:(0,z.jsx)(Jp,{})}):n.length===0?(0,z.jsx)(cf,{children:\`Queue is empty.\`}):(0,z.jsx)(\`div\`,{className:\`h-full overflow-auto\`,children:(0,z.jsxs)(Xp,{children:[(0,z.jsx)(Zp,{children:(0,z.jsxs)(\`tr\`,{children:[(0,z.jsx)(Z,{children:\`id\`}),(0,z.jsx)(Z,{children:\`reads\`}),(0,z.jsx)(Z,{children:\`enqueued\`}),(0,z.jsx)(Z,{children:\`message\`})]})}),(0,z.jsx)(\`tbody\`,{children:n.map((e,t)=>(0,z.jsxs)(Qp,{children:[(0,z.jsx)(Q,{className:\`font-mono text-muted-foreground\`,children:String(e.msg_id)}),(0,z.jsx)(Q,{className:\`tabular-nums text-muted-foreground\`,children:String(e.read_ct)}),(0,z.jsx)(Q,{className:\`text-muted-foreground\`,children:(0,z.jsx)(qm,{value:e.enqueued_at})}),(0,z.jsx)(Q,{className:\`max-w-70 truncate font-mono text-[11px]\`,children:(0,z.jsx)(Jm,{value:e.message})})]},t))})]})})})}function cg(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)([]),[i,a]=(0,_.useState)(null),o=(0,_.useCallback)(async()=>{let[e,n]=await Promise.allSettled([N.webhooksConfig(),N.sql(\`select id, status_code, timed_out, error_msg, created from net._http_response order by id desc limit 50\`)]);t(e.status===\`fulfilled\`?e.value:[]),n.status===\`fulfilled\`&&n.value.ok?(a(null),r(n.value.rows??[])):a((n.status===\`fulfilled\`?n.value.error:n.reason?.message)??\`Query failed\`)},[]);return(0,_.useEffect)(()=>{o()},[o]),e===null?(0,z.jsx)(Jp,{}):(0,z.jsxs)(\`div\`,{className:\`flex h-full flex-col\`,children:[(0,z.jsx)(Qh,{title:\`Webhooks\`,description:\`Fire HTTP requests on table changes (CDC → HTTP) — configured via supabase/webhooks.json or createBackend({ webhooks }).\`,onRefresh:()=>void o()}),i&&(0,z.jsx)(ff,{message:i}),(0,z.jsxs)(\`div\`,{className:\`min-h-0 flex-1 overflow-y-auto\`,children:[(0,z.jsxs)(Xp,{children:[(0,z.jsx)(Zp,{children:(0,z.jsxs)(\`tr\`,{children:[(0,z.jsx)(Z,{children:\`Table\`}),(0,z.jsx)(Z,{children:\`Events\`}),(0,z.jsx)(Z,{children:\`URL\`})]})}),(0,z.jsx)(\`tbody\`,{children:e.map((e,t)=>(0,z.jsxs)(Qp,{children:[(0,z.jsx)(Q,{className:\`font-mono text-foreground/90\`,children:e.table}),(0,z.jsx)(Q,{children:(0,z.jsx)(\`span\`,{className:\`flex gap-1\`,children:(e.events?.length?e.events:[\`INSERT\`,\`UPDATE\`,\`DELETE\`]).map(e=>(0,z.jsx)(B,{variant:\`blue\`,children:e},e))})}),(0,z.jsx)(Q,{className:\`max-w-90 truncate font-mono text-[12px] text-muted-foreground\`,title:e.url,children:e.url})]},t))})]}),e.length===0&&(0,z.jsxs)(cf,{children:[\`No webhooks configured. Add \`,(0,z.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`supabase/webhooks.json\`}),\` —\`,\` \`,(0,z.jsxs)(\`code\`,{className:\`text-muted-foreground\`,children:[\`[\`,\`{ "table": "orders", "url": "https://…" }\`,\`]\`]}),\` — and restart.\`]}),(0,z.jsx)(\`h2\`,{className:\`border-b border-border px-6 pb-2 pt-6 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground/80\`,children:\`Recent outbound requests (pg_net + webhooks)\`}),(0,z.jsxs)(Xp,{children:[(0,z.jsx)(Zp,{children:(0,z.jsxs)(\`tr\`,{children:[(0,z.jsx)(Z,{children:\`id\`}),(0,z.jsx)(Z,{children:\`Status\`}),(0,z.jsx)(Z,{children:\`Error\`}),(0,z.jsx)(Z,{children:\`At\`})]})}),(0,z.jsx)(\`tbody\`,{children:n.map(e=>(0,z.jsxs)(Qp,{children:[(0,z.jsx)(Q,{className:\`font-mono text-muted-foreground\`,children:e.id}),(0,z.jsx)(Q,{children:e.timed_out?(0,z.jsx)(B,{variant:\`red\`,children:\`timeout\`}):e.status_code&&e.status_code<400?(0,z.jsx)(B,{variant:\`brand\`,children:e.status_code}):(0,z.jsx)(B,{variant:\`red\`,children:e.status_code??\`error\`})}),(0,z.jsx)(Q,{className:\`max-w-90 truncate font-mono text-[11px] text-muted-foreground/80\`,children:e.error_msg??\`—\`}),(0,z.jsx)(Q,{className:\`text-muted-foreground\`,children:(0,z.jsx)(qm,{value:e.created})})]},e.id))})]}),n.length===0&&(0,z.jsx)(cf,{children:\`No outbound requests recorded yet.\`})]})]})}var lg=[{id:\`cron\`,label:\`Cron\`,component:tg},{id:\`queues\`,label:\`Queues\`,component:ig},{id:\`webhooks\`,label:\`Webhooks\`,component:cg}];function ug(){let{section:e}=Yt(),t=lg.some(t=>t.id===e)?e:\`cron\`,n=lg.find(e=>e.id===t).component;return(0,z.jsxs)(\`div\`,{className:\`flex h-full\`,children:[(0,z.jsx)(Th,{title:\`Automations\`,active:t,onSelect:e=>R(\`automations\`,e),groups:[{items:lg.map(e=>({id:e.id,label:e.label}))}]}),(0,z.jsx)(\`div\`,{className:\`min-w-0 flex-1 overflow-hidden\`,children:(0,z.jsx)(n,{})})]})}function dg(){let[e]=Kh(),[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(\`\`),[s,c]=(0,_.useState)(!1),[l,u]=(0,_.useState)(null),[d,f]=(0,_.useState)(null),p=(0,_.useCallback)(async()=>{let t=await N.sql(\`select t.typname as name, array_agg(e.enumlabel order by e.enumsortorder) as values,
|
|
1512
|
+
where table_schema = 'pgmq' and table_name like 'q\\\\_%' order by 1\`);if(!n.ok){r(n.error??\`Query failed\`),t(e=>e??[]);return}r(null);let i=[];for(let e of n.rows??[]){if(!ig.test(e.name))continue;let t=await N.sql(\`select count(*)::int as depth from pgmq.\${eg(\`q_\`+e.name)}\`);i.push({name:e.name,depth:t.ok?t.rows?.[0]?.depth??0:0,archived:0})}t(i)},[]);(0,_.useEffect)(()=>{f()},[f]);async function p(e){if(!ig.test(e.name)){H.error(\`Invalid queue name\`);return}let t=await N.sql(\`delete from pgmq.\${eg(\`q_\`+e.name)}\`);if(!t.ok){H.error(t.error??\`Purge failed\`);return}H.success(\`Purged queue \${e.name}\`),await f()}return e===null?(0,z.jsx)(Jp,{}):(0,z.jsxs)(\`div\`,{className:\`flex h-full flex-col\`,children:[(0,z.jsx)($h,{title:\`Queues\`,description:\`pgmq-compatible message queues — send/read/pop from SQL or supabase.schema('pgmq').rpc(…).\`,onRefresh:()=>void f(),actions:(0,z.jsxs)(V,{size:\`xs\`,onClick:()=>a(!0),children:[(0,z.jsx)(mt,{size:12}),\` New queue\`]})}),n&&(0,z.jsx)(ff,{message:n}),(0,z.jsxs)(\`div\`,{className:\`min-h-0 flex-1 overflow-auto\`,children:[(0,z.jsxs)(Xp,{children:[(0,z.jsx)(Zp,{children:(0,z.jsxs)(\`tr\`,{children:[(0,z.jsx)(Z,{children:\`Queue\`}),(0,z.jsx)(Z,{children:\`Depth\`}),(0,z.jsx)(Z,{className:\`w-28\`})]})}),(0,z.jsx)(\`tbody\`,{children:e.map(e=>(0,z.jsxs)(Qp,{children:[(0,z.jsx)(Q,{className:\`font-mono text-foreground/90\`,children:e.name}),(0,z.jsx)(Q,{className:\`tabular-nums text-muted-foreground\`,children:e.depth}),(0,z.jsx)(Q,{children:(0,z.jsxs)(\`div\`,{className:\`flex justify-end gap-0.5 opacity-0 group-hover:opacity-100\`,children:[(0,z.jsx)(\`button\`,{className:\`p-1 text-muted-foreground/80 hover:text-foreground\`,title:\`Peek messages\`,onClick:()=>l(e),children:(0,z.jsx)(Ae,{size:13})}),(0,z.jsx)(\`button\`,{className:\`p-1 text-muted-foreground/80 hover:text-foreground\`,title:\`Send test message\`,onClick:()=>s(e),children:(0,z.jsx)(yt,{size:13})}),(0,z.jsx)(\`button\`,{className:\`p-1 text-muted-foreground/80 hover:text-destructive\`,title:\`Purge queue\`,onClick:()=>d(e),children:(0,z.jsx)(At,{size:13})})]})})]},e.name))})]}),e.length===0&&(0,z.jsxs)(lf,{children:[\`No queues yet. Create one here or via\`,\` \`,(0,z.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`select pgmq.create('jobs')\`}),\`.\`]})]}),i&&(0,z.jsx)(og,{onClose:()=>a(!1),onDone:async()=>{a(!1),await f()}}),o&&(0,z.jsx)(sg,{queue:o,onClose:()=>s(null),onDone:async()=>{s(null),await f()}}),c&&(0,z.jsx)(cg,{queue:c,onClose:()=>l(null)}),u&&(0,z.jsx)(q,{open:!0,danger:!0,title:\`Purge queue "\${u.name}"?\`,description:\`All \${u.depth} pending messages are permanently deleted.\`,confirmLabel:\`Purge\`,onConfirm:()=>void p(u),onClose:()=>d(null)})]})}function og({onClose:e,onDone:t}){let[n,r]=(0,_.useState)(\`\`),[i,a]=(0,_.useState)(\`\`),[o,s]=(0,_.useState)(!1);async function c(){if(!ig.test(n))return a(\`Letters, digits, underscores and hyphens only.\`);s(!0),a(\`\`);let e=await N.sql(\`select pgmq.create(\${tg(n)})\`);if(!e.ok){a(e.error??\`Create failed\`),s(!1);return}H.success(\`Created queue \${n}\`),await t()}return(0,z.jsx)(qp,{open:!0,onClose:e,width:\`w-120\`,title:\`Create a new queue\`,footer:(0,z.jsxs)(z.Fragment,{children:[i&&(0,z.jsx)(\`p\`,{className:\`min-w-0 truncate text-xs text-destructive\`,children:i}),(0,z.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-2\`,children:[(0,z.jsx)(Kp,{asChild:!0,children:(0,z.jsx)(V,{variant:\`outline\`,children:\`Cancel\`})}),(0,z.jsx)(V,{onClick:()=>void c(),disabled:o||!n,children:o?\`Creating…\`:\`Create queue\`})]})]}),children:(0,z.jsx)(\`div\`,{className:\`space-y-3\`,children:(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Name\`}),(0,z.jsx)(Y,{mono:!0,value:n,autoFocus:!0,placeholder:\`jobs\`,onChange:e=>r(e.target.value),onKeyDown:e=>e.key===\`Enter\`&&void c()}),(0,z.jsx)(\`p\`,{className:\`mt-1 text-[11px] text-muted-foreground/60\`,children:\`Lowercase letters, digits and underscores.\`})]})})})}function sg({queue:e,onClose:t,onDone:n}){let[r,i]=(0,_.useState)(\`{ "task": "hello" }\`),[a,o]=(0,_.useState)(\`\`),[s,c]=(0,_.useState)(!1);async function l(){try{JSON.parse(r)}catch{return o(\`Payload must be valid JSON.\`)}c(!0),o(\`\`);let t=await N.sql(\`select pgmq.send(\${tg(e.name)}, \${tg(r)}::jsonb)\`);if(!t.ok){o(t.error??\`Send failed\`),c(!1);return}H.success(\`Sent to \${e.name}\`),await n()}return(0,z.jsx)(qp,{open:!0,onClose:t,width:\`w-120\`,title:(0,z.jsxs)(\`span\`,{children:[\`Send message to\`,\` \`,(0,z.jsx)(\`code\`,{className:\`rounded bg-accent px-1.5 py-0.5 font-mono text-xs text-foreground\`,children:e.name})]}),footer:(0,z.jsxs)(z.Fragment,{children:[a&&(0,z.jsx)(\`p\`,{className:\`min-w-0 truncate text-xs text-destructive\`,children:a}),(0,z.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-2\`,children:[(0,z.jsx)(Kp,{asChild:!0,children:(0,z.jsx)(V,{variant:\`outline\`,children:\`Cancel\`})}),(0,z.jsx)(V,{onClick:()=>void l(),disabled:s,children:s?\`Sending…\`:\`Send message\`})]})]}),children:(0,z.jsx)(\`div\`,{className:\`space-y-3\`,children:(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Message (JSON)\`}),(0,z.jsx)(em,{rows:6,value:r,onChange:e=>i(e.target.value)})]})})})}function cg({queue:e,onClose:t}){let[n,r]=(0,_.useState)(null);return(0,_.useEffect)(()=>{N.sql(\`select msg_id, read_ct, enqueued_at, vt, message from pgmq.\${\`q_\`+e.name} order by msg_id desc limit 50\`).then(e=>r(e.ok?e.rows??[]:[]))},[e.name]),(0,z.jsx)(qp,{open:!0,onClose:t,flush:!0,width:\`w-[620px]\`,title:(0,z.jsxs)(\`span\`,{children:[\`Messages in\`,\` \`,(0,z.jsx)(\`code\`,{className:\`rounded bg-accent px-1.5 py-0.5 font-mono text-xs text-foreground\`,children:e.name})]}),footer:(0,z.jsx)(Kp,{asChild:!0,children:(0,z.jsx)(V,{variant:\`outline\`,className:\`ml-auto\`,children:\`Done\`})}),children:n===null?(0,z.jsx)(\`div\`,{className:\`p-5\`,children:(0,z.jsx)(Jp,{})}):n.length===0?(0,z.jsx)(lf,{children:\`Queue is empty.\`}):(0,z.jsx)(\`div\`,{className:\`h-full overflow-auto\`,children:(0,z.jsxs)(Xp,{children:[(0,z.jsx)(Zp,{children:(0,z.jsxs)(\`tr\`,{children:[(0,z.jsx)(Z,{children:\`id\`}),(0,z.jsx)(Z,{children:\`reads\`}),(0,z.jsx)(Z,{children:\`enqueued\`}),(0,z.jsx)(Z,{children:\`message\`})]})}),(0,z.jsx)(\`tbody\`,{children:n.map((e,t)=>(0,z.jsxs)(Qp,{children:[(0,z.jsx)(Q,{className:\`font-mono text-muted-foreground\`,children:String(e.msg_id)}),(0,z.jsx)(Q,{className:\`tabular-nums text-muted-foreground\`,children:String(e.read_ct)}),(0,z.jsx)(Q,{className:\`text-muted-foreground\`,children:(0,z.jsx)(qm,{value:e.enqueued_at})}),(0,z.jsx)(Q,{className:\`max-w-70 truncate font-mono text-[11px]\`,children:(0,z.jsx)(Jm,{value:e.message})})]},t))})]})})})}function lg(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)([]),[i,a]=(0,_.useState)(null),o=(0,_.useCallback)(async()=>{let[e,n]=await Promise.allSettled([N.webhooksConfig(),N.sql(\`select id, status_code, timed_out, error_msg, created from net._http_response order by id desc limit 50\`)]);t(e.status===\`fulfilled\`?e.value:[]),n.status===\`fulfilled\`&&n.value.ok?(a(null),r(n.value.rows??[])):a((n.status===\`fulfilled\`?n.value.error:n.reason?.message)??\`Query failed\`)},[]);return(0,_.useEffect)(()=>{o()},[o]),e===null?(0,z.jsx)(Jp,{}):(0,z.jsxs)(\`div\`,{className:\`flex h-full flex-col\`,children:[(0,z.jsx)($h,{title:\`Webhooks\`,description:\`Fire HTTP requests on table changes (CDC → HTTP) — configured via supabase/webhooks.json or createBackend({ webhooks }).\`,onRefresh:()=>void o()}),i&&(0,z.jsx)(ff,{message:i}),(0,z.jsxs)(\`div\`,{className:\`min-h-0 flex-1 overflow-y-auto\`,children:[(0,z.jsxs)(Xp,{children:[(0,z.jsx)(Zp,{children:(0,z.jsxs)(\`tr\`,{children:[(0,z.jsx)(Z,{children:\`Table\`}),(0,z.jsx)(Z,{children:\`Events\`}),(0,z.jsx)(Z,{children:\`URL\`})]})}),(0,z.jsx)(\`tbody\`,{children:e.map((e,t)=>(0,z.jsxs)(Qp,{children:[(0,z.jsx)(Q,{className:\`font-mono text-foreground/90\`,children:e.table}),(0,z.jsx)(Q,{children:(0,z.jsx)(\`span\`,{className:\`flex gap-1\`,children:(e.events?.length?e.events:[\`INSERT\`,\`UPDATE\`,\`DELETE\`]).map(e=>(0,z.jsx)(B,{variant:\`blue\`,children:e},e))})}),(0,z.jsx)(Q,{className:\`max-w-90 truncate font-mono text-[12px] text-muted-foreground\`,title:e.url,children:e.url})]},t))})]}),e.length===0&&(0,z.jsxs)(lf,{children:[\`No webhooks configured. Add \`,(0,z.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`supabase/webhooks.json\`}),\` —\`,\` \`,(0,z.jsxs)(\`code\`,{className:\`text-muted-foreground\`,children:[\`[\`,\`{ "table": "orders", "url": "https://…" }\`,\`]\`]}),\` — and restart.\`]}),(0,z.jsx)(\`h2\`,{className:\`border-b border-border px-6 pb-2 pt-6 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground/80\`,children:\`Recent outbound requests (pg_net + webhooks)\`}),(0,z.jsxs)(Xp,{children:[(0,z.jsx)(Zp,{children:(0,z.jsxs)(\`tr\`,{children:[(0,z.jsx)(Z,{children:\`id\`}),(0,z.jsx)(Z,{children:\`Status\`}),(0,z.jsx)(Z,{children:\`Error\`}),(0,z.jsx)(Z,{children:\`At\`})]})}),(0,z.jsx)(\`tbody\`,{children:n.map(e=>(0,z.jsxs)(Qp,{children:[(0,z.jsx)(Q,{className:\`font-mono text-muted-foreground\`,children:e.id}),(0,z.jsx)(Q,{children:e.timed_out?(0,z.jsx)(B,{variant:\`red\`,children:\`timeout\`}):e.status_code&&e.status_code<400?(0,z.jsx)(B,{variant:\`brand\`,children:e.status_code}):(0,z.jsx)(B,{variant:\`red\`,children:e.status_code??\`error\`})}),(0,z.jsx)(Q,{className:\`max-w-90 truncate font-mono text-[11px] text-muted-foreground/80\`,children:e.error_msg??\`—\`}),(0,z.jsx)(Q,{className:\`text-muted-foreground\`,children:(0,z.jsx)(qm,{value:e.created})})]},e.id))})]}),n.length===0&&(0,z.jsx)(lf,{children:\`No outbound requests recorded yet.\`})]})]})}var ug=[{id:\`cron\`,label:\`Cron\`,component:ng},{id:\`queues\`,label:\`Queues\`,component:ag},{id:\`webhooks\`,label:\`Webhooks\`,component:lg}];function dg(){let{section:e}=Yt(),t=ug.some(t=>t.id===e)?e:\`cron\`,n=ug.find(e=>e.id===t).component;return(0,z.jsxs)(\`div\`,{className:\`flex h-full\`,children:[(0,z.jsx)(Th,{title:\`Automations\`,active:t,onSelect:e=>R(\`automations\`,e),groups:[{items:ug.map(e=>({id:e.id,label:e.label}))}]}),(0,z.jsx)(\`div\`,{className:\`min-w-0 flex-1 overflow-hidden\`,children:(0,z.jsx)(n,{})})]})}function fg(){let[e]=qh(),[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(\`\`),[s,c]=(0,_.useState)(!1),[l,u]=(0,_.useState)(null),[d,f]=(0,_.useState)(null),p=(0,_.useCallback)(async()=>{let t=await N.sql(\`select t.typname as name, array_agg(e.enumlabel order by e.enumsortorder) as values,
|
|
1513
1513
|
obj_description(t.oid, 'pg_type') as comment
|
|
1514
1514
|
from pg_type t join pg_enum e on e.enumtypid = t.oid
|
|
1515
1515
|
join pg_namespace n on n.oid = t.typnamespace
|
|
1516
|
-
where n.nspname = \${
|
|
1517
|
-
group by t.typname, t.oid order by t.typname\`);if(!t.ok){i(t.error??\`Query failed\`),n(e=>e??[]);return}i(null),n((t.rows??[]).map(e=>({...e,values:zt(e.values)})))},[e]);(0,_.useEffect)(()=>{p();let e=setInterval(()=>void p(),5e3);return()=>clearInterval(e)},[p]);async function m(t){let n=await N.sql(\`drop type \${Jh(e,t.name)}\`);if(!n.ok){H.error(n.error??\`Drop failed — is the type still used by a column?\`);return}H.success(\`Dropped type \${t.name}\`),await p()}if(t===null)return(0,z.jsx)(Jp,{});let h=t.filter(e=>e.name.toLowerCase().includes(a.toLowerCase()));return(0,z.jsxs)(\`div\`,{className:\`flex h-full flex-col\`,children:[(0,z.jsx)(Qh,{title:\`Enumerated Types\`,description:\`Custom enum types — columns using them render as dropdowns in the table editor.\`,search:a,onSearch:o,onRefresh:()=>void p(),schemaPicker:!0,actions:(0,z.jsxs)(V,{size:\`xs\`,onClick:()=>c(!0),children:[(0,z.jsx)(mt,{size:12}),\` New type\`]})}),r&&(0,z.jsx)(ff,{message:r}),(0,z.jsxs)(\`div\`,{className:\`min-h-0 flex-1 space-y-3 overflow-y-auto p-6\`,children:[h.map(e=>(0,z.jsxs)(\`div\`,{className:\`rounded-md border border-border bg-card p-4\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-2\`,children:[(0,z.jsx)(\`span\`,{className:\`font-mono text-[13px] text-foreground\`,children:e.name}),(0,z.jsxs)(\`span\`,{className:\`text-[11px] text-muted-foreground/60\`,children:[e.values.length,\` values\`]}),e.comment&&(0,z.jsxs)(\`span\`,{className:\`truncate text-[11px] text-muted-foreground/60\`,title:e.comment,children:[\`— \`,e.comment]}),(0,z.jsxs)(\`div\`,{className:\`ml-auto flex gap-0.5\`,children:[(0,z.jsx)(V,{variant:\`ghost\`,size:\`iconXs\`,title:\`Edit type\`,onClick:()=>u(e),children:(0,z.jsx)(lt,{size:12})}),(0,z.jsx)(V,{variant:\`ghost\`,size:\`iconXs\`,title:\`Drop type\`,onClick:()=>f(e),children:(0,z.jsx)(At,{size:12,className:\`text-muted-foreground hover:text-destructive\`})})]})]}),(0,z.jsx)(\`div\`,{className:\`mt-2 flex flex-wrap gap-1.5\`,children:e.values.map(e=>(0,z.jsx)(B,{variant:\`outline\`,className:\`font-mono\`,children:e},e))})]},e.name)),h.length===0&&(0,z.jsx)(cf,{children:t.length===0?\`No enum types yet.\`:\`No match.\`})]}),s&&(0,z.jsx)(fg,{schema:e,onClose:()=>c(!1),onDone:async()=>{c(!1),await p()}}),l&&(0,z.jsx)(fg,{schema:e,existing:l,onClose:()=>u(null),onDone:async()=>{u(null),await p()}}),d&&(0,z.jsx)(q,{open:!0,danger:!0,title:\`Drop type "\${d.name}"?\`,description:\`Fails if any column still uses the type. This cannot be undone.\`,confirmLabel:\`Drop type\`,onConfirm:()=>void m(d),onClose:()=>f(null)})]})}function fg({schema:e,existing:t,onClose:n,onDone:r}){let[i,a]=(0,_.useState)(t?.name??\`\`),[o,s]=(0,_.useState)(t?.comment??\`\`),[c,l]=(0,_.useState)(t?[...t.values]:[\`\`]),[u,d]=(0,_.useState)(!1),[f,p]=(0,_.useState)(\`\`),m=t?.values.length??0;async function h(e){let t=await N.sql(e);return t.ok?!0:(p(t.error??\`Statement failed\`),d(!1),!1)}async function g(){let n=c.map(e=>e.trim()),a=i.trim();if(!a)return p(\`Name is required.\`);if(n.some((e,t)=>!e&&t<m))return p(\`Existing values cannot be blank.\`);let s=n.filter(Boolean);if(s.length===0)return p(\`At least one value is required.\`);if(new Set(s).size!==s.length)return p(\`Values must be unique.\`);if(d(!0),p(\`\`),!t){if(!await h(\`create type \${Jh(e,a)} as enum (\${s.map(eg).join(\`, \`)})\`)||o.trim()&&!await h(\`comment on type \${Jh(e,a)} is \${eg(o.trim())}\`))return;H.success(\`Created type \${a}\`),await r();return}let l=t.name;for(let r=0;r<m;r++)if(n[r]!==t.values[r]&&!await h(\`alter type \${Jh(e,l)} rename value \${eg(t.values[r])} to \${eg(n[r])}\`))return;if(a!==t.name){if(!await h(\`alter type \${Jh(e,l)} rename to \${$h(a)}\`))return;l=a}for(let t of n.slice(m).filter(Boolean))if(!await h(\`alter type \${Jh(e,l)} add value if not exists \${eg(t)}\`))return;if((o.trim()||null)!==(t.comment??null)){let t=o.trim()?eg(o.trim()):\`null\`;if(!await h(\`comment on type \${Jh(e,l)} is \${t}\`))return}H.success(\`Updated type \${l}\`),await r()}return(0,z.jsx)(qp,{open:!0,onClose:n,width:\`w-135\`,title:t?\`Edit type "\${t.name}"\`:\`Create a new enumerated type\`,footer:(0,z.jsxs)(z.Fragment,{children:[f&&(0,z.jsx)(\`p\`,{className:\`min-w-0 truncate text-xs text-destructive\`,children:f}),(0,z.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-2\`,children:[(0,z.jsx)(Kp,{asChild:!0,children:(0,z.jsx)(V,{variant:\`outline\`,children:\`Cancel\`})}),(0,z.jsx)(V,{onClick:()=>void g(),disabled:u,children:u?\`Saving…\`:t?\`Save changes\`:\`Create type\`})]})]}),children:(0,z.jsxs)(\`div\`,{className:\`space-y-3\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Name\`}),(0,z.jsx)(lf,{mono:!0,value:i,autoFocus:!t,placeholder:\`order_status\`,onChange:e=>a(e.target.value)})]}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsxs)(X,{children:[\`Description \`,(0,z.jsx)(\`span\`,{className:\`font-normal text-muted-foreground/60\`,children:\`— optional\`})]}),(0,z.jsx)(lf,{value:o,onChange:e=>s(e.target.value)})]}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Values\`}),(0,z.jsxs)(\`div\`,{className:\`mb-2 flex items-start gap-2.5 rounded-md border border-border bg-card px-3 py-2.5 text-[11px] leading-relaxed text-muted-foreground\`,children:[(0,z.jsx)(_e,{size:13,className:\`mt-px shrink-0\`}),(0,z.jsx)(\`span\`,{children:t?\`Existing values can be renamed but never deleted or re-ordered — that requires dropping and recreating the type.\`:\`After creation, values cannot be deleted or sorted — only renamed or appended.\`})]}),(0,z.jsx)(\`div\`,{className:\`space-y-1.5\`,children:c.map((e,t)=>(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-1.5\`,children:[(0,z.jsx)(lf,{mono:!0,value:e,placeholder:t<m?void 0:\`new value\`,onChange:e=>l(n=>n.map((n,r)=>r===t?e.target.value:n))}),t>=m&&(0,z.jsx)(V,{variant:\`ghost\`,size:\`iconXs\`,title:\`Remove\`,onClick:()=>l(e=>e.filter((e,n)=>n!==t)),children:(0,z.jsx)(At,{size:12,className:\`text-muted-foreground\`})})]},t))}),(0,z.jsxs)(V,{variant:\`outline\`,size:\`xs\`,className:\`mt-2\`,onClick:()=>l(e=>[...e,\`\`]),children:[(0,z.jsx)(mt,{size:12}),\` Add value\`]})]})]})})}function pg(){let[e]=Kh(),[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(\`\`),[a,o]=(0,_.useState)(\`\`),[s,c]=(0,_.useState)(\`\`),[l,u]=(0,_.useState)(null),[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)(null),h=(0,_.useCallback)(()=>{N.functions(e).then(e=>n(e),()=>n([]))},[e]);(0,_.useEffect)(()=>{h();let e=setInterval(()=>void h(),5e3);return()=>clearInterval(e)},[h]);let g=(0,_.useMemo)(()=>[...new Set((t??[]).map(e=>e.returns))].sort(),[t]);async function v(t){let n=await N.sql(\`drop function \${$h(e)}.\${$h(t.name)}(\${t.args??\`\`})\`);if(!n.ok){H.error(n.error??\`Drop failed\`);return}H.success(\`Dropped function \${t.name}\`),h()}if(t===null)return(0,z.jsx)(Jp,{});let y=t.filter(e=>e.name.toLowerCase().includes(r.toLowerCase())&&(!a||e.returns===a)&&(!s||s===\`definer\`==!!e.security_definer));return(0,z.jsxs)(\`div\`,{className:\`flex h-full flex-col\`,children:[(0,z.jsx)(Qh,{title:\`Functions\`,description:\`User-defined functions in the selected schema — usable from SQL, triggers, and RPC.\`,search:r,onSearch:i,onRefresh:h,schemaPicker:!0,filters:(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Wp,{className:\`w-36 shrink-0\`,value:a,onValueChange:o,placeholder:\`Return type\`,options:[{value:\`\`,label:\`All return types\`},...g.map(e=>({value:e}))]}),(0,z.jsx)(Wp,{className:\`w-32 shrink-0\`,value:s,onValueChange:c,placeholder:\`Security\`,options:[{value:\`\`,label:\`All security\`},{value:\`definer\`,label:\`Definer\`},{value:\`invoker\`,label:\`Invoker\`}]})]}),actions:(0,z.jsxs)(V,{size:\`xs\`,onClick:()=>f(!0),children:[(0,z.jsx)(mt,{size:12}),\` New function\`]})}),(0,z.jsxs)(\`div\`,{className:\`min-h-0 flex-1 overflow-auto\`,children:[(0,z.jsxs)(Xp,{children:[(0,z.jsx)(Zp,{children:(0,z.jsxs)(\`tr\`,{children:[(0,z.jsx)(Z,{children:\`Name\`}),(0,z.jsx)(Z,{children:\`Arguments\`}),(0,z.jsx)(Z,{children:\`Returns\`}),(0,z.jsx)(Z,{children:\`Language\`}),(0,z.jsx)(Z,{children:\`Security\`}),(0,z.jsx)(Z,{className:\`w-20\`})]})}),(0,z.jsx)(\`tbody\`,{children:y.map(e=>(0,z.jsxs)(Qp,{children:[(0,z.jsx)(Q,{className:\`font-mono text-foreground/90\`,children:e.name}),(0,z.jsx)(Q,{className:\`max-w-70 truncate font-mono text-[11px] text-muted-foreground/80\`,children:e.args||\`—\`}),(0,z.jsx)(Q,{className:\`font-mono text-muted-foreground\`,children:e.returns}),(0,z.jsx)(Q,{className:\`text-muted-foreground\`,children:e.language}),(0,z.jsx)(Q,{children:e.security_definer?(0,z.jsx)(B,{variant:\`amber\`,children:\`definer\`}):(0,z.jsx)(B,{variant:\`neutral\`,children:\`invoker\`})}),(0,z.jsx)(Q,{children:(0,z.jsxs)(\`div\`,{className:\`flex justify-end gap-0.5 opacity-0 group-hover:opacity-100\`,children:[(0,z.jsx)(\`button\`,{className:\`p-1 text-muted-foreground/80 hover:text-foreground\`,title:\`View source\`,onClick:()=>u(e),children:(0,z.jsx)(Ae,{size:13})}),(0,z.jsx)(\`button\`,{className:\`p-1 text-muted-foreground/80 hover:text-destructive\`,title:\`Drop\`,onClick:()=>m(e),children:(0,z.jsx)(At,{size:13})})]})})]},e.name+e.args))})]}),y.length===0&&(0,z.jsx)(cf,{children:t.length===0?\`No user functions yet.\`:\`No match.\`})]}),l&&(0,z.jsx)(qp,{open:!0,onClose:()=>u(null),width:\`w-[640px]\`,title:(0,z.jsxs)(\`span\`,{children:[\`Source of \`,(0,z.jsx)(\`code\`,{className:\`rounded bg-accent px-1.5 py-0.5 font-mono text-xs text-foreground\`,children:l.name})]}),footer:(0,z.jsx)(Kp,{asChild:!0,children:(0,z.jsx)(V,{variant:\`outline\`,className:\`ml-auto\`,children:\`Done\`})}),children:(0,z.jsx)(nr,{value:l.body?.trim()??\`-- source unavailable\`,lang:\`sql\`,readOnly:!0,gutter:!0,minLines:6,maxLines:400})}),d&&(0,z.jsx)(_g,{schema:e,onDone:()=>{f(!1),h()},onClose:()=>f(!1)}),p&&(0,z.jsx)(q,{open:!0,danger:!0,title:\`Drop function "\${p.name}"?\`,description:\`Triggers and RPC calls that use it will fail. This cannot be undone.\`,confirmLabel:\`Drop function\`,onConfirm:()=>void v(p),onClose:()=>m(null)})]})}var mg=[\`void\`,\`trigger\`,\`text\`,\`int4\`,\`int8\`,\`numeric\`,\`bool\`,\`uuid\`,\`jsonb\`,\`timestamptz\`,\`record\`],hg=[\`text\`,\`int4\`,\`int8\`,\`numeric\`,\`bool\`,\`uuid\`,\`jsonb\`,\`timestamptz\`,\`date\`],gg={plpgsql:\`begin
|
|
1516
|
+
where n.nspname = \${tg(e)}
|
|
1517
|
+
group by t.typname, t.oid order by t.typname\`);if(!t.ok){i(t.error??\`Query failed\`),n(e=>e??[]);return}i(null),n((t.rows??[]).map(e=>({...e,values:zt(e.values)})))},[e]);(0,_.useEffect)(()=>{p();let e=setInterval(()=>void p(),5e3);return()=>clearInterval(e)},[p]);async function m(t){let n=await N.sql(\`drop type \${Yh(e,t.name)}\`);if(!n.ok){H.error(n.error??\`Drop failed — is the type still used by a column?\`);return}H.success(\`Dropped type \${t.name}\`),await p()}if(t===null)return(0,z.jsx)(Jp,{});let h=t.filter(e=>e.name.toLowerCase().includes(a.toLowerCase()));return(0,z.jsxs)(\`div\`,{className:\`flex h-full flex-col\`,children:[(0,z.jsx)($h,{title:\`Enumerated Types\`,description:\`Custom enum types — columns using them render as dropdowns in the table editor.\`,search:a,onSearch:o,onRefresh:()=>void p(),schemaPicker:!0,actions:(0,z.jsxs)(V,{size:\`xs\`,onClick:()=>c(!0),children:[(0,z.jsx)(mt,{size:12}),\` New type\`]})}),r&&(0,z.jsx)(ff,{message:r}),(0,z.jsxs)(\`div\`,{className:\`min-h-0 flex-1 space-y-3 overflow-y-auto p-6\`,children:[h.map(e=>(0,z.jsxs)(\`div\`,{className:\`rounded-md border border-border bg-card p-4\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-2\`,children:[(0,z.jsx)(\`span\`,{className:\`font-mono text-[13px] text-foreground\`,children:e.name}),(0,z.jsxs)(\`span\`,{className:\`text-[11px] text-muted-foreground/60\`,children:[e.values.length,\` values\`]}),e.comment&&(0,z.jsxs)(\`span\`,{className:\`truncate text-[11px] text-muted-foreground/60\`,title:e.comment,children:[\`— \`,e.comment]}),(0,z.jsxs)(\`div\`,{className:\`ml-auto flex gap-0.5\`,children:[(0,z.jsx)(V,{variant:\`ghost\`,size:\`iconXs\`,title:\`Edit type\`,onClick:()=>u(e),children:(0,z.jsx)(lt,{size:12})}),(0,z.jsx)(V,{variant:\`ghost\`,size:\`iconXs\`,title:\`Drop type\`,onClick:()=>f(e),children:(0,z.jsx)(At,{size:12,className:\`text-muted-foreground hover:text-destructive\`})})]})]}),(0,z.jsx)(\`div\`,{className:\`mt-2 flex flex-wrap gap-1.5\`,children:e.values.map(e=>(0,z.jsx)(B,{variant:\`outline\`,className:\`font-mono\`,children:e},e))})]},e.name)),h.length===0&&(0,z.jsx)(lf,{children:t.length===0?\`No enum types yet.\`:\`No match.\`})]}),s&&(0,z.jsx)(pg,{schema:e,onClose:()=>c(!1),onDone:async()=>{c(!1),await p()}}),l&&(0,z.jsx)(pg,{schema:e,existing:l,onClose:()=>u(null),onDone:async()=>{u(null),await p()}}),d&&(0,z.jsx)(q,{open:!0,danger:!0,title:\`Drop type "\${d.name}"?\`,description:\`Fails if any column still uses the type. This cannot be undone.\`,confirmLabel:\`Drop type\`,onConfirm:()=>void m(d),onClose:()=>f(null)})]})}function pg({schema:e,existing:t,onClose:n,onDone:r}){let[i,a]=(0,_.useState)(t?.name??\`\`),[o,s]=(0,_.useState)(t?.comment??\`\`),[c,l]=(0,_.useState)(t?[...t.values]:[\`\`]),[u,d]=(0,_.useState)(!1),[f,p]=(0,_.useState)(\`\`),m=t?.values.length??0;async function h(e){let t=await N.sql(e);return t.ok?!0:(p(t.error??\`Statement failed\`),d(!1),!1)}async function g(){let n=c.map(e=>e.trim()),a=i.trim();if(!a)return p(\`Name is required.\`);if(n.some((e,t)=>!e&&t<m))return p(\`Existing values cannot be blank.\`);let s=n.filter(Boolean);if(s.length===0)return p(\`At least one value is required.\`);if(new Set(s).size!==s.length)return p(\`Values must be unique.\`);if(d(!0),p(\`\`),!t){if(!await h(\`create type \${Yh(e,a)} as enum (\${s.map(tg).join(\`, \`)})\`)||o.trim()&&!await h(\`comment on type \${Yh(e,a)} is \${tg(o.trim())}\`))return;H.success(\`Created type \${a}\`),await r();return}let l=t.name;for(let r=0;r<m;r++)if(n[r]!==t.values[r]&&!await h(\`alter type \${Yh(e,l)} rename value \${tg(t.values[r])} to \${tg(n[r])}\`))return;if(a!==t.name){if(!await h(\`alter type \${Yh(e,l)} rename to \${eg(a)}\`))return;l=a}for(let t of n.slice(m).filter(Boolean))if(!await h(\`alter type \${Yh(e,l)} add value if not exists \${tg(t)}\`))return;if((o.trim()||null)!==(t.comment??null)){let t=o.trim()?tg(o.trim()):\`null\`;if(!await h(\`comment on type \${Yh(e,l)} is \${t}\`))return}H.success(\`Updated type \${l}\`),await r()}return(0,z.jsx)(qp,{open:!0,onClose:n,width:\`w-135\`,title:t?\`Edit type "\${t.name}"\`:\`Create a new enumerated type\`,footer:(0,z.jsxs)(z.Fragment,{children:[f&&(0,z.jsx)(\`p\`,{className:\`min-w-0 truncate text-xs text-destructive\`,children:f}),(0,z.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-2\`,children:[(0,z.jsx)(Kp,{asChild:!0,children:(0,z.jsx)(V,{variant:\`outline\`,children:\`Cancel\`})}),(0,z.jsx)(V,{onClick:()=>void g(),disabled:u,children:u?\`Saving…\`:t?\`Save changes\`:\`Create type\`})]})]}),children:(0,z.jsxs)(\`div\`,{className:\`space-y-3\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Name\`}),(0,z.jsx)(Y,{mono:!0,value:i,autoFocus:!t,placeholder:\`order_status\`,onChange:e=>a(e.target.value)})]}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsxs)(X,{children:[\`Description \`,(0,z.jsx)(\`span\`,{className:\`font-normal text-muted-foreground/60\`,children:\`— optional\`})]}),(0,z.jsx)(Y,{value:o,onChange:e=>s(e.target.value)})]}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Values\`}),(0,z.jsxs)(\`div\`,{className:\`mb-2 flex items-start gap-2.5 rounded-md border border-border bg-card px-3 py-2.5 text-[11px] leading-relaxed text-muted-foreground\`,children:[(0,z.jsx)(_e,{size:13,className:\`mt-px shrink-0\`}),(0,z.jsx)(\`span\`,{children:t?\`Existing values can be renamed but never deleted or re-ordered — that requires dropping and recreating the type.\`:\`After creation, values cannot be deleted or sorted — only renamed or appended.\`})]}),(0,z.jsx)(\`div\`,{className:\`space-y-1.5\`,children:c.map((e,t)=>(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-1.5\`,children:[(0,z.jsx)(Y,{mono:!0,value:e,placeholder:t<m?void 0:\`new value\`,onChange:e=>l(n=>n.map((n,r)=>r===t?e.target.value:n))}),t>=m&&(0,z.jsx)(V,{variant:\`ghost\`,size:\`iconXs\`,title:\`Remove\`,onClick:()=>l(e=>e.filter((e,n)=>n!==t)),children:(0,z.jsx)(At,{size:12,className:\`text-muted-foreground\`})})]},t))}),(0,z.jsxs)(V,{variant:\`outline\`,size:\`xs\`,className:\`mt-2\`,onClick:()=>l(e=>[...e,\`\`]),children:[(0,z.jsx)(mt,{size:12}),\` Add value\`]})]})]})})}function mg(){let[e]=qh(),[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(\`\`),[a,o]=(0,_.useState)(\`\`),[s,c]=(0,_.useState)(\`\`),[l,u]=(0,_.useState)(null),[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)(null),h=(0,_.useCallback)(()=>{N.functions(e).then(e=>n(e),()=>n([]))},[e]);(0,_.useEffect)(()=>{h();let e=setInterval(()=>void h(),5e3);return()=>clearInterval(e)},[h]);let g=(0,_.useMemo)(()=>[...new Set((t??[]).map(e=>e.returns))].sort(),[t]);async function v(t){let n=await N.sql(\`drop function \${eg(e)}.\${eg(t.name)}(\${t.args??\`\`})\`);if(!n.ok){H.error(n.error??\`Drop failed\`);return}H.success(\`Dropped function \${t.name}\`),h()}if(t===null)return(0,z.jsx)(Jp,{});let y=t.filter(e=>e.name.toLowerCase().includes(r.toLowerCase())&&(!a||e.returns===a)&&(!s||s===\`definer\`==!!e.security_definer));return(0,z.jsxs)(\`div\`,{className:\`flex h-full flex-col\`,children:[(0,z.jsx)($h,{title:\`Functions\`,description:\`User-defined functions in the selected schema — usable from SQL, triggers, and RPC.\`,search:r,onSearch:i,onRefresh:h,schemaPicker:!0,filters:(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Wp,{className:\`w-36 shrink-0\`,value:a,onValueChange:o,placeholder:\`Return type\`,options:[{value:\`\`,label:\`All return types\`},...g.map(e=>({value:e}))]}),(0,z.jsx)(Wp,{className:\`w-32 shrink-0\`,value:s,onValueChange:c,placeholder:\`Security\`,options:[{value:\`\`,label:\`All security\`},{value:\`definer\`,label:\`Definer\`},{value:\`invoker\`,label:\`Invoker\`}]})]}),actions:(0,z.jsxs)(V,{size:\`xs\`,onClick:()=>f(!0),children:[(0,z.jsx)(mt,{size:12}),\` New function\`]})}),(0,z.jsxs)(\`div\`,{className:\`min-h-0 flex-1 overflow-auto\`,children:[(0,z.jsxs)(Xp,{children:[(0,z.jsx)(Zp,{children:(0,z.jsxs)(\`tr\`,{children:[(0,z.jsx)(Z,{children:\`Name\`}),(0,z.jsx)(Z,{children:\`Arguments\`}),(0,z.jsx)(Z,{children:\`Returns\`}),(0,z.jsx)(Z,{children:\`Language\`}),(0,z.jsx)(Z,{children:\`Security\`}),(0,z.jsx)(Z,{className:\`w-20\`})]})}),(0,z.jsx)(\`tbody\`,{children:y.map(e=>(0,z.jsxs)(Qp,{children:[(0,z.jsx)(Q,{className:\`font-mono text-foreground/90\`,children:e.name}),(0,z.jsx)(Q,{className:\`max-w-70 truncate font-mono text-[11px] text-muted-foreground/80\`,children:e.args||\`—\`}),(0,z.jsx)(Q,{className:\`font-mono text-muted-foreground\`,children:e.returns}),(0,z.jsx)(Q,{className:\`text-muted-foreground\`,children:e.language}),(0,z.jsx)(Q,{children:e.security_definer?(0,z.jsx)(B,{variant:\`amber\`,children:\`definer\`}):(0,z.jsx)(B,{variant:\`neutral\`,children:\`invoker\`})}),(0,z.jsx)(Q,{children:(0,z.jsxs)(\`div\`,{className:\`flex justify-end gap-0.5 opacity-0 group-hover:opacity-100\`,children:[(0,z.jsx)(\`button\`,{className:\`p-1 text-muted-foreground/80 hover:text-foreground\`,title:\`View source\`,onClick:()=>u(e),children:(0,z.jsx)(Ae,{size:13})}),(0,z.jsx)(\`button\`,{className:\`p-1 text-muted-foreground/80 hover:text-destructive\`,title:\`Drop\`,onClick:()=>m(e),children:(0,z.jsx)(At,{size:13})})]})})]},e.name+e.args))})]}),y.length===0&&(0,z.jsx)(lf,{children:t.length===0?\`No user functions yet.\`:\`No match.\`})]}),l&&(0,z.jsx)(qp,{open:!0,onClose:()=>u(null),width:\`w-[640px]\`,title:(0,z.jsxs)(\`span\`,{children:[\`Source of \`,(0,z.jsx)(\`code\`,{className:\`rounded bg-accent px-1.5 py-0.5 font-mono text-xs text-foreground\`,children:l.name})]}),footer:(0,z.jsx)(Kp,{asChild:!0,children:(0,z.jsx)(V,{variant:\`outline\`,className:\`ml-auto\`,children:\`Done\`})}),children:(0,z.jsx)(nr,{value:l.body?.trim()??\`-- source unavailable\`,lang:\`sql\`,readOnly:!0,gutter:!0,minLines:6,maxLines:400})}),d&&(0,z.jsx)(vg,{schema:e,onDone:()=>{f(!1),h()},onClose:()=>f(!1)}),p&&(0,z.jsx)(q,{open:!0,danger:!0,title:\`Drop function "\${p.name}"?\`,description:\`Triggers and RPC calls that use it will fail. This cannot be undone.\`,confirmLabel:\`Drop function\`,onConfirm:()=>void v(p),onClose:()=>m(null)})]})}var hg=[\`void\`,\`trigger\`,\`text\`,\`int4\`,\`int8\`,\`numeric\`,\`bool\`,\`uuid\`,\`jsonb\`,\`timestamptz\`,\`record\`],gg=[\`text\`,\`int4\`,\`int8\`,\`numeric\`,\`bool\`,\`uuid\`,\`jsonb\`,\`timestamptz\`,\`date\`],_g={plpgsql:\`begin
|
|
1518
1518
|
|
|
1519
|
-
end;\`,sql:\`select 1;\`};function
|
|
1519
|
+
end;\`,sql:\`select 1;\`};function vg({schema:e,onDone:t,onClose:n}){let[r,i]=(0,_.useState)(\`\`),[a,o]=(0,_.useState)([]),[s,c]=(0,_.useState)(\`void\`),[l,u]=(0,_.useState)(\`plpgsql\`),[d,f]=(0,_.useState)(_g.plpgsql),[p,m]=(0,_.useState)(!1),[h,g]=(0,_.useState)(!1),[v,y]=(0,_.useState)(\`\`),[b,x]=(0,_.useState)(!1),S=e=>\`"\`+e.replace(/"/g,\`""\`)+\`"\`,C=a.filter(e=>e.name.trim()).map(e=>\`\${S(e.name.trim())} \${e.type}\`).join(\`, \`),w=\`create or replace function \${S(e)}.\${S(r.trim()||\`my_function\`)}(\${C})
|
|
1520
1520
|
returns \${s}
|
|
1521
1521
|
language \${l}\${p?\`
|
|
1522
1522
|
security definer\`:\`\`}
|
|
1523
1523
|
as $$
|
|
1524
1524
|
\${d}
|
|
1525
|
-
$$;\`;async function T(){if(!r.trim())return y(\`Function name is required.\`);x(!0),y(\`\`);let e=await N.sql(w);if(!e.ok){y(e.error??\`Create failed\`),x(!1);return}H.success(\`Created function \${r.trim()}\`),t()}return(0,z.jsx)(qp,{open:!0,onClose:n,width:\`w-160\`,title:\`Add a new function\`,footer:(0,z.jsxs)(z.Fragment,{children:[v&&(0,z.jsx)(\`p\`,{className:\`min-w-0 truncate text-xs text-destructive\`,children:v}),(0,z.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-2\`,children:[(0,z.jsx)(Kp,{asChild:!0,children:(0,z.jsx)(V,{variant:\`outline\`,children:\`Cancel\`})}),(0,z.jsx)(V,{onClick:()=>void T(),disabled:b||!r.trim(),children:b?\`Creating…\`:\`Create function\`})]})]}),children:(0,z.jsxs)(\`div\`,{className:\`space-y-3\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Schema\`}),(0,z.jsx)(\`div\`,{className:\`flex h-8 items-center rounded-md border border-border bg-card px-2.5 font-mono text-[13px] text-muted-foreground\`,children:e})]}),(0,z.jsxs)(\`div\`,{className:\`grid grid-cols-2 gap-3\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Name of function\`}),(0,z.jsx)(
|
|
1525
|
+
$$;\`;async function T(){if(!r.trim())return y(\`Function name is required.\`);x(!0),y(\`\`);let e=await N.sql(w);if(!e.ok){y(e.error??\`Create failed\`),x(!1);return}H.success(\`Created function \${r.trim()}\`),t()}return(0,z.jsx)(qp,{open:!0,onClose:n,width:\`w-160\`,title:\`Add a new function\`,footer:(0,z.jsxs)(z.Fragment,{children:[v&&(0,z.jsx)(\`p\`,{className:\`min-w-0 truncate text-xs text-destructive\`,children:v}),(0,z.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-2\`,children:[(0,z.jsx)(Kp,{asChild:!0,children:(0,z.jsx)(V,{variant:\`outline\`,children:\`Cancel\`})}),(0,z.jsx)(V,{onClick:()=>void T(),disabled:b||!r.trim(),children:b?\`Creating…\`:\`Create function\`})]})]}),children:(0,z.jsxs)(\`div\`,{className:\`space-y-3\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Schema\`}),(0,z.jsx)(\`div\`,{className:\`flex h-8 items-center rounded-md border border-border bg-card px-2.5 font-mono text-[13px] text-muted-foreground\`,children:e})]}),(0,z.jsxs)(\`div\`,{className:\`grid grid-cols-2 gap-3\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Name of function\`}),(0,z.jsx)(Y,{mono:!0,value:r,autoFocus:!0,placeholder:\`my_function\`,onChange:e=>i(e.target.value.replace(/\\s/g,\`_\`))})]}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Return type\`}),(0,z.jsx)(Wp,{mono:!0,value:s,onValueChange:c,options:hg.map(e=>({value:e}))})]})]}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsxs)(X,{children:[\`Arguments \`,(0,z.jsx)(\`span\`,{className:\`font-normal text-muted-foreground/60\`,children:\`— referenced in the body by name\`})]}),(0,z.jsx)(\`div\`,{className:\`space-y-1.5\`,children:a.map((e,t)=>(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-1.5\`,children:[(0,z.jsx)(Y,{mono:!0,value:e.name,placeholder:\`arg_name\`,onChange:e=>o(n=>n.map((n,r)=>r===t?{...n,name:e.target.value}:n))}),(0,z.jsx)(Wp,{mono:!0,className:\`w-36 shrink-0\`,value:e.type,onValueChange:e=>o(n=>n.map((n,r)=>r===t?{...n,type:e}:n)),options:gg.map(e=>({value:e}))}),(0,z.jsx)(V,{variant:\`ghost\`,size:\`iconXs\`,title:\`Remove\`,onClick:()=>o(e=>e.filter((e,n)=>n!==t)),children:(0,z.jsx)(At,{size:12,className:\`text-muted-foreground\`})})]},t))}),(0,z.jsxs)(V,{variant:\`outline\`,size:\`xs\`,className:\`mt-1.5\`,onClick:()=>o(e=>[...e,{name:\`\`,type:\`text\`}]),children:[(0,z.jsx)(mt,{size:12}),\` Add a new argument\`]})]}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsxs)(X,{children:[\`Definition \`,(0,z.jsxs)(\`span\`,{className:\`font-normal text-muted-foreground/60\`,children:[\`— written in \`,l]})]}),(0,z.jsx)(ir,{lang:\`sql\`,className:\`h-44\`,value:d,onChange:f,onCmdEnter:()=>void T()})]}),(0,z.jsxs)(\`button\`,{className:\`flex w-full items-center justify-between rounded-md border border-border bg-card px-3 py-2.5 text-left text-[13px] text-foreground/85 transition-colors hover:border-muted-foreground/60\`,onClick:()=>g(e=>!e),children:[\`Show advanced settings\`,(0,z.jsx)(Yp,{checked:h,onChange:()=>g(e=>!e)})]}),h&&(0,z.jsxs)(\`div\`,{className:\`space-y-3 rounded-md border border-border bg-card p-3\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Language\`}),(0,z.jsx)(Wp,{mono:!0,value:l,onValueChange:e=>{u(e),f(t=>Object.values(_g).includes(t)?_g[e]:t)},options:[{value:\`plpgsql\`},{value:\`sql\`}]})]}),(0,z.jsxs)(\`label\`,{className:\`flex items-center gap-3 text-[13px] text-foreground/85\`,children:[(0,z.jsx)(Yp,{checked:p,onChange:m}),(0,z.jsxs)(\`span\`,{children:[\`SECURITY DEFINER \`,(0,z.jsx)(\`span\`,{className:\`text-[11px] text-muted-foreground/60\`,children:\`— runs with the owner's privileges (bypasses caller RLS)\`})]})]})]}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Preview of SQL statement\`}),(0,z.jsx)(nr,{value:w,lang:\`sql\`,readOnly:!0,minLines:4,maxLines:10})]})]})})}function yg(){let[e]=qh(),[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(\`\`),[s,c]=(0,_.useState)(!1),[l,u]=(0,_.useState)(null),d=(0,_.useCallback)(async()=>{let t=await N.sql(\`select i.indexname as name, i.tablename as "table", i.indexdef as def,
|
|
1526
1526
|
exists (select 1 from pg_constraint c where c.conname = i.indexname) as constraint
|
|
1527
|
-
from pg_indexes i where i.schemaname = \${
|
|
1527
|
+
from pg_indexes i where i.schemaname = \${tg(e)} order by i.tablename, i.indexname\`);if(!t.ok){i(t.error??\`Query failed\`),n(e=>e??[]);return}i(null),n(t.rows??[])},[e]);(0,_.useEffect)(()=>{d();let e=setInterval(()=>void d(),5e3);return()=>clearInterval(e)},[d]);async function f(t){let n=await N.sql(\`drop index \${eg(e)}.\${eg(t.name)}\`);if(!n.ok){H.error(n.error??\`Drop failed\`);return}H.success(\`Dropped index \${t.name}\`),await d()}if(t===null)return(0,z.jsx)(Jp,{});let p=t.filter(e=>(e.name+e.table).toLowerCase().includes(a.toLowerCase()));return(0,z.jsxs)(\`div\`,{className:\`flex h-full flex-col\`,children:[(0,z.jsx)($h,{title:\`Indexes\`,description:\`Every index in the selected schema, including constraint-backed ones (locked).\`,search:a,onSearch:o,onRefresh:()=>void d(),schemaPicker:!0,actions:(0,z.jsxs)(V,{size:\`xs\`,onClick:()=>c(!0),children:[(0,z.jsx)(mt,{size:12}),\` New index\`]})}),r&&(0,z.jsx)(ff,{message:r}),(0,z.jsxs)(\`div\`,{className:\`min-h-0 flex-1 overflow-auto\`,children:[(0,z.jsxs)(Xp,{children:[(0,z.jsx)(Zp,{children:(0,z.jsxs)(\`tr\`,{children:[(0,z.jsx)(Z,{children:\`Name\`}),(0,z.jsx)(Z,{children:\`Table\`}),(0,z.jsx)(Z,{children:\`Definition\`}),(0,z.jsx)(Z,{className:\`w-12\`})]})}),(0,z.jsx)(\`tbody\`,{children:p.map(e=>(0,z.jsxs)(Qp,{children:[(0,z.jsx)(Q,{className:\`font-mono text-foreground/90\`,children:e.name}),(0,z.jsx)(Q,{className:\`font-mono text-muted-foreground\`,children:e.table}),(0,z.jsx)(Q,{className:\`max-w-120 truncate font-mono text-[11px]\`,title:e.def,children:(0,z.jsx)(\`span\`,{className:\`text-muted-foreground/80\`,children:e.def})}),(0,z.jsx)(Q,{children:!e.constraint&&(0,z.jsx)(\`button\`,{className:\`p-1 text-muted-foreground/80 opacity-0 hover:text-destructive group-hover:opacity-100\`,title:\`Drop index\`,onClick:()=>u(e),children:(0,z.jsx)(At,{size:13})})})]},e.name))})]}),p.length===0&&(0,z.jsx)(lf,{children:t.length===0?\`No indexes.\`:\`No match.\`})]}),s&&(0,z.jsx)(xg,{schema:e,onClose:()=>c(!1),onDone:async()=>{c(!1),await d()}}),l&&(0,z.jsx)(q,{open:!0,danger:!0,title:\`Drop index "\${l.name}"?\`,description:\`Queries relying on it may slow down. This cannot be undone.\`,confirmLabel:\`Drop index\`,onConfirm:()=>void f(l),onClose:()=>u(null)})]})}var bg=[\`btree\`,\`hash\`,\`gin\`,\`gist\`,\`brin\`];function xg({schema:e,onClose:t,onDone:n}){let[r,i]=(0,_.useState)([]),[a,o]=(0,_.useState)(\`\`),[s,c]=(0,_.useState)([]),[l,u]=(0,_.useState)(\`btree\`),[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)(\`\`);(0,_.useEffect)(()=>{N.tables(e).then(e=>{let t=e.filter(e=>!e.isView).map(e=>({name:e.name,columns:e.columns.map(e=>e.name)}));i(t),o(e=>e||(t[0]?.name??\`\`))},()=>{})},[e]);let h=r.find(e=>e.name===a)?.columns??[],g=e=>\`"\`+e.replace(/"/g,\`""\`)+\`"\`,v=a&&s.length>0?\`create index on \${g(e)}.\${g(a)} using \${l} (\${s.map(g).join(\`, \`)});\`:\`-- pick a table and at least one column\`;function y(e){c(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])}async function b(){f(!0),m(\`\`);let e=await N.sql(v);if(!e.ok){m(e.error??\`Create failed\`),f(!1);return}H.success(\`Index created on \${a}\`),await n()}return(0,z.jsx)(qp,{open:!0,onClose:t,width:\`w-140\`,title:\`Create new index\`,footer:(0,z.jsxs)(z.Fragment,{children:[p&&(0,z.jsx)(\`p\`,{className:\`min-w-0 truncate text-xs text-destructive\`,children:p}),(0,z.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-2\`,children:[(0,z.jsx)(Kp,{asChild:!0,children:(0,z.jsx)(V,{variant:\`outline\`,children:\`Cancel\`})}),(0,z.jsx)(V,{onClick:()=>void b(),disabled:d||!a||s.length===0,children:d?\`Creating…\`:\`Create index\`})]})]}),children:(0,z.jsxs)(\`div\`,{className:\`space-y-3\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Schema\`}),(0,z.jsx)(\`div\`,{className:\`flex h-8 items-center rounded-md border border-border bg-card px-2.5 font-mono text-[13px] text-muted-foreground\`,children:e})]}),(0,z.jsxs)(\`div\`,{className:\`grid grid-cols-2 gap-3\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Table\`}),(0,z.jsx)(Wp,{mono:!0,value:a,onValueChange:e=>{o(e),c([])},placeholder:\`Pick a table…\`,options:r.map(e=>({value:e.name}))})]}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Index type\`}),(0,z.jsx)(Wp,{mono:!0,value:l,onValueChange:u,options:bg.map(e=>({value:e}))})]})]}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Columns — click to add; order matters for btree\`}),(0,z.jsxs)(\`div\`,{className:\`flex flex-wrap gap-1.5 rounded-md border border-input bg-field p-2\`,children:[h.map(e=>{let t=s.indexOf(e);return(0,z.jsxs)(\`button\`,{onClick:()=>y(e),className:\`flex items-center gap-1 rounded border px-2 py-1 font-mono text-xs transition-colors \`+(t>=0?\`border-brand/50 bg-brand/15 text-brand\`:\`border-input text-muted-foreground hover:border-muted-foreground hover:text-foreground\`),children:[t>=0&&(0,z.jsxs)(\`span\`,{className:\`tabular-nums\`,children:[t+1,\`.\`]}),e]},e)}),h.length===0&&(0,z.jsx)(\`span\`,{className:\`px-1 py-0.5 text-xs text-muted-foreground/60\`,children:\`No table selected.\`})]})]}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Preview of SQL statement\`}),(0,z.jsx)(nr,{value:v,lang:\`sql\`,readOnly:!0,minLines:2,maxLines:6})]})]})})}function Sg(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(null),i=(0,_.useCallback)(async()=>{let e=await N.sql(\`select * from supabase_migrations.schema_migrations order by version\`);e.ok?t(e.rows??[]):N.migrations().then(e=>t(e),()=>t([]))},[]);if((0,_.useEffect)(()=>{i()},[i]),e===null)return(0,z.jsx)(Jp,{});let a=e=>Array.isArray(e.statements)?e.statements.join(\`
|
|
1528
1528
|
|
|
1529
|
-
\`):typeof e.statements==\`string\`&&e.statements.trim()?e.statements:null;return(0,z.jsxs)(\`div\`,{className:\`flex h-full flex-col\`,children:[(0,z.jsx)(Qh,{title:\`Migrations\`,description:\`Applied migrations from supabase/migrations/*.sql — the same ledger the Supabase CLI uses.\`,onRefresh:()=>void i()}),(0,z.jsxs)(\`div\`,{className:\`min-h-0 flex-1 overflow-auto\`,children:[(0,z.jsxs)(Xp,{children:[(0,z.jsx)(Zp,{children:(0,z.jsxs)(\`tr\`,{children:[(0,z.jsx)(Z,{children:\`Version\`}),(0,z.jsx)(Z,{children:\`Name\`}),(0,z.jsx)(Z,{children:\`Applied\`}),(0,z.jsx)(Z,{className:\`w-12\`})]})}),(0,z.jsx)(\`tbody\`,{children:e.map(e=>(0,z.jsxs)(Qp,{children:[(0,z.jsx)(Q,{className:\`font-mono text-muted-foreground\`,children:e.version}),(0,z.jsx)(Q,{className:\`font-mono text-foreground/90\`,children:e.name||\`—\`}),(0,z.jsx)(Q,{className:\`text-muted-foreground\`,children:(0,z.jsx)(qm,{value:e.applied_at})}),(0,z.jsx)(Q,{children:a(e)&&(0,z.jsx)(\`button\`,{className:\`p-1 text-muted-foreground/80 opacity-0 hover:text-foreground group-hover:opacity-100\`,title:\`View SQL\`,onClick:()=>r(e),children:(0,z.jsx)(Ae,{size:13})})})]},e.version))})]}),e.length===0&&(0,z.jsxs)(cf,{children:[\`No migrations applied. Add SQL files under \`,(0,z.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`supabase/migrations/\`}),\` and restart.\`]})]}),n&&(0,z.jsx)(qp,{open:!0,onClose:()=>r(null),width:\`w-[640px]\`,title:(0,z.jsxs)(\`span\`,{children:[\`Migration \`,(0,z.jsx)(\`code\`,{className:\`rounded bg-accent px-1.5 py-0.5 font-mono text-xs text-foreground\`,children:n.name??n.version})]}),footer:(0,z.jsx)(Kp,{asChild:!0,children:(0,z.jsx)(V,{variant:\`outline\`,className:\`ml-auto\`,children:\`Done\`})}),children:(0,z.jsx)(nr,{value:a(n)??\`-- SQL not recorded for this migration\`,lang:\`sql\`,readOnly:!0,gutter:!0,minLines:6,maxLines:500})})]})}var Sg=[\`SELECT\`,\`INSERT\`,\`UPDATE\`,\`DELETE\`,\`ALL\`],Cg=e=>e!==\`INSERT\`,wg=e=>e===\`INSERT\`||e===\`UPDATE\`||e===\`ALL\`,Tg={SELECT:\`brand\`,INSERT:\`amber\`,UPDATE:\`blue\`,DELETE:\`red\`,ALL:\`neutral\`},Eg=[{title:\`Enable read access for all users\`,description:\`This policy gives read access to your table for all users via the SELECT operation.\`,command:\`SELECT\`,roles:[],using:\`true\`},{title:\`Enable insert for authenticated users only\`,description:\`This policy gives insert access to your table for all authenticated users only.\`,command:\`INSERT\`,roles:[\`authenticated\`],check:\`true\`},{title:\`Enable delete for users based on user_id\`,description:\`This policy assumes that your table has a column "user_id", and allows users to delete rows which the "user_id" column matches their ID.\`,command:\`DELETE\`,roles:[],using:\`(select auth.uid()) = user_id\`},{title:\`Enable insert for users based on user_id\`,description:\`This policy assumes that your table has a column "user_id", and allows users to insert rows which the "user_id" column matches their ID.\`,command:\`INSERT\`,roles:[],check:\`(select auth.uid()) = user_id\`},{title:\`Enable users to view their own data only\`,description:\`Restrict users to reading only their own data, matching "user_id" against their ID.\`,command:\`SELECT\`,roles:[\`authenticated\`],using:\`(select auth.uid()) = user_id\`},{title:\`Policy with table joins\`,description:(0,z.jsxs)(z.Fragment,{children:[\`Query across tables to build more advanced RLS rules. Assuming 2 tables called\`,\` \`,(0,z.jsx)(\`code\`,{className:\`rounded bg-accent px-1 text-[11px]\`,children:\`teams\`}),\` and\`,\` \`,(0,z.jsx)(\`code\`,{className:\`rounded bg-accent px-1 text-[11px]\`,children:\`members\`}),\`, you can query both tables in the policy to control access to the members table.\`]}),command:\`UPDATE\`,roles:[],using:\`team_id in (select team_id from members where user_id = (select auth.uid()))\`,check:\`team_id in (select team_id from members where user_id = (select auth.uid()))\`},{title:\`Policy with security definer functions\`,description:(0,z.jsxs)(z.Fragment,{children:[\`Useful in a many-to-many relationship where you want to restrict access to the linking table. Use a\`,\` \`,(0,z.jsx)(\`code\`,{className:\`rounded bg-accent px-1 text-[11px]\`,children:\`security definer\`}),\` function in combination with a policy to avoid recursive RLS lookups.\`]}),command:\`ALL\`,roles:[],using:\`team_id in (select private.get_teams_for_user((select auth.uid())))\`,check:\`team_id in (select private.get_teams_for_user((select auth.uid())))\`},{title:\`Policy to implement Time To Live (TTL)\`,description:\`Implement a TTL-like feature as seen in Instagram stories or Snapchat. Rows are only visible if they were created within the last 24 hours.\`,command:\`SELECT\`,roles:[\`authenticated\`],using:\`created_at > (current_timestamp - interval '1 day')\`}];function Dg({table:e,tables:t,schema:n=\`public\`,existing:r,onClose:i,onCreated:a}){let[o,s]=(0,_.useState)(e??\`\`),[c,l]=(0,_.useState)(r?.name??\`\`),[u,d]=(0,_.useState)(r?.behavior??\`PERMISSIVE\`),[f,p]=(0,_.useState)(r?.command??\`SELECT\`),[m,h]=(0,_.useState)(r?.roles.filter(e=>e!==\`public\`)??[]),[g,v]=(0,_.useState)(r?.using??\`\`),[y,b]=(0,_.useState)(r?.check??\`\`),[x,S]=(0,_.useState)(\`\`),[C,w]=(0,_.useState)(!1),[T,E]=(0,_.useState)(\`\`),[D,O]=(0,_.useState)(!r),[k,A]=(0,_.useState)(!1),[j,M]=(0,_.useState)([\`anon\`,\`authenticated\`]);(0,_.useEffect)(()=>{N.sql(\`select rolname from pg_roles where rolname not like 'pg\\\\_%' order by rolname\`).then(e=>{let t=(e.rows??[]).map(e=>e.rolname);e.ok&&t.length>0&&M(t)}).catch(()=>{})},[]);let ee=m.length>0?m.join(\`, \`):\`public\`;function te(e){l(e.title),p(e.command),h(e.roles),v(e.using??\`\`),b(e.check??\`\`),E(\`\`)}async function P(){if(!o)return E(\`Pick a table for the policy.\`);if(!c.trim())return E(\`Policy name is required.\`);w(!0),E(\`\`);let e={schema:n,table:o,name:c.trim(),command:f,behavior:u,roles:ee,using:Cg(f)&&g.trim()||void 0,check:wg(f)&&y.trim()||void 0};try{if(r){await N.dropPolicy(o,r.name,n);try{await N.createPolicy(e)}catch(e){throw await N.createPolicy({schema:n,table:o,name:r.name,command:r.command,behavior:r.behavior,roles:r.roles.join(\`, \`)||\`public\`,using:r.using??void 0,check:r.check??void 0}).catch(()=>{}),e}H.success(\`Updated policy "\${c.trim()}"\`)}else await N.createPolicy(e),H.success(\`Created policy "\${c.trim()}"\`);await a(),i()}catch(e){E(e.message),w(!1)}}let F=Eg.filter(e=>e.title.toLowerCase().includes(x.toLowerCase()));return(0,z.jsx)(qp,{open:!0,onClose:i,flush:!0,hideHeader:!0,width:D?\`w-[980px]\`:\`w-[640px]\`,title:r?\`Edit policy "\${r.name}"\`:\`Create a new Row Level Security policy\`,footer:(0,z.jsxs)(z.Fragment,{children:[T&&(0,z.jsx)(\`p\`,{className:\`min-w-0 truncate text-xs text-destructive\`,children:T}),(0,z.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-2\`,children:[(0,z.jsx)(Kp,{asChild:!0,children:(0,z.jsx)(V,{variant:\`outline\`,children:\`Cancel\`})}),(0,z.jsx)(V,{onClick:()=>void P(),disabled:C||!c.trim(),children:C?\`Saving…\`:\`Save policy\`})]})]}),children:(0,z.jsxs)(\`div\`,{className:\`flex h-full\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex min-w-0 flex-1 flex-col\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex h-12 shrink-0 items-center gap-3 border-b border-border pl-3 pr-2\`,children:[(0,z.jsx)(Kp,{asChild:!0,children:(0,z.jsx)(\`button\`,{className:\`rounded p-1 text-muted-foreground/80 transition-colors hover:bg-accent hover:text-foreground\`,children:(0,z.jsx)(Lt,{size:16})})}),(0,z.jsx)(\`h2\`,{className:\`truncate text-[15px] font-medium text-foreground\`,children:r?(0,z.jsxs)(z.Fragment,{children:[\`Edit policy \`,(0,z.jsx)(\`code\`,{className:\`rounded bg-accent px-1.5 py-0.5 font-mono text-[13px]\`,children:r.name})]}):\`Create a new Row Level Security policy\`}),(0,z.jsx)(\`button\`,{onClick:()=>O(e=>!e),title:D?\`Hide templates\`:\`Show templates\`,className:\`ml-auto rounded p-1 text-muted-foreground/80 transition-colors hover:bg-accent hover:text-foreground\`,children:D?(0,z.jsx)(ot,{size:15}):(0,z.jsx)(st,{size:15})})]}),(0,z.jsxs)(\`div\`,{className:\`min-h-0 flex-1 space-y-4 overflow-y-auto px-5 py-4\`,children:[(0,z.jsxs)(\`div\`,{className:\`grid grid-cols-2 gap-3\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Policy name\`}),(0,z.jsx)(lf,{value:c,autoFocus:!0,placeholder:\`Provide a name for your policy\`,onChange:e=>l(e.target.value)})]}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsxs)(X,{children:[\`Table \`,(0,z.jsx)(Og,{children:\`on\`})]}),e||r?(0,z.jsxs)(\`div\`,{className:\`flex h-8 items-center rounded-md border border-border bg-card px-2.5 font-mono text-[13px] text-muted-foreground\`,children:[n,\`.\`,o]}):(0,z.jsx)(Wp,{mono:!0,value:o,onValueChange:s,placeholder:\`Pick a table…\`,options:(t??[]).map(e=>({value:e,label:\`\${n}.\${e}\`}))})]})]}),(0,z.jsxs)(\`div\`,{className:\`grid grid-cols-2 gap-3\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsxs)(X,{children:[\`Policy behavior \`,(0,z.jsx)(Og,{children:\`as\`})]}),(0,z.jsx)(Wp,{value:u,onValueChange:e=>d(e),options:[{value:\`PERMISSIVE\`,label:\`Permissive\`},{value:\`RESTRICTIVE\`,label:\`Restrictive\`}]})]}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsxs)(X,{children:[\`Target roles \`,(0,z.jsx)(Og,{children:\`to\`})]}),(0,z.jsxs)(pf,{open:k,onOpenChange:A,className:\`max-h-56 w-full overflow-auto p-1.5\`,trigger:(0,z.jsxs)(\`button\`,{onClick:()=>A(e=>!e),className:\`flex h-8 w-full items-center gap-1.5 rounded-md border border-input bg-field px-2.5 text-left text-[13px] transition-colors hover:border-muted-foreground focus:border-brand focus:outline-none\`,children:[m.length>0?(0,z.jsx)(\`span\`,{className:\`truncate font-mono text-foreground\`,children:m.join(\`, \`)}):(0,z.jsx)(\`span\`,{className:\`truncate text-muted-foreground/60\`,children:\`Defaults to all (public) roles\`}),(0,z.jsx)(me,{size:13,className:\`ml-auto shrink-0 text-muted-foreground/80\`})]}),children:[j.map(e=>(0,z.jsxs)(\`label\`,{className:\`flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-[13px] text-foreground hover:bg-accent\`,children:[(0,z.jsx)($t,{checked:m.includes(e),onChange:t=>h(n=>t?[...n,e]:n.filter(t=>t!==e))}),(0,z.jsx)(\`span\`,{className:\`font-mono\`,children:e})]},e)),m.length>0&&(0,z.jsx)(\`button\`,{className:\`mt-1 w-full rounded px-2 py-1.5 text-left text-xs text-brand hover:bg-accent\`,onClick:()=>h([]),children:\`Clear — default to public\`})]})]})]}),(0,z.jsx)(\`p\`,{className:\`mt-1.5! text-[11px] text-muted-foreground/60\`,children:u===\`PERMISSIVE\`?\`Permissive policies are combined with OR — a row is visible if any permissive policy allows it.\`:\`Restrictive policies are combined with AND — they narrow down what permissive policies allow.\`}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsxs)(X,{children:[\`Policy command \`,(0,z.jsx)(Og,{children:\`for\`})]}),(0,z.jsx)(\`div\`,{className:\`flex flex-wrap gap-1.5\`,children:Sg.map(e=>{let t=f===e;return(0,z.jsxs)(\`button\`,{onClick:()=>p(e),className:\`flex items-center gap-1.5 rounded-md border px-3 py-1.5 text-xs font-medium transition-colors \`+(t?\`border-foreground bg-accent text-foreground\`:\`border-input text-muted-foreground hover:border-muted-foreground hover:text-foreground\`),children:[t?(0,z.jsx)(ye,{size:12,className:\`text-brand\`}):(0,z.jsx)(be,{size:12,className:\`text-muted-foreground/60\`}),e]},e)})})]}),(0,z.jsx)(kg,{name:c,schema:n,table:o,behavior:u,command:f,roleStr:ee,usingExpr:Cg(f)?g:null,checkExpr:wg(f)?y:null,onUsing:v,onCheck:b})]})]}),(0,z.jsx)(\`div\`,{className:\`shrink-0 overflow-hidden transition-[width] duration-300 ease-[cubic-bezier(0.16,1,0.3,1)]\`,style:{width:D?340:0},children:(0,z.jsxs)(\`div\`,{className:\`flex h-full w-85 flex-col border-l border-border bg-card\`,children:[(0,z.jsx)(\`div\`,{className:\`flex h-12 shrink-0 items-end border-b border-border px-4\`,children:(0,z.jsx)(\`span\`,{className:\`border-b-2 border-foreground pb-3 text-[13px] font-medium text-foreground\`,children:\`Templates\`})}),(0,z.jsx)(\`div\`,{className:\`shrink-0 border-b border-border p-3\`,children:(0,z.jsxs)(\`div\`,{className:\`relative\`,children:[(0,z.jsx)(vt,{size:13,className:\`pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground/60\`}),(0,z.jsx)(\`input\`,{value:x,onChange:e=>S(e.target.value),placeholder:\`Search templates…\`,className:\`h-8 w-full rounded-md border border-input bg-field pl-8 pr-2 text-xs text-foreground placeholder:text-muted-foreground/60 focus:border-muted-foreground focus:outline-none\`})]})}),(0,z.jsxs)(\`div\`,{className:\`min-h-0 flex-1 space-y-2 overflow-y-auto p-3\`,children:[F.map(e=>(0,z.jsxs)(\`button\`,{onClick:()=>te(e),className:\`w-full rounded-md border border-border bg-popover p-3 text-left transition-colors hover:border-muted-foreground\`,children:[(0,z.jsx)(B,{variant:Tg[e.command],children:e.command}),(0,z.jsx)(\`p\`,{className:\`mt-2 text-[13px] font-medium text-foreground\`,children:e.title}),(0,z.jsx)(\`p\`,{className:\`mt-1 text-xs leading-relaxed text-muted-foreground/80\`,children:e.description})]},e.title)),F.length===0&&(0,z.jsx)(\`p\`,{className:\`py-6 text-center text-xs text-muted-foreground/60\`,children:\`No matching template.\`})]})]})})]})})}function Og({children:e}){return(0,z.jsx)(\`span\`,{className:\`mx-0.5 rounded border border-input bg-accent px-1 py-px font-mono text-[10px] normal-case text-muted-foreground\`,children:e})}function kg({name:e,schema:t,table:n,behavior:r,command:i,roleStr:a,usingExpr:o,checkExpr:s,onUsing:c,onCheck:l}){let u=e=>(0,z.jsx)(\`span\`,{className:\`text-info\`,children:e}),d=o!==null&&s===null,f=[{key:\`create\`,kind:\`static\`,content:(0,z.jsxs)(z.Fragment,{children:[u(\`create policy\`),\` \`,(0,z.jsxs)(\`span\`,{className:\`text-warning\`,children:[\`"\`,e||\`policy_name\`,\`"\`]})]})},{key:\`on\`,kind:\`static\`,content:(0,z.jsxs)(z.Fragment,{children:[u(\`on\`),\` "\`,t,\`"."\`,n,\`"\`]})},{key:\`as\`,kind:\`static\`,content:(0,z.jsxs)(z.Fragment,{children:[u(\`as\`),\` \`,r]})},{key:\`for\`,kind:\`static\`,content:(0,z.jsxs)(z.Fragment,{children:[u(\`for\`),\` \`,i]})},{key:\`to\`,kind:\`static\`,content:(0,z.jsxs)(z.Fragment,{children:[u(\`to\`),\` \`,a,o===null&&s===null?\`;\`:\`\`]})}];return o!==null&&f.push({key:\`using-open\`,kind:\`static\`,content:(0,z.jsxs)(z.Fragment,{children:[u(\`using\`),\` (\`]})},{key:\`using-expr\`,kind:\`expr\`,value:o,clause:\`using\`,onChange:c},{key:\`using-close\`,kind:\`static\`,content:(0,z.jsx)(z.Fragment,{children:d?\`);\`:\`)\`})}),s!==null&&f.push({key:\`check-open\`,kind:\`static\`,content:(0,z.jsxs)(z.Fragment,{children:[u(\`with check\`),\` (\`]})},{key:\`check-expr\`,kind:\`expr\`,value:s,clause:\`with check\`,onChange:l},{key:\`check-close\`,kind:\`static\`,content:(0,z.jsx)(z.Fragment,{children:\`);\`})}),(0,z.jsxs)(\`div\`,{className:\`overflow-hidden rounded-md border border-border bg-code font-mono text-[13px]\`,children:[(0,z.jsxs)(\`p\`,{className:\`flex items-center gap-2 border-b border-border px-3 py-1.5 text-[10px] uppercase tracking-wider text-muted-foreground/80\`,children:[(0,z.jsx)(Ze,{size:10}),\` Use options above to edit\`]}),(0,z.jsx)(\`div\`,{className:\`px-1 py-2\`,children:f.map((e,t)=>(0,z.jsxs)(\`div\`,{className:\`flex leading-6\`,children:[(0,z.jsx)(\`span\`,{className:\`w-8 shrink-0 select-none pr-3 text-right text-muted-foreground/60\`,children:t+1}),e.kind===\`static\`?(0,z.jsx)(\`span\`,{className:\`whitespace-pre\`,children:e.content}):(0,z.jsx)(\`input\`,{value:e.value,onChange:t=>e.onChange(t.target.value),placeholder:\`-- Provide a SQL expression for the \${e.clause} statement\`,spellCheck:!1,className:\`min-w-0 flex-1 border-b border-dashed border-input bg-transparent pr-2 font-mono text-brand placeholder:text-muted-foreground/60 focus:border-brand focus:outline-none\`})]},e.key))})]})}function Ag(e){return{name:e.name,command:e.cmd?.toUpperCase()??\`ALL\`,behavior:String(e.permissive).toUpperCase()===\`RESTRICTIVE\`?\`RESTRICTIVE\`:\`PERMISSIVE\`,roles:Array.isArray(e.roles)?e.roles:String(e.roles).replace(/[{}]/g,\`\`).split(\`,\`).map(e=>e.trim()).filter(Boolean),using:e.using_expr,check:e.with_check}}var jg=e=>e.replace(/'/g,\`''\`),Mg=(e,t)=>\`"\${e.replace(/"/g,\`""\`)}"."\${t.replace(/"/g,\`""\`)}"\`;async function Ng(e,t){let n=await N.sql(\`select c.relrowsecurity as enabled
|
|
1529
|
+
\`):typeof e.statements==\`string\`&&e.statements.trim()?e.statements:null;return(0,z.jsxs)(\`div\`,{className:\`flex h-full flex-col\`,children:[(0,z.jsx)($h,{title:\`Migrations\`,description:\`Applied migrations from supabase/migrations/*.sql — the same ledger the Supabase CLI uses.\`,onRefresh:()=>void i()}),(0,z.jsxs)(\`div\`,{className:\`min-h-0 flex-1 overflow-auto\`,children:[(0,z.jsxs)(Xp,{children:[(0,z.jsx)(Zp,{children:(0,z.jsxs)(\`tr\`,{children:[(0,z.jsx)(Z,{children:\`Version\`}),(0,z.jsx)(Z,{children:\`Name\`}),(0,z.jsx)(Z,{children:\`Applied\`}),(0,z.jsx)(Z,{className:\`w-12\`})]})}),(0,z.jsx)(\`tbody\`,{children:e.map(e=>(0,z.jsxs)(Qp,{children:[(0,z.jsx)(Q,{className:\`font-mono text-muted-foreground\`,children:e.version}),(0,z.jsx)(Q,{className:\`font-mono text-foreground/90\`,children:e.name||\`—\`}),(0,z.jsx)(Q,{className:\`text-muted-foreground\`,children:(0,z.jsx)(qm,{value:e.applied_at})}),(0,z.jsx)(Q,{children:a(e)&&(0,z.jsx)(\`button\`,{className:\`p-1 text-muted-foreground/80 opacity-0 hover:text-foreground group-hover:opacity-100\`,title:\`View SQL\`,onClick:()=>r(e),children:(0,z.jsx)(Ae,{size:13})})})]},e.version))})]}),e.length===0&&(0,z.jsxs)(lf,{children:[\`No migrations applied. Add SQL files under \`,(0,z.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`supabase/migrations/\`}),\` and restart.\`]})]}),n&&(0,z.jsx)(qp,{open:!0,onClose:()=>r(null),width:\`w-[640px]\`,title:(0,z.jsxs)(\`span\`,{children:[\`Migration \`,(0,z.jsx)(\`code\`,{className:\`rounded bg-accent px-1.5 py-0.5 font-mono text-xs text-foreground\`,children:n.name??n.version})]}),footer:(0,z.jsx)(Kp,{asChild:!0,children:(0,z.jsx)(V,{variant:\`outline\`,className:\`ml-auto\`,children:\`Done\`})}),children:(0,z.jsx)(nr,{value:a(n)??\`-- SQL not recorded for this migration\`,lang:\`sql\`,readOnly:!0,gutter:!0,minLines:6,maxLines:500})})]})}var Cg=[\`SELECT\`,\`INSERT\`,\`UPDATE\`,\`DELETE\`,\`ALL\`],wg=e=>e!==\`INSERT\`,Tg=e=>e===\`INSERT\`||e===\`UPDATE\`||e===\`ALL\`,Eg={SELECT:\`brand\`,INSERT:\`amber\`,UPDATE:\`blue\`,DELETE:\`red\`,ALL:\`neutral\`},Dg=[{title:\`Enable read access for all users\`,description:\`This policy gives read access to your table for all users via the SELECT operation.\`,command:\`SELECT\`,roles:[],using:\`true\`},{title:\`Enable insert for authenticated users only\`,description:\`This policy gives insert access to your table for all authenticated users only.\`,command:\`INSERT\`,roles:[\`authenticated\`],check:\`true\`},{title:\`Enable delete for users based on user_id\`,description:\`This policy assumes that your table has a column "user_id", and allows users to delete rows which the "user_id" column matches their ID.\`,command:\`DELETE\`,roles:[],using:\`(select auth.uid()) = user_id\`},{title:\`Enable insert for users based on user_id\`,description:\`This policy assumes that your table has a column "user_id", and allows users to insert rows which the "user_id" column matches their ID.\`,command:\`INSERT\`,roles:[],check:\`(select auth.uid()) = user_id\`},{title:\`Enable users to view their own data only\`,description:\`Restrict users to reading only their own data, matching "user_id" against their ID.\`,command:\`SELECT\`,roles:[\`authenticated\`],using:\`(select auth.uid()) = user_id\`},{title:\`Policy with table joins\`,description:(0,z.jsxs)(z.Fragment,{children:[\`Query across tables to build more advanced RLS rules. Assuming 2 tables called\`,\` \`,(0,z.jsx)(\`code\`,{className:\`rounded bg-accent px-1 text-[11px]\`,children:\`teams\`}),\` and\`,\` \`,(0,z.jsx)(\`code\`,{className:\`rounded bg-accent px-1 text-[11px]\`,children:\`members\`}),\`, you can query both tables in the policy to control access to the members table.\`]}),command:\`UPDATE\`,roles:[],using:\`team_id in (select team_id from members where user_id = (select auth.uid()))\`,check:\`team_id in (select team_id from members where user_id = (select auth.uid()))\`},{title:\`Policy with security definer functions\`,description:(0,z.jsxs)(z.Fragment,{children:[\`Useful in a many-to-many relationship where you want to restrict access to the linking table. Use a\`,\` \`,(0,z.jsx)(\`code\`,{className:\`rounded bg-accent px-1 text-[11px]\`,children:\`security definer\`}),\` function in combination with a policy to avoid recursive RLS lookups.\`]}),command:\`ALL\`,roles:[],using:\`team_id in (select private.get_teams_for_user((select auth.uid())))\`,check:\`team_id in (select private.get_teams_for_user((select auth.uid())))\`},{title:\`Policy to implement Time To Live (TTL)\`,description:\`Implement a TTL-like feature as seen in Instagram stories or Snapchat. Rows are only visible if they were created within the last 24 hours.\`,command:\`SELECT\`,roles:[\`authenticated\`],using:\`created_at > (current_timestamp - interval '1 day')\`}];function Og({table:e,tables:t,schema:n=\`public\`,existing:r,onClose:i,onCreated:a}){let[o,s]=(0,_.useState)(e??\`\`),[c,l]=(0,_.useState)(r?.name??\`\`),[u,d]=(0,_.useState)(r?.behavior??\`PERMISSIVE\`),[f,p]=(0,_.useState)(r?.command??\`SELECT\`),[m,h]=(0,_.useState)(r?.roles.filter(e=>e!==\`public\`)??[]),[g,v]=(0,_.useState)(r?.using??\`\`),[y,b]=(0,_.useState)(r?.check??\`\`),[x,S]=(0,_.useState)(\`\`),[C,w]=(0,_.useState)(!1),[T,E]=(0,_.useState)(\`\`),[D,O]=(0,_.useState)(!r),[k,A]=(0,_.useState)(!1),[j,M]=(0,_.useState)([\`anon\`,\`authenticated\`]);(0,_.useEffect)(()=>{N.sql(\`select rolname from pg_roles where rolname not like 'pg\\\\_%' order by rolname\`).then(e=>{let t=(e.rows??[]).map(e=>e.rolname);e.ok&&t.length>0&&M(t)}).catch(()=>{})},[]);let ee=m.length>0?m.join(\`, \`):\`public\`;function te(e){l(e.title),p(e.command),h(e.roles),v(e.using??\`\`),b(e.check??\`\`),E(\`\`)}async function P(){if(!o)return E(\`Pick a table for the policy.\`);if(!c.trim())return E(\`Policy name is required.\`);w(!0),E(\`\`);let e={schema:n,table:o,name:c.trim(),command:f,behavior:u,roles:ee,using:wg(f)&&g.trim()||void 0,check:Tg(f)&&y.trim()||void 0};try{if(r){await N.dropPolicy(o,r.name,n);try{await N.createPolicy(e)}catch(e){throw await N.createPolicy({schema:n,table:o,name:r.name,command:r.command,behavior:r.behavior,roles:r.roles.join(\`, \`)||\`public\`,using:r.using??void 0,check:r.check??void 0}).catch(()=>{}),e}H.success(\`Updated policy "\${c.trim()}"\`)}else await N.createPolicy(e),H.success(\`Created policy "\${c.trim()}"\`);await a(),i()}catch(e){E(e.message),w(!1)}}let F=Dg.filter(e=>e.title.toLowerCase().includes(x.toLowerCase()));return(0,z.jsx)(qp,{open:!0,onClose:i,flush:!0,hideHeader:!0,width:D?\`w-[980px]\`:\`w-[640px]\`,title:r?\`Edit policy "\${r.name}"\`:\`Create a new Row Level Security policy\`,footer:(0,z.jsxs)(z.Fragment,{children:[T&&(0,z.jsx)(\`p\`,{className:\`min-w-0 truncate text-xs text-destructive\`,children:T}),(0,z.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-2\`,children:[(0,z.jsx)(Kp,{asChild:!0,children:(0,z.jsx)(V,{variant:\`outline\`,children:\`Cancel\`})}),(0,z.jsx)(V,{onClick:()=>void P(),disabled:C||!c.trim(),children:C?\`Saving…\`:\`Save policy\`})]})]}),children:(0,z.jsxs)(\`div\`,{className:\`flex h-full\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex min-w-0 flex-1 flex-col\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex h-12 shrink-0 items-center gap-3 border-b border-border pl-3 pr-2\`,children:[(0,z.jsx)(Kp,{asChild:!0,children:(0,z.jsx)(\`button\`,{className:\`rounded p-1 text-muted-foreground/80 transition-colors hover:bg-accent hover:text-foreground\`,children:(0,z.jsx)(Lt,{size:16})})}),(0,z.jsx)(\`h2\`,{className:\`truncate text-[15px] font-medium text-foreground\`,children:r?(0,z.jsxs)(z.Fragment,{children:[\`Edit policy \`,(0,z.jsx)(\`code\`,{className:\`rounded bg-accent px-1.5 py-0.5 font-mono text-[13px]\`,children:r.name})]}):\`Create a new Row Level Security policy\`}),(0,z.jsx)(\`button\`,{onClick:()=>O(e=>!e),title:D?\`Hide templates\`:\`Show templates\`,className:\`ml-auto rounded p-1 text-muted-foreground/80 transition-colors hover:bg-accent hover:text-foreground\`,children:D?(0,z.jsx)(ot,{size:15}):(0,z.jsx)(st,{size:15})})]}),(0,z.jsxs)(\`div\`,{className:\`min-h-0 flex-1 space-y-4 overflow-y-auto px-5 py-4\`,children:[(0,z.jsxs)(\`div\`,{className:\`grid grid-cols-2 gap-3\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Policy name\`}),(0,z.jsx)(Y,{value:c,autoFocus:!0,placeholder:\`Provide a name for your policy\`,onChange:e=>l(e.target.value)})]}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsxs)(X,{children:[\`Table \`,(0,z.jsx)(kg,{children:\`on\`})]}),e||r?(0,z.jsxs)(\`div\`,{className:\`flex h-8 items-center rounded-md border border-border bg-card px-2.5 font-mono text-[13px] text-muted-foreground\`,children:[n,\`.\`,o]}):(0,z.jsx)(Wp,{mono:!0,value:o,onValueChange:s,placeholder:\`Pick a table…\`,options:(t??[]).map(e=>({value:e,label:\`\${n}.\${e}\`}))})]})]}),(0,z.jsxs)(\`div\`,{className:\`grid grid-cols-2 gap-3\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsxs)(X,{children:[\`Policy behavior \`,(0,z.jsx)(kg,{children:\`as\`})]}),(0,z.jsx)(Wp,{value:u,onValueChange:e=>d(e),options:[{value:\`PERMISSIVE\`,label:\`Permissive\`},{value:\`RESTRICTIVE\`,label:\`Restrictive\`}]})]}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsxs)(X,{children:[\`Target roles \`,(0,z.jsx)(kg,{children:\`to\`})]}),(0,z.jsxs)(pf,{open:k,onOpenChange:A,className:\`max-h-56 w-full overflow-auto p-1.5\`,trigger:(0,z.jsxs)(\`button\`,{onClick:()=>A(e=>!e),className:\`flex h-8 w-full items-center gap-1.5 rounded-md border border-input bg-field px-2.5 text-left text-[13px] transition-colors hover:border-muted-foreground focus:border-brand focus:outline-none\`,children:[m.length>0?(0,z.jsx)(\`span\`,{className:\`truncate font-mono text-foreground\`,children:m.join(\`, \`)}):(0,z.jsx)(\`span\`,{className:\`truncate text-muted-foreground/60\`,children:\`Defaults to all (public) roles\`}),(0,z.jsx)(me,{size:13,className:\`ml-auto shrink-0 text-muted-foreground/80\`})]}),children:[j.map(e=>(0,z.jsxs)(\`label\`,{className:\`flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-[13px] text-foreground hover:bg-accent\`,children:[(0,z.jsx)($t,{checked:m.includes(e),onChange:t=>h(n=>t?[...n,e]:n.filter(t=>t!==e))}),(0,z.jsx)(\`span\`,{className:\`font-mono\`,children:e})]},e)),m.length>0&&(0,z.jsx)(\`button\`,{className:\`mt-1 w-full rounded px-2 py-1.5 text-left text-xs text-brand hover:bg-accent\`,onClick:()=>h([]),children:\`Clear — default to public\`})]})]})]}),(0,z.jsx)(\`p\`,{className:\`mt-1.5! text-[11px] text-muted-foreground/60\`,children:u===\`PERMISSIVE\`?\`Permissive policies are combined with OR — a row is visible if any permissive policy allows it.\`:\`Restrictive policies are combined with AND — they narrow down what permissive policies allow.\`}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsxs)(X,{children:[\`Policy command \`,(0,z.jsx)(kg,{children:\`for\`})]}),(0,z.jsx)(\`div\`,{className:\`flex flex-wrap gap-1.5\`,children:Cg.map(e=>{let t=f===e;return(0,z.jsxs)(\`button\`,{onClick:()=>p(e),className:\`flex items-center gap-1.5 rounded-md border px-3 py-1.5 text-xs font-medium transition-colors \`+(t?\`border-foreground bg-accent text-foreground\`:\`border-input text-muted-foreground hover:border-muted-foreground hover:text-foreground\`),children:[t?(0,z.jsx)(ye,{size:12,className:\`text-brand\`}):(0,z.jsx)(be,{size:12,className:\`text-muted-foreground/60\`}),e]},e)})})]}),(0,z.jsx)(Ag,{name:c,schema:n,table:o,behavior:u,command:f,roleStr:ee,usingExpr:wg(f)?g:null,checkExpr:Tg(f)?y:null,onUsing:v,onCheck:b})]})]}),(0,z.jsx)(\`div\`,{className:\`shrink-0 overflow-hidden transition-[width] duration-300 ease-[cubic-bezier(0.16,1,0.3,1)]\`,style:{width:D?340:0},children:(0,z.jsxs)(\`div\`,{className:\`flex h-full w-85 flex-col border-l border-border bg-card\`,children:[(0,z.jsx)(\`div\`,{className:\`flex h-12 shrink-0 items-end border-b border-border px-4\`,children:(0,z.jsx)(\`span\`,{className:\`border-b-2 border-foreground pb-3 text-[13px] font-medium text-foreground\`,children:\`Templates\`})}),(0,z.jsx)(\`div\`,{className:\`shrink-0 border-b border-border p-3\`,children:(0,z.jsxs)(\`div\`,{className:\`relative\`,children:[(0,z.jsx)(vt,{size:13,className:\`pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground/60\`}),(0,z.jsx)(\`input\`,{value:x,onChange:e=>S(e.target.value),placeholder:\`Search templates…\`,className:\`h-8 w-full rounded-md border border-input bg-field pl-8 pr-2 text-xs text-foreground placeholder:text-muted-foreground/60 focus:border-muted-foreground focus:outline-none\`})]})}),(0,z.jsxs)(\`div\`,{className:\`min-h-0 flex-1 space-y-2 overflow-y-auto p-3\`,children:[F.map(e=>(0,z.jsxs)(\`button\`,{onClick:()=>te(e),className:\`w-full rounded-md border border-border bg-popover p-3 text-left transition-colors hover:border-muted-foreground\`,children:[(0,z.jsx)(B,{variant:Eg[e.command],children:e.command}),(0,z.jsx)(\`p\`,{className:\`mt-2 text-[13px] font-medium text-foreground\`,children:e.title}),(0,z.jsx)(\`p\`,{className:\`mt-1 text-xs leading-relaxed text-muted-foreground/80\`,children:e.description})]},e.title)),F.length===0&&(0,z.jsx)(\`p\`,{className:\`py-6 text-center text-xs text-muted-foreground/60\`,children:\`No matching template.\`})]})]})})]})})}function kg({children:e}){return(0,z.jsx)(\`span\`,{className:\`mx-0.5 rounded border border-input bg-accent px-1 py-px font-mono text-[10px] normal-case text-muted-foreground\`,children:e})}function Ag({name:e,schema:t,table:n,behavior:r,command:i,roleStr:a,usingExpr:o,checkExpr:s,onUsing:c,onCheck:l}){let u=e=>(0,z.jsx)(\`span\`,{className:\`text-info\`,children:e}),d=o!==null&&s===null,f=[{key:\`create\`,kind:\`static\`,content:(0,z.jsxs)(z.Fragment,{children:[u(\`create policy\`),\` \`,(0,z.jsxs)(\`span\`,{className:\`text-warning\`,children:[\`"\`,e||\`policy_name\`,\`"\`]})]})},{key:\`on\`,kind:\`static\`,content:(0,z.jsxs)(z.Fragment,{children:[u(\`on\`),\` "\`,t,\`"."\`,n,\`"\`]})},{key:\`as\`,kind:\`static\`,content:(0,z.jsxs)(z.Fragment,{children:[u(\`as\`),\` \`,r]})},{key:\`for\`,kind:\`static\`,content:(0,z.jsxs)(z.Fragment,{children:[u(\`for\`),\` \`,i]})},{key:\`to\`,kind:\`static\`,content:(0,z.jsxs)(z.Fragment,{children:[u(\`to\`),\` \`,a,o===null&&s===null?\`;\`:\`\`]})}];return o!==null&&f.push({key:\`using-open\`,kind:\`static\`,content:(0,z.jsxs)(z.Fragment,{children:[u(\`using\`),\` (\`]})},{key:\`using-expr\`,kind:\`expr\`,value:o,clause:\`using\`,onChange:c},{key:\`using-close\`,kind:\`static\`,content:(0,z.jsx)(z.Fragment,{children:d?\`);\`:\`)\`})}),s!==null&&f.push({key:\`check-open\`,kind:\`static\`,content:(0,z.jsxs)(z.Fragment,{children:[u(\`with check\`),\` (\`]})},{key:\`check-expr\`,kind:\`expr\`,value:s,clause:\`with check\`,onChange:l},{key:\`check-close\`,kind:\`static\`,content:(0,z.jsx)(z.Fragment,{children:\`);\`})}),(0,z.jsxs)(\`div\`,{className:\`overflow-hidden rounded-md border border-border bg-code font-mono text-[13px]\`,children:[(0,z.jsxs)(\`p\`,{className:\`flex items-center gap-2 border-b border-border px-3 py-1.5 text-[10px] uppercase tracking-wider text-muted-foreground/80\`,children:[(0,z.jsx)(Ze,{size:10}),\` Use options above to edit\`]}),(0,z.jsx)(\`div\`,{className:\`px-1 py-2\`,children:f.map((e,t)=>(0,z.jsxs)(\`div\`,{className:\`flex leading-6\`,children:[(0,z.jsx)(\`span\`,{className:\`w-8 shrink-0 select-none pr-3 text-right text-muted-foreground/60\`,children:t+1}),e.kind===\`static\`?(0,z.jsx)(\`span\`,{className:\`whitespace-pre\`,children:e.content}):(0,z.jsx)(\`input\`,{value:e.value,onChange:t=>e.onChange(t.target.value),placeholder:\`-- Provide a SQL expression for the \${e.clause} statement\`,spellCheck:!1,className:\`min-w-0 flex-1 border-b border-dashed border-input bg-transparent pr-2 font-mono text-brand placeholder:text-muted-foreground/60 focus:border-brand focus:outline-none\`})]},e.key))})]})}function jg(e){return{name:e.name,command:e.cmd?.toUpperCase()??\`ALL\`,behavior:String(e.permissive).toUpperCase()===\`RESTRICTIVE\`?\`RESTRICTIVE\`:\`PERMISSIVE\`,roles:Array.isArray(e.roles)?e.roles:String(e.roles).replace(/[{}]/g,\`\`).split(\`,\`).map(e=>e.trim()).filter(Boolean),using:e.using_expr,check:e.with_check}}var Mg=e=>e.replace(/'/g,\`''\`),Ng=(e,t)=>\`"\${e.replace(/"/g,\`""\`)}"."\${t.replace(/"/g,\`""\`)}"\`;async function Pg(e,t){let n=await N.sql(\`select c.relrowsecurity as enabled
|
|
1530
1530
|
from pg_class c join pg_namespace n on n.oid = c.relnamespace
|
|
1531
|
-
where n.nspname = '\${
|
|
1531
|
+
where n.nspname = '\${Mg(t)}' and c.relname = '\${Mg(e)}' and c.relkind = 'r'\`);return{enabled:n.ok?!!n.rows?.[0]?.enabled:!1,policies:(await N.policies(t)).filter(t=>t.table===e)}}function Fg({table:e,schema:t=\`public\`,refreshKey:n,onChanged:r}){let[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(!1),c=(0,_.useCallback)(()=>{Pg(e,t).then(a,()=>a(null))},[e,t]);(0,_.useEffect)(()=>{c()},[c,n]);let l=i?.policies.length??0,u=i?.enabled&&l===0;return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(V,{variant:\`outline\`,size:\`xs\`,onClick:()=>s(!0),title:i?i.enabled?u?\`RLS is enabled for this table, but no policies are set. Select queries may return 0 results.\`:\`\${l} \${l===1?\`policy\`:\`policies\`} active\`:\`RLS is disabled — the API exposes all rows to every role\`:void 0,children:[(0,z.jsx)(wt,{size:12}),\`Add RLS policy\`,i&&(0,z.jsx)(\`span\`,{className:\`size-1.5 rounded-full \`+(i.enabled?u?\`bg-warning\`:\`bg-brand\`:\`bg-destructive\`)})]}),o&&(0,z.jsx)(Lg,{table:e,schema:t,onClose:()=>s(!1),onChanged:()=>{c(),r?.()}})]})}function Ig({view:e,schema:t=\`public\`,refreshKey:n,onChanged:r}){let[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(!1),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)(!1),f=(0,_.useCallback)(()=>{N.sql(\`select coalesce('security_invoker=true' = any(c.reloptions) or 'security_invoker=on' = any(c.reloptions), false) as invoker,
|
|
1532
1532
|
pg_get_viewdef(c.oid, true) as def
|
|
1533
1533
|
from pg_class c join pg_namespace n on n.oid = c.relnamespace
|
|
1534
|
-
where n.nspname = '\${
|
|
1534
|
+
where n.nspname = '\${Mg(t)}' and c.relname = '\${Mg(e)}' and c.relkind = 'v'\`).then(e=>a(e.ok&&e.rows?.[0]?{invoker:!!e.rows[0].invoker,def:String(e.rows[0].def??\`\`)}:null),()=>a(null))},[e,t]);(0,_.useEffect)(()=>{f()},[f,n]);async function p(n){let i=await N.sql(\`alter view \${Ng(t,e)} set (security_invoker = \${n?\`on\`:\`off\`})\`);if(!i.ok){H.error(i.error??\`Failed to change view security\`);return}H.success(n?\`\${e} now runs with the caller's permissions\`:\`\${e} now runs with the owner's permissions\`),l(!1),s(!1),f(),r?.()}let m=i?.invoker??null,h=n=>\`create view \${t}.\${e}\${n?\`
|
|
1535
1535
|
with (security_invoker = on)\`:\`\`} as\\n\${(i?.def??\`…\`).trim()}\`,g=Math.max(h(!0).split(\`
|
|
1536
|
-
\`).length,6)+1;return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(pf,{open:o,onOpenChange:s,align:\`end\`,className:\`w-120 p-4\`,trigger:(0,z.jsxs)(V,{variant:\`outline\`,size:\`xs\`,className:m===!1?\`border-warning/50 bg-warning/10 text-warning hover:border-warning hover:bg-warning/15\`:void 0,onClick:()=>s(e=>!e),children:[m===!1?(0,z.jsx)(Ze,{size:12}):(0,z.jsx)(Qe,{size:12}),m===!1?\`Security Definer view\`:\`Security Invoker view\`,m===!0&&(0,z.jsx)(\`span\`,{className:\`size-1.5 rounded-full bg-brand\`})]}),children:[(0,z.jsxs)(\`p\`,{className:\`flex items-center gap-2 text-[13px] font-medium text-foreground\`,children:[m===!1?(0,z.jsx)(Ze,{size:13,className:\`text-warning\`}):(0,z.jsx)(St,{size:13,className:\`text-brand\`}),m===!1?\`Secure your view\`:\`This view is secured\`]}),m===!1?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(\`p\`,{className:\`mt-2.5 text-[13px] leading-relaxed text-muted-foreground\`,children:\`This view is defined with the Security Definer property, giving it the permissions of the view's creator (postgres), rather than the permissions of the querying user.\`}),(0,z.jsxs)(\`p\`,{className:\`mt-2.5 text-[13px] leading-relaxed text-muted-foreground\`,children:[\`Since this view is in the \`,(0,z.jsx)(\`code\`,{className:\`text-foreground/80\`,children:t}),\` schema, it is accessible via your project's APIs — Row Level Security on the tables it reads is bypassed through it.\`]}),(0,z.jsx)(\`div\`,{className:\`mt-4\`,children:(0,z.jsx)(V,{onClick:()=>l(!0),children:\`Autofix\`})})]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(\`p\`,{className:\`mt-2.5 text-[13px] leading-relaxed text-muted-foreground\`,children:[\`This view runs with \`,(0,z.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`security_invoker=on\`}),\` — it executes with the querying user's permissions, so Row Level Security on the underlying tables applies through it.\`]}),(0,z.jsx)(\`button\`,{className:\`mt-3 text-[11px] text-muted-foreground/70 underline-offset-2 hover:text-destructive hover:underline\`,onClick:()=>d(!0),children:\`Switch back to security definer…\`})]})]}),c&&(0,z.jsxs)(go,{open:!0,onClose:()=>l(!1),title:\`Confirm autofixing view security\`,width:\`w-235\`,children:[(0,z.jsxs)(\`div\`,{className:\`px-1 pt-1\`,children:[(0,z.jsxs)(\`p\`,{className:\`text-[13px] leading-relaxed text-muted-foreground\`,children:[\`Setting \`,(0,z.jsx)(\`code\`,{className:\`rounded bg-accent px-1.5 py-0.5 font-mono text-xs text-foreground\`,children:\`security_invoker=on\`}),\` \`,\`ensures the view runs with the permissions of the querying user, reducing the risk of unintended data exposure.\`]}),(0,z.jsx)(\`div\`,{className:\`mt-4 grid grid-cols-2 gap-4\`,children:[[\`Existing query\`,h(!1)],[\`Updated query\`,h(!0)]].map(([e,t])=>(0,z.jsxs)(\`div\`,{className:\`overflow-hidden rounded-md border border-border bg-code\`,children:[(0,z.jsx)(\`div\`,{className:\`border-b border-border bg-card px-4 py-2.5 font-mono text-[12px] font-medium text-foreground\`,children:e}),(0,z.jsx)(\`div\`,{className:\`px-2 py-3\`,children:(0,z.jsx)(nr,{value:t,lang:\`sql\`,readOnly:!0,minLines:g,maxLines:g})})]},e))})]}),(0,z.jsxs)(\`div\`,{className:\`-mx-4 -mb-4 mt-5 flex gap-3 border-t border-border px-4 py-3.5\`,children:[(0,z.jsx)(V,{variant:\`outline\`,className:\`h-9 flex-1\`,onClick:()=>l(!1),children:\`Cancel\`}),(0,z.jsx)(V,{className:\`h-9 flex-1\`,autoFocus:!0,onClick:()=>void p(!0),children:\`Confirm\`})]})]}),u&&(0,z.jsx)(q,{open:!0,danger:!0,title:\`Run "\${e}" as its owner?\`,description:\`RLS on the underlying tables will be bypassed through this view — every role can read all rows the owner can.\`,confirmLabel:\`Switch to definer\`,onConfirm:()=>{d(!1),p(!1)},onClose:()=>d(!1)})]})}function Ig({table:e,schema:t=\`public\`,onClose:n,onChanged:r}){let[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(!1),[c,l]=(0,_.useState)(null),[u,d]=(0,_.useState)(!1),[f,p]=(0,_.useState)(null),m=(0,_.useCallback)(async()=>{try{a(await Ng(e,t))}catch(e){H.error(e.message)}},[e,t]);(0,_.useEffect)(()=>{m()},[m]);async function h(n){let i=await N.sql(\`alter table \${Mg(t,e)} \${n?\`enable\`:\`disable\`} row level security\`);if(!i.ok){H.error(i.error??\`Failed to change RLS\`);return}H.success(\`RLS \${n?\`enabled\`:\`disabled\`} on \${e}\`),await m(),r?.()}async function g(n){try{await N.dropPolicy(e,n.name,t),H.success(\`Dropped policy \${n.name}\`),await m(),r?.()}catch(e){H.error(e.message)}}return(0,z.jsxs)(qp,{open:!0,onClose:n,width:\`w-[560px]\`,title:(0,z.jsxs)(\`span\`,{children:[\`Row Level Security — \`,(0,z.jsx)(\`code\`,{className:\`rounded bg-accent px-1.5 py-0.5 font-mono text-xs text-foreground\`,children:e})]}),footer:(0,z.jsx)(Kp,{asChild:!0,children:(0,z.jsx)(V,{variant:\`outline\`,className:\`ml-auto\`,children:\`Done\`})}),children:[i?(0,z.jsxs)(\`div\`,{className:\`space-y-5\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-3 rounded-md border border-border bg-card p-3.5\`,children:[i.enabled?(0,z.jsx)(St,{size:16,className:\`text-brand\`}):(0,z.jsx)(Ct,{size:16,className:\`text-destructive\`}),(0,z.jsxs)(\`div\`,{className:\`min-w-0 flex-1\`,children:[(0,z.jsx)(\`p\`,{className:\`text-[13px] font-medium text-foreground\`,children:\`Enable Row Level Security\`}),(0,z.jsx)(\`p\`,{className:\`text-[11px] text-muted-foreground/80\`,children:i.enabled?\`Rows are only visible to roles a policy grants access to. The service_role always bypasses RLS.\`:\`RLS is disabled — the API exposes all rows to every role, including anon.\`})]}),(0,z.jsx)(Yp,{checked:i.enabled,onChange:e=>e?void h(!0):d(!0)})]}),i.enabled&&i.policies.length===0&&(0,z.jsxs)(\`div\`,{className:\`flex items-start gap-2.5 rounded-md border border-warning/30 bg-warning/10 px-3 py-2.5 text-xs text-warning\`,children:[(0,z.jsx)(jt,{size:13,className:\`mt-px shrink-0\`}),\`RLS is enabled for this table, but no policies are set. Select queries by anon/authenticated will return 0 results.\`]}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsxs)(\`div\`,{className:\`mb-2 flex items-center justify-between\`,children:[(0,z.jsxs)(\`p\`,{className:\`text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/80\`,children:[\`Policies \`,(0,z.jsx)(\`span\`,{className:\`text-muted-foreground/60\`,children:i.policies.length})]}),(0,z.jsxs)(V,{size:\`xs\`,onClick:()=>s(!0),children:[(0,z.jsx)(mt,{size:12}),\` Create policy\`]})]}),(0,z.jsxs)(\`div\`,{className:\`space-y-2\`,children:[i.policies.map(e=>(0,z.jsxs)(\`div\`,{className:\`cursor-pointer rounded-md border border-border bg-card p-3 transition-colors hover:border-muted-foreground/60\`,title:\`Edit policy\`,onClick:()=>l(e),children:[(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-2\`,children:[(0,z.jsx)(\`span\`,{className:\`truncate font-mono text-[13px] text-foreground\`,children:e.name}),(0,z.jsx)(B,{variant:\`blue\`,children:e.cmd}),String(e.permissive).toUpperCase()!==\`PERMISSIVE\`&&(0,z.jsx)(B,{variant:\`red\`,children:\`restrictive\`}),(0,z.jsx)(B,{variant:\`neutral\`,children:Array.isArray(e.roles)?e.roles.join(\`, \`):String(e.roles)}),(0,z.jsx)(\`button\`,{className:\`ml-auto p-1 text-muted-foreground/80 hover:text-destructive\`,title:\`Drop policy\`,onClick:t=>{t.stopPropagation(),p(e)},children:(0,z.jsx)(At,{size:13})})]}),e.using_expr&&(0,z.jsxs)(\`p\`,{className:\`mt-1.5 truncate font-mono text-[11px] text-muted-foreground/80\`,title:e.using_expr,children:[\`using (\`,e.using_expr,\`)\`]}),e.with_check&&(0,z.jsxs)(\`p\`,{className:\`mt-0.5 truncate font-mono text-[11px] text-muted-foreground/80\`,title:e.with_check,children:[\`with check (\`,e.with_check,\`)\`]})]},e.name)),i.policies.length===0&&(0,z.jsxs)(\`p\`,{className:\`rounded-md border border-dashed border-border px-3 py-4 text-center text-xs text-muted-foreground/60\`,children:[\`No policies on this table yet. Start from a template →\`,\` \`,(0,z.jsx)(\`button\`,{className:\`text-brand hover:underline\`,onClick:()=>s(!0),children:\`Create policy\`})]})]})]})]}):(0,z.jsx)(Jp,{}),o&&(0,z.jsx)(Dg,{table:e,schema:t,onClose:()=>s(!1),onCreated:async()=>{await m(),r?.()}}),c&&(0,z.jsx)(Dg,{table:e,schema:t,existing:Ag(c),onClose:()=>l(null),onCreated:async()=>{await m(),r?.()}}),u&&(0,z.jsx)(q,{open:!0,danger:!0,title:\`Disable RLS on "\${e}"?\`,description:\`Every role — including anon — will be able to read and write all rows through the API.\`,confirmLabel:\`Disable RLS\`,onConfirm:()=>void h(!1),onClose:()=>d(!1)}),f&&(0,z.jsx)(q,{open:!0,danger:!0,title:\`Drop policy "\${f.name}"?\`,description:\`Access rules for this table change immediately.\`,confirmLabel:\`Drop policy\`,onConfirm:()=>void g(f),onClose:()=>p(null)})]})}function Lg(){let[e]=Kh(),[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)([]),[s,c]=(0,_.useState)(\`\`),[l,u]=(0,_.useState)(!1),[d,f]=(0,_.useState)(null),[p,m]=(0,_.useState)(null),h=(0,_.useCallback)(()=>{Promise.all([N.policies(e),N.tables(e)]).then(([e,t])=>{i(null),n(e),o(t.filter(e=>!e.isView).map(e=>e.name))},e=>{i(e?.message??\`Query failed\`),n(e=>e??[])})},[e]);(0,_.useEffect)(()=>{h();let e=setInterval(()=>void h(),5e3);return()=>clearInterval(e)},[h]);async function g(e){try{await N.dropPolicy(e.table,e.name),H.success(\`Dropped policy \${e.name}\`),h()}catch(e){H.error(e.message)}}if(t===null)return(0,z.jsx)(Jp,{});let v=t.filter(e=>(e.table+e.name).toLowerCase().includes(s.toLowerCase())),y=new Map;for(let e of v)y.has(e.table)||y.set(e.table,[]),y.get(e.table).push(e);return(0,z.jsxs)(\`div\`,{className:\`flex h-full flex-col\`,children:[(0,z.jsx)(Qh,{title:\`Policies\`,description:\`Row Level Security policies across every table — who can see and write which rows.\`,search:s,onSearch:c,onRefresh:h,schemaPicker:!0,actions:(0,z.jsxs)(V,{size:\`xs\`,onClick:()=>u(!0),children:[(0,z.jsx)(mt,{size:12}),\` New policy\`]})}),r&&(0,z.jsx)(ff,{message:r}),(0,z.jsxs)(\`div\`,{className:\`min-h-0 flex-1 space-y-5 overflow-y-auto p-6\`,children:[[...y].map(([e,t])=>(0,z.jsxs)(\`div\`,{children:[(0,z.jsxs)(\`div\`,{className:\`mb-1.5 flex items-center gap-2\`,children:[(0,z.jsx)(St,{size:13,className:\`text-brand\`}),(0,z.jsx)(\`span\`,{className:\`font-mono text-[13px] text-foreground/90\`,children:e}),(0,z.jsxs)(\`span\`,{className:\`text-[11px] text-muted-foreground/60\`,children:[t.length,\` \`,t.length===1?\`policy\`:\`policies\`]})]}),(0,z.jsx)(\`div\`,{className:\`space-y-2\`,children:t.map(e=>(0,z.jsxs)(\`div\`,{className:\`cursor-pointer rounded-md border border-border bg-card p-3 transition-colors hover:border-muted-foreground/60\`,title:\`Edit policy\`,onClick:()=>f(e),children:[(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-2\`,children:[(0,z.jsx)(\`span\`,{className:\`truncate font-mono text-[13px] text-foreground\`,children:e.name}),(0,z.jsx)(B,{variant:\`blue\`,children:e.cmd}),String(e.permissive).toUpperCase()!==\`PERMISSIVE\`&&(0,z.jsx)(B,{variant:\`red\`,children:\`restrictive\`}),(0,z.jsx)(B,{variant:\`neutral\`,children:Array.isArray(e.roles)?e.roles.join(\`, \`):String(e.roles)}),(0,z.jsx)(\`button\`,{className:\`ml-auto p-1 text-muted-foreground/80 hover:text-destructive\`,title:\`Drop policy\`,onClick:t=>{t.stopPropagation(),m(e)},children:(0,z.jsx)(At,{size:13})})]}),e.using_expr&&(0,z.jsxs)(\`p\`,{className:\`mt-1.5 truncate font-mono text-[11px] text-muted-foreground/80\`,title:e.using_expr,children:[\`using (\`,e.using_expr,\`)\`]}),e.with_check&&(0,z.jsxs)(\`p\`,{className:\`mt-0.5 truncate font-mono text-[11px] text-muted-foreground/80\`,title:e.with_check,children:[\`with check (\`,e.with_check,\`)\`]})]},e.name))})]},e)),v.length===0&&(0,z.jsx)(cf,{children:t.length===0?\`No policies yet. Create one to start restricting access.\`:\`No match.\`})]}),l&&(0,z.jsx)(Dg,{tables:a,schema:e,onClose:()=>u(!1),onCreated:async()=>h()}),d&&(0,z.jsx)(Dg,{table:d.table,schema:e,existing:Ag(d),onClose:()=>f(null),onCreated:async()=>h()}),p&&(0,z.jsx)(q,{open:!0,danger:!0,title:\`Drop policy "\${p.name}"?\`,description:\`Access rules for "\${p.table}" change immediately.\`,confirmLabel:\`Drop policy\`,onConfirm:()=>void g(p),onClose:()=>m(null)})]})}var Rg=new Set([\`postgres\`,\`anon\`,\`authenticated\`,\`authenticator\`,\`service_role\`]),zg=[{key:\`login\`,label:\`User can login\`,sql:e=>e?\`login\`:\`nologin\`},{key:\`createrole\`,label:\`User can create roles\`,sql:e=>e?\`createrole\`:\`nocreaterole\`},{key:\`createdb\`,label:\`User can create databases\`,sql:e=>e?\`createdb\`:\`nocreatedb\`},{key:\`bypassrls\`,label:\`User bypasses every row level security policy\`,sql:e=>e?\`bypassrls\`:\`nobypassrls\`},{key:\`replication\`,label:\`User can initiate streaming replication and put the system in and out of backup mode\`,sql:e=>e?\`replication\`:\`noreplication\`}];function Bg(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(null),[i,a]=(0,_.useState)(\`\`),[o,s]=(0,_.useState)(null),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)(null),f=(0,_.useCallback)(async()=>{let e=await N.sql(\`select r.rolname as name, r.oid::int as oid, r.rolsuper as "super", r.rolcanlogin as login,
|
|
1536
|
+
\`).length,6)+1;return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(pf,{open:o,onOpenChange:s,align:\`end\`,className:\`w-120 p-4\`,trigger:(0,z.jsxs)(V,{variant:\`outline\`,size:\`xs\`,className:m===!1?\`border-warning/50 bg-warning/10 text-warning hover:border-warning hover:bg-warning/15\`:void 0,onClick:()=>s(e=>!e),children:[m===!1?(0,z.jsx)(Ze,{size:12}):(0,z.jsx)(Qe,{size:12}),m===!1?\`Security Definer view\`:\`Security Invoker view\`,m===!0&&(0,z.jsx)(\`span\`,{className:\`size-1.5 rounded-full bg-brand\`})]}),children:[(0,z.jsxs)(\`p\`,{className:\`flex items-center gap-2 text-[13px] font-medium text-foreground\`,children:[m===!1?(0,z.jsx)(Ze,{size:13,className:\`text-warning\`}):(0,z.jsx)(St,{size:13,className:\`text-brand\`}),m===!1?\`Secure your view\`:\`This view is secured\`]}),m===!1?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(\`p\`,{className:\`mt-2.5 text-[13px] leading-relaxed text-muted-foreground\`,children:\`This view is defined with the Security Definer property, giving it the permissions of the view's creator (postgres), rather than the permissions of the querying user.\`}),(0,z.jsxs)(\`p\`,{className:\`mt-2.5 text-[13px] leading-relaxed text-muted-foreground\`,children:[\`Since this view is in the \`,(0,z.jsx)(\`code\`,{className:\`text-foreground/80\`,children:t}),\` schema, it is accessible via your project's APIs — Row Level Security on the tables it reads is bypassed through it.\`]}),(0,z.jsx)(\`div\`,{className:\`mt-4\`,children:(0,z.jsx)(V,{onClick:()=>l(!0),children:\`Autofix\`})})]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(\`p\`,{className:\`mt-2.5 text-[13px] leading-relaxed text-muted-foreground\`,children:[\`This view runs with \`,(0,z.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`security_invoker=on\`}),\` — it executes with the querying user's permissions, so Row Level Security on the underlying tables applies through it.\`]}),(0,z.jsx)(\`button\`,{className:\`mt-3 text-[11px] text-muted-foreground/70 underline-offset-2 hover:text-destructive hover:underline\`,onClick:()=>d(!0),children:\`Switch back to security definer…\`})]})]}),c&&(0,z.jsxs)(go,{open:!0,onClose:()=>l(!1),title:\`Confirm autofixing view security\`,width:\`w-235\`,children:[(0,z.jsxs)(\`div\`,{className:\`px-1 pt-1\`,children:[(0,z.jsxs)(\`p\`,{className:\`text-[13px] leading-relaxed text-muted-foreground\`,children:[\`Setting \`,(0,z.jsx)(\`code\`,{className:\`rounded bg-accent px-1.5 py-0.5 font-mono text-xs text-foreground\`,children:\`security_invoker=on\`}),\` \`,\`ensures the view runs with the permissions of the querying user, reducing the risk of unintended data exposure.\`]}),(0,z.jsx)(\`div\`,{className:\`mt-4 grid grid-cols-2 gap-4\`,children:[[\`Existing query\`,h(!1)],[\`Updated query\`,h(!0)]].map(([e,t])=>(0,z.jsxs)(\`div\`,{className:\`overflow-hidden rounded-md border border-border bg-code\`,children:[(0,z.jsx)(\`div\`,{className:\`border-b border-border bg-card px-4 py-2.5 font-mono text-[12px] font-medium text-foreground\`,children:e}),(0,z.jsx)(\`div\`,{className:\`px-2 py-3\`,children:(0,z.jsx)(nr,{value:t,lang:\`sql\`,readOnly:!0,minLines:g,maxLines:g})})]},e))})]}),(0,z.jsxs)(\`div\`,{className:\`-mx-4 -mb-4 mt-5 flex gap-3 border-t border-border px-4 py-3.5\`,children:[(0,z.jsx)(V,{variant:\`outline\`,className:\`h-9 flex-1\`,onClick:()=>l(!1),children:\`Cancel\`}),(0,z.jsx)(V,{className:\`h-9 flex-1\`,autoFocus:!0,onClick:()=>void p(!0),children:\`Confirm\`})]})]}),u&&(0,z.jsx)(q,{open:!0,danger:!0,title:\`Run "\${e}" as its owner?\`,description:\`RLS on the underlying tables will be bypassed through this view — every role can read all rows the owner can.\`,confirmLabel:\`Switch to definer\`,onConfirm:()=>{d(!1),p(!1)},onClose:()=>d(!1)})]})}function Lg({table:e,schema:t=\`public\`,onClose:n,onChanged:r}){let[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(!1),[c,l]=(0,_.useState)(null),[u,d]=(0,_.useState)(!1),[f,p]=(0,_.useState)(null),m=(0,_.useCallback)(async()=>{try{a(await Pg(e,t))}catch(e){H.error(e.message)}},[e,t]);(0,_.useEffect)(()=>{m()},[m]);async function h(n){let i=await N.sql(\`alter table \${Ng(t,e)} \${n?\`enable\`:\`disable\`} row level security\`);if(!i.ok){H.error(i.error??\`Failed to change RLS\`);return}H.success(\`RLS \${n?\`enabled\`:\`disabled\`} on \${e}\`),await m(),r?.()}async function g(n){try{await N.dropPolicy(e,n.name,t),H.success(\`Dropped policy \${n.name}\`),await m(),r?.()}catch(e){H.error(e.message)}}return(0,z.jsxs)(qp,{open:!0,onClose:n,width:\`w-[560px]\`,title:(0,z.jsxs)(\`span\`,{children:[\`Row Level Security — \`,(0,z.jsx)(\`code\`,{className:\`rounded bg-accent px-1.5 py-0.5 font-mono text-xs text-foreground\`,children:e})]}),footer:(0,z.jsx)(Kp,{asChild:!0,children:(0,z.jsx)(V,{variant:\`outline\`,className:\`ml-auto\`,children:\`Done\`})}),children:[i?(0,z.jsxs)(\`div\`,{className:\`space-y-5\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-3 rounded-md border border-border bg-card p-3.5\`,children:[i.enabled?(0,z.jsx)(St,{size:16,className:\`text-brand\`}):(0,z.jsx)(Ct,{size:16,className:\`text-destructive\`}),(0,z.jsxs)(\`div\`,{className:\`min-w-0 flex-1\`,children:[(0,z.jsx)(\`p\`,{className:\`text-[13px] font-medium text-foreground\`,children:\`Enable Row Level Security\`}),(0,z.jsx)(\`p\`,{className:\`text-[11px] text-muted-foreground/80\`,children:i.enabled?\`Rows are only visible to roles a policy grants access to. The service_role always bypasses RLS.\`:\`RLS is disabled — the API exposes all rows to every role, including anon.\`})]}),(0,z.jsx)(Yp,{checked:i.enabled,onChange:e=>e?void h(!0):d(!0)})]}),i.enabled&&i.policies.length===0&&(0,z.jsxs)(\`div\`,{className:\`flex items-start gap-2.5 rounded-md border border-warning/30 bg-warning/10 px-3 py-2.5 text-xs text-warning\`,children:[(0,z.jsx)(jt,{size:13,className:\`mt-px shrink-0\`}),\`RLS is enabled for this table, but no policies are set. Select queries by anon/authenticated will return 0 results.\`]}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsxs)(\`div\`,{className:\`mb-2 flex items-center justify-between\`,children:[(0,z.jsxs)(\`p\`,{className:\`text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/80\`,children:[\`Policies \`,(0,z.jsx)(\`span\`,{className:\`text-muted-foreground/60\`,children:i.policies.length})]}),(0,z.jsxs)(V,{size:\`xs\`,onClick:()=>s(!0),children:[(0,z.jsx)(mt,{size:12}),\` Create policy\`]})]}),(0,z.jsxs)(\`div\`,{className:\`space-y-2\`,children:[i.policies.map(e=>(0,z.jsxs)(\`div\`,{className:\`cursor-pointer rounded-md border border-border bg-card p-3 transition-colors hover:border-muted-foreground/60\`,title:\`Edit policy\`,onClick:()=>l(e),children:[(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-2\`,children:[(0,z.jsx)(\`span\`,{className:\`truncate font-mono text-[13px] text-foreground\`,children:e.name}),(0,z.jsx)(B,{variant:\`blue\`,children:e.cmd}),String(e.permissive).toUpperCase()!==\`PERMISSIVE\`&&(0,z.jsx)(B,{variant:\`red\`,children:\`restrictive\`}),(0,z.jsx)(B,{variant:\`neutral\`,children:Array.isArray(e.roles)?e.roles.join(\`, \`):String(e.roles)}),(0,z.jsx)(\`button\`,{className:\`ml-auto p-1 text-muted-foreground/80 hover:text-destructive\`,title:\`Drop policy\`,onClick:t=>{t.stopPropagation(),p(e)},children:(0,z.jsx)(At,{size:13})})]}),e.using_expr&&(0,z.jsxs)(\`p\`,{className:\`mt-1.5 truncate font-mono text-[11px] text-muted-foreground/80\`,title:e.using_expr,children:[\`using (\`,e.using_expr,\`)\`]}),e.with_check&&(0,z.jsxs)(\`p\`,{className:\`mt-0.5 truncate font-mono text-[11px] text-muted-foreground/80\`,title:e.with_check,children:[\`with check (\`,e.with_check,\`)\`]})]},e.name)),i.policies.length===0&&(0,z.jsxs)(\`p\`,{className:\`rounded-md border border-dashed border-border px-3 py-4 text-center text-xs text-muted-foreground/60\`,children:[\`No policies on this table yet. Start from a template →\`,\` \`,(0,z.jsx)(\`button\`,{className:\`text-brand hover:underline\`,onClick:()=>s(!0),children:\`Create policy\`})]})]})]})]}):(0,z.jsx)(Jp,{}),o&&(0,z.jsx)(Og,{table:e,schema:t,onClose:()=>s(!1),onCreated:async()=>{await m(),r?.()}}),c&&(0,z.jsx)(Og,{table:e,schema:t,existing:jg(c),onClose:()=>l(null),onCreated:async()=>{await m(),r?.()}}),u&&(0,z.jsx)(q,{open:!0,danger:!0,title:\`Disable RLS on "\${e}"?\`,description:\`Every role — including anon — will be able to read and write all rows through the API.\`,confirmLabel:\`Disable RLS\`,onConfirm:()=>void h(!1),onClose:()=>d(!1)}),f&&(0,z.jsx)(q,{open:!0,danger:!0,title:\`Drop policy "\${f.name}"?\`,description:\`Access rules for this table change immediately.\`,confirmLabel:\`Drop policy\`,onConfirm:()=>void g(f),onClose:()=>p(null)})]})}function Rg(){let[e]=qh(),[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)([]),[s,c]=(0,_.useState)(\`\`),[l,u]=(0,_.useState)(!1),[d,f]=(0,_.useState)(null),[p,m]=(0,_.useState)(null),h=(0,_.useCallback)(()=>{Promise.all([N.policies(e),N.tables(e)]).then(([e,t])=>{i(null),n(e),o(t.filter(e=>!e.isView).map(e=>e.name))},e=>{i(e?.message??\`Query failed\`),n(e=>e??[])})},[e]);(0,_.useEffect)(()=>{h();let e=setInterval(()=>void h(),5e3);return()=>clearInterval(e)},[h]);async function g(e){try{await N.dropPolicy(e.table,e.name),H.success(\`Dropped policy \${e.name}\`),h()}catch(e){H.error(e.message)}}if(t===null)return(0,z.jsx)(Jp,{});let v=t.filter(e=>(e.table+e.name).toLowerCase().includes(s.toLowerCase())),y=new Map;for(let e of v)y.has(e.table)||y.set(e.table,[]),y.get(e.table).push(e);return(0,z.jsxs)(\`div\`,{className:\`flex h-full flex-col\`,children:[(0,z.jsx)($h,{title:\`Policies\`,description:\`Row Level Security policies across every table — who can see and write which rows.\`,search:s,onSearch:c,onRefresh:h,schemaPicker:!0,actions:(0,z.jsxs)(V,{size:\`xs\`,onClick:()=>u(!0),children:[(0,z.jsx)(mt,{size:12}),\` New policy\`]})}),r&&(0,z.jsx)(ff,{message:r}),(0,z.jsxs)(\`div\`,{className:\`min-h-0 flex-1 space-y-5 overflow-y-auto p-6\`,children:[[...y].map(([e,t])=>(0,z.jsxs)(\`div\`,{children:[(0,z.jsxs)(\`div\`,{className:\`mb-1.5 flex items-center gap-2\`,children:[(0,z.jsx)(St,{size:13,className:\`text-brand\`}),(0,z.jsx)(\`span\`,{className:\`font-mono text-[13px] text-foreground/90\`,children:e}),(0,z.jsxs)(\`span\`,{className:\`text-[11px] text-muted-foreground/60\`,children:[t.length,\` \`,t.length===1?\`policy\`:\`policies\`]})]}),(0,z.jsx)(\`div\`,{className:\`space-y-2\`,children:t.map(e=>(0,z.jsxs)(\`div\`,{className:\`cursor-pointer rounded-md border border-border bg-card p-3 transition-colors hover:border-muted-foreground/60\`,title:\`Edit policy\`,onClick:()=>f(e),children:[(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-2\`,children:[(0,z.jsx)(\`span\`,{className:\`truncate font-mono text-[13px] text-foreground\`,children:e.name}),(0,z.jsx)(B,{variant:\`blue\`,children:e.cmd}),String(e.permissive).toUpperCase()!==\`PERMISSIVE\`&&(0,z.jsx)(B,{variant:\`red\`,children:\`restrictive\`}),(0,z.jsx)(B,{variant:\`neutral\`,children:Array.isArray(e.roles)?e.roles.join(\`, \`):String(e.roles)}),(0,z.jsx)(\`button\`,{className:\`ml-auto p-1 text-muted-foreground/80 hover:text-destructive\`,title:\`Drop policy\`,onClick:t=>{t.stopPropagation(),m(e)},children:(0,z.jsx)(At,{size:13})})]}),e.using_expr&&(0,z.jsxs)(\`p\`,{className:\`mt-1.5 truncate font-mono text-[11px] text-muted-foreground/80\`,title:e.using_expr,children:[\`using (\`,e.using_expr,\`)\`]}),e.with_check&&(0,z.jsxs)(\`p\`,{className:\`mt-0.5 truncate font-mono text-[11px] text-muted-foreground/80\`,title:e.with_check,children:[\`with check (\`,e.with_check,\`)\`]})]},e.name))})]},e)),v.length===0&&(0,z.jsx)(lf,{children:t.length===0?\`No policies yet. Create one to start restricting access.\`:\`No match.\`})]}),l&&(0,z.jsx)(Og,{tables:a,schema:e,onClose:()=>u(!1),onCreated:async()=>h()}),d&&(0,z.jsx)(Og,{table:d.table,schema:e,existing:jg(d),onClose:()=>f(null),onCreated:async()=>h()}),p&&(0,z.jsx)(q,{open:!0,danger:!0,title:\`Drop policy "\${p.name}"?\`,description:\`Access rules for "\${p.table}" change immediately.\`,confirmLabel:\`Drop policy\`,onConfirm:()=>void g(p),onClose:()=>m(null)})]})}var zg=new Set([\`postgres\`,\`anon\`,\`authenticated\`,\`authenticator\`,\`service_role\`]),Bg=[{key:\`login\`,label:\`User can login\`,sql:e=>e?\`login\`:\`nologin\`},{key:\`createrole\`,label:\`User can create roles\`,sql:e=>e?\`createrole\`:\`nocreaterole\`},{key:\`createdb\`,label:\`User can create databases\`,sql:e=>e?\`createdb\`:\`nocreatedb\`},{key:\`bypassrls\`,label:\`User bypasses every row level security policy\`,sql:e=>e?\`bypassrls\`:\`nobypassrls\`},{key:\`replication\`,label:\`User can initiate streaming replication and put the system in and out of backup mode\`,sql:e=>e?\`replication\`:\`noreplication\`}];function Vg(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(null),[i,a]=(0,_.useState)(\`\`),[o,s]=(0,_.useState)(null),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)(null),f=(0,_.useCallback)(async()=>{let e=await N.sql(\`select r.rolname as name, r.oid::int as oid, r.rolsuper as "super", r.rolcanlogin as login,
|
|
1537
1537
|
r.rolcreatedb as createdb, r.rolcreaterole as createrole,
|
|
1538
1538
|
r.rolreplication as replication, r.rolbypassrls as bypassrls,
|
|
1539
1539
|
r.rolconnlimit as connlimit,
|
|
1540
1540
|
coalesce((select count(*)::int from pg_stat_activity a where a.usename = r.rolname), 0) as connections
|
|
1541
|
-
from pg_roles r where r.rolname not like 'pg\\\\_%' order by r.rolname\`);if(!e.ok){r(e.error??\`Query failed\`),t(e=>e??[]);return}r(null),t(e.rows??[])},[]);(0,_.useEffect)(()=>{f();let e=setInterval(()=>void f(),5e3);return()=>clearInterval(e)},[f]);async function p(e,t,n){let r=await N.sql(\`alter role \${
|
|
1541
|
+
from pg_roles r where r.rolname not like 'pg\\\\_%' order by r.rolname\`);if(!e.ok){r(e.error??\`Query failed\`),t(e=>e??[]);return}r(null),t(e.rows??[])},[]);(0,_.useEffect)(()=>{f();let e=setInterval(()=>void f(),5e3);return()=>clearInterval(e)},[f]);async function p(e,t,n){let r=await N.sql(\`alter role \${eg(e.name)} \${t.sql(n)}\`);if(!r.ok){H.error(r.error??\`Failed to change privilege\`);return}H.success(\`\${e.name}: \${t.sql(n)}\`),await f()}async function m(e){let t=await N.sql(\`drop role \${eg(e.name)}\`);if(!t.ok){H.error(t.error??\`Drop failed — the role may still own objects or have grants\`);return}H.success(\`Dropped role \${e.name}\`),await f()}if(e===null)return(0,z.jsx)(Jp,{});let h=e.filter(e=>e.name.toLowerCase().includes(i.toLowerCase())),g=h.filter(e=>zg.has(e.name)),v=h.filter(e=>!zg.has(e.name)),y=e.reduce((e,t)=>e+t.connections,0),b=(e,t)=>{let n=o===e.name;return(0,z.jsxs)(\`div\`,{className:\`border-b border-border/60 last:border-b-0\`,children:[(0,z.jsxs)(\`button\`,{className:\`flex w-full items-center gap-2.5 px-4 py-2.5 text-left transition-colors hover:bg-accent/40\`,onClick:()=>s(n?null:e.name),children:[n?(0,z.jsx)(me,{size:13,className:\`shrink-0 text-muted-foreground/60\`}):(0,z.jsx)(ge,{size:13,className:\`shrink-0 text-muted-foreground/60\`}),(0,z.jsx)(\`span\`,{className:\`font-mono text-[13px] text-foreground\`,children:e.name}),(0,z.jsxs)(\`span\`,{className:\`text-[11px] text-muted-foreground/60\`,children:[\`(ID: \`,e.oid,\`)\`]}),e.super&&(0,z.jsx)(B,{variant:\`amber\`,children:\`superuser\`}),[\`anon\`,\`authenticated\`,\`service_role\`].includes(e.name)&&(0,z.jsx)(B,{variant:\`brand\`,children:\`api\`}),(0,z.jsxs)(\`span\`,{className:\`ml-auto flex items-center gap-1.5 text-[12px] text-muted-foreground\`,children:[e.connections>0&&(0,z.jsx)(\`span\`,{className:\`size-1.5 rounded-full bg-brand\`}),e.connections,\` connection\`,e.connections===1?\`\`:\`s\`]}),!t&&(0,z.jsx)(\`span\`,{role:\`button\`,title:\`Drop role\`,className:\`rounded p-1 text-muted-foreground/70 hover:bg-muted hover:text-destructive\`,onClick:t=>{t.stopPropagation(),d(e)},children:(0,z.jsx)(At,{size:13})})]}),n&&(0,z.jsxs)(\`div\`,{className:\`space-y-3 px-11 pb-4 pt-1\`,children:[Bg.map(n=>(0,z.jsxs)(\`label\`,{className:\`flex items-center gap-3 text-[13px] text-foreground/85 \`+(t?\`opacity-70\`:\`\`),children:[(0,z.jsx)(Yp,{checked:!!e[n.key],disabled:t,onChange:t=>void p(e,n,t)}),n.label]},n.key)),(0,z.jsxs)(\`label\`,{className:\`flex items-center gap-3 text-[13px] text-foreground/85 opacity-70\`,children:[(0,z.jsx)(Yp,{checked:e.super,disabled:!0}),\`User is a Superuser \`,(0,z.jsx)(\`span\`,{className:\`text-[11px] text-muted-foreground/60\`,children:\`— cannot be granted via the dashboard\`})]})]})]},e.name)};return(0,z.jsxs)(\`div\`,{className:\`flex h-full flex-col\`,children:[(0,z.jsx)($h,{title:\`Roles\`,description:\`Manage access control to your database through users, groups, and permissions.\`,search:i,onSearch:a,onRefresh:()=>void f(),filters:(0,z.jsxs)(\`span\`,{className:\`ml-auto shrink-0 text-[11px] text-muted-foreground/70\`,children:[\`Active connections \`,(0,z.jsx)(\`span\`,{className:\`tabular-nums text-foreground/80\`,children:y})]}),actions:(0,z.jsxs)(V,{size:\`xs\`,onClick:()=>l(!0),children:[(0,z.jsx)(mt,{size:12}),\` Add role\`]})}),n&&(0,z.jsx)(ff,{message:n}),(0,z.jsxs)(\`div\`,{className:\`min-h-0 flex-1 space-y-5 overflow-y-auto p-6\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsxs)(\`div\`,{className:\`mb-1.5 flex items-center gap-2\`,children:[(0,z.jsx)(\`p\`,{className:\`text-[13px] text-foreground/90\`,children:\`Roles managed by tinbase\`}),(0,z.jsx)(B,{variant:\`brand\`,children:\`PROTECTED\`})]}),(0,z.jsxs)(\`div\`,{className:\`rounded-md border border-border bg-card\`,children:[g.map(e=>b(e,!0)),g.length===0&&(0,z.jsx)(\`p\`,{className:\`px-4 py-3 text-xs text-muted-foreground/60\`,children:\`No match.\`})]})]}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(\`p\`,{className:\`mb-1.5 text-[13px] text-foreground/90\`,children:\`Custom roles\`}),(0,z.jsxs)(\`div\`,{className:\`rounded-md border border-border bg-card\`,children:[v.map(e=>b(e,!1)),v.length===0&&(0,z.jsxs)(lf,{children:[\`No custom roles yet —\`,\` \`,(0,z.jsx)(\`button\`,{className:\`text-brand hover:underline\`,onClick:()=>l(!0),children:\`add one\`}),\`.\`]})]})]})]}),c&&(0,z.jsx)(Hg,{onClose:()=>l(!1),onDone:async()=>{l(!1),await f()}}),u&&(0,z.jsx)(q,{open:!0,danger:!0,title:\`Drop role "\${u.name}"?\`,description:\`Grants and policies referencing this role will stop matching. Fails if the role still owns objects.\`,confirmLabel:\`Drop role\`,onConfirm:()=>void m(u),onClose:()=>d(null)})]})}function Hg({onClose:e,onDone:t}){let[n,r]=(0,_.useState)(\`\`),[i,a]=(0,_.useState)({}),[o,s]=(0,_.useState)(!1),[c,l]=(0,_.useState)(\`\`);async function u(){if(!n.trim())return l(\`Role name is required.\`);s(!0),l(\`\`);let e=Bg.map(e=>e.sql(!!i[e.key])).join(\` \`),r=await N.sql(\`create role \${eg(n.trim())} \${e}\`);if(!r.ok){l(r.error??\`Create failed\`),s(!1);return}H.success(\`Created role \${n.trim()}\`),await t()}return(0,z.jsx)(qp,{open:!0,onClose:e,width:\`w-135\`,title:\`Create a new role\`,footer:(0,z.jsxs)(z.Fragment,{children:[c&&(0,z.jsx)(\`p\`,{className:\`min-w-0 truncate text-xs text-destructive\`,children:c}),(0,z.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-2\`,children:[(0,z.jsx)(Kp,{asChild:!0,children:(0,z.jsx)(V,{variant:\`outline\`,children:\`Cancel\`})}),(0,z.jsx)(V,{onClick:()=>void u(),disabled:o||!n.trim(),children:o?\`Creating…\`:\`Create role\`})]})]}),children:(0,z.jsxs)(\`div\`,{className:\`space-y-4\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Name\`}),(0,z.jsx)(Y,{mono:!0,value:n,autoFocus:!0,onChange:e=>r(e.target.value)})]}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Role privileges\`}),(0,z.jsx)(\`div\`,{className:\`space-y-2.5\`,children:Bg.map(e=>(0,z.jsxs)(\`label\`,{className:\`flex items-center gap-3 text-[13px] text-foreground/85\`,children:[(0,z.jsx)(Yp,{checked:!!i[e.key],onChange:t=>a(n=>({...n,[e.key]:t}))}),e.label]},e.key))}),(0,z.jsxs)(\`div\`,{className:\`mt-3 border-t border-border pt-3\`,children:[(0,z.jsx)(\`p\`,{className:\`mb-2 text-[12px] font-medium text-foreground/80\`,children:\`These privileges cannot be granted via the dashboard:\`}),(0,z.jsxs)(\`label\`,{className:\`flex items-center gap-3 text-[13px] text-foreground/85 opacity-60\`,children:[(0,z.jsx)(Yp,{checked:!1,disabled:!0}),\`User is a Superuser\`]})]})]})]})})}function Ug(){let[e]=qh(),[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(\`\`),s=(0,_.useCallback)(async()=>{try{let[t,r]=await Promise.all([N.tables(e),N.sql(\`select c.relname as name, c.relrowsecurity as rls,
|
|
1542
1542
|
coalesce('security_invoker=true' = any(c.reloptions) or 'security_invoker=on' = any(c.reloptions), false) as invoker,
|
|
1543
1543
|
case when c.relkind = 'r' then pg_size_pretty(pg_total_relation_size(c.oid)) end as size,
|
|
1544
|
-
(select count(*)::int from pg_policies p where p.schemaname = \${
|
|
1544
|
+
(select count(*)::int from pg_policies p where p.schemaname = \${tg(e)} and p.tablename = c.relname) as policies
|
|
1545
1545
|
from pg_class c join pg_namespace n on n.oid = c.relnamespace
|
|
1546
|
-
where n.nspname = \${
|
|
1546
|
+
where n.nspname = \${tg(e)} and c.relkind in ('r','v') order by c.relname\`)]);i(r.ok?null:r.error??\`Query failed\`);let a=new Map(((r.ok?r.rows:[])??[]).map(e=>[e.name,e]));n(t.map(e=>{let t=a.get(e.name);return{name:e.name,rows:e.rowCount,size:t?.size??\`—\`,rls:!!t?.rls,policies:t?.policies??0,pk:e.primaryKey.length>0,view:!!e.isView,invoker:!!t?.invoker}}))}catch(e){i(e?.message??\`Query failed\`),n(e=>e??[])}},[e]);if((0,_.useEffect)(()=>{s();let e=setInterval(()=>void s(),5e3);return()=>clearInterval(e)},[s]),t===null)return(0,z.jsx)(Jp,{});let c=t.filter(e=>e.name.toLowerCase().includes(a.toLowerCase())),l=Zh(e);return(0,z.jsxs)(\`div\`,{className:\`flex h-full flex-col\`,children:[(0,z.jsx)($h,{title:\`Tables\`,description:\`Every table in the selected schema — size, rows, and Row Level Security posture.\`,search:a,onSearch:o,onRefresh:()=>void s(),schemaPicker:!0}),r&&(0,z.jsx)(ff,{message:r}),l&&(0,z.jsxs)(\`div\`,{className:\`flex shrink-0 items-center gap-2 border-b border-border bg-accent/40 px-6 py-2 text-xs text-muted-foreground\`,children:[(0,z.jsx)(Ze,{size:13,className:\`shrink-0\`}),(0,z.jsxs)(\`span\`,{children:[\`The \`,(0,z.jsx)(\`span\`,{className:\`font-mono text-foreground/80\`,children:e}),\` schema is managed by tinbase. It isn't exposed to anon/authenticated through the Data API — access is controlled by grants, so tables here don't need RLS policies.\`]})]}),(0,z.jsxs)(\`div\`,{className:\`min-h-0 flex-1 overflow-auto\`,children:[(0,z.jsxs)(Xp,{children:[(0,z.jsx)(Zp,{children:(0,z.jsxs)(\`tr\`,{children:[(0,z.jsx)(Z,{children:\`Name\`}),(0,z.jsx)(Z,{children:\`Rows\`}),(0,z.jsx)(Z,{children:\`Size\`}),(0,z.jsx)(Z,{children:\`RLS\`}),(0,z.jsx)(Z,{children:\`Policies\`}),(0,z.jsx)(Z,{className:\`w-10\`})]})}),(0,z.jsx)(\`tbody\`,{children:c.map(e=>(0,z.jsxs)(Qp,{className:\`cursor-pointer\`,onClick:()=>R(\`table\`,e.name),children:[(0,z.jsx)(Q,{className:\`font-mono text-foreground/90\`,children:(0,z.jsxs)(\`span\`,{className:\`flex items-center gap-1.5\`,children:[e.view?(0,z.jsx)(Ae,{size:12,className:\`shrink-0 text-muted-foreground/60\`}):(0,z.jsx)(Ot,{size:12,className:\`shrink-0 text-muted-foreground/50\`}),e.name,e.view&&(0,z.jsx)(B,{variant:\`neutral\`,children:\`view\`}),!e.pk&&!e.view&&(0,z.jsx)(\`span\`,{title:\`No primary key\`,children:(0,z.jsx)(Ke,{size:11,className:\`text-warning\`})})]})}),(0,z.jsx)(Q,{className:\`tabular-nums text-muted-foreground\`,children:e.rows.toLocaleString()}),(0,z.jsx)(Q,{className:\`font-mono text-muted-foreground\`,children:e.view?\`—\`:e.size}),(0,z.jsx)(Q,{children:e.view?e.invoker?(0,z.jsx)(\`span\`,{title:\`security_invoker — the caller's RLS applies through this view\`,children:(0,z.jsx)(B,{variant:\`neutral\`,children:\`invoker\`})}):(0,z.jsx)(\`span\`,{title:l?\`Owner-rights view in a grant-protected schema\`:\`Runs with the owner's permissions — RLS on the underlying tables is bypassed\`,children:(0,z.jsx)(B,{variant:l?\`neutral\`:\`red\`,children:l?\`definer\`:\`unrestricted\`})}):e.rls?(0,z.jsx)(B,{variant:\`brand\`,children:\`enabled\`}):(0,z.jsx)(\`span\`,{title:l?\`Protected by grants — not exposed through the Data API\`:\`RLS is disabled — all rows are exposed to every role\`,children:(0,z.jsx)(B,{variant:l?\`neutral\`:\`red\`,children:\`disabled\`})})}),(0,z.jsx)(Q,{className:\`tabular-nums text-muted-foreground\`,children:e.view?\`—\`:e.policies}),(0,z.jsx)(Q,{children:(0,z.jsx)(de,{size:13,className:\`text-muted-foreground/60 opacity-0 group-hover:opacity-100\`})})]},e.name))})]}),c.length===0&&(0,z.jsx)(lf,{children:t.length===0?\`No tables yet.\`:\`No match.\`})]})]})}function Wg(){let[e]=qh(),[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(\`\`),[s,c]=(0,_.useState)(!1),[l,u]=(0,_.useState)(null),d=(0,_.useCallback)(async()=>{let t=await N.sql(\`select tg.tgname as name, c.relname as "table", tg.tgenabled <> 'D' as enabled,
|
|
1547
1547
|
case when (tg.tgtype & 2) <> 0 then 'BEFORE' else 'AFTER' end as timing,
|
|
1548
1548
|
array_remove(array[
|
|
1549
1549
|
case when (tg.tgtype & 4) <> 0 then 'INSERT' end,
|
|
@@ -1554,16 +1554,16 @@ with (security_invoker = on)\`:\`\`} as\\n\${(i?.def??\`…\`).trim()}\`,g=Math.
|
|
|
1554
1554
|
join pg_class c on c.oid = tg.tgrelid
|
|
1555
1555
|
join pg_namespace n on n.oid = c.relnamespace
|
|
1556
1556
|
join pg_proc p on p.oid = tg.tgfoid
|
|
1557
|
-
where n.nspname = \${
|
|
1558
|
-
order by c.relname, tg.tgname\`);if(!t.ok){i(t.error??\`Query failed\`),n(e=>e??[]);return}i(null),n(t.rows??[])},[e]);(0,_.useEffect)(()=>{d();let e=setInterval(()=>void d(),5e3);return()=>clearInterval(e)},[d]);async function f(t){let n=await N.sql(\`alter table \${
|
|
1559
|
-
\${d.toLowerCase()} \${T.join(\` or \`)} on \${
|
|
1557
|
+
where n.nspname = \${tg(e)} and not tg.tgisinternal
|
|
1558
|
+
order by c.relname, tg.tgname\`);if(!t.ok){i(t.error??\`Query failed\`),n(e=>e??[]);return}i(null),n(t.rows??[])},[e]);(0,_.useEffect)(()=>{d();let e=setInterval(()=>void d(),5e3);return()=>clearInterval(e)},[d]);async function f(t){let n=await N.sql(\`alter table \${eg(e)}.\${eg(t.table)} \${t.enabled?\`disable\`:\`enable\`} trigger \${eg(t.name)}\`);if(!n.ok){H.error(n.error??\`Failed\`);return}H.success(\`\${t.enabled?\`Disabled\`:\`Enabled\`} \${t.name}\`),await d()}async function p(t){let n=await N.sql(\`drop trigger \${eg(t.name)} on \${eg(e)}.\${eg(t.table)}\`);if(!n.ok){H.error(n.error??\`Drop failed\`);return}H.success(\`Dropped trigger \${t.name}\`),await d()}if(t===null)return(0,z.jsx)(Jp,{});let m=t.filter(e=>(e.name+e.table).toLowerCase().includes(a.toLowerCase()));return(0,z.jsxs)(\`div\`,{className:\`flex h-full flex-col\`,children:[(0,z.jsx)($h,{title:\`Triggers\`,description:\`Functions that fire automatically on table events.\`,search:a,onSearch:o,onRefresh:()=>void d(),schemaPicker:!0,actions:(0,z.jsxs)(V,{size:\`xs\`,onClick:()=>c(!0),children:[(0,z.jsx)(mt,{size:12}),\` New trigger\`]})}),r&&(0,z.jsx)(ff,{message:r}),(0,z.jsxs)(\`div\`,{className:\`min-h-0 flex-1 overflow-auto\`,children:[(0,z.jsxs)(Xp,{children:[(0,z.jsx)(Zp,{children:(0,z.jsxs)(\`tr\`,{children:[(0,z.jsx)(Z,{children:\`Name\`}),(0,z.jsx)(Z,{children:\`Table\`}),(0,z.jsx)(Z,{children:\`Fires\`}),(0,z.jsx)(Z,{children:\`Function\`}),(0,z.jsx)(Z,{children:\`Status\`}),(0,z.jsx)(Z,{className:\`w-20\`})]})}),(0,z.jsx)(\`tbody\`,{children:m.map(e=>(0,z.jsxs)(Qp,{children:[(0,z.jsx)(Q,{className:\`font-mono text-foreground/90\`,children:e.name}),(0,z.jsx)(Q,{className:\`font-mono text-muted-foreground\`,children:e.table}),(0,z.jsxs)(Q,{className:\`text-muted-foreground\`,children:[e.timing,\` \`,zt(e.events).join(\` | \`)]}),(0,z.jsxs)(Q,{className:\`font-mono text-[11px] text-muted-foreground/80\`,children:[e.function,\`()\`]}),(0,z.jsx)(Q,{children:e.enabled?(0,z.jsx)(B,{variant:\`brand\`,children:\`enabled\`}):(0,z.jsx)(B,{variant:\`neutral\`,children:\`disabled\`})}),(0,z.jsx)(Q,{children:(0,z.jsxs)(\`div\`,{className:\`flex justify-end gap-0.5 opacity-0 group-hover:opacity-100\`,children:[(0,z.jsx)(\`button\`,{className:\`p-1 text-muted-foreground/80 hover:text-foreground\`,title:e.enabled?\`Disable\`:\`Enable\`,onClick:()=>void f(e),children:e.enabled?(0,z.jsx)(ct,{size:13}):(0,z.jsx)(ft,{size:13})}),(0,z.jsx)(\`button\`,{className:\`p-1 text-muted-foreground/80 hover:text-destructive\`,title:\`Drop\`,onClick:()=>u(e),children:(0,z.jsx)(At,{size:13})})]})})]},e.table+e.name))})]}),m.length===0&&(0,z.jsx)(lf,{children:t.length===0?\`No triggers.\`:\`No match.\`})]}),s&&(0,z.jsx)(Gg,{schema:e,onClose:()=>c(!1),onDone:async()=>{c(!1),await d()}}),l&&(0,z.jsx)(q,{open:!0,danger:!0,title:\`Drop trigger "\${l.name}"?\`,description:\`The trigger on "\${l.table}" will stop firing immediately.\`,confirmLabel:\`Drop trigger\`,onConfirm:()=>void p(l),onClose:()=>u(null)})]})}function Gg({schema:e,onClose:t,onDone:n}){let[r,i]=(0,_.useState)(\`\`),[a,o]=(0,_.useState)(\`\`),[s,c]=(0,_.useState)([]),[l,u]=(0,_.useState)(new Set([\`INSERT\`])),[d,f]=(0,_.useState)(\`AFTER\`),[p,m]=(0,_.useState)(\`ROW\`),[h,g]=(0,_.useState)(\`\`),[v,y]=(0,_.useState)([]),[b,x]=(0,_.useState)(!1),[S,C]=(0,_.useState)(\`\`);(0,_.useEffect)(()=>{N.tables(e).then(e=>{let t=e.filter(e=>!e.isView).map(e=>e.name);c(t),o(e=>e||(t[0]??\`\`))},()=>{}),N.functions(e).then(e=>y(e.filter(e=>e.returns===\`trigger\`).map(e=>e.name)),()=>{})},[e]);function w(e){u(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}let T=[\`INSERT\`,\`UPDATE\`,\`DELETE\`].filter(e=>l.has(e));async function E(){if(!r.trim()||!a||T.length===0||!h)return C(\`Name, table, at least one event, and a function are required.\`);x(!0),C(\`\`);let t=\`create trigger \${eg(r.trim())}
|
|
1559
|
+
\${d.toLowerCase()} \${T.join(\` or \`)} on \${Yh(e,a)}
|
|
1560
1560
|
for each \${p.toLowerCase()}
|
|
1561
|
-
execute function \${Jh(e,h)}()\`,i=await N.sql(t);if(!i.ok){C(i.error??\`Create failed\`),x(!1);return}H.success(\`Created trigger \${r.trim()}\`),await n()}return(0,z.jsx)(qp,{open:!0,onClose:t,width:\`w-140\`,title:\`Create a new database trigger\`,footer:(0,z.jsxs)(z.Fragment,{children:[S&&(0,z.jsx)(\`p\`,{className:\`min-w-0 truncate text-xs text-destructive\`,children:S}),(0,z.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-2\`,children:[(0,z.jsx)(Kp,{asChild:!0,children:(0,z.jsx)(V,{variant:\`outline\`,children:\`Cancel\`})}),(0,z.jsx)(V,{onClick:()=>void E(),disabled:b||!r.trim()||!a||T.length===0||!h,children:b?\`Creating…\`:\`Create trigger\`})]})]}),children:(0,z.jsxs)(\`div\`,{className:\`space-y-3\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Name of trigger\`}),(0,z.jsx)(lf,{mono:!0,value:r,autoFocus:!0,placeholder:\`set_updated_at\`,onChange:e=>i(e.target.value.replace(/\\s/g,\`_\`))}),(0,z.jsx)(\`p\`,{className:\`mt-1 text-[11px] text-muted-foreground/60\`,children:\`Do not use spaces/whitespace.\`})]}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Table\`}),(0,z.jsx)(Wp,{mono:!0,value:a,onValueChange:o,placeholder:\`Pick a table…\`,options:s.map(t=>({value:t,label:\`\${e}.\${t}\`}))}),(0,z.jsx)(\`p\`,{className:\`mt-1 text-[11px] text-muted-foreground/60\`,children:\`The trigger watches for changes on this table.\`})]}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Events\`}),(0,z.jsx)(\`div\`,{className:\`space-y-1.5\`,children:[\`INSERT\`,\`UPDATE\`,\`DELETE\`].map(e=>(0,z.jsxs)(\`label\`,{className:\`flex cursor-pointer items-center gap-2 text-[13px] text-foreground/85\`,children:[(0,z.jsx)($t,{checked:l.has(e),onChange:()=>w(e)}),(0,z.jsx)(\`span\`,{className:\`font-mono\`,children:e})]},e))})]}),(0,z.jsxs)(\`div\`,{className:\`grid grid-cols-2 gap-3\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Trigger type\`}),(0,z.jsx)(Wp,{value:d,onValueChange:e=>f(e),options:[{value:\`BEFORE\`,label:\`Before the event\`},{value:\`AFTER\`,label:\`After the event\`}]})]}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Orientation\`}),(0,z.jsx)(Wp,{value:p,onValueChange:e=>m(e),options:[{value:\`ROW\`,label:\`Row\`},{value:\`STATEMENT\`,label:\`Statement\`}]})]})]}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Function to trigger\`}),v.length>0?(0,z.jsx)(Wp,{mono:!0,value:h,onValueChange:g,placeholder:\`Choose a function…\`,options:v.map(e=>({value:e,label:\`\${e}()\`}))}):(0,z.jsxs)(\`p\`,{className:\`rounded-md border border-dashed border-border px-3 py-2.5 text-xs text-muted-foreground/80\`,children:[\`No trigger functions in \`,(0,z.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:e}),\` yet — create one under Functions with return type \`,(0,z.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`trigger\`}),\` first.\`]})]})]})})}var Gg=240,Kg=32,qg=22,Jg=36,Yg=60,Xg=e=>Kg+e.columns.length*qg+6;function Zg(e){let t=new Map(e.map(e=>[e.name,e])),n=new Map;function r(e,i){if(n.has(e))return n.get(e);if(i.has(e))return 0;let a=t.get(e);if(!a)return 0;i.add(e);let o=0;for(let n of a.foreignKeys){let a=n.target.split(\`.\`).pop();a===e||!t.has(a)||(o=Math.max(o,r(a,i)+1))}return i.delete(e),n.set(e,o),o}let i=new Map;for(let t of e){let e=r(t.name,new Set);i.has(e)||i.set(e,[]),i.get(e).push(t)}let a={};for(let[e,t]of[...i.entries()].sort((e,t)=>e[0]-t[0])){t.sort((e,t)=>t.columns.length-e.columns.length);let n=Yg;for(let r of t)a[r.name]={x:Yg+e*350,y:n},n+=Xg(r)+Jg}return a}function Qg(){let[e]=Kh(),[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)({}),[a,o]=(0,_.useState)({x:0,y:0}),[s,c]=(0,_.useState)(1),[l,u]=(0,_.useState)(\`\`),[d,f]=(0,_.useState)(null),p=(0,_.useRef)(null),m=(0,_.useCallback)(()=>{n(null),N.tables(e).then(e=>{n(e),i(Zg(e)),o({x:0,y:0}),c(e.length>8?.8:1)},()=>n([]))},[e]);(0,_.useEffect)(()=>{m()},[m]);let h=(0,_.useRef)(null);(0,_.useEffect)(()=>{h.current=t},[t]),(0,_.useEffect)(()=>{let t=setInterval(()=>{N.tables(e).then(e=>{let t=h.current;t&&JSON.stringify(e.map(e=>[e.name,e.columns.length]))!==JSON.stringify(t.map(e=>[e.name,e.columns.length]))&&(n(e),i(t=>{let n={...Zg(e),...t};for(let t of Object.keys(n))e.some(e=>e.name===t)||delete n[t];return n}))},()=>{})},5e3);return()=>clearInterval(t)},[e]);let g=(0,_.useMemo)(()=>{if(!t)return[];let e=new Map(t.map(e=>[e.name,e])),n=[];for(let i of t){let t=r[i.name];if(t)for(let[a,o]of i.foreignKeys.entries()){let s=o.target.split(\`.\`).pop(),c=e.get(s),l=c&&r[s];if(!c||!l)continue;let u=Math.max(0,i.columns.findIndex(e=>e.name===o.columns[0])),d=t.y+Kg+u*qg+qg/2,f=l.x+Gg/2<t.x+Gg/2,p={x:f?t.x:t.x+Gg,y:d},m={x:f?l.x+Gg:l.x,y:l.y+Kg/2};n.push({from:p,to:m,key:\`\${i.name}-\${a}\`})}}return n},[t,r]);function v(e){let t=p.current;if(t)if(t.kind===\`pan\`)o({x:t.panX+(e.clientX-t.startX),y:t.panY+(e.clientY-t.startY)});else{let n=t.name;i(r=>({...r,[n]:{x:t.nodeX+(e.clientX-t.startX)/s,y:t.nodeY+(e.clientY-t.startY)/s}}))}}let y=()=>p.current=null;function b(e){c(t=>Math.min(1.6,Math.max(.3,Math.round(t*e*100)/100)))}function x(e){let t=r[e];t&&(f(e),o({x:-(t.x+Gg/2)*s+480,y:-(t.y+60)*s+240}),setTimeout(()=>f(t=>t===e?null:t),1600))}let S=l&&t?t.filter(e=>e.name.toLowerCase().includes(l.toLowerCase())).slice(0,8):[];return t===null?(0,z.jsx)(Jp,{}):(0,z.jsxs)(\`div\`,{className:\`flex h-full flex-col\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex shrink-0 items-center gap-2 border-b border-border px-4 py-2.5\`,children:[(0,z.jsx)(\`h1\`,{className:\`mr-2 text-sm font-semibold text-foreground\`,children:\`Schema Visualizer\`}),(0,z.jsx)(Zh,{}),(0,z.jsxs)(\`div\`,{className:\`relative w-56\`,children:[(0,z.jsx)(vt,{size:13,className:\`pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground/60\`}),(0,z.jsx)(\`input\`,{value:l,onChange:e=>u(e.target.value),placeholder:\`Find table…\`,className:\`h-8 w-full rounded-md border border-input bg-field pl-8 pr-2 text-[13px] text-foreground placeholder:text-muted-foreground/60 focus:border-brand focus:outline-none\`}),S.length>0&&(0,z.jsx)(\`div\`,{className:\`absolute left-0 top-full z-30 mt-1 w-full overflow-hidden rounded-md border border-input bg-popover py-1 shadow-xl\`,children:S.map(e=>(0,z.jsx)(\`button\`,{className:\`block w-full px-3 py-1.5 text-left font-mono text-xs text-foreground hover:bg-accent\`,onClick:()=>{x(e.name),u(\`\`)},children:e.name},e.name))})]}),(0,z.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-1.5\`,children:[(0,z.jsx)(V,{variant:\`ghost\`,size:\`iconXs\`,title:\`Zoom out\`,onClick:()=>b(1/1.2),children:(0,z.jsx)(nt,{size:13})}),(0,z.jsxs)(\`span\`,{className:\`w-10 text-center text-[11px] tabular-nums text-muted-foreground\`,children:[Math.round(s*100),\`%\`]}),(0,z.jsx)(V,{variant:\`ghost\`,size:\`iconXs\`,title:\`Zoom in\`,onClick:()=>b(1.2),children:(0,z.jsx)(mt,{size:13})}),(0,z.jsxs)(V,{variant:\`outline\`,size:\`xs\`,onClick:()=>{i(Zg(t)),o({x:0,y:0})},children:[(0,z.jsx)(qe,{size:12}),\` Auto layout\`]})]})]}),t.length===0?(0,z.jsx)(cf,{children:\`No tables in this schema yet — create one in the table editor or SQL editor.\`}):(0,z.jsxs)(\`div\`,{className:\`relative min-h-0 flex-1 cursor-grab overflow-hidden bg-background active:cursor-grabbing\`,style:{backgroundImage:\`radial-gradient(circle, var(--color-border) 1px, transparent 1px)\`,backgroundSize:\`\${24*s}px \${24*s}px\`,backgroundPosition:\`\${a.x}px \${a.y}px\`},onPointerDown:e=>{e.target===e.currentTarget&&(e.target.setPointerCapture(e.pointerId),p.current={kind:\`pan\`,startX:e.clientX,startY:e.clientY,panX:a.x,panY:a.y})},onPointerMove:v,onPointerUp:y,onPointerLeave:y,onWheel:e=>b(e.deltaY<0?1.08:1/1.08),children:[(0,z.jsxs)(\`div\`,{className:\`pointer-events-none absolute left-0 top-0\`,style:{transform:\`translate(\${a.x}px, \${a.y}px) scale(\${s})\`,transformOrigin:\`0 0\`},children:[(0,z.jsx)(\`svg\`,{className:\`absolute left-0 top-0 overflow-visible\`,width:1,height:1,children:g.map(e=>{let t=Math.max(40,Math.abs(e.to.x-e.from.x)/2),n=e.from.x<e.to.x?e.from.x+t:e.from.x-t,r=e.from.x<e.to.x?e.to.x-t:e.to.x+t;return(0,z.jsxs)(\`g\`,{children:[(0,z.jsx)(\`path\`,{d:\`M \${e.from.x} \${e.from.y} C \${n} \${e.from.y}, \${r} \${e.to.y}, \${e.to.x} \${e.to.y}\`,fill:\`none\`,stroke:\`var(--color-muted-foreground)\`,strokeOpacity:.45,strokeWidth:1.25}),(0,z.jsx)(\`circle\`,{cx:e.from.x,cy:e.from.y,r:2.5,fill:\`var(--color-muted-foreground)\`,fillOpacity:.7}),(0,z.jsx)(\`circle\`,{cx:e.to.x,cy:e.to.y,r:2.5,fill:\`var(--color-muted-foreground)\`,fillOpacity:.7})]},e.key)})}),t.map(e=>{let t=r[e.name];return t?(0,z.jsxs)(\`div\`,{className:\`pointer-events-auto absolute select-none overflow-hidden rounded-md border bg-card shadow-sm transition-shadow \`+(d===e.name?\`border-brand ring-2 ring-brand/40\`:\`border-border hover:border-muted-foreground/60\`),style:{left:t.x,top:t.y,width:Gg},children:[(0,z.jsxs)(\`div\`,{className:\`flex h-8 cursor-move items-center gap-1.5 border-b border-border bg-accent/40 px-2.5\`,onPointerDown:n=>{n.stopPropagation(),n.currentTarget.setPointerCapture(n.pointerId),p.current={kind:\`node\`,name:e.name,startX:n.clientX,startY:n.clientY,nodeX:t.x,nodeY:t.y}},onPointerMove:v,onPointerUp:y,children:[(0,z.jsx)(Ot,{size:12,className:\`shrink-0 text-muted-foreground\`}),(0,z.jsx)(\`button\`,{className:\`min-w-0 flex-1 truncate text-left font-mono text-xs font-medium text-foreground hover:text-brand\`,title:\`Open in table editor\`,onClick:()=>R(\`table\`,e.name),children:e.name}),(0,z.jsx)(\`span\`,{className:\`text-[10px] tabular-nums text-muted-foreground/60\`,children:e.rowCount.toLocaleString()})]}),(0,z.jsx)(\`div\`,{className:\`py-0.5\`,children:e.columns.map(e=>(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-1.5 px-2.5\`,style:{height:qg},children:[e.isPrimaryKey?(0,z.jsx)(Ke,{size:9,className:\`shrink-0 text-warning\`}):(0,z.jsx)(Te,{size:8,className:\`shrink-0 \`+(e.nullable?\`text-muted-foreground/50\`:\`fill-muted-foreground/60 text-muted-foreground/60\`)}),(0,z.jsx)(\`span\`,{className:\`min-w-0 flex-1 truncate font-mono text-[11px] text-foreground/85\`,children:e.name}),(0,z.jsx)(\`span\`,{className:\`shrink-0 font-mono text-[10px] text-muted-foreground/50\`,children:e.type})]},e.name))})]},e.name):null})]}),(0,z.jsxs)(\`div\`,{className:\`pointer-events-none absolute bottom-0 left-0 right-0 flex items-center justify-center gap-5 border-t border-border bg-background/80 py-1.5 font-mono text-[11px] text-muted-foreground backdrop-blur\`,children:[(0,z.jsxs)(\`span\`,{className:\`flex items-center gap-1.5\`,children:[(0,z.jsx)(Ke,{size:10,className:\`text-warning\`}),\` Primary key\`]}),(0,z.jsxs)(\`span\`,{className:\`flex items-center gap-1.5\`,children:[(0,z.jsx)(Te,{size:9,className:\`text-muted-foreground/50\`}),\` Nullable\`]}),(0,z.jsxs)(\`span\`,{className:\`flex items-center gap-1.5\`,children:[(0,z.jsx)(Te,{size:9,className:\`fill-muted-foreground/60 text-muted-foreground/60\`}),\` Non-nullable\`]})]})]})]})}var $g=[{id:\`visualizer\`,label:\`Schema Visualizer\`,component:Qg},{id:\`tables\`,label:\`Tables\`,component:Hg},{id:\`functions\`,label:\`Functions\`,component:pg},{id:\`triggers\`,label:\`Triggers\`,component:Ug},{id:\`enums\`,label:\`Enumerated Types\`,component:dg},{id:\`indexes\`,label:\`Indexes\`,component:vg},{id:\`migrations\`,label:\`Migrations\`,component:xg},{id:\`policies\`,label:\`Policies\`,component:Lg},{id:\`roles\`,label:\`Roles\`,component:Bg}];function e_(){let{section:e}=Yt(),t=$g.some(t=>t.id===e)?e:\`visualizer\`,n=$g.find(e=>e.id===t).component;return(0,z.jsxs)(\`div\`,{className:\`flex h-full\`,children:[(0,z.jsx)(Th,{title:\`Database\`,active:t,onSelect:e=>R(\`database\`,e),groups:[{title:\`Database Management\`,items:$g.slice(0,7).map(e=>({id:e.id,label:e.label}))},{title:\`Access Control\`,items:$g.slice(7).map(e=>({id:e.id,label:e.label}))}]}),(0,z.jsx)(\`div\`,{className:\`min-w-0 flex-1 overflow-y-auto\`,children:(0,z.jsx)(n,{})})]})}function t_({name:e,onClose:t}){let[n,r]=(0,_.useState)(\`POST\`),[i,a]=(0,_.useState)(\`service_role\`),[o,s]=(0,_.useState)(\`{
|
|
1561
|
+
execute function \${Yh(e,h)}()\`,i=await N.sql(t);if(!i.ok){C(i.error??\`Create failed\`),x(!1);return}H.success(\`Created trigger \${r.trim()}\`),await n()}return(0,z.jsx)(qp,{open:!0,onClose:t,width:\`w-140\`,title:\`Create a new database trigger\`,footer:(0,z.jsxs)(z.Fragment,{children:[S&&(0,z.jsx)(\`p\`,{className:\`min-w-0 truncate text-xs text-destructive\`,children:S}),(0,z.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-2\`,children:[(0,z.jsx)(Kp,{asChild:!0,children:(0,z.jsx)(V,{variant:\`outline\`,children:\`Cancel\`})}),(0,z.jsx)(V,{onClick:()=>void E(),disabled:b||!r.trim()||!a||T.length===0||!h,children:b?\`Creating…\`:\`Create trigger\`})]})]}),children:(0,z.jsxs)(\`div\`,{className:\`space-y-3\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Name of trigger\`}),(0,z.jsx)(Y,{mono:!0,value:r,autoFocus:!0,placeholder:\`set_updated_at\`,onChange:e=>i(e.target.value.replace(/\\s/g,\`_\`))}),(0,z.jsx)(\`p\`,{className:\`mt-1 text-[11px] text-muted-foreground/60\`,children:\`Do not use spaces/whitespace.\`})]}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Table\`}),(0,z.jsx)(Wp,{mono:!0,value:a,onValueChange:o,placeholder:\`Pick a table…\`,options:s.map(t=>({value:t,label:\`\${e}.\${t}\`}))}),(0,z.jsx)(\`p\`,{className:\`mt-1 text-[11px] text-muted-foreground/60\`,children:\`The trigger watches for changes on this table.\`})]}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Events\`}),(0,z.jsx)(\`div\`,{className:\`space-y-1.5\`,children:[\`INSERT\`,\`UPDATE\`,\`DELETE\`].map(e=>(0,z.jsxs)(\`label\`,{className:\`flex cursor-pointer items-center gap-2 text-[13px] text-foreground/85\`,children:[(0,z.jsx)($t,{checked:l.has(e),onChange:()=>w(e)}),(0,z.jsx)(\`span\`,{className:\`font-mono\`,children:e})]},e))})]}),(0,z.jsxs)(\`div\`,{className:\`grid grid-cols-2 gap-3\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Trigger type\`}),(0,z.jsx)(Wp,{value:d,onValueChange:e=>f(e),options:[{value:\`BEFORE\`,label:\`Before the event\`},{value:\`AFTER\`,label:\`After the event\`}]})]}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Orientation\`}),(0,z.jsx)(Wp,{value:p,onValueChange:e=>m(e),options:[{value:\`ROW\`,label:\`Row\`},{value:\`STATEMENT\`,label:\`Statement\`}]})]})]}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Function to trigger\`}),v.length>0?(0,z.jsx)(Wp,{mono:!0,value:h,onValueChange:g,placeholder:\`Choose a function…\`,options:v.map(e=>({value:e,label:\`\${e}()\`}))}):(0,z.jsxs)(\`p\`,{className:\`rounded-md border border-dashed border-border px-3 py-2.5 text-xs text-muted-foreground/80\`,children:[\`No trigger functions in \`,(0,z.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:e}),\` yet — create one under Functions with return type \`,(0,z.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`trigger\`}),\` first.\`]})]})]})})}var Kg=240,qg=32,Jg=22,Yg=36,Xg=60,Zg=e=>qg+e.columns.length*Jg+6;function Qg(e){let t=new Map(e.map(e=>[e.name,e])),n=new Map;function r(e,i){if(n.has(e))return n.get(e);if(i.has(e))return 0;let a=t.get(e);if(!a)return 0;i.add(e);let o=0;for(let n of a.foreignKeys){let a=n.target.split(\`.\`).pop();a===e||!t.has(a)||(o=Math.max(o,r(a,i)+1))}return i.delete(e),n.set(e,o),o}let i=new Map;for(let t of e){let e=r(t.name,new Set);i.has(e)||i.set(e,[]),i.get(e).push(t)}let a={};for(let[e,t]of[...i.entries()].sort((e,t)=>e[0]-t[0])){t.sort((e,t)=>t.columns.length-e.columns.length);let n=Xg;for(let r of t)a[r.name]={x:Xg+e*350,y:n},n+=Zg(r)+Yg}return a}function $g(){let[e]=qh(),[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)({}),[a,o]=(0,_.useState)({x:0,y:0}),[s,c]=(0,_.useState)(1),[l,u]=(0,_.useState)(\`\`),[d,f]=(0,_.useState)(null),p=(0,_.useRef)(null),m=(0,_.useCallback)(()=>{n(null),N.tables(e).then(e=>{n(e),i(Qg(e)),o({x:0,y:0}),c(e.length>8?.8:1)},()=>n([]))},[e]);(0,_.useEffect)(()=>{m()},[m]);let h=(0,_.useRef)(null);(0,_.useEffect)(()=>{h.current=t},[t]),(0,_.useEffect)(()=>{let t=setInterval(()=>{N.tables(e).then(e=>{let t=h.current;t&&JSON.stringify(e.map(e=>[e.name,e.columns.length]))!==JSON.stringify(t.map(e=>[e.name,e.columns.length]))&&(n(e),i(t=>{let n={...Qg(e),...t};for(let t of Object.keys(n))e.some(e=>e.name===t)||delete n[t];return n}))},()=>{})},5e3);return()=>clearInterval(t)},[e]);let g=(0,_.useMemo)(()=>{if(!t)return[];let e=new Map(t.map(e=>[e.name,e])),n=[];for(let i of t){let t=r[i.name];if(t)for(let[a,o]of i.foreignKeys.entries()){let s=o.target.split(\`.\`).pop(),c=e.get(s),l=c&&r[s];if(!c||!l)continue;let u=Math.max(0,i.columns.findIndex(e=>e.name===o.columns[0])),d=t.y+qg+u*Jg+Jg/2,f=l.x+Kg/2<t.x+Kg/2,p={x:f?t.x:t.x+Kg,y:d},m={x:f?l.x+Kg:l.x,y:l.y+qg/2};n.push({from:p,to:m,key:\`\${i.name}-\${a}\`})}}return n},[t,r]);function v(e){let t=p.current;if(t)if(t.kind===\`pan\`)o({x:t.panX+(e.clientX-t.startX),y:t.panY+(e.clientY-t.startY)});else{let n=t.name;i(r=>({...r,[n]:{x:t.nodeX+(e.clientX-t.startX)/s,y:t.nodeY+(e.clientY-t.startY)/s}}))}}let y=()=>p.current=null;function b(e){c(t=>Math.min(1.6,Math.max(.3,Math.round(t*e*100)/100)))}function x(e){let t=r[e];t&&(f(e),o({x:-(t.x+Kg/2)*s+480,y:-(t.y+60)*s+240}),setTimeout(()=>f(t=>t===e?null:t),1600))}let S=l&&t?t.filter(e=>e.name.toLowerCase().includes(l.toLowerCase())).slice(0,8):[];return t===null?(0,z.jsx)(Jp,{}):(0,z.jsxs)(\`div\`,{className:\`flex h-full flex-col\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex shrink-0 items-center gap-2 border-b border-border px-4 py-2.5\`,children:[(0,z.jsx)(\`h1\`,{className:\`mr-2 text-sm font-semibold text-foreground\`,children:\`Schema Visualizer\`}),(0,z.jsx)(Qh,{}),(0,z.jsxs)(\`div\`,{className:\`relative w-56\`,children:[(0,z.jsx)(vt,{size:13,className:\`pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground/60\`}),(0,z.jsx)(\`input\`,{value:l,onChange:e=>u(e.target.value),placeholder:\`Find table…\`,className:\`h-8 w-full rounded-md border border-input bg-field pl-8 pr-2 text-[13px] text-foreground placeholder:text-muted-foreground/60 focus:border-brand focus:outline-none\`}),S.length>0&&(0,z.jsx)(\`div\`,{className:\`absolute left-0 top-full z-30 mt-1 w-full overflow-hidden rounded-md border border-input bg-popover py-1 shadow-xl\`,children:S.map(e=>(0,z.jsx)(\`button\`,{className:\`block w-full px-3 py-1.5 text-left font-mono text-xs text-foreground hover:bg-accent\`,onClick:()=>{x(e.name),u(\`\`)},children:e.name},e.name))})]}),(0,z.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-1.5\`,children:[(0,z.jsx)(V,{variant:\`ghost\`,size:\`iconXs\`,title:\`Zoom out\`,onClick:()=>b(1/1.2),children:(0,z.jsx)(nt,{size:13})}),(0,z.jsxs)(\`span\`,{className:\`w-10 text-center text-[11px] tabular-nums text-muted-foreground\`,children:[Math.round(s*100),\`%\`]}),(0,z.jsx)(V,{variant:\`ghost\`,size:\`iconXs\`,title:\`Zoom in\`,onClick:()=>b(1.2),children:(0,z.jsx)(mt,{size:13})}),(0,z.jsxs)(V,{variant:\`outline\`,size:\`xs\`,onClick:()=>{i(Qg(t)),o({x:0,y:0})},children:[(0,z.jsx)(qe,{size:12}),\` Auto layout\`]})]})]}),t.length===0?(0,z.jsx)(lf,{children:\`No tables in this schema yet — create one in the table editor or SQL editor.\`}):(0,z.jsxs)(\`div\`,{className:\`relative min-h-0 flex-1 cursor-grab overflow-hidden bg-background active:cursor-grabbing\`,style:{backgroundImage:\`radial-gradient(circle, var(--color-border) 1px, transparent 1px)\`,backgroundSize:\`\${24*s}px \${24*s}px\`,backgroundPosition:\`\${a.x}px \${a.y}px\`},onPointerDown:e=>{e.target===e.currentTarget&&(e.target.setPointerCapture(e.pointerId),p.current={kind:\`pan\`,startX:e.clientX,startY:e.clientY,panX:a.x,panY:a.y})},onPointerMove:v,onPointerUp:y,onPointerLeave:y,onWheel:e=>b(e.deltaY<0?1.08:1/1.08),children:[(0,z.jsxs)(\`div\`,{className:\`pointer-events-none absolute left-0 top-0\`,style:{transform:\`translate(\${a.x}px, \${a.y}px) scale(\${s})\`,transformOrigin:\`0 0\`},children:[(0,z.jsx)(\`svg\`,{className:\`absolute left-0 top-0 overflow-visible\`,width:1,height:1,children:g.map(e=>{let t=Math.max(40,Math.abs(e.to.x-e.from.x)/2),n=e.from.x<e.to.x?e.from.x+t:e.from.x-t,r=e.from.x<e.to.x?e.to.x-t:e.to.x+t;return(0,z.jsxs)(\`g\`,{children:[(0,z.jsx)(\`path\`,{d:\`M \${e.from.x} \${e.from.y} C \${n} \${e.from.y}, \${r} \${e.to.y}, \${e.to.x} \${e.to.y}\`,fill:\`none\`,stroke:\`var(--color-muted-foreground)\`,strokeOpacity:.45,strokeWidth:1.25}),(0,z.jsx)(\`circle\`,{cx:e.from.x,cy:e.from.y,r:2.5,fill:\`var(--color-muted-foreground)\`,fillOpacity:.7}),(0,z.jsx)(\`circle\`,{cx:e.to.x,cy:e.to.y,r:2.5,fill:\`var(--color-muted-foreground)\`,fillOpacity:.7})]},e.key)})}),t.map(e=>{let t=r[e.name];return t?(0,z.jsxs)(\`div\`,{className:\`pointer-events-auto absolute select-none overflow-hidden rounded-md border bg-card shadow-sm transition-shadow \`+(d===e.name?\`border-brand ring-2 ring-brand/40\`:\`border-border hover:border-muted-foreground/60\`),style:{left:t.x,top:t.y,width:Kg},children:[(0,z.jsxs)(\`div\`,{className:\`flex h-8 cursor-move items-center gap-1.5 border-b border-border bg-accent/40 px-2.5\`,onPointerDown:n=>{n.stopPropagation(),n.currentTarget.setPointerCapture(n.pointerId),p.current={kind:\`node\`,name:e.name,startX:n.clientX,startY:n.clientY,nodeX:t.x,nodeY:t.y}},onPointerMove:v,onPointerUp:y,children:[(0,z.jsx)(Ot,{size:12,className:\`shrink-0 text-muted-foreground\`}),(0,z.jsx)(\`button\`,{className:\`min-w-0 flex-1 truncate text-left font-mono text-xs font-medium text-foreground hover:text-brand\`,title:\`Open in table editor\`,onClick:()=>R(\`table\`,e.name),children:e.name}),(0,z.jsx)(\`span\`,{className:\`text-[10px] tabular-nums text-muted-foreground/60\`,children:e.rowCount.toLocaleString()})]}),(0,z.jsx)(\`div\`,{className:\`py-0.5\`,children:e.columns.map(e=>(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-1.5 px-2.5\`,style:{height:Jg},children:[e.isPrimaryKey?(0,z.jsx)(Ke,{size:9,className:\`shrink-0 text-warning\`}):(0,z.jsx)(Te,{size:8,className:\`shrink-0 \`+(e.nullable?\`text-muted-foreground/50\`:\`fill-muted-foreground/60 text-muted-foreground/60\`)}),(0,z.jsx)(\`span\`,{className:\`min-w-0 flex-1 truncate font-mono text-[11px] text-foreground/85\`,children:e.name}),(0,z.jsx)(\`span\`,{className:\`shrink-0 font-mono text-[10px] text-muted-foreground/50\`,children:e.type})]},e.name))})]},e.name):null})]}),(0,z.jsxs)(\`div\`,{className:\`pointer-events-none absolute bottom-0 left-0 right-0 flex items-center justify-center gap-5 border-t border-border bg-background/80 py-1.5 font-mono text-[11px] text-muted-foreground backdrop-blur\`,children:[(0,z.jsxs)(\`span\`,{className:\`flex items-center gap-1.5\`,children:[(0,z.jsx)(Ke,{size:10,className:\`text-warning\`}),\` Primary key\`]}),(0,z.jsxs)(\`span\`,{className:\`flex items-center gap-1.5\`,children:[(0,z.jsx)(Te,{size:9,className:\`text-muted-foreground/50\`}),\` Nullable\`]}),(0,z.jsxs)(\`span\`,{className:\`flex items-center gap-1.5\`,children:[(0,z.jsx)(Te,{size:9,className:\`fill-muted-foreground/60 text-muted-foreground/60\`}),\` Non-nullable\`]})]})]})]})}var e_=[{id:\`visualizer\`,label:\`Schema Visualizer\`,component:$g},{id:\`tables\`,label:\`Tables\`,component:Ug},{id:\`functions\`,label:\`Functions\`,component:mg},{id:\`triggers\`,label:\`Triggers\`,component:Wg},{id:\`enums\`,label:\`Enumerated Types\`,component:fg},{id:\`indexes\`,label:\`Indexes\`,component:yg},{id:\`migrations\`,label:\`Migrations\`,component:Sg},{id:\`policies\`,label:\`Policies\`,component:Rg},{id:\`roles\`,label:\`Roles\`,component:Vg}];function t_(){let{section:e}=Yt(),t=e_.some(t=>t.id===e)?e:\`visualizer\`,n=e_.find(e=>e.id===t).component;return(0,z.jsxs)(\`div\`,{className:\`flex h-full\`,children:[(0,z.jsx)(Th,{title:\`Database\`,active:t,onSelect:e=>R(\`database\`,e),groups:[{title:\`Database Management\`,items:e_.slice(0,7).map(e=>({id:e.id,label:e.label}))},{title:\`Access Control\`,items:e_.slice(7).map(e=>({id:e.id,label:e.label}))}]}),(0,z.jsx)(\`div\`,{className:\`min-w-0 flex-1 overflow-y-auto\`,children:(0,z.jsx)(n,{})})]})}function n_({name:e,onClose:t}){let[n,r]=(0,_.useState)(\`POST\`),[i,a]=(0,_.useState)(\`service_role\`),[o,s]=(0,_.useState)(\`{
|
|
1562
1562
|
"name": "world"
|
|
1563
|
-
}\`),[c,l]=(0,_.useState)(null),[u,d]=(0,_.useState)(!1);async function f(){d(!0),l(null);try{let t=i===\`anon\`?(await N.keys()).anonKey??x():x(),r=performance.now(),a=await fetch(\`\${lh()}/functions/v1/\${e}\`,{method:n,headers:{apikey:t,authorization:\`Bearer \${t}\`,"content-type":\`application/json\`},body:n===\`GET\`||n===\`HEAD\`?void 0:o}),s=await a.text(),c=s;try{c=JSON.stringify(JSON.parse(s),null,2)}catch{}l({status:a.status,ms:Math.round(performance.now()-r),headers:[...a.headers.entries()],body:c})}catch(e){l({status:0,ms:0,headers:[],body:\`Request failed: \${e.message}\`})}finally{d(!1)}}return(0,z.jsx)(qp,{open:!0,onClose:t,width:\`w-[560px]\`,title:(0,z.jsxs)(\`span\`,{children:[\`Invoke \`,(0,z.jsx)(\`code\`,{className:\`rounded bg-accent px-1.5 py-0.5 font-mono text-xs text-foreground\`,children:e})]}),footer:(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Kp,{asChild:!0,children:(0,z.jsx)(V,{variant:\`outline\`,children:\`Close\`})}),(0,z.jsxs)(V,{className:\`ml-auto\`,onClick:()=>void f(),disabled:u,children:[(0,z.jsx)(ft,{size:12}),\` \`,u?\`Invoking…\`:\`Invoke\`]})]}),children:(0,z.jsxs)(\`div\`,{className:\`space-y-4\`,children:[(0,z.jsxs)(\`div\`,{className:\`grid grid-cols-2 gap-3\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Method\`}),(0,z.jsx)(Wp,{value:n,onValueChange:r,options:[\`POST\`,\`GET\`,\`PUT\`,\`PATCH\`,\`DELETE\`].map(e=>({value:e}))})]}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Authorization\`}),(0,z.jsx)(Wp,{value:i,onValueChange:e=>a(e),options:[{value:\`service_role\`,label:\`service_role key\`},{value:\`anon\`,label:\`anon key\`}]})]})]}),n!==\`GET\`&&(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Request body (JSON)\`}),(0,z.jsx)(ir,{lang:\`js\`,className:\`h-32\`,value:o,onChange:s,onCmdEnter:()=>void f()})]}),u&&(0,z.jsx)(Jp,{}),c&&(0,z.jsxs)(\`div\`,{children:[(0,z.jsxs)(\`div\`,{className:\`mb-2 flex items-center gap-3 text-[13px]\`,children:[(0,z.jsx)(\`span\`,{className:\`rounded px-2 py-0.5 font-mono text-xs font-semibold \`+(c.status>=200&&c.status<300?\`bg-brand/15 text-brand\`:c.status===0?\`bg-destructive/15 text-destructive\`:\`bg-warning/15 text-warning\`),children:c.status||\`ERR\`}),(0,z.jsxs)(\`span\`,{className:\`text-muted-foreground/80\`,children:[c.ms,\` ms\`]})]}),(0,z.jsx)(nr,{value:c.body||\`(empty body)\`,lang:\`js\`,readOnly:!0,minLines:4,maxLines:200}),c.headers.length>0&&(0,z.jsxs)(\`details\`,{className:\`mt-2\`,children:[(0,z.jsxs)(\`summary\`,{className:\`cursor-pointer text-xs text-muted-foreground hover:text-foreground\`,children:[\`Response headers (\`,c.headers.length,\`)\`]}),(0,z.jsx)(\`div\`,{className:\`mt-1.5 space-y-0.5 font-mono text-[11px] text-muted-foreground\`,children:c.headers.map(([e,t])=>(0,z.jsxs)(\`div\`,{className:\`truncate\`,children:[(0,z.jsx)(\`span\`,{className:\`text-foreground/70\`,children:e}),\`: \`,t]},e))})]})]})]})})}var n_=[\`functions\`,\`secrets\`,\`settings\`];function r_(){let{section:e}=Yt(),t=n_.includes(e)?e:\`functions\`;return(0,z.jsxs)(\`div\`,{className:\`flex h-full\`,children:[(0,z.jsx)(Th,{title:\`Edge Functions\`,active:t,onSelect:e=>R(\`functions\`,e),groups:[{title:\`Manage\`,items:[{id:\`functions\`,label:\`Functions\`}]},{title:\`Configuration\`,items:[{id:\`secrets\`,label:\`Secrets\`},{id:\`settings\`,label:\`Settings\`}]}]}),(0,z.jsxs)(\`div\`,{className:\`min-w-0 flex-1 overflow-y-auto\`,children:[t===\`functions\`&&(0,z.jsx)(i_,{}),t===\`secrets\`&&(0,z.jsx)(o_,{}),t===\`settings\`&&(0,z.jsx)(l_,{})]})]})}function i_(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(null),i=(0,_.useCallback)(()=>{N.edgeFunctions().then(e=>t(e.functions),()=>t([]))},[]);return(0,_.useEffect)(()=>{i()},[i]),e===null?(0,z.jsx)(Jp,{}):(0,z.jsxs)(\`div\`,{className:\`flex h-full flex-col\`,children:[(0,z.jsx)(\`div\`,{className:\`border-b border-border px-6 pb-4 pt-5\`,children:(0,z.jsxs)(\`div\`,{className:\`flex items-start justify-between\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(\`h1\`,{className:\`text-lg font-semibold text-foreground\`,children:\`Functions\`}),(0,z.jsxs)(\`p\`,{className:\`mt-0.5 text-[13px] text-muted-foreground/80\`,children:[(0,z.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`Deno.serve\`}),\` / export-default handlers loaded from\`,\` \`,(0,z.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`supabase/functions/<name>/index.ts\`}),\` — running in-process.\`]})]}),(0,z.jsx)(V,{variant:\`ghost\`,size:\`iconXs\`,title:\`Refresh\`,onClick:i,children:(0,z.jsx)(gt,{size:13})})]})}),(0,z.jsxs)(\`div\`,{className:\`min-h-0 flex-1 overflow-auto\`,children:[e.length===0?(0,z.jsx)(\`div\`,{className:\`flex h-full items-center justify-center\`,children:(0,z.jsxs)(\`div\`,{className:\`max-w-md rounded-lg border border-dashed border-border px-10 py-8 text-center\`,children:[(0,z.jsx)(Rt,{size:20,className:\`mx-auto text-muted-foreground/60\`}),(0,z.jsx)(\`p\`,{className:\`mt-3 text-sm font-medium text-foreground\`,children:\`No functions loaded\`}),(0,z.jsxs)(\`p\`,{className:\`mt-1 text-xs leading-relaxed text-muted-foreground/80\`,children:[\`Create \`,(0,z.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`supabase/functions/hello/index.ts\`}),\` with a\`,\` \`,(0,z.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`Deno.serve(handler)\`}),\` and restart tinbase — it appears here and is served at \`,(0,z.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`/functions/v1/hello\`}),\`.\`]})]})}):(0,z.jsxs)(Xp,{children:[(0,z.jsx)(Zp,{children:(0,z.jsxs)(\`tr\`,{children:[(0,z.jsx)(Z,{children:\`Name\`}),(0,z.jsx)(Z,{children:\`URL\`}),(0,z.jsx)(Z,{className:\`w-24\`})]})}),(0,z.jsx)(\`tbody\`,{children:e.map(e=>{let t=\`\${lh()}/functions/v1/\${e}\`;return(0,z.jsxs)(Qp,{children:[(0,z.jsx)(Q,{className:\`font-mono text-foreground/90\`,children:e}),(0,z.jsx)(Q,{children:(0,z.jsxs)(\`span\`,{className:\`flex items-center gap-1 font-mono text-[12px] text-muted-foreground\`,children:[(0,z.jsx)(\`span\`,{className:\`truncate\`,children:t}),(0,z.jsx)(er,{value:t,label:\`\${e} URL\`,iconSize:11})]})}),(0,z.jsx)(Q,{children:(0,z.jsxs)(V,{variant:\`outline\`,size:\`xs\`,onClick:()=>r(e),children:[(0,z.jsx)(ft,{size:11}),\` Invoke\`]})})]},e)})})]}),e.length>0&&(0,z.jsx)(cf,{children:\`Invoke runs the function through the real HTTP path with the key/role you pick.\`})]}),n&&(0,z.jsx)(t_,{name:n,onClose:()=>r(null)})]})}var a_={SUPABASE_URL:\`The in-process API gateway for this tinbase instance.\`,SUPABASE_ANON_KEY:\`Anon JWT — safe in a browser when RLS is enabled.\`,SUPABASE_SERVICE_ROLE_KEY:\`Service-role JWT — bypasses RLS, keep server-side only.\`};function o_(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(\`\`),i=(0,_.useCallback)(()=>{N.edgeFunctions().then(e=>{let n=new Set(e.builtins),r=Object.keys(e.env).filter(e=>!n.has(e)).sort((e,t)=>e.localeCompare(t)).map(t=>({name:t,digest:e.digests[t]??\`\`}));t({builtins:e.builtins,custom:r})},()=>t({builtins:[],custom:[]}))},[]);if((0,_.useEffect)(()=>{i()},[i]),e===null)return(0,z.jsx)(Jp,{});let a=n.trim()?e.custom.filter(e=>e.name.toLowerCase().includes(n.trim().toLowerCase())):e.custom;return(0,z.jsxs)(xh,{title:\`Edge Function Secrets\`,children:[(0,z.jsx)(c_,{existing:new Set([...e.builtins,...e.custom.map(e=>e.name)]),onSaved:i}),(0,z.jsxs)(Sh,{title:\`Custom secrets\`,description:\`Runtime secrets you've set for this instance. Applied live to Deno.env — no restart. Not written back to supabase/functions/.env, so a restart reloads from that file.\`,children:[(0,z.jsxs)(\`div\`,{className:\`mb-3 flex items-center justify-between gap-3\`,children:[(0,z.jsxs)(\`p\`,{className:\`text-xs text-muted-foreground/70\`,children:[e.custom.length,\` secret\`,e.custom.length===1?\`\`:\`s\`]}),e.custom.length>0&&(0,z.jsx)(lf,{value:n,onChange:e=>r(e.target.value),placeholder:\`Search for a secret\`,className:\`h-8 w-56 text-xs\`})]}),e.custom.length===0?(0,z.jsx)(\`p\`,{className:\`py-6 text-xs text-muted-foreground/60\`,children:\`No custom secrets yet. Add one above.\`}):(0,z.jsxs)(Xp,{children:[(0,z.jsx)(Zp,{children:(0,z.jsxs)(\`tr\`,{children:[(0,z.jsx)(Z,{children:\`Name\`}),(0,z.jsxs)(Z,{children:[\`Digest \`,(0,z.jsx)(B,{variant:\`neutral\`,children:\`SHA256\`})]}),(0,z.jsx)(Z,{className:\`w-10\`})]})}),(0,z.jsxs)(\`tbody\`,{children:[a.map(e=>(0,z.jsx)(s_,{secret:e,onChanged:i},e.name)),a.length===0&&(0,z.jsx)(\`tr\`,{children:(0,z.jsxs)(Q,{colSpan:3,className:\`py-6 text-center text-xs text-muted-foreground/60\`,children:[\`No secret matches “\`,n,\`”.\`]})})]})]})]}),(0,z.jsx)(Sh,{title:\`Built-in secrets\`,description:\`Injected into every function by tinbase — read-only. These are the vars a local Supabase edge function can rely on here.\`,children:e.builtins.map(e=>(0,z.jsx)(Ch,{label:e,description:a_[e]??\`Provided by tinbase.\`,children:(0,z.jsx)(B,{variant:\`neutral\`,children:\`built-in\`})},e))})]})}function s_({secret:e,onChanged:t}){let[n,r]=(0,_.useState)(!1),i=async()=>{try{await N.deleteSecret(e.name),H.success(\`Deleted \${e.name}\`),t()}catch(t){H.error(t instanceof Error?t.message:\`Failed to delete \${e.name}\`)}finally{r(!1)}};return(0,z.jsxs)(Qp,{children:[(0,z.jsx)(Q,{children:(0,z.jsx)(B,{variant:\`neutral\`,children:e.name})}),(0,z.jsx)(Q,{children:(0,z.jsxs)(\`span\`,{className:\`flex items-center gap-1 font-mono text-[12px] text-muted-foreground\`,children:[(0,z.jsxs)(\`span\`,{className:\`truncate\`,title:e.digest,children:[e.digest.slice(0,48),\`…\`]}),(0,z.jsx)(er,{value:e.digest,label:\`\${e.name} digest\`,iconSize:11})]})}),(0,z.jsx)(Q,{children:(0,z.jsxs)(Zd,{children:[(0,z.jsx)(Qd,{asChild:!0,children:(0,z.jsx)(V,{variant:\`ghost\`,size:\`iconXs\`,title:\`Actions\`,children:(0,z.jsx)(De,{size:13})})}),(0,z.jsx)(tf,{children:(0,z.jsxs)(nf,{danger:!0,onSelect:()=>r(!0),children:[(0,z.jsx)(At,{size:13}),\` Delete secret\`]})})]})}),n&&(0,z.jsx)(q,{open:!0,danger:!0,title:\`Delete \${e.name}?\`,description:\`Functions will stop seeing this value on the next invocation.\`,confirmLabel:\`Delete\`,onConfirm:()=>void i(),onClose:()=>r(!1)})]})}function c_({existing:e,onSaved:t}){let[n,r]=(0,_.useState)([{name:\`\`,value:\`\`}]),[i,a]=(0,_.useState)(!1),o=(e,t)=>r(n=>n.map((n,r)=>r===e?{...n,...t}:n)),s=async()=>{let i={};for(let t of n){let n=t.name.trim();if(n){if(!/^[A-Za-z_][A-Za-z0-9_]*$/.test(n))return H.error(\`Invalid name "\${n}" — letters, digits, underscores.\`);if(e.has(n)&&[\`SUPABASE_URL\`,\`SUPABASE_ANON_KEY\`,\`SUPABASE_SERVICE_ROLE_KEY\`].includes(n))return H.error(\`"\${n}" is built-in and can't be changed.\`);i[n]=t.value}}if(Object.keys(i).length===0)return H.error(\`Enter at least one named secret.\`);a(!0);try{await N.putSecrets(i),H.success(\`Saved \${Object.keys(i).length} secret\${Object.keys(i).length===1?\`\`:\`s\`}\`),r([{name:\`\`,value:\`\`}]),t()}catch(e){H.error(e instanceof Error?e.message:\`Failed to save secrets\`)}finally{a(!1)}};return(0,z.jsx)(Sh,{title:\`Add or replace secrets\`,description:\`Set a secret every function reads via Deno.env.get(). Saving an existing name replaces its value.\`,children:(0,z.jsxs)(\`div\`,{className:\`space-y-3\`,children:[n.map((e,t)=>(0,z.jsxs)(\`div\`,{className:\`grid grid-cols-[minmax(0,1fr)_minmax(0,1.6fr)_auto] items-start gap-3\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Name\`}),(0,z.jsx)(lf,{value:e.name,onChange:e=>o(t,{name:e.target.value}),placeholder:\`e.g. CLIENT_KEY\`,className:\`mt-1 h-9 font-mono text-xs\`})]}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Value\`}),(0,z.jsx)(em,{value:e.value,onChange:e=>o(t,{value:e.target.value}),placeholder:\`Supports multi-line values such as PEM keys, JSON, or tokens.\`,rows:2,className:\`mt-1 font-mono text-xs\`})]}),n.length>1&&(0,z.jsx)(V,{variant:\`ghost\`,size:\`iconXs\`,title:\`Remove row\`,className:\`mt-6\`,onClick:()=>r(e=>e.filter((e,n)=>n!==t)),children:(0,z.jsx)(At,{size:13})})]},t)),(0,z.jsxs)(\`div\`,{className:\`flex items-center justify-between border-t border-border pt-3\`,children:[(0,z.jsxs)(V,{variant:\`outline\`,size:\`xs\`,onClick:()=>r(e=>[...e,{name:\`\`,value:\`\`}]),children:[(0,z.jsx)(mt,{size:12}),\` Add another\`]}),(0,z.jsx)(V,{size:\`sm\`,onClick:()=>void s(),disabled:i,children:i?\`Saving…\`:\`Save\`})]})]})})}function l_(){let e=({children:e})=>(0,z.jsx)(\`code\`,{className:\`rounded bg-code px-1 py-px font-mono text-foreground/90\`,children:e});return(0,z.jsxs)(xh,{title:\`Edge Function Settings\`,children:[(0,z.jsxs)(Sh,{title:\`Runtime\`,description:\`How functions execute on this instance.\`,children:[(0,z.jsx)(Ch,{label:\`Engine\`,description:\`In-process Deno shim — no containers, no cold starts.\`,children:(0,z.jsxs)(\`span\`,{className:\`text-[13px] text-muted-foreground\`,children:[(0,z.jsx)(e,{children:\`Deno.serve\`}),\`, \`,(0,z.jsx)(e,{children:\`Deno.env\`}),\`, fetch, WebCrypto\`]})}),(0,z.jsx)(Ch,{label:\`Loading\`,description:\`Functions are discovered at boot; restart tinbase to pick up new or changed code.\`,children:(0,z.jsx)(\`span\`,{className:\`text-[13px] text-muted-foreground\`,children:(0,z.jsx)(e,{children:\`supabase/functions/<name>/index.ts\`})})}),(0,z.jsx)(Ch,{label:\`Invocation\`,description:\`Every HTTP method, CORS pre-handled.\`,children:(0,z.jsx)(\`span\`,{className:\`text-[13px] text-muted-foreground\`,children:(0,z.jsx)(e,{children:\`/functions/v1/<name>\`})})})]}),(0,z.jsxs)(Sh,{title:\`Security\`,description:\`What a function sees on each request.\`,children:[(0,z.jsx)(Ch,{label:\`JWT verification\`,description:(0,z.jsxs)(z.Fragment,{children:[\`The \`,(0,z.jsx)(e,{children:\`Authorization\`}),\` header is passed through as-is — verify the JWT inside the function (or trust the gateway key), matching \`,(0,z.jsx)(e,{children:\`verify_jwt\`}),\`-off Supabase functions.\`]}),children:(0,z.jsx)(B,{variant:\`neutral\`,children:\`pass-through\`})}),(0,z.jsx)(Ch,{label:\`Secrets\`,description:\`Injected from supabase/functions/.env plus the built-in SUPABASE_* vars.\`,children:(0,z.jsx)(V,{variant:\`outline\`,size:\`xs\`,onClick:()=>R(\`functions\`,\`secrets\`),children:\`View secrets\`})}),(0,z.jsx)(Ch,{label:\`Database access\`,description:(0,z.jsxs)(z.Fragment,{children:[\`Use supabase-js with \`,(0,z.jsx)(e,{children:\`SUPABASE_URL\`}),\` and a key from env — requests loop back through the same backend in-process.\`]}),children:(0,z.jsx)(B,{variant:\`brand\`,children:\`in-process\`})})]})]})}function u_(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)([]),[i,a]=(0,_.useState)([]),[o,s]=(0,_.useState)([]),[c,l]=(0,_.useState)([]),[u,d]=(0,_.useState)(!0),f=lh(),p=$n(f,\`API URL\`);if((0,_.useEffect)(()=>{Promise.allSettled([N.stats(),N.tables(),N.migrations(),N.logs(),Qm()]).then(([e,n,i,o,c])=>{e.status===\`fulfilled\`&&t(e.value),r(n.status===\`fulfilled\`?n.value:[]),i.status===\`fulfilled\`&&a(i.value),o.status===\`fulfilled\`&&s(o.value),c.status===\`fulfilled\`&&l(c.value),d(!1)})},[]),u)return(0,z.jsx)(Jp,{});let m=n.reduce((e,t)=>e+t.rowCount,0),h=i[i.length-1],g=o.slice(-8).reverse(),v=o.filter(e=>e.level===\`error\`).length;return(0,z.jsx)(\`div\`,{className:\`h-full overflow-y-auto\`,children:(0,z.jsxs)(\`div\`,{className:\`mx-auto w-full max-w-7xl space-y-12 px-10 py-12\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-3\`,children:[(0,z.jsx)(\`h1\`,{className:\`text-3xl font-semibold text-foreground\`,children:\`tinbase\`}),(0,z.jsxs)(B,{variant:\`brand\`,children:[(0,z.jsx)(\`span\`,{className:\`inline-block size-1.5 rounded-full bg-brand\`}),\` \`,\`Healthy\`]})]}),(0,z.jsxs)(\`button\`,{onClick:p.copy,title:p.copied?\`Copied!\`:\`Copy API URL\`,className:\`group mt-1.5 flex items-center gap-2 font-mono text-[13px] text-muted-foreground/80 transition-colors hover:text-foreground\`,children:[f,p.copied?(0,z.jsx)(pe,{size:11,className:\`text-brand\`}):(0,z.jsx)(Se,{size:11,className:\`opacity-0 transition-opacity group-hover:opacity-100\`})]}),(0,z.jsxs)(\`div\`,{className:\`mt-8 grid grid-cols-1 gap-x-10 gap-y-6 sm:grid-cols-2 lg:grid-cols-3\`,children:[(0,z.jsx)(d_,{icon:se,label:\`Status\`,value:\`Healthy\`,accent:!0}),(0,z.jsx)(d_,{icon:we,label:\`Database size\`,value:e?.dbSize??\`—\`}),(0,z.jsx)(d_,{icon:Rt,label:\`Version\`,value:e?.version??\`—\`}),(0,z.jsx)(d_,{icon:je,label:\`Last migration\`,value:h?h.name??h.version:\`No migrations\`,sub:h?(0,z.jsx)(qm,{value:h.applied_at}):void 0}),(0,z.jsx)(d_,{icon:Ot,label:\`Tables\`,value:\`\${e?.tables??0}\`,sub:\`\${m.toLocaleString()} total rows\`}),(0,z.jsx)(d_,{icon:Ke,label:\`Auth users\`,value:\`\${e?.users??0}\`})]})]}),(0,z.jsx)(f_,{title:\`At a glance\`,children:(0,z.jsxs)(\`div\`,{className:\`grid grid-cols-2 gap-4 lg:grid-cols-4\`,children:[(0,z.jsx)(m_,{icon:Ot,label:\`Table Editor\`,value:e?.tables??0,sub:\`\${m.toLocaleString()} rows\`,onClick:()=>R(\`table\`)}),(0,z.jsx)(m_,{icon:Ke,label:\`Authentication\`,value:e?.users??0,sub:\`users\`,onClick:()=>R(\`auth\`)}),(0,z.jsx)(m_,{icon:Be,label:\`Storage\`,value:e?.buckets??0,sub:\`\${e?.objects??0} objects\`,onClick:()=>R(\`storage\`)}),(0,z.jsx)(m_,{icon:_t,label:\`Logs\`,value:o.length,sub:v>0?\`\${v} errors\`:\`no errors\`,danger:v>0,onClick:()=>R(\`logs\`)})]})}),(0,z.jsx)(f_,{title:\`Advisor\`,action:c.length>0?(0,z.jsxs)(\`button\`,{className:\`text-xs text-brand hover:underline\`,onClick:eh,children:[\`View all \`,c.length]}):void 0,children:c.length===0?(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-3 rounded-lg border border-border bg-card p-5 text-[13px] text-muted-foreground\`,children:[(0,z.jsx)(pe,{size:15,className:\`text-brand\`}),\` No advisor findings — security and performance checks all pass.\`]}):(0,z.jsx)(\`div\`,{className:\`overflow-hidden rounded-lg border border-border bg-card\`,children:c.slice(0,6).map(e=>(0,z.jsxs)(\`button\`,{onClick:eh,className:\`flex w-full items-center gap-3 border-b border-border/60 px-4 py-2.5 text-left transition-colors last:border-0 hover:bg-accent/40\`,children:[(0,z.jsx)(xt,{size:14,className:e.level===\`critical\`?\`text-destructive\`:e.level===\`warning\`?\`text-warning\`:\`text-muted-foreground/70\`}),(0,z.jsx)(\`span\`,{className:\`shrink-0 text-[13px] text-foreground/90\`,children:e.title}),(0,z.jsx)(\`span\`,{className:\`truncate font-mono text-xs text-muted-foreground\`,children:e.entity}),(0,z.jsx)(ue,{size:12,className:\`ml-auto shrink-0 text-muted-foreground/60\`})]},e.id))})}),(0,z.jsxs)(\`div\`,{className:\`grid gap-5 lg:grid-cols-2\`,children:[(0,z.jsx)(p_,{title:\`Recent migrations\`,onMore:()=>R(\`database\`,\`migrations\`),children:i.length===0?(0,z.jsxs)(\`p\`,{className:\`px-4 py-6 text-center text-xs text-muted-foreground/60\`,children:[\`No migrations applied. Add SQL files under\`,\` \`,(0,z.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`supabase/migrations/\`}),\`.\`]}):i.slice(-6).reverse().map(e=>(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-3 border-b border-border/60 px-4 py-2 last:border-0\`,children:[(0,z.jsx)(\`span\`,{className:\`font-mono text-xs text-muted-foreground/80\`,children:e.version}),(0,z.jsx)(\`span\`,{className:\`truncate text-[13px] text-foreground/80\`,children:e.name??\`—\`}),(0,z.jsx)(\`span\`,{className:\`ml-auto shrink-0 text-[11px] text-muted-foreground/60\`,children:(0,z.jsx)(qm,{value:e.applied_at})})]},e.version))}),(0,z.jsx)(p_,{title:\`Recent logs\`,onMore:()=>R(\`logs\`),children:g.length===0?(0,z.jsx)(\`p\`,{className:\`px-4 py-6 text-center text-xs text-muted-foreground/60\`,children:\`No log entries yet.\`}):g.map((e,t)=>(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-2.5 border-b border-border/60 px-4 py-2 last:border-0\`,children:[(0,z.jsx)(\`span\`,{className:\`size-1.5 shrink-0 rounded-full \`+(e.level===\`error\`?\`bg-destructive\`:e.level===\`warn\`?\`bg-warning\`:\`bg-muted-foreground/60\`)}),(0,z.jsx)(\`span\`,{className:\`truncate font-mono text-xs text-muted-foreground\`,children:e.msg}),(0,z.jsx)(\`span\`,{className:\`ml-auto shrink-0 text-[11px] text-muted-foreground/60\`,children:(0,z.jsx)(qm,{value:e.ts,format:\`time\`})})]},t))})]}),(0,z.jsx)(f_,{title:\`Get connected\`,children:(0,z.jsxs)(\`div\`,{className:\`rounded-lg border border-border bg-card p-6\`,children:[(0,z.jsxs)(\`p\`,{className:\`text-[13px] text-muted-foreground/80\`,children:[\`Every tinbase service is a\`,\` \`,(0,z.jsx)(\`span\`,{className:\`text-foreground/80\`,children:\`(Request) ⇒ Response\`}),\` \`,\`fetch handler — run the whole backend in-process, or point\`,\` \`,(0,z.jsx)(\`span\`,{className:\`text-foreground/80\`,children:\`supabase-js\`}),\` at this server (URL + keys under\`,\` \`,(0,z.jsx)(\`span\`,{className:\`text-foreground/80\`,children:\`Connect\`}),\`).\`]}),(0,z.jsx)(\`div\`,{className:\`mt-3\`,children:(0,z.jsx)(rr,{code:uh(),lang:\`js\`})})]})})]})})}function d_({icon:e,label:t,value:n,sub:r,accent:i}){return(0,z.jsxs)(\`div\`,{className:\`flex items-start gap-3.5\`,children:[(0,z.jsx)(\`div\`,{className:\`flex size-11 shrink-0 items-center justify-center rounded-md border border-border bg-card\`,children:(0,z.jsx)(e,{size:17,className:i?\`text-brand\`:\`text-muted-foreground/80\`})}),(0,z.jsxs)(\`div\`,{className:\`min-w-0\`,children:[(0,z.jsx)(\`p\`,{className:\`text-[11px] font-semibold uppercase tracking-wider text-muted-foreground/80\`,children:t}),(0,z.jsx)(\`p\`,{className:\`mt-0.5 truncate text-sm \`+(i?\`text-brand\`:\`text-foreground\`),children:n}),r&&(0,z.jsx)(\`p\`,{className:\`truncate text-xs text-muted-foreground/60\`,children:r})]})]})}function f_({title:e,action:t,children:n}){return(0,z.jsxs)(\`div\`,{children:[(0,z.jsxs)(\`div\`,{className:\`mb-4 flex items-center justify-between gap-4\`,children:[(0,z.jsx)(\`h2\`,{className:\`text-base font-medium text-foreground\`,children:e}),t]}),n]})}function p_({title:e,onMore:t,children:n}){return(0,z.jsxs)(\`div\`,{className:\`overflow-hidden rounded-lg border border-border bg-card\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex items-center justify-between border-b border-border px-4 py-2.5\`,children:[(0,z.jsx)(\`h3\`,{className:\`text-[13px] font-medium text-foreground\`,children:e}),t&&(0,z.jsxs)(\`button\`,{onClick:t,className:\`flex items-center gap-1 text-[11px] text-muted-foreground/80 transition-colors hover:text-brand\`,children:[\`View all \`,(0,z.jsx)(ue,{size:11})]})]}),(0,z.jsx)(\`div\`,{children:n})]})}function m_({icon:e,label:t,value:n,sub:r,danger:i,onClick:a}){return(0,z.jsxs)(\`button\`,{onClick:a,className:\`group rounded-lg border border-border bg-card p-5 text-left transition-colors hover:border-muted-foreground\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-2 text-muted-foreground/80\`,children:[(0,z.jsx)(e,{size:13}),(0,z.jsx)(\`span\`,{className:\`text-[11px] font-medium uppercase tracking-wide\`,children:t}),(0,z.jsx)(ue,{size:12,className:\`ml-auto opacity-0 transition-opacity group-hover:opacity-100\`})]}),(0,z.jsx)(\`p\`,{className:\`mt-3 text-3xl font-semibold text-foreground\`,children:n.toLocaleString()}),(0,z.jsx)(\`p\`,{className:\`mt-1 text-[13px] \`+(i?\`text-destructive\`:\`text-muted-foreground/80\`),children:r})]})}function h_(e,t){let n=e=>{if(e==null)return\`\`;let t=typeof e==\`object\`?JSON.stringify(e):String(e);return/[",\\n]/.test(t)?\`"\`+t.replace(/"/g,\`""\`)+\`"\`:t};return[e.join(\`,\`),...t.map(t=>e.map(e=>n(t[e])).join(\`,\`))].join(\`
|
|
1564
|
-
\`)}function
|
|
1565
|
-
\`)),children:\`Download .txt\`}),(0,z.jsx)(nf,{onSelect:()=>g_(\`tinbase-logs.json\`,\`application/json\`,JSON.stringify(T,null,2)),children:\`Download .json\`})]})]}),(0,z.jsx)(V,{variant:\`ghost\`,size:\`iconXs\`,title:\`Clear logs\`,onClick:()=>b(!0),children:(0,z.jsx)(At,{size:13})})]})]}),(0,z.jsx)(E_,{entries:C}),(0,z.jsx)(\`div\`,{className:\`min-h-0 flex-1 overflow-auto\`,children:T.length===0?(0,z.jsx)(cf,{children:S.length===0?\`No logs yet. Make a request or trigger an email/webhook.\`:\`No entries match the filters.\`}):(0,z.jsxs)(\`table\`,{className:\`w-full border-collapse font-mono text-[12px]\`,children:[(0,z.jsx)(\`thead\`,{className:\`sticky top-0 z-10 bg-background\`,children:(0,z.jsxs)(\`tr\`,{className:\`border-b border-border text-left text-[10px] uppercase tracking-wider text-muted-foreground/60\`,children:[(0,z.jsx)(\`th\`,{className:\`w-24 px-3 py-1.5 font-medium\`,children:\`Time\`}),(0,z.jsx)(\`th\`,{className:\`w-16 px-2 py-1.5 font-medium\`,children:\`Level\`}),(0,z.jsx)(\`th\`,{className:\`w-20 px-2 py-1.5 font-medium\`,children:\`Service\`}),(0,z.jsx)(\`th\`,{className:\`w-16 px-2 py-1.5 font-medium\`,children:\`Method\`}),(0,z.jsx)(\`th\`,{className:\`w-12 px-2 py-1.5 font-medium\`,children:\`Status\`}),(0,z.jsx)(\`th\`,{className:\`px-2 py-1.5 font-medium\`,children:\`Event\`})]})}),(0,z.jsx)(\`tbody\`,{children:T.map((e,t)=>(0,z.jsxs)(\`tr\`,{onClick:()=>v(e),className:\`cursor-pointer border-b border-border/40 transition-colors hover:bg-accent/40 \`+(g===e?\`bg-selected \`:\`\`)+(e.level===\`error\`?\`bg-destructive/5\`:\`\`),children:[(0,z.jsx)(\`td\`,{className:\`whitespace-nowrap px-3 py-1 text-muted-foreground/70\`,children:(0,z.jsx)(qm,{value:e.ts,format:\`time\`})}),(0,z.jsx)(\`td\`,{className:\`px-2 py-1\`,children:(0,z.jsx)(\`span\`,{className:\`inline-block size-2 rounded-full \`+(e.level===\`error\`?\`bg-destructive\`:e.level===\`warn\`?\`bg-warning\`:\`bg-muted-foreground/40\`),title:e.level})}),(0,z.jsx)(\`td\`,{className:\`px-2 py-1 text-muted-foreground/80\`,children:e.service}),(0,z.jsx)(\`td\`,{className:\`px-2 py-1 text-foreground/70\`,children:e.method??\`\`}),(0,z.jsx)(\`td\`,{className:\`px-2 py-1\`,children:e.status!==null&&(0,z.jsx)(\`span\`,{className:e.status>=500?\`text-destructive\`:e.status>=400?\`text-warning\`:\`text-brand\`,children:e.status})}),(0,z.jsx)(\`td\`,{className:\`max-w-0 truncate px-2 py-1 text-foreground/85\`,title:e.msg,children:e.path??e.msg})]},\`\${e.ts}-\${t}\`))})]})})]}),g&&(0,z.jsx)(j_,{entry:g,onClose:()=>v(null)}),y&&(0,z.jsx)(q,{open:!0,danger:!0,title:\`Clear all logs?\`,description:\`The in-memory log buffer is emptied — this cannot be undone.\`,confirmLabel:\`Clear logs\`,onConfirm:()=>{N.clearLogs().then(x),v(null)},onClose:()=>b(!1)})]})}function C_(e,t){let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n}function w_({title:e,children:t}){return(0,z.jsxs)(\`div\`,{className:\`px-2 pt-3\`,children:[(0,z.jsx)(\`p\`,{className:\`px-2 pb-1 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/60\`,children:e}),t]})}function T_({label:e,count:t,checked:n,onToggle:r,dot:i,mono:a}){return(0,z.jsxs)(\`button\`,{onClick:r,className:\`group flex w-full items-center gap-2 rounded px-2 py-1 text-left text-xs text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground\`,children:[(0,z.jsx)($t,{checked:n,onChange:r}),i&&(0,z.jsx)(\`span\`,{className:\`size-1.5 shrink-0 rounded-full \${i}\`}),(0,z.jsx)(\`span\`,{className:\`min-w-0 flex-1 truncate \`+(a?\`font-mono\`:\`\`),children:e}),(0,z.jsx)(\`span\`,{className:\`tabular-nums text-muted-foreground/50\`,children:t.toLocaleString()})]})}function E_({entries:e}){let t=(0,_.useMemo)(()=>{if(e.length===0)return null;let t=1/0,n=-1/0,r=e.map(e=>Date.parse(e.ts));for(let e of r)e<t&&(t=e),e>n&&(n=e);n===t&&(n=t+1);let i=n-t,a=Array.from({length:60},()=>({ok:0,err:0}));return e.forEach((e,n)=>{let o=Math.min(59,Math.floor((r[n]-t)/i*60));e.level===\`error\`||e.status!==null&&e.status>=500?a[o].err++:a[o].ok++}),{buckets:a,peak:Math.max(...a.map(e=>e.ok+e.err)),min:t,max:n}},[e]);return t?(0,z.jsx)(\`div\`,{className:\`flex h-12 shrink-0 items-end gap-px border-b border-border px-3 pb-1 pt-2\`,title:\`Event volume\`,children:t.buckets.map((e,n)=>{let r=e.ok+e.err,i=r===0?0:Math.max(8,r/t.peak*100);return(0,z.jsx)(\`div\`,{className:\`flex min-w-0 flex-1 flex-col justify-end self-stretch\`,title:\`\${r} events\`,children:r>0&&(0,z.jsxs)(\`div\`,{className:\`flex w-full flex-col overflow-hidden rounded-sm\`,style:{height:\`\${i}%\`},children:[e.err>0&&(0,z.jsx)(\`div\`,{className:\`w-full bg-destructive/70\`,style:{flexGrow:e.err}}),(0,z.jsx)(\`div\`,{className:\`w-full bg-brand/40\`,style:{flexGrow:e.ok}})]})},n)})}):null}var D_={200:\`OK\`,201:\`Created\`,204:\`No Content\`,206:\`Partial Content\`,301:\`Moved Permanently\`,303:\`See Other\`,304:\`Not Modified\`,400:\`Bad Request\`,401:\`Unauthorized\`,403:\`Forbidden\`,404:\`Not Found\`,405:\`Method Not Allowed\`,406:\`Not Acceptable\`,409:\`Conflict\`,422:\`Unprocessable Entity\`,429:\`Too Many Requests\`,500:\`Internal Server Error\`,503:\`Service Unavailable\`};function O_(e){let t=Date.now()-Date.parse(e);if(!Number.isFinite(t))return\`\`;for(let[e,n]of[[864e5,\`day\`],[36e5,\`hour\`],[6e4,\`minute\`],[1e3,\`second\`]])if(Math.abs(t)>=e){let r=Math.round(Math.abs(t)/e);return\`\${r} \${n}\${r===1?\`\`:\`s\`} ago\`}return\`just now\`}function k_({label:e,copy:t,children:n}){return(0,z.jsxs)(\`div\`,{className:\`group flex items-start gap-3 rounded px-1 py-1 -mx-1 hover:bg-accent/40\`,children:[(0,z.jsx)(\`span\`,{className:\`w-24 shrink-0 pt-px font-mono text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/60\`,children:e}),(0,z.jsx)(\`span\`,{className:\`min-w-0 flex-1 text-right text-[12.5px] text-foreground/90\`,children:n}),t!==void 0&&(0,z.jsx)(\`span\`,{className:\`shrink-0 opacity-0 transition-opacity group-hover:opacity-100\`,children:(0,z.jsx)(er,{value:t,label:e})})]})}function A_({title:e,children:t}){return(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(\`p\`,{className:\`mb-1.5 border-b border-border pb-1.5 font-mono text-[10px] font-semibold uppercase tracking-wider text-muted-foreground\`,children:e}),(0,z.jsx)(\`div\`,{className:\`space-y-0.5\`,children:t})]})}function j_({entry:e,onClose:t}){let n=new Date(e.ts),[r,i]=(e.path??\`\`).split(\`?\`),a=Intl.DateTimeFormat().resolvedOptions().timeZone;return(0,z.jsxs)(hf,{id:\`logs-detail\`,side:\`right\`,defaultSize:400,min:300,max:640,className:\`flex flex-col border-l border-border bg-card\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex shrink-0 items-center justify-between border-b border-border px-4 py-2.5\`,children:[(0,z.jsx)(\`span\`,{className:\`text-[13px] font-medium text-foreground\`,children:\`Event details\`}),(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-1\`,children:[(0,z.jsx)(er,{value:JSON.stringify(e,null,2),label:\`Event JSON\`}),(0,z.jsx)(\`button\`,{className:\`rounded p-1 text-muted-foreground hover:bg-accent hover:text-foreground\`,onClick:t,children:(0,z.jsx)(Lt,{size:14})})]})]}),(0,z.jsxs)(\`div\`,{className:\`min-h-0 flex-1 space-y-5 overflow-y-auto p-4\`,children:[(0,z.jsxs)(A_,{title:\`Event\`,children:[(0,z.jsx)(k_,{label:\`Timestamp\`,copy:e.ts,children:(0,z.jsx)(\`span\`,{className:\`font-mono text-[12px]\`,children:e.ts})}),(0,z.jsx)(k_,{label:\`Local\`,children:(0,z.jsx)(\`span\`,{className:\`font-mono text-[12px]\`,title:a,children:n.toLocaleString()})}),(0,z.jsx)(k_,{label:\`Relative\`,children:O_(e.ts)}),(0,z.jsx)(k_,{label:\`Level\`,children:(0,z.jsx)(B,{variant:e.level===\`error\`?\`red\`:e.level===\`warn\`?\`amber\`:\`neutral\`,children:e.level})}),(0,z.jsx)(k_,{label:\`Service\`,copy:e.service,children:e.service})]}),e.method&&(0,z.jsxs)(A_,{title:\`Request\`,children:[(0,z.jsx)(k_,{label:\`Method\`,copy:e.method,children:(0,z.jsx)(\`span\`,{className:\`font-mono text-[12px]\`,children:e.method})}),(0,z.jsx)(k_,{label:\`Path\`,copy:r,children:(0,z.jsx)(\`span\`,{className:\`break-all font-mono text-[12px]\`,children:r})}),i&&(0,z.jsx)(k_,{label:\`Query\`,copy:i,children:(0,z.jsx)(\`span\`,{className:\`break-all font-mono text-[11px] text-muted-foreground\`,children:i})}),e.status!==null&&(0,z.jsx)(k_,{label:\`Status\`,copy:String(e.status),children:(0,z.jsxs)(\`span\`,{className:\`inline-flex items-center gap-1.5\`,children:[(0,z.jsx)(B,{variant:e.status>=500?\`red\`:e.status>=400?\`amber\`:\`brand\`,children:e.status}),D_[e.status]&&(0,z.jsx)(\`span\`,{className:\`text-[11px] text-muted-foreground\`,children:D_[e.status]})]})})]}),(0,z.jsx)(A_,{title:\`Message\`,children:(0,z.jsx)(\`pre\`,{className:\`whitespace-pre-wrap wrap-break-word rounded-md border border-border bg-code p-3 font-mono text-[12px] leading-relaxed text-foreground/90\`,children:e.msg})}),(0,z.jsx)(A_,{title:\`Raw JSON\`,children:(0,z.jsx)(\`div\`,{className:\`overflow-hidden rounded-md border border-border bg-code px-1 py-2\`,children:(0,z.jsx)(nr,{value:JSON.stringify(e,null,2),lang:\`js\`,readOnly:!0,minLines:6,maxLines:16})})})]})]})}var M_=25e3;function N_(e){let t=\`\${e.baseUrl.replace(/^http/,\`ws\`)}/realtime/v1/websocket?apikey=\${encodeURIComponent(e.token)}&vsn=1.0.0\`,n=\`realtime:\${e.channel}\`,r=0,i=()=>String(++r),a=null,o=null,s=!1;e.onStatus(\`connecting\`);let c=new WebSocket(t),l=t=>{c.readyState===WebSocket.OPEN&&(c.send(JSON.stringify(t)),e.onMessage({dir:\`out\`,ts:Date.now(),event:t.event,topic:t.topic,payload:t.payload}))};return c.onopen=()=>{e.onStatus(\`open\`);let t=e.listenChanges?[{event:\`*\`,schema:e.schema,...e.table?{table:e.table}:{}}]:[];a=i(),l({topic:n,event:\`phx_join\`,ref:a,payload:{config:{broadcast:{self:!0},presence:{key:\`studio-\${Math.floor(performance.now()).toString(36)}\`},postgres_changes:t},access_token:e.token}}),o=setInterval(()=>{l({topic:\`phoenix\`,event:\`heartbeat\`,payload:{},ref:i()})},M_)},c.onmessage=t=>{try{let n=JSON.parse(String(t.data));if(n.topic===\`phoenix\`)return;if(n.event===\`phx_reply\`&&n.ref===a){let t=n.payload?.status===\`ok\`;e.onStatus(t?\`joined\`:\`error\`)}e.onMessage({dir:\`in\`,ts:Date.now(),event:n.event,topic:n.topic,payload:n.payload})}catch{e.onMessage({dir:\`in\`,ts:Date.now(),event:\`raw\`,payload:String(t.data)})}},c.onerror=()=>{s||e.onStatus(\`error\`)},c.onclose=()=>{o&&clearInterval(o),e.onStatus(\`closed\`)},{sendBroadcast:(e,t)=>{l({topic:n,event:\`broadcast\`,ref:i(),payload:{type:\`broadcast\`,event:e,payload:t}})},close:()=>{s=!0,o&&clearInterval(o);try{l({topic:n,event:\`phx_leave\`,payload:{},ref:i()})}finally{c.close()}}}}var P_=[\`inspector\`,\`policies\`,\`settings\`];function F_(){let{section:e}=Yt(),t=P_.includes(e)?e:\`inspector\`;return(0,z.jsxs)(\`div\`,{className:\`flex h-full\`,children:[(0,z.jsx)(Th,{title:\`Realtime\`,active:t,onSelect:e=>R(\`realtime\`,e),groups:[{title:\`Tools\`,items:[{id:\`inspector\`,label:\`Inspector\`}]},{title:\`Configuration\`,items:[{id:\`policies\`,label:\`Policies\`},{id:\`settings\`,label:\`Settings\`}]}]}),(0,z.jsxs)(\`div\`,{className:\`min-w-0 flex-1 overflow-y-auto\`,children:[t===\`inspector\`&&(0,z.jsx)(z_,{}),t===\`policies\`&&(0,z.jsx)(B_,{}),t===\`settings\`&&(0,z.jsx)(V_,{})]})]})}function I_(e){return e.event===\`broadcast\`?\`broadcast\`:e.event===\`postgres_changes\`?\`postgres\`:e.event.startsWith(\`presence\`)?\`presence\`:\`system\`}var L_={broadcast:\`brand\`,postgres:\`blue\`,presence:\`amber\`,system:\`neutral\`},R_={connecting:{label:\`connecting…\`,variant:\`amber\`},open:{label:\`connected\`,variant:\`amber\`},joined:{label:\`joined\`,variant:\`brand\`},closed:{label:\`disconnected\`,variant:\`neutral\`},error:{label:\`error\`,variant:\`red\`}};function z_(){let[e,t]=(0,_.useState)(\`room-1\`),[n,r]=(0,_.useState)(\`service_role\`),[i,a]=(0,_.useState)(!0),[o,s]=(0,_.useState)(\`\`),[c,l]=(0,_.useState)(\`closed\`),[u,d]=(0,_.useState)([]),[f,p]=(0,_.useState)(new Set),[m,h]=(0,_.useState)(\`test\`),[g,v]=(0,_.useState)(\`{ "hello": "world" }\`),y=(0,_.useRef)(null),b=c===\`joined\`||c===\`open\`||c===\`connecting\`;(0,_.useEffect)(()=>()=>y.current?.close(),[]);async function S(){let t=n===\`anon\`?(await N.keys()).anonKey??x():x();d([]),y.current?.close(),y.current=N_({baseUrl:lh(),token:t,channel:e.trim()||\`room-1\`,listenChanges:i,schema:\`public\`,table:o.trim()||void 0,onMessage:e=>d(t=>[e,...t].slice(0,500)),onStatus:l})}function C(){y.current?.close(),y.current=null}function w(){if(!y.current||c!==\`joined\`)return H.error(\`Join a channel first\`);let e;try{e=g.trim()?JSON.parse(g):{}}catch{return H.error(\`Payload is not valid JSON\`)}y.current.sendBroadcast(m.trim()||\`test\`,e)}let T=u.filter(e=>f.size===0||f.has(I_(e))),E=R_[c];return(0,z.jsxs)(\`div\`,{className:\`flex h-full flex-col\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex shrink-0 flex-wrap items-end gap-3 border-b border-border px-4 py-3\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Channel\`}),(0,z.jsx)(lf,{mono:!0,className:\`w-44\`,value:e,disabled:b,onChange:e=>t(e.target.value)})]}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Join as\`}),(0,z.jsx)(Wp,{className:\`w-36\`,value:n,disabled:b,onValueChange:e=>r(e),options:[{value:\`service_role\`,label:\`service_role\`},{value:\`anon\`,label:\`anon\`}]})]}),(0,z.jsxs)(\`label\`,{className:\`flex cursor-pointer items-center gap-2 pb-2 text-[13px] text-foreground/80\`,children:[(0,z.jsx)($t,{checked:i,disabled:b,onChange:a}),\`postgres_changes\`]}),i&&(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Table (empty = all public)\`}),(0,z.jsx)(lf,{mono:!0,className:\`w-40\`,value:o,disabled:b,placeholder:\`*\`,onChange:e=>s(e.target.value)})]}),(0,z.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-2 pb-0.5\`,children:[(0,z.jsxs)(B,{variant:E.variant,children:[(0,z.jsx)(ht,{size:10}),\` \`,E.label]}),b?(0,z.jsxs)(V,{variant:\`outline\`,size:\`xs\`,onClick:C,children:[(0,z.jsx)(Dt,{size:11}),\` Leave\`]}):(0,z.jsxs)(V,{size:\`xs\`,onClick:()=>void S(),children:[(0,z.jsx)(ft,{size:11}),\` Join channel\`]})]})]}),(0,z.jsxs)(\`div\`,{className:\`flex shrink-0 items-end gap-3 border-b border-border bg-card px-4 py-2.5\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Broadcast event\`}),(0,z.jsx)(lf,{mono:!0,className:\`w-36\`,value:m,onChange:e=>h(e.target.value)})]}),(0,z.jsxs)(\`div\`,{className:\`min-w-0 flex-1\`,children:[(0,z.jsx)(X,{children:\`Payload (JSON)\`}),(0,z.jsx)(lf,{mono:!0,value:g,onChange:e=>v(e.target.value),onKeyDown:e=>e.key===\`Enter\`&&w()})]}),(0,z.jsxs)(V,{size:\`xs\`,className:\`mb-0.5\`,onClick:w,disabled:c!==\`joined\`,children:[(0,z.jsx)(yt,{size:11}),\` Send\`]})]}),(0,z.jsxs)(\`div\`,{className:\`flex shrink-0 items-center gap-1.5 border-b border-border px-4 py-2\`,children:[[\`broadcast\`,\`postgres\`,\`presence\`,\`system\`].map(e=>(0,z.jsx)(\`button\`,{onClick:()=>p(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),className:\`rounded-md border px-2 py-1 text-[11px] font-medium transition-colors \`+(f.size===0||f.has(e)?\`border-input text-foreground/80\`:\`border-transparent text-muted-foreground/50 hover:text-muted-foreground\`),children:e},e)),(0,z.jsxs)(\`span\`,{className:\`ml-auto text-xs text-muted-foreground/60\`,children:[u.length,\` messages\`]}),(0,z.jsx)(V,{variant:\`ghost\`,size:\`iconXs\`,title:\`Clear feed\`,onClick:()=>d([]),children:(0,z.jsx)(At,{size:13})})]}),(0,z.jsx)(\`div\`,{className:\`min-h-0 flex-1 overflow-auto p-2\`,children:T.length===0?(0,z.jsx)(cf,{children:c===\`joined\`?\`Listening… insert a row in the table editor or send a broadcast to see messages.\`:\`Join a channel to start inspecting realtime traffic.\`}):T.map((e,t)=>{let n=I_(e);return(0,z.jsxs)(\`details\`,{className:\`group rounded px-2 py-1 hover:bg-accent/40\`,children:[(0,z.jsxs)(\`summary\`,{className:\`flex cursor-pointer list-none items-center gap-2.5 text-[12.5px]\`,children:[e.dir===\`out\`?(0,z.jsx)(fe,{size:11,className:\`shrink-0 text-brand\`}):(0,z.jsx)(le,{size:11,className:\`shrink-0 text-info\`}),(0,z.jsx)(\`span\`,{className:\`shrink-0 font-mono text-muted-foreground/60\`,children:(0,z.jsx)(qm,{value:e.ts,format:\`time\`})}),(0,z.jsx)(B,{variant:L_[n],children:n}),(0,z.jsx)(\`span\`,{className:\`truncate font-mono text-foreground/80\`,children:e.event})]}),(0,z.jsx)(\`pre\`,{className:\`mt-1 overflow-auto rounded-md border border-border bg-code p-2 font-mono text-[11px] text-foreground/80\`,children:JSON.stringify(e.payload,null,2)})]},t)})})]})}function B_(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(!1),[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(null),c=(0,_.useCallback)(()=>{N.policies(\`realtime\`).then(e=>t(e.filter(e=>e.table===\`messages\`)),()=>t([]))},[]);return(0,_.useEffect)(()=>{c();let e=setInterval(()=>void c(),5e3);return()=>clearInterval(e)},[c]),e===null?(0,z.jsx)(Jp,{}):(0,z.jsxs)(\`div\`,{className:\`mx-auto max-w-3xl px-8 py-8\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex items-start justify-between gap-4\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(\`h1\`,{className:\`text-lg font-semibold text-foreground\`,children:\`Policies\`}),(0,z.jsxs)(\`p\`,{className:\`mt-0.5 text-[13px] text-muted-foreground/80\`,children:[\`RLS on \`,(0,z.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`realtime.messages\`}),\` authorizes channels: SELECT gates receiving broadcast/presence, INSERT gates sending. Use \`,(0,z.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`realtime.topic()\`}),\` in expressions to scope a policy to specific channels.\`]})]}),(0,z.jsxs)(V,{size:\`xs\`,className:\`shrink-0\`,onClick:()=>r(!0),children:[(0,z.jsx)(mt,{size:12}),\` New policy\`]})]}),(0,z.jsxs)(\`div\`,{className:\`mt-6 space-y-2\`,children:[e.map(e=>(0,z.jsxs)(\`div\`,{className:\`cursor-pointer rounded-md border border-border bg-card p-3 transition-colors hover:border-muted-foreground/60\`,title:\`Edit policy\`,onClick:()=>a(e),children:[(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-2\`,children:[(0,z.jsx)(\`span\`,{className:\`truncate font-mono text-[13px] text-foreground\`,children:e.name}),(0,z.jsx)(B,{variant:\`blue\`,children:e.cmd}),(0,z.jsx)(B,{variant:\`neutral\`,children:Array.isArray(e.roles)?e.roles.join(\`, \`):String(e.roles)}),(0,z.jsx)(\`button\`,{className:\`ml-auto p-1 text-muted-foreground/80 hover:text-destructive\`,title:\`Drop policy\`,onClick:t=>{t.stopPropagation(),s(e)},children:(0,z.jsx)(At,{size:13})})]}),e.using_expr&&(0,z.jsxs)(\`p\`,{className:\`mt-1.5 truncate font-mono text-[11px] text-muted-foreground/80\`,title:e.using_expr,children:[\`using (\`,e.using_expr,\`)\`]}),e.with_check&&(0,z.jsxs)(\`p\`,{className:\`mt-0.5 truncate font-mono text-[11px] text-muted-foreground/80\`,title:e.with_check,children:[\`with check (\`,e.with_check,\`)\`]})]},e.name)),e.length===0&&(0,z.jsx)(\`p\`,{className:\`rounded-md border border-dashed border-border px-4 py-6 text-center text-xs text-muted-foreground/60\`,children:\`No channel policies yet — every channel is public. Create one to start requiring authorization.\`})]}),n&&(0,z.jsx)(Dg,{table:\`messages\`,schema:\`realtime\`,onClose:()=>r(!1),onCreated:async()=>c()}),i&&(0,z.jsx)(Dg,{table:\`messages\`,schema:\`realtime\`,existing:Ag(i),onClose:()=>a(null),onCreated:async()=>c()}),o&&(0,z.jsx)(q,{open:!0,danger:!0,title:\`Drop policy "\${o.name}"?\`,description:\`Channel authorization changes immediately.\`,confirmLabel:\`Drop policy\`,onConfirm:()=>{N.dropPolicy(\`messages\`,o.name,\`realtime\`).then(c,e=>H.error(e.message))},onClose:()=>s(null)})]})}function V_(){let e=\`\${lh().replace(/^http/,\`ws\`)}/realtime/v1/websocket?apikey=<anon key>&vsn=1.0.0\`,t=({children:e})=>(0,z.jsx)(\`code\`,{className:\`rounded bg-code px-1 py-px font-mono text-foreground/90\`,children:e});return(0,z.jsxs)(xh,{title:\`Realtime Settings\`,children:[(0,z.jsxs)(Sh,{title:\`Connection\`,description:\`How clients reach the Realtime engine.\`,children:[(0,z.jsx)(Ch,{label:\`WebSocket endpoint\`,description:\`supabase-js connects here automatically from the project URL.\`,wide:!0,children:(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-1.5\`,children:[(0,z.jsx)(\`code\`,{className:\`min-w-0 flex-1 truncate rounded-md border border-border bg-code px-2.5 py-1.5 font-mono text-[12px] text-foreground/90\`,title:e,children:e}),(0,z.jsx)(er,{value:e,label:\`WebSocket URL\`})]})}),(0,z.jsxs)(Ch,{label:\`Protocol\`,description:\`The exact wire format supabase-js's RealtimeClient speaks.\`,children:[(0,z.jsx)(wh,{label:\`Format\`,value:\`Phoenix v1 JSON\`}),(0,z.jsx)(wh,{label:\`Heartbeat\`,value:\`every 25s\`})]})]}),(0,z.jsxs)(Sh,{title:\`Features\`,description:\`What channels can carry on this instance.\`,children:[(0,z.jsx)(Ch,{label:\`postgres_changes\`,description:\`Change-data-capture on every table — INSERT / UPDATE / DELETE, filterable by schema and table.\`,children:(0,z.jsx)(B,{variant:\`brand\`,children:\`Enabled\`})}),(0,z.jsx)(Ch,{label:\`Broadcast\`,description:(0,z.jsxs)(z.Fragment,{children:[\`Client-to-client messages; \`,(0,z.jsx)(t,{children:\`self: true\`}),\` echoes back to the sender.\`]}),children:(0,z.jsx)(B,{variant:\`brand\`,children:\`Enabled\`})}),(0,z.jsx)(Ch,{label:\`Presence\`,description:\`Join/leave state tracking per channel.\`,children:(0,z.jsx)(B,{variant:\`brand\`,children:\`Enabled\`})})]}),(0,z.jsx)(Sh,{title:\`Authorization\`,description:\`Who may join, read, and send on private channels.\`,children:(0,z.jsx)(Ch,{label:\`Channel policies\`,description:(0,z.jsxs)(z.Fragment,{children:[\`RLS on \`,(0,z.jsx)(t,{children:\`realtime.messages\`}),\`: SELECT gates receiving broadcast/presence, INSERT gates sending. Scope with \`,(0,z.jsx)(t,{children:\`realtime.topic()\`}),\`.\`]}),children:(0,z.jsx)(V,{variant:\`outline\`,size:\`xs\`,onClick:()=>R(\`realtime\`,\`policies\`),children:\`Manage policies\`})})})]})}function H_(){let[e,t]=(0,_.useState)(\`\`),n=lh();return(0,_.useEffect)(()=>{N.keys().then(e=>t(e.anonKey??\`\`),()=>t(\`\`))},[]),(0,z.jsxs)(Sh,{title:\`API keys\`,description:\`Long-lived JWTs signed with the project's JWT secret. Rotating the secret invalidates both.\`,children:[(0,z.jsx)(Ch,{label:\`Project URL\`,description:\`Point supabase-js (or any HTTP client) here.\`,children:(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-2\`,children:[(0,z.jsx)(lf,{mono:!0,readOnly:!0,value:n}),(0,z.jsx)(er,{value:n,label:\`API URL\`,variant:\`outline\`,size:\`icon\`,iconSize:13})]})}),(0,z.jsx)(Ch,{label:\`anon key\`,description:\`Safe for browsers — Row Level Security applies to every request.\`,children:(0,z.jsx)(df,{bare:!0,label:\`anon key\`,hint:\`\`,value:e})}),(0,z.jsx)(Ch,{label:\`service_role key\`,description:(0,z.jsx)(\`span\`,{className:\`text-destructive/80\`,children:\`Server-side only — bypasses Row Level Security.\`}),children:(0,z.jsx)(df,{bare:!0,label:\`service_role key\`,hint:\`\`,value:x(),danger:!0})}),(0,z.jsx)(Ch,{label:\`CLI\`,description:\`Keys are also printed on startup.\`,children:(0,z.jsx)(\`code\`,{className:\`rounded bg-code px-2 py-1 font-mono text-xs text-foreground/90\`,children:\`tinbase keys\`})})]})}function U_(){let[e,t]=pn(),[n,r]=gn();return(0,z.jsxs)(Sh,{title:\`Appearance\`,description:\`Preferences are stored in this browser and apply instantly.\`,children:[(0,z.jsx)(Ch,{label:\`Theme\`,description:\`Choose your interface color theme. System follows your OS preference.\`,wide:!0,children:(0,z.jsx)(Z_,{value:e,onChange:t})}),(0,z.jsx)(Ch,{label:\`Sidebar\`,description:\`How the navigation sidebar behaves.\`,wide:!0,children:(0,z.jsx)(q_,{value:n,onChange:r})})]})}var W_=[{value:\`expanded\`,label:\`Expanded\`},{value:\`collapsed\`,label:\`Collapsed\`},{value:\`hover\`,label:\`Expand on hover\`}];function G_({label:e}){return(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-1.5\`,children:[(0,z.jsx)(\`div\`,{className:\`size-1.5 shrink-0 rounded-full bg-muted-foreground/60\`}),e&&(0,z.jsx)(\`div\`,{className:\`h-1 flex-1 rounded-full bg-muted-foreground/25\`})]})}function K_({variant:e}){return(0,z.jsxs)(\`div\`,{className:\`absolute inset-0 flex\`,children:[(0,z.jsx)(\`div\`,{className:\`flex shrink-0 flex-col gap-2 border-r border-border bg-accent/50 p-2.5 \`+(e===\`expanded\`?\`w-[42%]\`:\`w-[22%]\`),children:[0,1,2,3].map(t=>(0,z.jsx)(G_,{label:e===\`expanded\`},t))}),e===\`hover\`&&(0,z.jsx)(\`div\`,{className:\`absolute inset-y-0 left-[22%] flex w-[42%] flex-col gap-2 border-r border-border bg-popover/95 p-2.5 shadow-xl backdrop-blur-sm\`,children:[0,1,2,3].map(e=>(0,z.jsx)(G_,{label:!0},e))}),(0,z.jsx)(\`div\`,{className:\`flex-1 bg-card\`})]})}function q_({value:e,onChange:t}){return(0,z.jsx)(\`div\`,{className:\`grid max-w-2xl grid-cols-1 gap-4 sm:grid-cols-3\`,children:W_.map(n=>{let r=e===n.value;return(0,z.jsxs)(\`button\`,{onClick:()=>t(n.value),"aria-pressed":r,className:\`group relative flex h-32 flex-col overflow-hidden rounded-lg border-2 text-left transition-colors \`+(r?\`border-brand\`:\`border-border hover:border-muted-foreground\`),children:[(0,z.jsx)(\`div\`,{className:\`relative flex-1 overflow-hidden\`,children:(0,z.jsx)(K_,{variant:n.value})}),(0,z.jsx)(\`div\`,{className:\`flex h-8 shrink-0 items-center border-t px-3 text-xs font-medium transition-colors \`+(r?\`border-brand/40 bg-brand/10 text-foreground\`:\`border-border bg-card text-muted-foreground group-hover:text-foreground\`),children:n.label})]},n.value)})})}var J_={light:{bg:\`#ffffff\`,panel:\`#f4f4f5\`,line:\`#d9d9de\`,block:\`#e8e8ea\`,card:\`#fafafa\`,border:\`#e4e4e7\`},dark:{bg:\`#1c1c1c\`,panel:\`#141414\`,line:\`#3a3a3a\`,block:\`#2a2a2a\`,card:\`#212121\`,border:\`#333333\`}};function Y_({variant:e}){let t=J_[e];return(0,z.jsxs)(\`div\`,{className:\`absolute inset-0 flex gap-2 p-3\`,style:{background:t.bg},children:[(0,z.jsxs)(\`div\`,{className:\`flex w-1/4 shrink-0 flex-col gap-1.5 rounded-sm p-1.5\`,style:{background:t.panel},children:[(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-1\`,children:[(0,z.jsx)(\`div\`,{className:\`h-1.5 w-2/3 rounded-full\`,style:{background:t.line}}),(0,z.jsx)(\`div\`,{className:\`ml-auto size-2 rounded-full\`,style:{background:t.line}})]}),[80,60,70,50].map((e,n)=>(0,z.jsx)(\`div\`,{className:\`h-1.5 rounded-full\`,style:{width:\`\${e}%\`,background:t.block}},n))]}),(0,z.jsxs)(\`div\`,{className:\`flex min-w-0 flex-1 flex-col gap-1.5 rounded-sm border p-2\`,style:{background:t.card,borderColor:t.border},children:[(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-1.5\`,children:[(0,z.jsx)(\`div\`,{className:\`size-2.5 rounded-full\`,style:{background:t.block}}),(0,z.jsx)(\`div\`,{className:\`h-1.5 w-1/3 rounded-full\`,style:{background:t.line}}),(0,z.jsx)(\`div\`,{className:\`h-1.5 w-1/4 rounded-full\`,style:{background:t.block}})]}),(0,z.jsx)(\`div\`,{className:\`h-1.5 w-3/4 rounded-full\`,style:{background:t.block}}),(0,z.jsx)(\`div\`,{className:\`mt-auto h-1/2 w-full rounded-sm\`,style:{background:t.block}})]})]})}var X_=[{value:\`light\`,label:\`Light\`},{value:\`dark\`,label:\`Dark\`},{value:\`system\`,label:\`System\`}];function Z_({value:e,onChange:t}){return(0,z.jsx)(\`div\`,{className:\`grid max-w-2xl grid-cols-1 gap-4 sm:grid-cols-3\`,children:X_.map(n=>{let r=e===n.value;return(0,z.jsxs)(\`button\`,{onClick:()=>t(n.value),"aria-pressed":r,className:\`group relative flex h-32 flex-col overflow-hidden rounded-lg border-2 text-left transition-colors \`+(r?\`border-brand\`:\`border-border hover:border-muted-foreground\`),children:[(0,z.jsx)(\`div\`,{className:\`relative flex-1 overflow-hidden\`,children:n.value===\`system\`?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Y_,{variant:\`light\`}),(0,z.jsx)(\`div\`,{className:\`absolute inset-0\`,style:{clipPath:\`polygon(100% 0, 100% 100%, 0 100%)\`},children:(0,z.jsx)(Y_,{variant:\`dark\`})})]}):(0,z.jsx)(Y_,{variant:n.value})}),(0,z.jsx)(\`div\`,{className:\`flex h-8 shrink-0 items-center border-t px-3 text-xs font-medium transition-colors \`+(r?\`border-brand/40 bg-brand/10 text-foreground\`:\`border-border bg-card text-muted-foreground group-hover:text-foreground\`),children:n.label})]},n.value)})})}var Q_=({children:e})=>(0,z.jsx)(\`code\`,{className:\`rounded bg-code px-1 py-px font-mono text-foreground/90\`,children:e});function $_(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(null);return(0,_.useEffect)(()=>{N.stats().then(e=>{t(e),r(!0)},()=>r(!1))},[]),e===null&&n===null?(0,z.jsx)(Jp,{}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(Sh,{title:\`Instance\`,description:\`One process — embedded Postgres, no Docker.\`,children:[(0,z.jsx)(Ch,{label:\`Status\`,description:\`Whether the admin API responds.\`,children:n?(0,z.jsx)(B,{variant:\`brand\`,children:\`Healthy\`}):(0,z.jsx)(B,{variant:\`red\`,children:\`Unreachable\`})}),(0,z.jsxs)(Ch,{label:\`Database\`,description:\`Engine version and current on-disk size.\`,children:[(0,z.jsx)(wh,{label:\`Postgres\`,value:e?.version??\`—\`}),(0,z.jsx)(wh,{label:\`Size\`,value:e?.dbSize??\`—\`}),(0,z.jsx)(wh,{label:\`Tables (public)\`,value:e?.tables??\`—\`}),(0,z.jsx)(wh,{label:\`Applied migrations\`,value:e?.migrations??\`—\`})]}),(0,z.jsxs)(Ch,{label:\`Services\`,description:\`Counts across auth and storage.\`,children:[(0,z.jsx)(wh,{label:\`Auth users\`,value:e?.users??\`—\`}),(0,z.jsx)(wh,{label:\`Buckets\`,value:e?.buckets??\`—\`}),(0,z.jsx)(wh,{label:\`Objects\`,value:e?.objects??\`—\`})]})]}),(0,z.jsx)(Sh,{title:\`Data locations\`,description:\`Configured by CLI flags when starting tinbase.\`,children:(0,z.jsx)(Ch,{label:\`On disk\`,description:\`Where this project's data lives, relative to the project directory.\`,children:(0,z.jsxs)(\`div\`,{className:\`space-y-1.5 text-xs leading-relaxed text-muted-foreground\`,children:[(0,z.jsxs)(\`p\`,{children:[\`Database: \`,(0,z.jsx)(Q_,{children:\`.tinbase/db\`}),\` (PGlite) or \`,(0,z.jsx)(Q_,{children:\`.tinbase/pgdata\`}),\` (native)\`]}),(0,z.jsxs)(\`p\`,{children:[\`Storage objects: \`,(0,z.jsx)(Q_,{children:\`.tinbase/storage\`})]}),(0,z.jsxs)(\`p\`,{children:[\`Override with \`,(0,z.jsx)(Q_,{children:\`--data-dir\`}),\` / \`,(0,z.jsx)(Q_,{children:\`--storage-dir\`}),\` · wipe + reseed with \`,(0,z.jsx)(Q_,{children:\`tinbase db reset\`})]})]})})})]})}var ev=({children:e})=>(0,z.jsx)(\`code\`,{className:\`rounded bg-code px-1 py-px font-mono text-foreground/90\`,children:e});function tv(){return(0,z.jsxs)(Sh,{title:\`JWT keys\`,description:\`All tokens — anon key, service_role key, and user sessions — are HS256 JWTs signed with one secret.\`,children:[(0,z.jsx)(Ch,{label:\`Secret\`,description:\`Never exposed over the API. Configured where tinbase starts.\`,children:(0,z.jsxs)(\`div\`,{className:\`space-y-1.5 text-xs leading-relaxed text-muted-foreground\`,children:[(0,z.jsxs)(\`p\`,{children:[(0,z.jsx)(ev,{children:\`TINBASE_JWT_SECRET\`}),\` environment variable, or the \`,(0,z.jsx)(ev,{children:\`--jwt-secret\`}),\` CLI flag.\`]}),(0,z.jsx)(\`p\`,{children:\`Without either, a well-known development default is used — fine locally, but set a real secret before exposing the server to anything.\`})]})}),(0,z.jsx)(Ch,{label:\`Rotation\`,description:\`Rotating the secret invalidates every existing token.\`,children:(0,z.jsxs)(\`ol\`,{className:\`list-inside list-decimal space-y-1.5 text-xs leading-relaxed text-muted-foreground\`,children:[(0,z.jsxs)(\`li\`,{children:[\`Restart with the new secret: \`,(0,z.jsx)(ev,{children:\`TINBASE_JWT_SECRET=… tinbase start\`})]}),(0,z.jsxs)(\`li\`,{children:[\`Grab the re-derived keys from the startup banner or \`,(0,z.jsx)(ev,{children:\`tinbase keys\`})]}),(0,z.jsx)(\`li\`,{children:\`Update every client using the old keys — and sign back in to this studio\`})]})})]})}var nv=[{id:\`general\`,label:\`General\`,component:U_},{id:\`infrastructure\`,label:\`Infrastructure\`,component:$_},{id:\`api-keys\`,label:\`API Keys\`,component:H_},{id:\`jwt\`,label:\`JWT Keys\`,component:tv}];function rv(){let{section:e}=Yt(),t=nv.some(t=>t.id===e)?e:\`general\`,n=nv.find(e=>e.id===t).component;return(0,z.jsxs)(\`div\`,{className:\`flex h-full\`,children:[(0,z.jsx)(Th,{title:\`Project Settings\`,active:t,onSelect:e=>R(\`settings\`,e),groups:[{items:nv.map(e=>({id:e.id,label:e.label}))}]}),(0,z.jsx)(\`div\`,{className:\`min-w-0 flex-1 overflow-y-auto\`,children:(0,z.jsxs)(\`div\`,{className:\`mx-auto max-w-4xl px-10 py-8\`,children:[(0,z.jsx)(\`h1\`,{className:\`border-b border-border pb-4 text-xl font-semibold text-foreground\`,children:nv.find(e=>e.id===t).label}),(0,z.jsx)(n,{})]})})]})}var iv=[{kind:\`postgres\`,icon:we,title:\`Postgres\`,sub:\`Superuser\`,blurb:\`Full admin access — the service_role, which bypasses all Row Level Security (RLS) policies.\`},{kind:\`anon\`,icon:Nt,title:\`Anonymous\`,sub:\`Not logged in\`,blurb:\`The anon key — what an unauthenticated visitor sees. RLS policies apply.\`},{kind:\`authenticated\`,icon:Pt,title:\`Authenticated\`,sub:\`Specific logged in user\`,blurb:\`Impersonate a real user — auth.uid() resolves to them. RLS policies apply.\`}];function av({value:e,onChange:t,align:n=\`end\`}){let[r,i]=(0,_.useState)(!1),[a,o]=(0,_.useState)([]);(0,_.useEffect)(()=>{r&&a.length===0&&N.users().then(o,()=>{})},[r,a.length]);async function s(e,n){try{if(e===\`postgres\`)t({kind:\`postgres\`},null);else if(e===\`anon\`){let{anonKey:e}=await N.keys();t({kind:\`anon\`},e??(await N.impersonate(\`anon\`)).token)}else{if(!n)return;let{token:e}=await N.impersonate(\`authenticated\`,{sub:n.id,email:n.email});t({kind:\`authenticated\`,sub:n.id,email:n.email},e)}(e!==\`authenticated\`||n)&&i(!1)}catch(e){H.error(e.message)}}let c=e.kind===\`authenticated\`?e.email??e.sub.slice(0,8):e.kind,l=iv.find(t=>t.kind===e.kind);return(0,z.jsxs)(pf,{open:r,onOpenChange:i,align:n,className:\`w-105 p-3\`,trigger:(0,z.jsxs)(V,{variant:\`outline\`,size:\`xs\`,onClick:()=>i(e=>!e),children:[\`Role \`,(0,z.jsx)(\`span\`,{className:\`font-mono \`+(e.kind===\`postgres\`?\`text-foreground\`:\`text-brand\`),children:c}),(0,z.jsx)(me,{size:11})]}),children:[(0,z.jsx)(\`p\`,{className:\`mb-2 px-0.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/80\`,children:\`View data as a role\`}),(0,z.jsx)(\`div\`,{className:\`grid grid-cols-3 gap-2\`,children:iv.map(t=>{let n=t.icon,r=e.kind===t.kind;return(0,z.jsxs)(\`button\`,{onClick:()=>t.kind===\`authenticated\`?void 0:void s(t.kind),className:\`relative rounded-md border p-3 text-left transition-colors \`+(r?\`border-foreground bg-accent/60\`:\`border-input hover:border-muted-foreground\`),children:[r&&(0,z.jsx)(\`span\`,{className:\`absolute right-2 top-2 flex size-4 items-center justify-center rounded-full bg-foreground text-background\`,children:(0,z.jsx)(pe,{size:10,strokeWidth:3})}),(0,z.jsx)(n,{size:15,className:\`text-muted-foreground\`}),(0,z.jsx)(\`p\`,{className:\`mt-2 text-[13px] font-medium text-foreground\`,children:t.title}),(0,z.jsx)(\`p\`,{className:\`text-[11px] text-muted-foreground/80\`,children:t.sub})]},t.kind)})}),(0,z.jsx)(\`div\`,{className:\`mt-2\`,children:(0,z.jsx)(Wp,{value:e.kind===\`authenticated\`?e.sub:\`\`,onValueChange:e=>{let t=a.find(t=>t.id===e);t&&s(\`authenticated\`,t)},placeholder:a.length===0?\`No auth users — sign someone up first\`:\`Impersonate a user…\`,disabled:a.length===0,options:a.map(e=>({value:e.id,label:e.email??e.id}))})}),(0,z.jsxs)(\`p\`,{className:\`mt-3 border-t border-border pt-2.5 text-[11px] leading-relaxed text-muted-foreground/80\`,children:[(0,z.jsx)(\`span\`,{className:\`font-medium text-foreground/80\`,children:l.title}),e.kind===\`postgres\`&&(0,z.jsx)(\`span\`,{className:\`ml-1.5 rounded border border-input px-1 py-px text-[9px] uppercase text-muted-foreground/80\`,children:\`default\`}),(0,z.jsx)(\`br\`,{}),l.blurb]})]})}function ov({result:e}){if(!e)return(0,z.jsx)(cf,{children:\`Run a query to see results. ⌘⏎ / Ctrl+⏎\`});if(!e.ok)return(0,z.jsxs)(\`div\`,{className:\`m-4 rounded-md border border-destructive/30 bg-destructive/10 p-3 text-[13px] text-destructive\`,children:[(0,z.jsx)(\`div\`,{className:\`font-mono\`,children:e.error}),e.code&&(0,z.jsxs)(\`div\`,{className:\`mt-1 text-xs text-destructive/70\`,children:[\`SQLSTATE \`,e.code]}),e.detail&&(0,z.jsx)(\`div\`,{className:\`mt-1 text-xs text-muted-foreground\`,children:e.detail}),e.hint&&(0,z.jsxs)(\`div\`,{className:\`mt-1 text-xs text-muted-foreground\`,children:[\`Hint: \`,e.hint]})]});let t=e.rows??[],n=t[0]?Object.keys(t[0]):[];return n.length===0?(0,z.jsxs)(cf,{children:[\`Statement executed\`,e.affectedRows==null?\`\`:\` · \${e.affectedRows} rows affected\`,\`.\`]}):(0,z.jsxs)(\`div\`,{className:\`flex h-full min-h-0 flex-col\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex shrink-0 items-center gap-3 border-b border-border px-3 py-1.5 text-xs text-muted-foreground/80\`,children:[(0,z.jsxs)(\`span\`,{children:[e.rowCount,\` row\`,e.rowCount===1?\`\`:\`s\`,\` · \`,e.ms,\` ms\`]}),(0,z.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-1\`,children:[(0,z.jsxs)(V,{variant:\`ghost\`,size:\`xs\`,onClick:()=>g_(\`results.csv\`,\`text/csv\`,h_(n,t)),children:[(0,z.jsx)(Ee,{size:12}),\` CSV\`]}),(0,z.jsxs)(V,{variant:\`ghost\`,size:\`xs\`,onClick:()=>g_(\`results.json\`,\`application/json\`,JSON.stringify(t,null,2)),children:[(0,z.jsx)(Ee,{size:12}),\` JSON\`]}),(0,z.jsx)(er,{variant:\`ghost\`,size:\`xs\`,label:\`results as JSON\`,value:()=>JSON.stringify(t,null,2),children:\`Copy\`})]})]}),(0,z.jsx)(\`div\`,{className:\`min-h-0 flex-1 overflow-auto\`,children:(0,z.jsxs)(Xp,{children:[(0,z.jsx)(Zp,{children:(0,z.jsx)(\`tr\`,{children:n.map(e=>(0,z.jsx)(Z,{className:\`font-mono text-foreground/80\`,children:e},e))})}),(0,z.jsx)(\`tbody\`,{children:t.map((e,t)=>(0,z.jsx)(Qp,{children:n.map(t=>(0,z.jsx)(Q,{className:\`max-w-90 cursor-cell truncate font-mono text-foreground/80\`,title:Ym(e[t])??\`Double-click to copy\`,onDoubleClick:()=>{let n=e[t];Qn(n==null?\`\`:typeof n==\`object\`?JSON.stringify(n):String(n),t)},children:(0,z.jsx)(Jm,{value:e[t]})},t))},t))})]})})]})}var sv=\`tinbase_sql_queries\`,cv=\`tinbase_sql_tabs\`,lv=\`tinbase_sql_history\`,uv=50;function dv(e,t){try{let n=localStorage.getItem(e);return n?JSON.parse(n):t}catch{return t}}function fv(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{}}var pv=()=>dv(sv,[]),mv=e=>fv(sv,e),hv=()=>dv(cv,{tabs:[],active:null}),gv=(e,t)=>fv(cv,{tabs:e,active:t}),_v=()=>dv(lv,[]);function vv(e){let t=[e,..._v()].slice(0,uv);return fv(lv,t),t}function yv(){return fv(lv,[]),[]}var bv=()=>crypto.randomUUID();function xv(e,t){if(t)return t.name;let n=e.replace(/--[^\\n]*/g,\` \`).replace(/\\/\\*[\\s\\S]*?\\*\\//g,\` \`).replace(/\\s+/g,\` \`).trim();return n?n.length>32?n.slice(0,32)+\`…\`:n:\`Untitled query\`}function Sv(e,t){if(!t)return e;let n=e.trim().replace(/;+\\s*$/,\`\`);return!/^\\s*(select|with)\\b/i.test(n)||/\\blimit\\s+\\d+/i.test(n)?e:\`\${n} limit \${t}\`}var Cv=/\\b(select|from|where|group by|order by|having|limit|offset|left join|right join|inner join|join|union|insert into|values|update|set|delete from|returning)\\b/gi;function wv(e){return e.replace(Cv,e=>\`\\n\${e.toUpperCase()}\`).replace(/^\\n/,\`\`).replace(/\\n{2,}/g,\`
|
|
1566
|
-
\`).trim()}var Tv=!1;function Ev(e){Tv||(Tv=!0,sn.default.require(\`ace/ext/language_tools\`).addCompleter({getCompletions:(t,n,r,i,a)=>{a(null,e().map(e=>({...e,score:500})))}}))}function Dv(){let[e,t]=(0,_.useState)(pv),[n,r]=(0,_.useState)(\`\`),[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(null),c=hv(),[l,u]=(0,_.useState)(c.tabs.length?c.tabs:[{id:bv(),queryId:null,sql:\`\`}]),[d,f]=(0,_.useState)(c.active??(c.tabs[0]?.id||\`\`)),p=l.find(e=>e.id===d)??l[0],[m,h]=(0,_.useState)({kind:\`postgres\`}),[g,v]=(0,_.useState)(100),[y,b]=(0,_.useState)(null),[x,S]=(0,_.useState)(!1),[C,w]=(0,_.useState)(_v),[T,E]=(0,_.useState)(!1),[D,O]=(0,_.useState)(!1),k=(0,_.useRef)([]);(0,_.useEffect)(()=>{Ev(()=>k.current),N.tables().then(e=>{let t=[];for(let n of e){t.push({caption:n.name,value:n.name,meta:\`table\`});for(let e of n.columns)t.push({caption:\`\${n.name}.\${e.name}\`,value:e.name,meta:e.type})}k.current=t},()=>{})},[]),(0,_.useEffect)(()=>gv(l,p?.id??null),[l,p]);let A=(0,_.useCallback)(e=>{t(e),mv(e)},[]);if(!p)return(0,z.jsx)(cf,{children:\`Something went wrong — reload.\`});let j=t=>e.find(e=>e.id===t.queryId)??null,M=e=>{let t=j(e);return t?t.sql!==e.sql:e.sql.trim()!==\`\`};function ee(e){u(t=>t.map(t=>t.id===d?{...t,sql:e}:t))}function te(e=\`\`,t=null){let n={id:bv(),queryId:t,sql:e};u(e=>[...e,n]),f(n.id),b(null)}function P(e){u(t=>{let n=t.filter(t=>t.id!==e);if(n.length===0){let e={id:bv(),queryId:null,sql:\`\`};return f(e.id),[e]}return e===d&&f(n[Math.max(0,t.findIndex(t=>t.id===e)-1)].id),n})}function F(e){let t=l.find(t=>t.queryId===e.id);t?f(t.id):te(e.sql,e.id)}function ne(t){let n=j(p);if(n)A(e.map(e=>e.id===n.id?{...e,sql:p.sql,updatedAt:Date.now()}:e)),H.success(\`Saved "\${n.name}"\`);else if(t){let n={id:bv(),name:t,sql:p.sql,favorite:!1,updatedAt:Date.now()};A([n,...e]),u(e=>e.map(e=>e.id===d?{...e,queryId:n.id}:e)),H.success(\`Saved "\${t}"\`)}else O(!0)}async function re(){let e=p.sql.trim();if(!e||x)return;S(!0);let t=m.kind===\`postgres\`?void 0:m.kind===\`anon\`?{role:\`anon\`,claims:{role:\`anon\`}}:{role:\`authenticated\`,claims:{role:\`authenticated\`,sub:m.sub,email:m.email}};try{let n=await N.sql(Sv(e,g),t);b(n),w(vv({sql:e,ts:Date.now(),ms:n.ms,ok:n.ok,rows:n.rowCount}))}catch(e){b({ok:!1,error:e instanceof Error?e.message:String(e)})}finally{S(!1)}}let ie=n.toLowerCase(),ae=e.filter(e=>e.name.toLowerCase().includes(ie)||e.sql.toLowerCase().includes(ie)),oe=ae.filter(e=>e.favorite),I=ae.filter(e=>!e.favorite);return(0,z.jsxs)(\`div\`,{className:\`flex h-full\`,children:[(0,z.jsxs)(hf,{id:\`sql-saved\`,side:\`left\`,defaultSize:240,min:200,max:400,className:\`flex flex-col border-r border-border bg-card\`,children:[(0,z.jsx)(\`div\`,{className:\`px-4 pb-1 pt-4 text-sm font-semibold text-foreground\`,children:\`SQL Editor\`}),(0,z.jsxs)(\`div\`,{className:\`space-y-1.5 px-2 pb-2 pt-1\`,children:[(0,z.jsxs)(V,{variant:\`outline\`,size:\`xs\`,className:\`w-full\`,onClick:()=>te(),children:[(0,z.jsx)(mt,{size:12}),\` New query\`]}),(0,z.jsxs)(\`div\`,{className:\`relative\`,children:[(0,z.jsx)(vt,{size:13,className:\`pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground/60\`}),(0,z.jsx)(\`input\`,{value:n,onChange:e=>r(e.target.value),placeholder:\`Search queries…\`,className:\`h-7 w-full rounded-md border border-border bg-field pl-7 pr-2 text-xs text-foreground placeholder:text-muted-foreground/60 focus:border-muted-foreground focus:outline-none\`})]})]}),(0,z.jsxs)(\`div\`,{className:\`min-h-0 flex-1 overflow-y-auto pb-2\`,children:[oe.length>0&&(0,z.jsx)(Ov,{title:\`Favorites\`,items:oe,onOpen:F,onRename:a,onDelete:s,onFav:t=>A(e.map(e=>e.id===t.id?{...e,favorite:!e.favorite}:e))}),(0,z.jsx)(Ov,{title:\`Saved (\${I.length})\`,items:I,onOpen:F,onRename:a,onDelete:s,onFav:t=>A(e.map(e=>e.id===t.id?{...e,favorite:!e.favorite}:e))}),ae.length===0&&(0,z.jsx)(\`p\`,{className:\`px-4 py-6 text-center text-xs text-muted-foreground/60\`,children:e.length===0?\`No saved queries yet — write one and hit Save.\`:\`No match.\`})]})]}),(0,z.jsxs)(\`div\`,{className:\`flex min-w-0 flex-1 flex-col\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex shrink-0 items-center gap-px overflow-x-auto border-b border-border bg-card px-1 pt-1\`,children:[l.map(e=>(0,z.jsxs)(\`div\`,{className:\`group flex shrink-0 cursor-pointer items-center gap-1.5 rounded-t-md border-x border-t px-3 py-1.5 text-xs \`+(e.id===d?\`border-border bg-background text-foreground\`:\`border-transparent text-muted-foreground hover:text-foreground\`),onClick:()=>f(e.id),children:[(0,z.jsx)(\`span\`,{className:\`max-w-40 truncate\`,children:xv(e.sql,j(e))}),M(e)&&(0,z.jsx)(\`span\`,{className:\`size-1.5 shrink-0 rounded-full bg-brand\`,title:\`Unsaved changes\`}),(0,z.jsx)(\`button\`,{className:\`rounded p-px text-muted-foreground/60 opacity-0 hover:bg-accent hover:text-foreground group-hover:opacity-100\`,onClick:t=>{t.stopPropagation(),P(e.id)},children:(0,z.jsx)(Lt,{size:11})})]},e.id)),(0,z.jsx)(\`button\`,{className:\`ml-1 rounded p-1 text-muted-foreground/80 hover:bg-accent hover:text-foreground\`,title:\`New tab\`,onClick:()=>te(),children:(0,z.jsx)(mt,{size:13})})]}),(0,z.jsxs)(\`div\`,{className:\`flex shrink-0 items-center gap-1.5 border-b border-border px-3 py-1.5\`,children:[(0,z.jsx)(av,{align:\`start\`,value:m,onChange:e=>h(e)}),(0,z.jsx)(Wp,{size:\`xs\`,className:\`w-26 shrink-0\`,value:g===null?\`none\`:String(g),onValueChange:e=>v(e===\`none\`?null:parseInt(e,10)),options:[{value:\`100\`,label:\`Limit 100\`},{value:\`500\`,label:\`Limit 500\`},{value:\`1000\`,label:\`Limit 1000\`},{value:\`none\`,label:\`No limit\`}]}),(0,z.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-1.5\`,children:[(0,z.jsxs)(pf,{open:T,onOpenChange:E,align:\`end\`,className:\`max-h-96 w-105 overflow-y-auto p-1.5\`,trigger:(0,z.jsxs)(V,{variant:\`ghost\`,size:\`xs\`,onClick:()=>E(e=>!e),children:[(0,z.jsx)(He,{size:12}),\` History\`]}),children:[C.length===0&&(0,z.jsx)(\`p\`,{className:\`px-3 py-4 text-center text-xs text-muted-foreground/60\`,children:\`No runs yet.\`}),C.map((e,t)=>(0,z.jsxs)(\`button\`,{className:\`block w-full rounded px-2.5 py-1.5 text-left hover:bg-accent\`,onClick:()=>{te(e.sql),E(!1)},children:[(0,z.jsx)(\`span\`,{className:\`block truncate font-mono text-xs text-foreground/80\`,children:e.sql}),(0,z.jsxs)(\`span\`,{className:\`text-[10px] text-muted-foreground/60\`,children:[(0,z.jsx)(qm,{value:e.ts,format:\`time\`}),\` · \`,e.ok?\`\${e.rows??0} rows · \${e.ms} ms\`:\`error\`]})]},t)),C.length>0&&(0,z.jsx)(\`button\`,{className:\`mt-1 w-full rounded px-2.5 py-1.5 text-left text-xs text-muted-foreground hover:bg-accent\`,onClick:()=>w(yv()),children:\`Clear history\`})]}),(0,z.jsxs)(V,{variant:\`ghost\`,size:\`xs\`,title:\`Format query\`,onClick:()=>ee(wv(p.sql)),children:[(0,z.jsx)(Ft,{size:12}),\` Format\`]}),(0,z.jsx)(V,{variant:\`outline\`,size:\`xs\`,onClick:()=>ne(),disabled:!p.sql.trim(),children:j(p)?\`Save\`:\`Save as…\`}),(0,z.jsxs)(V,{size:\`xs\`,onClick:()=>void re(),disabled:x||!p.sql.trim(),children:[(0,z.jsx)(ft,{size:12}),\` \`,x?\`Running…\`:\`Run\`,\` \`,(0,z.jsx)(uf,{children:\`⌘⏎\`})]})]})]}),(0,z.jsx)(\`div\`,{className:\`min-h-0 flex-1 p-3 pb-0\`,children:(0,z.jsx)(ir,{lang:\`sql\`,className:\`h-full\`,value:p.sql,onChange:ee,onCmdEnter:()=>void re(),placeholder:\`select * from … (⌘⏎ to run)\`})}),(0,z.jsx)(hf,{id:\`sql-results\`,axis:\`y\`,side:\`right\`,defaultSize:300,min:140,max:640,className:\`overflow-hidden border-t border-border\`,children:(0,z.jsx)(ov,{result:y})})]}),i&&(0,z.jsx)(kv,{query:i,onClose:()=>a(null),onSave:t=>{A(e.map(e=>e.id===i.id?{...e,name:t}:e)),a(null)}}),D&&(0,z.jsx)(Av,{suggested:xv(p.sql,null),onClose:()=>O(!1),onSave:e=>{ne(e),O(!1)}}),o&&(0,z.jsx)(q,{open:!0,danger:!0,title:\`Delete query "\${o.name}"?\`,description:\`The saved query will be removed from this browser.\`,confirmLabel:\`Delete query\`,onConfirm:()=>{A(e.filter(e=>e.id!==o.id)),u(e=>e.map(e=>e.queryId===o.id?{...e,queryId:null}:e))},onClose:()=>s(null)})]})}function Ov({title:e,items:t,onOpen:n,onRename:r,onDelete:i,onFav:a}){return(0,z.jsxs)(\`div\`,{className:\`pt-2\`,children:[(0,z.jsx)(\`p\`,{className:\`px-4 pb-1 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/60\`,children:e}),t.map(e=>(0,z.jsxs)(\`div\`,{className:\`group flex items-center gap-1 pl-4 pr-1.5 text-[13px] text-muted-foreground hover:bg-accent/50\`,children:[(0,z.jsxs)(\`button\`,{className:\`flex min-w-0 flex-1 items-center gap-1.5 py-1.5 text-left\`,onClick:()=>n(e),title:e.sql,children:[e.favorite&&(0,z.jsx)(Ve,{size:10,className:\`shrink-0 fill-brand text-brand\`}),(0,z.jsx)(\`span\`,{className:\`truncate\`,children:e.name})]}),(0,z.jsxs)(Zd,{children:[(0,z.jsx)(Qd,{asChild:!0,children:(0,z.jsx)(\`button\`,{className:\`hidden shrink-0 rounded p-1 text-muted-foreground/80 hover:bg-muted hover:text-foreground group-hover:block data-[state=open]:block\`,children:(0,z.jsx)(De,{size:12})})}),(0,z.jsxs)(tf,{align:\`start\`,children:[(0,z.jsxs)(nf,{onSelect:()=>a(e),children:[(0,z.jsx)(Ve,{size:13}),\` \`,e.favorite?\`Unfavorite\`:\`Favorite\`]}),(0,z.jsxs)(nf,{onSelect:()=>r(e),children:[(0,z.jsx)(lt,{size:13}),\` Rename\`]}),(0,z.jsx)(of,{}),(0,z.jsxs)(nf,{danger:!0,onSelect:()=>i(e),children:[(0,z.jsx)(At,{size:13}),\` Delete\`]})]})]})]},e.id))]})}function kv({query:e,onClose:t,onSave:n}){let[r,i]=(0,_.useState)(e.name);return(0,z.jsx)(go,{open:!0,onClose:t,title:\`Rename query\`,children:(0,z.jsxs)(\`div\`,{className:\`space-y-3\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Name\`}),(0,z.jsx)(lf,{value:r,autoFocus:!0,onChange:e=>i(e.target.value),onKeyDown:e=>e.key===\`Enter\`&&r.trim()&&n(r.trim())})]}),(0,z.jsxs)(\`div\`,{className:\`flex justify-end gap-2\`,children:[(0,z.jsx)(V,{variant:\`outline\`,onClick:t,children:\`Cancel\`}),(0,z.jsx)(V,{onClick:()=>n(r.trim()),disabled:!r.trim(),children:\`Rename\`})]})]})})}function Av({suggested:e,onClose:t,onSave:n}){let[r,i]=(0,_.useState)(e===\`Untitled query\`?\`\`:e);return(0,z.jsx)(go,{open:!0,onClose:t,title:\`Save query\`,children:(0,z.jsxs)(\`div\`,{className:\`space-y-3\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Name\`}),(0,z.jsx)(lf,{value:r,autoFocus:!0,placeholder:\`My query\`,onChange:e=>i(e.target.value),onKeyDown:e=>e.key===\`Enter\`&&r.trim()&&n(r.trim())})]}),(0,z.jsxs)(\`div\`,{className:\`flex justify-end gap-2\`,children:[(0,z.jsx)(V,{variant:\`outline\`,onClick:t,children:\`Cancel\`}),(0,z.jsx)(V,{onClick:()=>n(r.trim()),disabled:!r.trim(),children:\`Save\`})]})]})})}function jv({bucket:e}){let[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(!1),[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(null),l=(0,_.useCallback)(()=>{N.policies(\`storage\`).then(e=>n(e.filter(e=>e.table===\`objects\`)),()=>n([]))},[]);(0,_.useEffect)(()=>{l();let e=setInterval(()=>void l(),5e3);return()=>clearInterval(e)},[l]);async function u(e){try{await N.dropPolicy(\`objects\`,e.name,\`storage\`),H.success(\`Dropped policy \${e.name}\`),l()}catch(e){H.error(e.message)}}if(t===null)return(0,z.jsx)(Jp,{});let d=t=>\`\${t.using_expr??\`\`} \${t.with_check??\`\`}\`.includes(\`'\${e}'\`),f=e?t.filter(d):[],p=e?t.filter(e=>!d(e)):t,m=e=>(0,z.jsxs)(\`div\`,{className:\`cursor-pointer rounded-md border border-border bg-card p-3 transition-colors hover:border-muted-foreground/60\`,title:\`Edit policy\`,onClick:()=>o(e),children:[(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-2\`,children:[(0,z.jsx)(\`span\`,{className:\`truncate font-mono text-[13px] text-foreground\`,children:e.name}),(0,z.jsx)(B,{variant:\`blue\`,children:e.cmd}),String(e.permissive).toUpperCase()!==\`PERMISSIVE\`&&(0,z.jsx)(B,{variant:\`red\`,children:\`restrictive\`}),(0,z.jsx)(B,{variant:\`neutral\`,children:Array.isArray(e.roles)?e.roles.join(\`, \`):String(e.roles)}),(0,z.jsx)(\`button\`,{className:\`ml-auto p-1 text-muted-foreground/80 hover:text-destructive\`,title:\`Drop policy\`,onClick:t=>{t.stopPropagation(),c(e)},children:(0,z.jsx)(At,{size:13})})]}),e.using_expr&&(0,z.jsxs)(\`p\`,{className:\`mt-1.5 truncate font-mono text-[11px] text-muted-foreground/80\`,title:e.using_expr,children:[\`using (\`,e.using_expr,\`)\`]}),e.with_check&&(0,z.jsxs)(\`p\`,{className:\`mt-0.5 truncate font-mono text-[11px] text-muted-foreground/80\`,title:e.with_check,children:[\`with check (\`,e.with_check,\`)\`]})]},e.name);return(0,z.jsxs)(\`div\`,{className:\`h-full overflow-y-auto px-6 py-5\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex max-w-2xl items-start justify-between gap-4\`,children:[(0,z.jsxs)(\`p\`,{className:\`text-xs text-muted-foreground/80\`,children:[\`Object access is controlled by RLS policies on \`,(0,z.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`storage.objects\`}),\`. The service_role (this studio) bypasses them; your app's anon/authenticated requests do not. Scope a policy to a bucket with\`,\` \`,(0,z.jsxs)(\`code\`,{className:\`text-muted-foreground\`,children:[\`bucket_id = '\`,e??\`name\`,\`'\`]}),\`.\`]}),(0,z.jsxs)(V,{size:\`xs\`,className:\`shrink-0\`,onClick:()=>i(!0),children:[(0,z.jsx)(mt,{size:12}),\` New policy\`]})]}),(0,z.jsxs)(\`div\`,{className:\`mt-4 max-w-2xl space-y-5\`,children:[e&&(0,z.jsxs)(\`div\`,{children:[(0,z.jsxs)(\`p\`,{className:\`mb-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/60\`,children:[\`Policies for \`,e,\` \`,(0,z.jsx)(\`span\`,{className:\`text-muted-foreground/40\`,children:f.length})]}),(0,z.jsxs)(\`div\`,{className:\`space-y-2\`,children:[f.map(m),f.length===0&&(0,z.jsx)(\`p\`,{className:\`rounded-md border border-dashed border-border px-3 py-3 text-center text-xs text-muted-foreground/60\`,children:\`No policies mention this bucket yet.\`})]})]}),(0,z.jsxs)(\`div\`,{children:[e&&(0,z.jsxs)(\`p\`,{className:\`mb-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/60\`,children:[\`Other policies on storage.objects \`,(0,z.jsx)(\`span\`,{className:\`text-muted-foreground/40\`,children:p.length})]}),(0,z.jsxs)(\`div\`,{className:\`space-y-2\`,children:[p.map(m),t.length===0&&(0,z.jsx)(cf,{children:\`No policies on storage.objects — only the service_role can access objects in private buckets. Create one to open access up.\`})]})]})]}),r&&(0,z.jsx)(Dg,{table:\`objects\`,schema:\`storage\`,onClose:()=>i(!1),onCreated:async()=>l()}),a&&(0,z.jsx)(Dg,{table:\`objects\`,schema:\`storage\`,existing:Ag(a),onClose:()=>o(null),onCreated:async()=>l()}),s&&(0,z.jsx)(q,{open:!0,danger:!0,title:\`Drop policy "\${s.name}"?\`,description:\`Object access rules change immediately.\`,confirmLabel:\`Drop policy\`,onConfirm:()=>void u(s),onClose:()=>c(null)})]})}var Mv=e=>e==null?\`Unlimited\`:e<1024*1024?\`\${(e/1024).toFixed(0)} KB\`:\`\${(e/1024/1024).toFixed(0)} MB\`;function Nv({bucket:e,onDelete:t}){return(0,z.jsxs)(\`div\`,{className:\`h-full overflow-y-auto px-6 py-5\`,children:[(0,z.jsxs)(\`div\`,{className:\`max-w-2xl divide-y divide-border/70\`,children:[(0,z.jsx)(Pv,{label:\`Visibility\`,description:\`Public buckets serve objects without authentication.\`,children:e.public?(0,z.jsx)(B,{variant:\`brand\`,children:\`public\`}):(0,z.jsx)(B,{variant:\`neutral\`,children:\`private\`})}),(0,z.jsx)(Pv,{label:\`File size limit\`,description:\`Uploads above the limit are rejected.\`,children:(0,z.jsx)(\`span\`,{className:\`font-mono text-[13px] text-foreground/90\`,children:Mv(e.file_size_limit)})}),(0,z.jsx)(Pv,{label:\`Allowed MIME types\`,description:\`Empty means every type is accepted.\`,children:e.allowed_mime_types?.length?(0,z.jsx)(\`div\`,{className:\`flex flex-wrap gap-1.5\`,children:e.allowed_mime_types.map(e=>(0,z.jsx)(B,{variant:\`outline\`,className:\`font-mono\`,children:e},e))}):(0,z.jsx)(\`span\`,{className:\`text-[13px] text-muted-foreground\`,children:\`Any\`})}),(0,z.jsx)(Pv,{label:\`Created\`,description:\`\`,children:(0,z.jsx)(\`span\`,{className:\`font-mono text-[13px] text-foreground/90\`,children:(0,z.jsx)(qm,{value:e.created_at})})}),(0,z.jsx)(Pv,{label:\`Delete bucket\`,description:\`The bucket must be empty. This cannot be undone.\`,children:(0,z.jsxs)(V,{variant:\`danger\`,size:\`xs\`,onClick:t,children:[(0,z.jsx)(At,{size:12}),\` Delete bucket\`]})})]}),(0,z.jsxs)(\`p\`,{className:\`mt-4 max-w-2xl text-[11px] text-muted-foreground/60\`,children:[\`Limits and visibility are set when the bucket is created (or via \`,(0,z.jsx)(\`code\`,{children:\`supabase-js\`}),\`'s\`,\` \`,(0,z.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`updateBucket\`}),\`).\`]})]})}function Pv({label:e,description:t,children:n}){return(0,z.jsxs)(\`div\`,{className:\`flex flex-col gap-3 py-5 sm:flex-row sm:items-start sm:gap-10\`,children:[(0,z.jsxs)(\`div\`,{className:\`w-56 shrink-0\`,children:[(0,z.jsx)(\`p\`,{className:\`text-[13px] font-medium text-foreground\`,children:e}),t&&(0,z.jsx)(\`p\`,{className:\`mt-1 text-xs leading-relaxed text-muted-foreground/80\`,children:t})]}),(0,z.jsx)(\`div\`,{className:\`min-w-0 flex-1 pt-0.5\`,children:n})]})}var Fv=e=>e.id===null&&!e.metadata;function Iv(e){return e==null?\`—\`:e<1024?\`\${e} B\`:e<1024*1024?\`\${(e/1024).toFixed(1)} KB\`:\`\${(e/1024/1024).toFixed(1)} MB\`}function Lv({bucket:e}){let[t,n]=(0,_.useState)(\`\`),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(new Set),[s,c]=(0,_.useState)(null),[l,u]=(0,_.useState)(!1),[d,f]=(0,_.useState)(!1),p=(0,_.useRef)(null),m=(0,_.useCallback)(async()=>{try{i(await N.listObjects(e.id,t))}catch(e){H.error(e.message),i([])}},[e.id,t]);(0,_.useEffect)(()=>{o(new Set),c(null),m()},[m]);let h=e=>t?\`\${t}/\${e.name}\`:e.name;async function g(n){for(let r of Array.from(n))try{await N.uploadObject(e.id,t?\`\${t}/\${r.name}\`:r.name,r)}catch(e){H.error(\`\${r.name}: \${e.message}\`)}H.success(\`Uploaded \${n.length} file\${n.length===1?\`\`:\`s\`}\`),await m()}async function v(){try{await N.removeObjects(e.id,[...a]),H.success(\`Deleted \${a.size} object\${a.size===1?\`\`:\`s\`}\`),o(new Set),await m()}catch(e){H.error(e.message)}}async function y(t){let n=h(t);if(e.public)await Qn(\`\${lh()}/storage/v1/object/public/\${e.id}/\${n}\`,\`Public URL\`);else try{await Qn(await N.signUrl(e.id,n,3600),\`Signed URL (1h)\`)}catch(e){H.error(e.message)}}if(r===null)return(0,z.jsx)(Jp,{});let b=t?t.split(\`/\`):[],x=r.filter(e=>!Fv(e)).map(h),S=x.length>0&&x.every(e=>a.has(e));return(0,z.jsxs)(\`div\`,{className:\`relative flex h-full min-h-0\`,onDragOver:e=>{e.preventDefault(),f(!0)},onDragLeave:()=>f(!1),onDrop:e=>{e.preventDefault(),f(!1),e.dataTransfer.files.length&&g(e.dataTransfer.files)},children:[(0,z.jsxs)(\`div\`,{className:\`flex min-w-0 flex-1 flex-col\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex shrink-0 items-center gap-1 border-b border-border px-4 py-2 text-[13px]\`,children:[(0,z.jsxs)(\`button\`,{className:\`flex items-center gap-1 text-muted-foreground hover:text-foreground\`,onClick:()=>n(\`\`),children:[(0,z.jsx)(Ue,{size:12}),\` \`,e.id]}),b.map((e,t)=>(0,z.jsxs)(\`span\`,{className:\`flex items-center gap-1\`,children:[(0,z.jsx)(ge,{size:11,className:\`text-muted-foreground/60\`}),(0,z.jsx)(\`button\`,{className:\`font-mono text-muted-foreground hover:text-foreground\`,onClick:()=>n(b.slice(0,t+1).join(\`/\`)),children:e})]},t)),(0,z.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-1.5\`,children:[a.size>0&&(0,z.jsxs)(V,{variant:\`dangerSolid\`,size:\`xs\`,onClick:()=>u(!0),children:[(0,z.jsx)(At,{size:12}),\` Delete \`,a.size]}),(0,z.jsx)(V,{variant:\`ghost\`,size:\`iconXs\`,title:\`Refresh\`,onClick:()=>void m(),children:(0,z.jsx)(gt,{size:13})}),(0,z.jsx)(\`input\`,{ref:p,type:\`file\`,multiple:!0,className:\`hidden\`,onChange:e=>e.target.files&&void g(e.target.files)}),(0,z.jsxs)(V,{size:\`xs\`,onClick:()=>p.current?.click(),children:[(0,z.jsx)(Mt,{size:12}),\` Upload\`]})]})]}),(0,z.jsxs)(\`div\`,{className:\`min-h-0 flex-1 overflow-auto\`,children:[(0,z.jsxs)(Xp,{children:[(0,z.jsx)(Zp,{children:(0,z.jsxs)(\`tr\`,{children:[(0,z.jsx)(Z,{className:\`w-10\`,children:(0,z.jsx)($t,{checked:S,indeterminate:!S&&x.some(e=>a.has(e)),disabled:x.length===0,onChange:e=>o(e?new Set(x):new Set)})}),(0,z.jsx)(Z,{children:\`Name\`}),(0,z.jsx)(Z,{children:\`Size\`}),(0,z.jsx)(Z,{children:\`Type\`}),(0,z.jsx)(Z,{children:\`Modified\`}),(0,z.jsx)(Z,{className:\`w-16\`})]})}),(0,z.jsx)(\`tbody\`,{children:r.map(t=>{let r=Fv(t),i=h(t);return(0,z.jsxs)(Qp,{className:\`cursor-pointer\`,onClick:()=>r?n(i):c(t),children:[(0,z.jsx)(Q,{onClick:e=>e.stopPropagation(),children:!r&&(0,z.jsx)($t,{checked:a.has(i),onChange:e=>o(t=>{let n=new Set(t);return e?n.add(i):n.delete(i),n})})}),(0,z.jsx)(Q,{className:\`font-mono text-foreground/90\`,children:(0,z.jsxs)(\`span\`,{className:\`flex items-center gap-2\`,children:[r?(0,z.jsx)(Ie,{size:13,className:\`text-info\`}):(0,z.jsx)(Ne,{size:13,className:\`text-muted-foreground/70\`}),t.name]})}),(0,z.jsx)(Q,{className:\`text-muted-foreground\`,children:r?\`—\`:Iv(t.metadata?.size)}),(0,z.jsx)(Q,{className:\`text-muted-foreground\`,children:r?\`folder\`:t.metadata?.mimetype??\`—\`}),(0,z.jsx)(Q,{className:\`text-muted-foreground\`,children:(0,z.jsx)(qm,{value:t.updated_at})}),(0,z.jsx)(Q,{onClick:e=>e.stopPropagation(),children:!r&&(0,z.jsxs)(\`div\`,{className:\`flex justify-end gap-0.5 opacity-0 group-hover:opacity-100\`,children:[(0,z.jsx)(\`button\`,{className:\`p-1 text-muted-foreground/80 hover:text-foreground\`,title:e.public?\`Copy public URL\`:\`Copy signed URL (1h)\`,onClick:()=>void y(t),children:(0,z.jsx)(Ye,{size:13})}),(0,z.jsx)(\`button\`,{className:\`p-1 text-muted-foreground/80 hover:text-destructive\`,title:\`Delete\`,onClick:()=>{o(new Set([i])),u(!0)},children:(0,z.jsx)(At,{size:13})})]})})]},t.name)})})]}),r.length===0&&(0,z.jsxs)(cf,{children:[\`Empty\`,t?\` folder\`:\` bucket\`,\` — drop files here or hit Upload.\`]})]})]}),s&&(0,z.jsx)(Rv,{bucket:e,path:h(s),entry:s,onClose:()=>c(null),onCopyUrl:()=>void y(s)}),d&&(0,z.jsx)(\`div\`,{className:\`pointer-events-none absolute inset-0 z-10 flex items-center justify-center border-2 border-dashed border-brand bg-brand/5\`,children:(0,z.jsxs)(\`p\`,{className:\`rounded-md bg-popover px-4 py-2 text-sm text-foreground shadow-lg\`,children:[\`Drop to upload\`,t?\` into \${t}/\`:\`\`]})}),l&&(0,z.jsx)(q,{open:!0,danger:!0,title:\`Delete \${a.size} object\${a.size===1?\`\`:\`s\`}?\`,description:\`Objects are permanently removed from the bucket.\`,confirmLabel:\`Delete\`,onConfirm:()=>void v(),onClose:()=>u(!1)})]})}function Rv({bucket:e,path:t,entry:n,onClose:r,onCopyUrl:i}){let[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(!1),l=n.metadata?.mimetype??\`\`,u=l.startsWith(\`image/\`),d=l.startsWith(\`text/\`)||l===\`application/json\`,[f,p]=(0,_.useState)(null);return(0,_.useEffect)(()=>{let n=null;if(o(null),p(null),c(!1),!(!u&&!d))return N.downloadObject(e.id,t).then(async e=>{u?(n=URL.createObjectURL(e),o(n)):p((await e.text()).slice(0,4e3))},()=>c(!0)),()=>{n&&URL.revokeObjectURL(n)}},[e.id,t,u,d]),(0,z.jsxs)(hf,{id:\`storage-preview\`,side:\`right\`,defaultSize:320,min:260,max:560,className:\`flex flex-col border-l border-border bg-card\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex items-center justify-between border-b border-border px-4 py-2.5\`,children:[(0,z.jsx)(\`span\`,{className:\`truncate font-mono text-[13px] text-foreground\`,children:n.name}),(0,z.jsx)(\`button\`,{className:\`text-muted-foreground/80 hover:text-foreground\`,onClick:r,children:\`✕\`})]}),(0,z.jsxs)(\`div\`,{className:\`min-h-0 flex-1 overflow-y-auto p-4\`,children:[u&&(a?(0,z.jsx)(\`img\`,{src:a,alt:n.name,className:\`max-h-64 w-full rounded-md border border-border object-contain\`}):s?(0,z.jsx)(\`p\`,{className:\`text-xs text-destructive\`,children:\`Preview failed.\`}):(0,z.jsx)(\`div\`,{className:\`h-40 animate-pulse rounded-md bg-accent\`})),d&&f!==null&&(0,z.jsx)(\`pre\`,{className:\`max-h-64 overflow-auto rounded-md border border-border bg-code p-2 font-mono text-[11px] text-foreground/80\`,children:f}),!u&&!d&&(0,z.jsxs)(\`p\`,{className:\`text-xs text-muted-foreground/80\`,children:[\`No inline preview for \`,l||\`this type\`,\`.\`]}),(0,z.jsxs)(\`div\`,{className:\`mt-4 space-y-1.5 text-[13px]\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex justify-between gap-4\`,children:[(0,z.jsx)(\`span\`,{className:\`text-muted-foreground\`,children:\`Size\`}),(0,z.jsx)(\`span\`,{className:\`font-mono text-foreground/90\`,children:Iv(n.metadata?.size)})]}),(0,z.jsxs)(\`div\`,{className:\`flex justify-between gap-4\`,children:[(0,z.jsx)(\`span\`,{className:\`text-muted-foreground\`,children:\`Type\`}),(0,z.jsx)(\`span\`,{className:\`truncate font-mono text-foreground/90\`,children:l||\`—\`})]}),(0,z.jsxs)(\`div\`,{className:\`flex justify-between gap-4\`,children:[(0,z.jsx)(\`span\`,{className:\`text-muted-foreground\`,children:\`Path\`}),(0,z.jsx)(\`span\`,{className:\`truncate font-mono text-foreground/90\`,title:t,children:t})]})]}),(0,z.jsxs)(V,{variant:\`outline\`,size:\`xs\`,className:\`mt-4 w-full\`,onClick:i,children:[(0,z.jsx)(Ye,{size:12}),\` \`,e.public?\`Copy public URL\`:\`Copy signed URL (1h)\`]})]})]})}function zv(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(\`files\`),[i,a]=(0,_.useState)(!1),[o,s]=(0,_.useState)(null),{section:c}=Yt(),l=(0,_.useCallback)(async()=>{try{let e=await N.buckets();return t(e),e}catch{return t([]),[]}},[]);if((0,_.useEffect)(()=>{l()},[l]),e===null)return(0,z.jsx)(Jp,{});let u=e.find(e=>e.id===c)??null;!u&&e.length>0&&c===null&&R(\`storage\`,e[0].id,{replace:!0});async function d(e){try{await N.deleteBucket(e.id),H.success(\`Deleted bucket \${e.id}\`),R(\`storage\`,(await l())[0]?.id??null,{replace:!0})}catch(e){H.error(e.message)}}return(0,z.jsxs)(\`div\`,{className:\`flex h-full\`,children:[(0,z.jsxs)(hf,{id:\`storage-rail\`,side:\`left\`,defaultSize:224,min:180,max:360,className:\`flex flex-col border-r border-border bg-card\`,children:[(0,z.jsx)(\`div\`,{className:\`px-4 pb-1 pt-4 text-sm font-semibold text-foreground\`,children:\`Storage\`}),(0,z.jsx)(\`div\`,{className:\`px-2 pb-2 pt-1\`,children:(0,z.jsxs)(V,{variant:\`outline\`,size:\`xs\`,className:\`w-full\`,onClick:()=>a(!0),children:[(0,z.jsx)(mt,{size:12}),\` New bucket\`]})}),(0,z.jsxs)(\`div\`,{className:\`min-h-0 flex-1 overflow-y-auto px-2 pb-3\`,children:[e.map(e=>(0,z.jsxs)(\`button\`,{onClick:()=>R(\`storage\`,e.id),className:\`mb-px flex w-full items-center gap-2 rounded-md px-2.5 py-1.5 text-left text-[13px] transition-colors \`+(u?.id===e.id?\`bg-accent text-foreground\`:\`text-muted-foreground hover:bg-accent/50 hover:text-foreground\`),children:[(0,z.jsx)(\`span\`,{className:\`min-w-0 flex-1 truncate font-mono\`,children:e.id}),e.public&&(0,z.jsx)(B,{variant:\`brand\`,children:\`public\`})]},e.id)),e.length===0&&(0,z.jsx)(\`p\`,{className:\`px-3 py-4 text-center text-xs text-muted-foreground/60\`,children:\`No buckets yet.\`})]})]}),(0,z.jsx)(\`div\`,{className:\`flex min-w-0 flex-1 flex-col\`,children:u?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(\`div\`,{className:\`shrink-0 px-6 pt-5\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-2\`,children:[(0,z.jsx)(\`h1\`,{className:\`font-mono text-lg font-semibold text-foreground\`,children:u.id}),u.public&&(0,z.jsx)(B,{variant:\`brand\`,children:\`public\`})]}),(0,z.jsx)(\`div\`,{className:\`mt-3\`,children:(0,z.jsx)($p,{tabs:[{id:\`files\`,label:\`Files\`},{id:\`settings\`,label:\`Settings\`},{id:\`policies\`,label:\`Policies\`}],active:n,onSelect:r})})]}),(0,z.jsxs)(\`div\`,{className:\`min-h-0 flex-1\`,children:[n===\`files\`&&(0,z.jsx)(Lv,{bucket:u}),n===\`settings\`&&(0,z.jsx)(Nv,{bucket:u,onDelete:()=>s(u)}),n===\`policies\`&&(0,z.jsx)(jv,{bucket:u.id})]})]}):(0,z.jsx)(\`div\`,{className:\`flex flex-1 items-center justify-center\`,children:(0,z.jsxs)(\`div\`,{className:\`rounded-lg border border-dashed border-border px-16 py-12 text-center\`,children:[(0,z.jsx)(Fe,{size:22,className:\`mx-auto text-muted-foreground/60\`}),(0,z.jsx)(\`p\`,{className:\`mt-3 text-sm font-medium text-foreground\`,children:\`Create a file bucket\`}),(0,z.jsx)(\`p\`,{className:\`mt-1 text-xs text-muted-foreground/80\`,children:\`Store images, videos, documents, and any other file type.\`}),(0,z.jsxs)(V,{size:\`xs\`,className:\`mt-4\`,onClick:()=>a(!0),children:[(0,z.jsx)(mt,{size:12}),\` New bucket\`]})]})})}),i&&(0,z.jsx)(Bv,{onClose:()=>a(!1),onDone:async e=>{a(!1),await l(),R(\`storage\`,e,{replace:!0})}}),o&&(0,z.jsx)(q,{open:!0,danger:!0,title:\`Delete bucket "\${o.id}"?\`,description:\`The bucket must be empty before it can be deleted.\`,confirmLabel:\`Delete bucket\`,onConfirm:()=>void d(o),onClose:()=>s(null)})]})}function Bv({onClose:e,onDone:t}){let[n,r]=(0,_.useState)(\`\`),[i,a]=(0,_.useState)(!1),[o,s]=(0,_.useState)(\`\`),[c,l]=(0,_.useState)(!1);async function u(){l(!0),s(\`\`);try{await N.createBucket({id:n,name:n,public:i}),H.success(\`Created bucket \${n}\`),await t(n)}catch(e){s(e.message),l(!1)}}return(0,z.jsx)(go,{open:!0,onClose:e,title:\`New bucket\`,children:(0,z.jsxs)(\`div\`,{className:\`space-y-3\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Name — lowercase, no spaces\`}),(0,z.jsx)(lf,{mono:!0,value:n,autoFocus:!0,placeholder:\`avatars\`,onChange:e=>r(e.target.value.toLowerCase()),onKeyDown:e=>e.key===\`Enter\`&&n&&void u()})]}),(0,z.jsxs)(\`label\`,{className:\`flex cursor-pointer items-center gap-2 text-[13px] text-foreground/80\`,children:[(0,z.jsx)($t,{checked:i,onChange:a}),\`Public bucket — objects readable without auth\`]}),o&&(0,z.jsx)(\`p\`,{className:\`text-xs text-destructive\`,children:o}),(0,z.jsxs)(\`div\`,{className:\`flex justify-end gap-2\`,children:[(0,z.jsx)(V,{variant:\`outline\`,onClick:e,children:\`Cancel\`}),(0,z.jsx)(V,{onClick:()=>void u(),disabled:c||!n,children:c?\`Creating…\`:\`Create bucket\`})]})]})})}var Vv=[{op:\`eq\`,label:\`Equals\`,sym:\`=\`,group:\`Comparison\`},{op:\`neq\`,label:\`Not equal\`,sym:\`<>\`,group:\`Comparison\`},{op:\`gt\`,label:\`Greater than\`,sym:\`>\`,group:\`Comparison\`},{op:\`lt\`,label:\`Less than\`,sym:\`<\`,group:\`Comparison\`},{op:\`gte\`,label:\`Greater or equal\`,sym:\`>=\`,group:\`Comparison\`},{op:\`lte\`,label:\`Less or equal\`,sym:\`<=\`,group:\`Comparison\`},{op:\`like\`,label:\`Like\`,sym:\`~~\`,group:\`Pattern matching\`},{op:\`ilike\`,label:\`iLike\`,sym:\`~~*\`,group:\`Pattern matching\`},{op:\`in\`,label:\`In list\`,sym:\`in\`,group:\`Lists\`},{op:\`is\`,label:\`Is NULL\`,sym:\`null\`,group:\`Null\`,noValue:!0},{op:\`not.is\`,label:\`Is not NULL\`,sym:\`!null\`,group:\`Null\`,noValue:!0}],Hv=[\`Comparison\`,\`Pattern matching\`,\`Lists\`,\`Null\`],Uv=new Set([\`text\`,\`varchar\`,\`bpchar\`,\`char\`,\`name\`,\`citext\`]);function Wv(e,t){let n=e.filter(e=>Uv.has(e.type)).map(e=>e.name);if(n.length===0)return null;let r=t.replace(/[(),]/g,\` \`).trim();return[\`or\`,\`(\${n.map(e=>\`\${e}.ilike.*\${r}*\`).join(\`,\`)})\`]}function Gv(e,t){let n=[];for(let r of t)if(r.column===\`*\`){let t=Wv(e,r.value);t&&n.push(t)}else r.op===\`is\`||r.op===\`not.is\`?n.push([r.column,\`\${r.op}.null\`]):r.op===\`in\`?n.push([r.column,\`in.(\${r.value})\`]):n.push([r.column,\`\${r.op}.\${r.value}\`]);return n}function Kv(e){let t=e.type;return t===\`uuid\`?300:t===\`bool\`?100:/^(int|float|numeric)/.test(t)?110:/timestamp|date|time/.test(t)?220:t===\`json\`||t===\`jsonb\`||t.startsWith(\`_\`)?240:190}function qv(e){let t=new Date().toISOString();return e.startsWith(\`timestamp\`)?t.replace(\`T\`,\` \`).replace(\`Z\`,\`+00\`):e===\`date\`?t.slice(0,10):e===\`timetz\`?t.slice(11,23)+\`+00\`:e.startsWith(\`time\`)?t.slice(11,19):t}function Jv(e){let t=e.trim();if(!t)return null;let n=t.includes(\`T\`)?t:t.replace(\` \`,\`T\`);/[+-]\\d\\d$/.test(n)&&(n+=\`:00\`);let r=new Date(n);return Number.isNaN(r.getTime())?null:r}function Yv(e,t){if(t===\`bool\`)return e===\`true\`||e===\`t\`||e===\`1\`;if([\`int2\`,\`int4\`,\`int8\`,\`float4\`,\`float8\`,\`numeric\`].includes(t)){let t=Number(e);return Number.isNaN(t)?e:t}if(t===\`json\`||t===\`jsonb\`||t.startsWith(\`_\`))try{return JSON.parse(e)}catch{return e}return e}function Xv(e){if(e==null)return;let t=typeof e==\`object\`?JSON.stringify(e):String(e);return t.length>40?t:void 0}function Zv({value:e}){return e==null?(0,z.jsx)(\`span\`,{className:\`select-none text-muted-foreground/60\`,children:\`NULL\`}):e===\`\`?(0,z.jsx)(\`span\`,{className:\`select-none italic text-muted-foreground/60\`,children:\`empty\`}):typeof e==\`boolean\`?(0,z.jsx)(\`span\`,{className:\`text-info\`,children:String(e)}):typeof e==\`object\`?(0,z.jsx)(\`span\`,{className:\`text-warning/90\`,children:JSON.stringify(e)}):(0,z.jsx)(z.Fragment,{children:String(e)})}function Qv(e){let t=e.getTime()-Date.now(),n=Math.abs(t);for(let[e,r]of[[31536e6,\`year\`],[2592e6,\`month\`],[864e5,\`day\`],[36e5,\`hour\`],[6e4,\`minute\`],[1e3,\`second\`]])if(n>=e){let i=Math.round(n/e);return t<0?\`\${i} \${r}\${i>1?\`s\`:\`\`} ago\`:\`in \${i} \${r}\${i>1?\`s\`:\`\`}\`}return\`just now\`}function $v({col:e,value:t,anchor:n,enumValues:r,onCommit:i,onCancel:a}){let o=t==null?\`\`:typeof t==\`object\`?JSON.stringify(t,null,2):String(t),[s,c]=(0,_.useState)(o),l=(0,_.useRef)(!1),u=e=>{l.current||(l.current=!0,e())},d=(e=0)=>u(()=>i(s,e)),f=()=>u(a),p=e.type===\`bool\`,m=!p&&(r?.length??0)>0,h=/^(timestamp|date|time)/.test(e.type),g=!p&&!m&&!h&&!/^(int|float|numeric|uuid)/.test(e.type),v=/^(timestamp|date)/.test(e.type),y=v&&s?Jv(s):null,b=y!==null,x=Intl.DateTimeFormat().resolvedOptions().timeZone,S=Math.max(n.width+2,h?320:280),C=Math.max(8,Math.min(n.top,window.innerHeight-(g?320:h?300:m?320:160)))-1,w=Math.max(8,Math.min(n.left,window.innerWidth-S-12))-1,T=p?[\`true\`,\`false\`,...e.nullable?[\`__null\`]:[]]:m?[...r,...e.nullable?[\`__null\`]:[]]:null;return(0,_n.createPortal)((0,z.jsxs)(\`div\`,{style:{position:\`fixed\`,top:C,left:w,width:S},className:\`z-80 overflow-hidden rounded-md border border-muted-foreground bg-card shadow-[0_16px_48px_rgba(0,0,0,0.6)] animate-[fade-in_.1s_ease-out]\`,onKeyDown:e=>{e.key===\`Escape\`?(e.stopPropagation(),f()):e.key===\`Enter\`&&!(g&&e.shiftKey)?(e.preventDefault(),d()):e.key===\`Tab\`&&(e.preventDefault(),d(e.shiftKey?-1:1))},onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||d()},children:[T?(0,z.jsx)(\`div\`,{className:\`max-h-64 overflow-y-auto p-1\`,children:T.map(e=>(0,z.jsxs)(\`button\`,{autoFocus:e===(o||T[0]),onFocus:()=>c(e),onMouseDown:e=>e.preventDefault(),onClick:()=>u(()=>i(e,0)),className:\`flex w-full items-center gap-2 rounded px-2.5 py-1.5 text-left font-mono text-[13px] transition-colors hover:bg-accent focus:bg-accent focus:outline-none \`+(e===o?\`text-brand\`:e===\`__null\`?\`text-muted-foreground/80\`:\`text-foreground\`),children:[e===\`__null\`?\`NULL\`:e,e===o&&(0,z.jsx)(pe,{size:12,className:\`ml-auto shrink-0\`})]},e))}):g?(0,z.jsx)(\`textarea\`,{autoFocus:!0,value:s,onChange:e=>c(e.target.value),onFocus:e=>e.target.select(),placeholder:e.nullable?\`NULL\`:\`\`,className:\`block h-52 w-full resize-none bg-transparent px-2.5 py-2 font-mono text-[13px] leading-relaxed text-foreground selection:bg-brand/40 placeholder:text-muted-foreground/60 focus:outline-none\`}):(0,z.jsx)(\`input\`,{autoFocus:!0,value:s,onChange:e=>c(e.target.value),onFocus:e=>e.target.select(),placeholder:e.nullable?\`NULL\`:\`\`,className:\`block w-full bg-transparent px-2.5 py-2 font-mono text-[13px] text-foreground selection:bg-brand/40 placeholder:text-muted-foreground/60 focus:outline-none\`}),v&&(0,z.jsxs)(\`div\`,{className:\`border-t border-border px-2.5 py-2 font-mono text-[11px]\`,children:[(0,z.jsx)(\`p\`,{className:\`mb-1 font-sans text-muted-foreground/80\`,children:\`Formatted value:\`}),s===\`\`?(0,z.jsx)(\`p\`,{className:\`text-muted-foreground/60\`,children:e.nullable?\`NULL\`:\`empty\`}):b?(0,z.jsxs)(\`div\`,{className:\`space-y-0.5\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex justify-between gap-4\`,children:[(0,z.jsx)(\`span\`,{className:\`text-muted-foreground/80\`,children:\`UTC\`}),(0,z.jsx)(\`span\`,{className:\`text-foreground/80\`,children:y.toISOString().replace(\`T\`,\` \`).slice(0,19)})]}),(0,z.jsxs)(\`div\`,{className:\`flex justify-between gap-4\`,children:[(0,z.jsx)(\`span\`,{className:\`truncate text-muted-foreground/80\`,children:x}),(0,z.jsx)(\`span\`,{className:\`shrink-0 text-foreground/80\`,children:y.toLocaleString()})]}),(0,z.jsxs)(\`div\`,{className:\`flex justify-between gap-4\`,children:[(0,z.jsx)(\`span\`,{className:\`text-muted-foreground/80\`,children:\`Relative\`}),(0,z.jsx)(\`span\`,{className:\`text-foreground/80\`,children:Qv(y)})]})]}):(0,z.jsx)(\`p\`,{className:\`text-destructive\`,children:\`Invalid date\`})]}),(0,z.jsxs)(\`div\`,{className:\`border-t border-border p-1.5\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-1\`,children:[(0,z.jsxs)(\`button\`,{className:\`flex flex-1 items-center gap-2 rounded px-2 py-1.5 text-left text-xs text-foreground/80 hover:bg-accent\`,onMouseDown:e=>e.preventDefault(),onClick:()=>d(),children:[(0,z.jsx)(uf,{children:\`↵\`}),\` Save changes\`]}),h&&(0,z.jsxs)(\`button\`,{className:\`flex shrink-0 items-center gap-1.5 rounded border border-input px-2 py-1 text-xs text-foreground/80 hover:bg-accent\`,onMouseDown:e=>e.preventDefault(),onClick:()=>c(qv(e.type)),children:[(0,z.jsx)(xe,{size:11}),\` Set to NOW\`]})]}),(0,z.jsxs)(\`button\`,{className:\`flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs text-muted-foreground hover:bg-accent\`,onMouseDown:e=>e.preventDefault(),onClick:f,children:[(0,z.jsx)(uf,{children:\`Esc\`}),\` Cancel changes\`]})]})]}),document.body)}var ey=e=>e.replace(/'/g,\`''\`);async function ty(e,t){let n=ey(e),r=ey(t),i=\`'"\${n}"."\${r}"'::regclass\`,a=await N.sql(\`select
|
|
1563
|
+
}\`),[c,l]=(0,_.useState)(null),[u,d]=(0,_.useState)(!1);async function f(){d(!0),l(null);try{let t=i===\`anon\`?(await N.keys()).anonKey??x():x(),r=performance.now(),a=await fetch(\`\${lh()}/functions/v1/\${e}\`,{method:n,headers:{apikey:t,authorization:\`Bearer \${t}\`,"content-type":\`application/json\`},body:n===\`GET\`||n===\`HEAD\`?void 0:o}),s=await a.text(),c=s;try{c=JSON.stringify(JSON.parse(s),null,2)}catch{}l({status:a.status,ms:Math.round(performance.now()-r),headers:[...a.headers.entries()],body:c})}catch(e){l({status:0,ms:0,headers:[],body:\`Request failed: \${e.message}\`})}finally{d(!1)}}return(0,z.jsx)(qp,{open:!0,onClose:t,width:\`w-[560px]\`,title:(0,z.jsxs)(\`span\`,{children:[\`Invoke \`,(0,z.jsx)(\`code\`,{className:\`rounded bg-accent px-1.5 py-0.5 font-mono text-xs text-foreground\`,children:e})]}),footer:(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Kp,{asChild:!0,children:(0,z.jsx)(V,{variant:\`outline\`,children:\`Close\`})}),(0,z.jsxs)(V,{className:\`ml-auto\`,onClick:()=>void f(),disabled:u,children:[(0,z.jsx)(ft,{size:12}),\` \`,u?\`Invoking…\`:\`Invoke\`]})]}),children:(0,z.jsxs)(\`div\`,{className:\`space-y-4\`,children:[(0,z.jsxs)(\`div\`,{className:\`grid grid-cols-2 gap-3\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Method\`}),(0,z.jsx)(Wp,{value:n,onValueChange:r,options:[\`POST\`,\`GET\`,\`PUT\`,\`PATCH\`,\`DELETE\`].map(e=>({value:e}))})]}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Authorization\`}),(0,z.jsx)(Wp,{value:i,onValueChange:e=>a(e),options:[{value:\`service_role\`,label:\`service_role key\`},{value:\`anon\`,label:\`anon key\`}]})]})]}),n!==\`GET\`&&(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Request body (JSON)\`}),(0,z.jsx)(ir,{lang:\`js\`,className:\`h-32\`,value:o,onChange:s,onCmdEnter:()=>void f()})]}),u&&(0,z.jsx)(Jp,{}),c&&(0,z.jsxs)(\`div\`,{children:[(0,z.jsxs)(\`div\`,{className:\`mb-2 flex items-center gap-3 text-[13px]\`,children:[(0,z.jsx)(\`span\`,{className:\`rounded px-2 py-0.5 font-mono text-xs font-semibold \`+(c.status>=200&&c.status<300?\`bg-brand/15 text-brand\`:c.status===0?\`bg-destructive/15 text-destructive\`:\`bg-warning/15 text-warning\`),children:c.status||\`ERR\`}),(0,z.jsxs)(\`span\`,{className:\`text-muted-foreground/80\`,children:[c.ms,\` ms\`]})]}),(0,z.jsx)(nr,{value:c.body||\`(empty body)\`,lang:\`js\`,readOnly:!0,minLines:4,maxLines:200}),c.headers.length>0&&(0,z.jsxs)(\`details\`,{className:\`mt-2\`,children:[(0,z.jsxs)(\`summary\`,{className:\`cursor-pointer text-xs text-muted-foreground hover:text-foreground\`,children:[\`Response headers (\`,c.headers.length,\`)\`]}),(0,z.jsx)(\`div\`,{className:\`mt-1.5 space-y-0.5 font-mono text-[11px] text-muted-foreground\`,children:c.headers.map(([e,t])=>(0,z.jsxs)(\`div\`,{className:\`truncate\`,children:[(0,z.jsx)(\`span\`,{className:\`text-foreground/70\`,children:e}),\`: \`,t]},e))})]})]})]})})}var r_=[\`functions\`,\`secrets\`,\`settings\`];function i_(){let{section:e}=Yt(),t=r_.includes(e)?e:\`functions\`;return(0,z.jsxs)(\`div\`,{className:\`flex h-full\`,children:[(0,z.jsx)(Th,{title:\`Edge Functions\`,active:t,onSelect:e=>R(\`functions\`,e),groups:[{title:\`Manage\`,items:[{id:\`functions\`,label:\`Functions\`}]},{title:\`Configuration\`,items:[{id:\`secrets\`,label:\`Secrets\`},{id:\`settings\`,label:\`Settings\`}]}]}),(0,z.jsxs)(\`div\`,{className:\`min-w-0 flex-1 overflow-y-auto\`,children:[t===\`functions\`&&(0,z.jsx)(a_,{}),t===\`secrets\`&&(0,z.jsx)(s_,{}),t===\`settings\`&&(0,z.jsx)(u_,{})]})]})}function a_(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(null),i=(0,_.useCallback)(()=>{N.edgeFunctions().then(e=>t(e.functions),()=>t([]))},[]);return(0,_.useEffect)(()=>{i()},[i]),e===null?(0,z.jsx)(Jp,{}):(0,z.jsxs)(\`div\`,{className:\`flex h-full flex-col\`,children:[(0,z.jsx)(\`div\`,{className:\`border-b border-border px-6 pb-4 pt-5\`,children:(0,z.jsxs)(\`div\`,{className:\`flex items-start justify-between\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(\`h1\`,{className:\`text-lg font-semibold text-foreground\`,children:\`Functions\`}),(0,z.jsxs)(\`p\`,{className:\`mt-0.5 text-[13px] text-muted-foreground/80\`,children:[(0,z.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`Deno.serve\`}),\` / export-default handlers loaded from\`,\` \`,(0,z.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`supabase/functions/<name>/index.ts\`}),\` — running in-process.\`]})]}),(0,z.jsx)(V,{variant:\`ghost\`,size:\`iconXs\`,title:\`Refresh\`,onClick:i,children:(0,z.jsx)(gt,{size:13})})]})}),(0,z.jsxs)(\`div\`,{className:\`min-h-0 flex-1 overflow-auto\`,children:[e.length===0?(0,z.jsx)(\`div\`,{className:\`flex h-full items-center justify-center\`,children:(0,z.jsxs)(\`div\`,{className:\`max-w-md rounded-lg border border-dashed border-border px-10 py-8 text-center\`,children:[(0,z.jsx)(Rt,{size:20,className:\`mx-auto text-muted-foreground/60\`}),(0,z.jsx)(\`p\`,{className:\`mt-3 text-sm font-medium text-foreground\`,children:\`No functions loaded\`}),(0,z.jsxs)(\`p\`,{className:\`mt-1 text-xs leading-relaxed text-muted-foreground/80\`,children:[\`Create \`,(0,z.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`supabase/functions/hello/index.ts\`}),\` with a\`,\` \`,(0,z.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`Deno.serve(handler)\`}),\` and restart tinbase — it appears here and is served at \`,(0,z.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`/functions/v1/hello\`}),\`.\`]})]})}):(0,z.jsxs)(Xp,{children:[(0,z.jsx)(Zp,{children:(0,z.jsxs)(\`tr\`,{children:[(0,z.jsx)(Z,{children:\`Name\`}),(0,z.jsx)(Z,{children:\`URL\`}),(0,z.jsx)(Z,{className:\`w-24\`})]})}),(0,z.jsx)(\`tbody\`,{children:e.map(e=>{let t=\`\${lh()}/functions/v1/\${e}\`;return(0,z.jsxs)(Qp,{children:[(0,z.jsx)(Q,{className:\`font-mono text-foreground/90\`,children:e}),(0,z.jsx)(Q,{children:(0,z.jsxs)(\`span\`,{className:\`flex items-center gap-1 font-mono text-[12px] text-muted-foreground\`,children:[(0,z.jsx)(\`span\`,{className:\`truncate\`,children:t}),(0,z.jsx)(er,{value:t,label:\`\${e} URL\`,iconSize:11})]})}),(0,z.jsx)(Q,{children:(0,z.jsxs)(V,{variant:\`outline\`,size:\`xs\`,onClick:()=>r(e),children:[(0,z.jsx)(ft,{size:11}),\` Invoke\`]})})]},e)})})]}),e.length>0&&(0,z.jsx)(lf,{children:\`Invoke runs the function through the real HTTP path with the key/role you pick.\`})]}),n&&(0,z.jsx)(n_,{name:n,onClose:()=>r(null)})]})}var o_={SUPABASE_URL:\`The in-process API gateway for this tinbase instance.\`,SUPABASE_ANON_KEY:\`Anon JWT — safe in a browser when RLS is enabled.\`,SUPABASE_SERVICE_ROLE_KEY:\`Service-role JWT — bypasses RLS, keep server-side only.\`};function s_(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(\`\`),i=(0,_.useCallback)(()=>{N.edgeFunctions().then(e=>{let n=new Set(e.builtins),r=Object.keys(e.env).filter(e=>!n.has(e)).sort((e,t)=>e.localeCompare(t)).map(t=>({name:t,digest:e.digests[t]??\`\`}));t({builtins:e.builtins,custom:r})},()=>t({builtins:[],custom:[]}))},[]);if((0,_.useEffect)(()=>{i()},[i]),e===null)return(0,z.jsx)(Jp,{});let a=n.trim()?e.custom.filter(e=>e.name.toLowerCase().includes(n.trim().toLowerCase())):e.custom;return(0,z.jsxs)(xh,{title:\`Edge Function Secrets\`,children:[(0,z.jsx)(l_,{existing:new Set([...e.builtins,...e.custom.map(e=>e.name)]),onSaved:i}),(0,z.jsxs)(Sh,{title:\`Custom secrets\`,description:\`Runtime secrets you've set for this instance. Applied live to Deno.env — no restart. Not written back to supabase/functions/.env, so a restart reloads from that file.\`,children:[(0,z.jsxs)(\`div\`,{className:\`mb-3 flex items-center justify-between gap-3\`,children:[(0,z.jsxs)(\`p\`,{className:\`text-xs text-muted-foreground/70\`,children:[e.custom.length,\` secret\`,e.custom.length===1?\`\`:\`s\`]}),e.custom.length>0&&(0,z.jsx)(Y,{value:n,onChange:e=>r(e.target.value),placeholder:\`Search for a secret\`,className:\`h-8 w-56 text-xs\`})]}),e.custom.length===0?(0,z.jsx)(\`p\`,{className:\`py-6 text-xs text-muted-foreground/60\`,children:\`No custom secrets yet. Add one above.\`}):(0,z.jsxs)(Xp,{children:[(0,z.jsx)(Zp,{children:(0,z.jsxs)(\`tr\`,{children:[(0,z.jsx)(Z,{children:\`Name\`}),(0,z.jsxs)(Z,{children:[\`Digest \`,(0,z.jsx)(B,{variant:\`neutral\`,children:\`SHA256\`})]}),(0,z.jsx)(Z,{className:\`w-10\`})]})}),(0,z.jsxs)(\`tbody\`,{children:[a.map(e=>(0,z.jsx)(c_,{secret:e,onChanged:i},e.name)),a.length===0&&(0,z.jsx)(\`tr\`,{children:(0,z.jsxs)(Q,{colSpan:3,className:\`py-6 text-center text-xs text-muted-foreground/60\`,children:[\`No secret matches “\`,n,\`”.\`]})})]})]})]}),(0,z.jsx)(Sh,{title:\`Built-in secrets\`,description:\`Injected into every function by tinbase — read-only. These are the vars a local Supabase edge function can rely on here.\`,children:e.builtins.map(e=>(0,z.jsx)(Ch,{label:e,description:o_[e]??\`Provided by tinbase.\`,children:(0,z.jsx)(B,{variant:\`neutral\`,children:\`built-in\`})},e))})]})}function c_({secret:e,onChanged:t}){let[n,r]=(0,_.useState)(!1),i=async()=>{try{await N.deleteSecret(e.name),H.success(\`Deleted \${e.name}\`),t()}catch(t){H.error(t instanceof Error?t.message:\`Failed to delete \${e.name}\`)}finally{r(!1)}};return(0,z.jsxs)(Qp,{children:[(0,z.jsx)(Q,{children:(0,z.jsx)(B,{variant:\`neutral\`,children:e.name})}),(0,z.jsx)(Q,{children:(0,z.jsxs)(\`span\`,{className:\`flex items-center gap-1 font-mono text-[12px] text-muted-foreground\`,children:[(0,z.jsxs)(\`span\`,{className:\`truncate\`,title:e.digest,children:[e.digest.slice(0,48),\`…\`]}),(0,z.jsx)(er,{value:e.digest,label:\`\${e.name} digest\`,iconSize:11})]})}),(0,z.jsx)(Q,{children:(0,z.jsxs)(Qd,{children:[(0,z.jsx)($d,{asChild:!0,children:(0,z.jsx)(V,{variant:\`ghost\`,size:\`iconXs\`,title:\`Actions\`,children:(0,z.jsx)(De,{size:13})})}),(0,z.jsx)(nf,{children:(0,z.jsxs)(rf,{danger:!0,onSelect:()=>r(!0),children:[(0,z.jsx)(At,{size:13}),\` Delete secret\`]})})]})}),n&&(0,z.jsx)(q,{open:!0,danger:!0,title:\`Delete \${e.name}?\`,description:\`Functions will stop seeing this value on the next invocation.\`,confirmLabel:\`Delete\`,onConfirm:()=>void i(),onClose:()=>r(!1)})]})}function l_({existing:e,onSaved:t}){let[n,r]=(0,_.useState)([{name:\`\`,value:\`\`}]),[i,a]=(0,_.useState)(!1),o=(e,t)=>r(n=>n.map((n,r)=>r===e?{...n,...t}:n)),s=async()=>{let i={};for(let t of n){let n=t.name.trim();if(n){if(!/^[A-Za-z_][A-Za-z0-9_]*$/.test(n))return H.error(\`Invalid name "\${n}" — letters, digits, underscores.\`);if(e.has(n)&&[\`SUPABASE_URL\`,\`SUPABASE_ANON_KEY\`,\`SUPABASE_SERVICE_ROLE_KEY\`].includes(n))return H.error(\`"\${n}" is built-in and can't be changed.\`);i[n]=t.value}}if(Object.keys(i).length===0)return H.error(\`Enter at least one named secret.\`);a(!0);try{await N.putSecrets(i),H.success(\`Saved \${Object.keys(i).length} secret\${Object.keys(i).length===1?\`\`:\`s\`}\`),r([{name:\`\`,value:\`\`}]),t()}catch(e){H.error(e instanceof Error?e.message:\`Failed to save secrets\`)}finally{a(!1)}};return(0,z.jsx)(Sh,{title:\`Add or replace secrets\`,description:\`Set a secret every function reads via Deno.env.get(). Saving an existing name replaces its value.\`,children:(0,z.jsxs)(\`div\`,{className:\`space-y-3\`,children:[n.map((e,t)=>(0,z.jsxs)(\`div\`,{className:\`grid grid-cols-[minmax(0,1fr)_minmax(0,1.6fr)_auto] items-start gap-3\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Name\`}),(0,z.jsx)(Y,{value:e.name,onChange:e=>o(t,{name:e.target.value}),placeholder:\`e.g. CLIENT_KEY\`,className:\`mt-1 h-9 font-mono text-xs\`})]}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Value\`}),(0,z.jsx)(em,{value:e.value,onChange:e=>o(t,{value:e.target.value}),placeholder:\`Supports multi-line values such as PEM keys, JSON, or tokens.\`,rows:2,className:\`mt-1 font-mono text-xs\`})]}),n.length>1&&(0,z.jsx)(V,{variant:\`ghost\`,size:\`iconXs\`,title:\`Remove row\`,className:\`mt-6\`,onClick:()=>r(e=>e.filter((e,n)=>n!==t)),children:(0,z.jsx)(At,{size:13})})]},t)),(0,z.jsxs)(\`div\`,{className:\`flex items-center justify-between border-t border-border pt-3\`,children:[(0,z.jsxs)(V,{variant:\`outline\`,size:\`xs\`,onClick:()=>r(e=>[...e,{name:\`\`,value:\`\`}]),children:[(0,z.jsx)(mt,{size:12}),\` Add another\`]}),(0,z.jsx)(V,{size:\`sm\`,onClick:()=>void s(),disabled:i,children:i?\`Saving…\`:\`Save\`})]})]})})}function u_(){let e=({children:e})=>(0,z.jsx)(\`code\`,{className:\`rounded bg-code px-1 py-px font-mono text-foreground/90\`,children:e});return(0,z.jsxs)(xh,{title:\`Edge Function Settings\`,children:[(0,z.jsxs)(Sh,{title:\`Runtime\`,description:\`How functions execute on this instance.\`,children:[(0,z.jsx)(Ch,{label:\`Engine\`,description:\`In-process Deno shim — no containers, no cold starts.\`,children:(0,z.jsxs)(\`span\`,{className:\`text-[13px] text-muted-foreground\`,children:[(0,z.jsx)(e,{children:\`Deno.serve\`}),\`, \`,(0,z.jsx)(e,{children:\`Deno.env\`}),\`, fetch, WebCrypto\`]})}),(0,z.jsx)(Ch,{label:\`Loading\`,description:\`Functions are discovered at boot; restart tinbase to pick up new or changed code.\`,children:(0,z.jsx)(\`span\`,{className:\`text-[13px] text-muted-foreground\`,children:(0,z.jsx)(e,{children:\`supabase/functions/<name>/index.ts\`})})}),(0,z.jsx)(Ch,{label:\`Invocation\`,description:\`Every HTTP method, CORS pre-handled.\`,children:(0,z.jsx)(\`span\`,{className:\`text-[13px] text-muted-foreground\`,children:(0,z.jsx)(e,{children:\`/functions/v1/<name>\`})})})]}),(0,z.jsxs)(Sh,{title:\`Security\`,description:\`What a function sees on each request.\`,children:[(0,z.jsx)(Ch,{label:\`JWT verification\`,description:(0,z.jsxs)(z.Fragment,{children:[\`The \`,(0,z.jsx)(e,{children:\`Authorization\`}),\` header is passed through as-is — verify the JWT inside the function (or trust the gateway key), matching \`,(0,z.jsx)(e,{children:\`verify_jwt\`}),\`-off Supabase functions.\`]}),children:(0,z.jsx)(B,{variant:\`neutral\`,children:\`pass-through\`})}),(0,z.jsx)(Ch,{label:\`Secrets\`,description:\`Injected from supabase/functions/.env plus the built-in SUPABASE_* vars.\`,children:(0,z.jsx)(V,{variant:\`outline\`,size:\`xs\`,onClick:()=>R(\`functions\`,\`secrets\`),children:\`View secrets\`})}),(0,z.jsx)(Ch,{label:\`Database access\`,description:(0,z.jsxs)(z.Fragment,{children:[\`Use supabase-js with \`,(0,z.jsx)(e,{children:\`SUPABASE_URL\`}),\` and a key from env — requests loop back through the same backend in-process.\`]}),children:(0,z.jsx)(B,{variant:\`brand\`,children:\`in-process\`})})]})]})}function d_(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)([]),[i,a]=(0,_.useState)([]),[o,s]=(0,_.useState)([]),[c,l]=(0,_.useState)([]),[u,d]=(0,_.useState)(!0),f=lh(),p=$n(f,\`API URL\`);if((0,_.useEffect)(()=>{Promise.allSettled([N.stats(),N.tables(),N.migrations(),N.logs(),Qm()]).then(([e,n,i,o,c])=>{e.status===\`fulfilled\`&&t(e.value),r(n.status===\`fulfilled\`?n.value:[]),i.status===\`fulfilled\`&&a(i.value),o.status===\`fulfilled\`&&s(o.value),c.status===\`fulfilled\`&&l(c.value),d(!1)})},[]),u)return(0,z.jsx)(Jp,{});let m=n.reduce((e,t)=>e+t.rowCount,0),h=i[i.length-1],g=o.slice(-8).reverse(),v=o.filter(e=>e.level===\`error\`).length;return(0,z.jsx)(\`div\`,{className:\`h-full overflow-y-auto\`,children:(0,z.jsxs)(\`div\`,{className:\`mx-auto w-full max-w-7xl space-y-12 px-10 py-12\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-3\`,children:[(0,z.jsx)(\`h1\`,{className:\`text-3xl font-semibold text-foreground\`,children:\`tinbase\`}),(0,z.jsxs)(B,{variant:\`brand\`,children:[(0,z.jsx)(\`span\`,{className:\`inline-block size-1.5 rounded-full bg-brand\`}),\` \`,\`Healthy\`]})]}),(0,z.jsxs)(\`button\`,{onClick:p.copy,title:p.copied?\`Copied!\`:\`Copy API URL\`,className:\`group mt-1.5 flex items-center gap-2 font-mono text-[13px] text-muted-foreground/80 transition-colors hover:text-foreground\`,children:[f,p.copied?(0,z.jsx)(pe,{size:11,className:\`text-brand\`}):(0,z.jsx)(Se,{size:11,className:\`opacity-0 transition-opacity group-hover:opacity-100\`})]}),(0,z.jsxs)(\`div\`,{className:\`mt-8 grid grid-cols-1 gap-x-10 gap-y-6 sm:grid-cols-2 lg:grid-cols-3\`,children:[(0,z.jsx)(f_,{icon:se,label:\`Status\`,value:\`Healthy\`,accent:!0}),(0,z.jsx)(f_,{icon:we,label:\`Database size\`,value:e?.dbSize??\`—\`}),(0,z.jsx)(f_,{icon:Rt,label:\`Version\`,value:e?.version??\`—\`}),(0,z.jsx)(f_,{icon:je,label:\`Last migration\`,value:h?h.name??h.version:\`No migrations\`,sub:h?(0,z.jsx)(qm,{value:h.applied_at}):void 0}),(0,z.jsx)(f_,{icon:Ot,label:\`Tables\`,value:\`\${e?.tables??0}\`,sub:\`\${m.toLocaleString()} total rows\`}),(0,z.jsx)(f_,{icon:Ke,label:\`Auth users\`,value:\`\${e?.users??0}\`})]})]}),(0,z.jsx)(p_,{title:\`At a glance\`,children:(0,z.jsxs)(\`div\`,{className:\`grid grid-cols-2 gap-4 lg:grid-cols-4\`,children:[(0,z.jsx)(h_,{icon:Ot,label:\`Table Editor\`,value:e?.tables??0,sub:\`\${m.toLocaleString()} rows\`,onClick:()=>R(\`table\`)}),(0,z.jsx)(h_,{icon:Ke,label:\`Authentication\`,value:e?.users??0,sub:\`users\`,onClick:()=>R(\`auth\`)}),(0,z.jsx)(h_,{icon:Be,label:\`Storage\`,value:e?.buckets??0,sub:\`\${e?.objects??0} objects\`,onClick:()=>R(\`storage\`)}),(0,z.jsx)(h_,{icon:_t,label:\`Logs\`,value:o.length,sub:v>0?\`\${v} errors\`:\`no errors\`,danger:v>0,onClick:()=>R(\`logs\`)})]})}),(0,z.jsx)(p_,{title:\`Advisor\`,action:c.length>0?(0,z.jsxs)(\`button\`,{className:\`text-xs text-brand hover:underline\`,onClick:eh,children:[\`View all \`,c.length]}):void 0,children:c.length===0?(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-3 rounded-lg border border-border bg-card p-5 text-[13px] text-muted-foreground\`,children:[(0,z.jsx)(pe,{size:15,className:\`text-brand\`}),\` No advisor findings — security and performance checks all pass.\`]}):(0,z.jsx)(\`div\`,{className:\`overflow-hidden rounded-lg border border-border bg-card\`,children:c.slice(0,6).map(e=>(0,z.jsxs)(\`button\`,{onClick:eh,className:\`flex w-full items-center gap-3 border-b border-border/60 px-4 py-2.5 text-left transition-colors last:border-0 hover:bg-accent/40\`,children:[(0,z.jsx)(xt,{size:14,className:e.level===\`critical\`?\`text-destructive\`:e.level===\`warning\`?\`text-warning\`:\`text-muted-foreground/70\`}),(0,z.jsx)(\`span\`,{className:\`shrink-0 text-[13px] text-foreground/90\`,children:e.title}),(0,z.jsx)(\`span\`,{className:\`truncate font-mono text-xs text-muted-foreground\`,children:e.entity}),(0,z.jsx)(ue,{size:12,className:\`ml-auto shrink-0 text-muted-foreground/60\`})]},e.id))})}),(0,z.jsxs)(\`div\`,{className:\`grid gap-5 lg:grid-cols-2\`,children:[(0,z.jsx)(m_,{title:\`Recent migrations\`,onMore:()=>R(\`database\`,\`migrations\`),children:i.length===0?(0,z.jsxs)(\`p\`,{className:\`px-4 py-6 text-center text-xs text-muted-foreground/60\`,children:[\`No migrations applied. Add SQL files under\`,\` \`,(0,z.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`supabase/migrations/\`}),\`.\`]}):i.slice(-6).reverse().map(e=>(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-3 border-b border-border/60 px-4 py-2 last:border-0\`,children:[(0,z.jsx)(\`span\`,{className:\`font-mono text-xs text-muted-foreground/80\`,children:e.version}),(0,z.jsx)(\`span\`,{className:\`truncate text-[13px] text-foreground/80\`,children:e.name??\`—\`}),(0,z.jsx)(\`span\`,{className:\`ml-auto shrink-0 text-[11px] text-muted-foreground/60\`,children:(0,z.jsx)(qm,{value:e.applied_at})})]},e.version))}),(0,z.jsx)(m_,{title:\`Recent logs\`,onMore:()=>R(\`logs\`),children:g.length===0?(0,z.jsx)(\`p\`,{className:\`px-4 py-6 text-center text-xs text-muted-foreground/60\`,children:\`No log entries yet.\`}):g.map((e,t)=>(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-2.5 border-b border-border/60 px-4 py-2 last:border-0\`,children:[(0,z.jsx)(\`span\`,{className:\`size-1.5 shrink-0 rounded-full \`+(e.level===\`error\`?\`bg-destructive\`:e.level===\`warn\`?\`bg-warning\`:\`bg-muted-foreground/60\`)}),(0,z.jsx)(\`span\`,{className:\`truncate font-mono text-xs text-muted-foreground\`,children:e.msg}),(0,z.jsx)(\`span\`,{className:\`ml-auto shrink-0 text-[11px] text-muted-foreground/60\`,children:(0,z.jsx)(qm,{value:e.ts,format:\`time\`})})]},t))})]}),(0,z.jsx)(p_,{title:\`Get connected\`,children:(0,z.jsxs)(\`div\`,{className:\`rounded-lg border border-border bg-card p-6\`,children:[(0,z.jsxs)(\`p\`,{className:\`text-[13px] text-muted-foreground/80\`,children:[\`Every tinbase service is a\`,\` \`,(0,z.jsx)(\`span\`,{className:\`text-foreground/80\`,children:\`(Request) ⇒ Response\`}),\` \`,\`fetch handler — run the whole backend in-process, or point\`,\` \`,(0,z.jsx)(\`span\`,{className:\`text-foreground/80\`,children:\`supabase-js\`}),\` at this server (URL + keys under\`,\` \`,(0,z.jsx)(\`span\`,{className:\`text-foreground/80\`,children:\`Connect\`}),\`).\`]}),(0,z.jsx)(\`div\`,{className:\`mt-3\`,children:(0,z.jsx)(rr,{code:uh(),lang:\`js\`})})]})})]})})}function f_({icon:e,label:t,value:n,sub:r,accent:i}){return(0,z.jsxs)(\`div\`,{className:\`flex items-start gap-3.5\`,children:[(0,z.jsx)(\`div\`,{className:\`flex size-11 shrink-0 items-center justify-center rounded-md border border-border bg-card\`,children:(0,z.jsx)(e,{size:17,className:i?\`text-brand\`:\`text-muted-foreground/80\`})}),(0,z.jsxs)(\`div\`,{className:\`min-w-0\`,children:[(0,z.jsx)(\`p\`,{className:\`text-[11px] font-semibold uppercase tracking-wider text-muted-foreground/80\`,children:t}),(0,z.jsx)(\`p\`,{className:\`mt-0.5 truncate text-sm \`+(i?\`text-brand\`:\`text-foreground\`),children:n}),r&&(0,z.jsx)(\`p\`,{className:\`truncate text-xs text-muted-foreground/60\`,children:r})]})]})}function p_({title:e,action:t,children:n}){return(0,z.jsxs)(\`div\`,{children:[(0,z.jsxs)(\`div\`,{className:\`mb-4 flex items-center justify-between gap-4\`,children:[(0,z.jsx)(\`h2\`,{className:\`text-base font-medium text-foreground\`,children:e}),t]}),n]})}function m_({title:e,onMore:t,children:n}){return(0,z.jsxs)(\`div\`,{className:\`overflow-hidden rounded-lg border border-border bg-card\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex items-center justify-between border-b border-border px-4 py-2.5\`,children:[(0,z.jsx)(\`h3\`,{className:\`text-[13px] font-medium text-foreground\`,children:e}),t&&(0,z.jsxs)(\`button\`,{onClick:t,className:\`flex items-center gap-1 text-[11px] text-muted-foreground/80 transition-colors hover:text-brand\`,children:[\`View all \`,(0,z.jsx)(ue,{size:11})]})]}),(0,z.jsx)(\`div\`,{children:n})]})}function h_({icon:e,label:t,value:n,sub:r,danger:i,onClick:a}){return(0,z.jsxs)(\`button\`,{onClick:a,className:\`group rounded-lg border border-border bg-card p-5 text-left transition-colors hover:border-muted-foreground\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-2 text-muted-foreground/80\`,children:[(0,z.jsx)(e,{size:13}),(0,z.jsx)(\`span\`,{className:\`text-[11px] font-medium uppercase tracking-wide\`,children:t}),(0,z.jsx)(ue,{size:12,className:\`ml-auto opacity-0 transition-opacity group-hover:opacity-100\`})]}),(0,z.jsx)(\`p\`,{className:\`mt-3 text-3xl font-semibold text-foreground\`,children:n.toLocaleString()}),(0,z.jsx)(\`p\`,{className:\`mt-1 text-[13px] \`+(i?\`text-destructive\`:\`text-muted-foreground/80\`),children:r})]})}function g_(e,t){let n=e=>{if(e==null)return\`\`;let t=typeof e==\`object\`?JSON.stringify(e):String(e);return/[",\\n]/.test(t)?\`"\`+t.replace(/"/g,\`""\`)+\`"\`:t};return[e.join(\`,\`),...t.map(t=>e.map(e=>n(t[e])).join(\`,\`))].join(\`
|
|
1564
|
+
\`)}function __(e,t,n){let r=document.createElement(\`a\`);r.href=URL.createObjectURL(new Blob([n],{type:t})),r.download=e,r.click(),URL.revokeObjectURL(r.href)}var v_=/^([A-Z]+)\\s+(\\S+)\\s+→\\s+(\\d{3})\\b/;function y_(e,t){if(e)return e.startsWith(\`/rest/\`)?\`REST\`:e.startsWith(\`/auth/\`)?\`Auth\`:e.startsWith(\`/storage/\`)?\`Storage\`:e.startsWith(\`/realtime/\`)?\`Realtime\`:e.startsWith(\`/functions/\`)?\`Functions\`:e.startsWith(\`/admin/\`)?\`Admin\`:e.startsWith(\`/inbox\`)?\`Inbox\`:e===\`/_\`||e.startsWith(\`/_/\`)?\`Studio\`:\`Server\`;let n=t.toLowerCase();return n.includes(\`cron\`)?\`Cron\`:n.includes(\`webhook\`)||n.includes(\`http\`)?\`Webhooks\`:n.includes(\`mail\`)||n.includes(\`otp\`)||n.includes(\`magic\`)?\`Auth\`:n.includes(\`migration\`)?\`Migrations\`:\`Server\`}function b_(e){let t=v_.exec(e.msg),n=t?.[1]??null,r=t?.[2]??null,i=t?parseInt(t[3],10):null;return{...e,method:n,path:r,status:i,service:y_(r,e.msg)}}var x_=e=>e===null?null:\`\${Math.floor(e/100)}xx\`,S_=[{key:\`all\`,label:\`All time\`,ms:null},{key:\`1m\`,label:\`Last minute\`,ms:6e4},{key:\`5m\`,label:\`Last 5 min\`,ms:3e5},{key:\`15m\`,label:\`Last 15 min\`,ms:9e5},{key:\`1h\`,label:\`Last hour\`,ms:36e5}];function C_(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(!0),[i,a]=(0,_.useState)(\`all\`),[o,s]=(0,_.useState)(new Set),[c,l]=(0,_.useState)(new Set),[u,d]=(0,_.useState)(new Set),[f,p]=(0,_.useState)(new Set),[m,h]=(0,_.useState)(\`\`),[g,v]=(0,_.useState)(null),[y,b]=(0,_.useState)(!1),x=(0,_.useCallback)(async()=>{try{t(await N.logs())}catch{}},[]);(0,_.useEffect)(()=>{if(x(),!n)return;let e=setInterval(x,2e3);return()=>clearInterval(e)},[n,x]);let S=(0,_.useMemo)(()=>(e??[]).map(b_),[e]),C=(0,_.useMemo)(()=>{let e=S_.find(e=>e.key===i).ms,t=e===null?0:Date.now()-e,n=m.toLowerCase();return S.filter(e=>(t===0||Date.parse(e.ts)>=t)&&(!n||e.msg.toLowerCase().includes(n)))},[S,i,m]),w=(0,_.useMemo)(()=>{let e=new Map,t={info:0,warn:0,error:0},n=new Map,r=new Map;for(let i of C){e.set(i.service,(e.get(i.service)??0)+1),t[i.level]++,i.method&&n.set(i.method,(n.get(i.method)??0)+1);let a=x_(i.status);a&&r.set(a,(r.get(a)??0)+1)}return{svc:e,lvl:t,mth:n,sts:r}},[C]),T=(0,_.useMemo)(()=>C.filter(e=>(o.size===0||o.has(e.service))&&(c.size===0||c.has(e.level))&&(u.size===0||e.method!==null&&u.has(e.method))&&(f.size===0||x_(e.status)!==null&&f.has(x_(e.status)))).reverse(),[C,o,c,u,f]),E=o.size+c.size+u.size+f.size+ +!!m+(i===\`all\`?0:1);return e===null?(0,z.jsx)(Jp,{}):(0,z.jsxs)(\`div\`,{className:\`flex h-full\`,children:[(0,z.jsxs)(hf,{id:\`logs-facets\`,side:\`left\`,defaultSize:224,min:180,max:360,className:\`flex flex-col overflow-y-auto border-r border-border bg-card\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex items-center justify-between px-4 pb-1 pt-4\`,children:[(0,z.jsx)(\`span\`,{className:\`text-sm font-semibold text-foreground\`,children:\`Logs\`}),E>0&&(0,z.jsxs)(\`button\`,{className:\`flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] text-muted-foreground hover:bg-accent hover:text-foreground\`,onClick:()=>{s(new Set),l(new Set),d(new Set),p(new Set),h(\`\`),a(\`all\`)},children:[(0,z.jsx)(Lt,{size:10}),\` Clear (\`,E,\`)\`]})]}),(0,z.jsx)(T_,{title:\`Time range\`,children:S_.map(e=>(0,z.jsx)(\`button\`,{onClick:()=>a(e.key),className:\`flex w-full items-center rounded px-2 py-1 text-left text-xs transition-colors \`+(i===e.key?\`bg-accent text-foreground\`:\`text-muted-foreground hover:bg-accent/50 hover:text-foreground\`),children:e.label},e.key))}),(0,z.jsxs)(T_,{title:\`Service\`,children:[[...w.svc.entries()].sort((e,t)=>t[1]-e[1]).map(([e,t])=>(0,z.jsx)(E_,{label:e,count:t,checked:o.has(e),onToggle:()=>s(w_(o,e))},e)),w.svc.size===0&&(0,z.jsx)(\`p\`,{className:\`px-2 py-1 text-[11px] text-muted-foreground/50\`,children:\`No entries\`})]}),(0,z.jsx)(T_,{title:\`Level\`,children:[\`info\`,\`warn\`,\`error\`].map(e=>(0,z.jsx)(E_,{label:e,count:w.lvl[e],dot:e===\`error\`?\`bg-destructive\`:e===\`warn\`?\`bg-warning\`:\`bg-muted-foreground/60\`,checked:c.has(e),onToggle:()=>l(w_(c,e))},e))}),(0,z.jsxs)(T_,{title:\`Method\`,children:[[\`GET\`,\`POST\`,\`PATCH\`,\`PUT\`,\`DELETE\`,\`OPTIONS\`].filter(e=>w.mth.has(e)).map(e=>(0,z.jsx)(E_,{label:e,mono:!0,count:w.mth.get(e),checked:u.has(e),onToggle:()=>d(w_(u,e))},e)),w.mth.size===0&&(0,z.jsx)(\`p\`,{className:\`px-2 py-1 text-[11px] text-muted-foreground/50\`,children:\`No requests\`})]}),(0,z.jsxs)(T_,{title:\`Status\`,children:[[\`2xx\`,\`3xx\`,\`4xx\`,\`5xx\`].filter(e=>w.sts.has(e)).map(e=>(0,z.jsx)(E_,{label:e,mono:!0,count:w.sts.get(e),dot:e===\`2xx\`?\`bg-brand\`:e===\`4xx\`?\`bg-warning\`:e===\`5xx\`?\`bg-destructive\`:\`bg-muted-foreground/60\`,checked:f.has(e),onToggle:()=>p(w_(f,e))},e)),w.sts.size===0&&(0,z.jsx)(\`p\`,{className:\`px-2 py-1 text-[11px] text-muted-foreground/50\`,children:\`No responses\`})]})]}),(0,z.jsxs)(\`div\`,{className:\`flex min-w-0 flex-1 flex-col\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex shrink-0 items-center gap-2 border-b border-border px-3 py-2\`,children:[(0,z.jsxs)(\`div\`,{className:\`relative min-w-0 flex-1 max-w-md\`,children:[(0,z.jsx)(vt,{size:13,className:\`pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground/60\`}),(0,z.jsx)(\`input\`,{value:m,onChange:e=>h(e.target.value),placeholder:\`Search events…\`,className:\`h-7 w-full rounded-md border border-input bg-field pl-8 pr-2 text-xs text-foreground placeholder:text-muted-foreground/60 focus:border-brand focus:outline-none\`})]}),(0,z.jsxs)(\`span\`,{className:\`text-[11px] tabular-nums text-muted-foreground/70\`,children:[T.length.toLocaleString(),\` event\`,T.length===1?\`\`:\`s\`]}),(0,z.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-1.5\`,children:[(0,z.jsx)(V,{variant:n?\`outline\`:\`ghost\`,size:\`xs\`,onClick:()=>r(e=>!e),children:n?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(ct,{size:12}),\` Live \`,(0,z.jsx)(\`span\`,{className:\`size-1.5 animate-pulse rounded-full bg-brand\`})]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(ft,{size:12}),\` Paused\`]})}),(0,z.jsx)(V,{variant:\`ghost\`,size:\`iconXs\`,title:\`Refresh\`,onClick:()=>void x(),children:(0,z.jsx)(gt,{size:13})}),(0,z.jsxs)(Qd,{children:[(0,z.jsx)($d,{asChild:!0,children:(0,z.jsxs)(V,{variant:\`ghost\`,size:\`xs\`,title:\`Download logs\`,children:[(0,z.jsx)(Ee,{size:13}),\` \`,(0,z.jsx)(me,{size:10})]})}),(0,z.jsxs)(nf,{align:\`end\`,children:[(0,z.jsx)(rf,{onSelect:()=>__(\`tinbase-logs.txt\`,\`text/plain\`,T.map(e=>\`\${e.ts} \${e.level.toUpperCase()} \${e.msg}\`).join(\`
|
|
1565
|
+
\`)),children:\`Download .txt\`}),(0,z.jsx)(rf,{onSelect:()=>__(\`tinbase-logs.json\`,\`application/json\`,JSON.stringify(T,null,2)),children:\`Download .json\`})]})]}),(0,z.jsx)(V,{variant:\`ghost\`,size:\`iconXs\`,title:\`Clear logs\`,onClick:()=>b(!0),children:(0,z.jsx)(At,{size:13})})]})]}),(0,z.jsx)(D_,{entries:C}),(0,z.jsx)(\`div\`,{className:\`min-h-0 flex-1 overflow-auto\`,children:T.length===0?(0,z.jsx)(lf,{children:S.length===0?\`No logs yet. Make a request or trigger an email/webhook.\`:\`No entries match the filters.\`}):(0,z.jsxs)(\`table\`,{className:\`w-full border-collapse font-mono text-[12px]\`,children:[(0,z.jsx)(\`thead\`,{className:\`sticky top-0 z-10 bg-background\`,children:(0,z.jsxs)(\`tr\`,{className:\`border-b border-border text-left text-[10px] uppercase tracking-wider text-muted-foreground/60\`,children:[(0,z.jsx)(\`th\`,{className:\`w-24 px-3 py-1.5 font-medium\`,children:\`Time\`}),(0,z.jsx)(\`th\`,{className:\`w-16 px-2 py-1.5 font-medium\`,children:\`Level\`}),(0,z.jsx)(\`th\`,{className:\`w-20 px-2 py-1.5 font-medium\`,children:\`Service\`}),(0,z.jsx)(\`th\`,{className:\`w-16 px-2 py-1.5 font-medium\`,children:\`Method\`}),(0,z.jsx)(\`th\`,{className:\`w-12 px-2 py-1.5 font-medium\`,children:\`Status\`}),(0,z.jsx)(\`th\`,{className:\`px-2 py-1.5 font-medium\`,children:\`Event\`})]})}),(0,z.jsx)(\`tbody\`,{children:T.map((e,t)=>(0,z.jsxs)(\`tr\`,{onClick:()=>v(e),className:\`cursor-pointer border-b border-border/40 transition-colors hover:bg-accent/40 \`+(g===e?\`bg-selected \`:\`\`)+(e.level===\`error\`?\`bg-destructive/5\`:\`\`),children:[(0,z.jsx)(\`td\`,{className:\`whitespace-nowrap px-3 py-1 text-muted-foreground/70\`,children:(0,z.jsx)(qm,{value:e.ts,format:\`time\`})}),(0,z.jsx)(\`td\`,{className:\`px-2 py-1\`,children:(0,z.jsx)(\`span\`,{className:\`inline-block size-2 rounded-full \`+(e.level===\`error\`?\`bg-destructive\`:e.level===\`warn\`?\`bg-warning\`:\`bg-muted-foreground/40\`),title:e.level})}),(0,z.jsx)(\`td\`,{className:\`px-2 py-1 text-muted-foreground/80\`,children:e.service}),(0,z.jsx)(\`td\`,{className:\`px-2 py-1 text-foreground/70\`,children:e.method??\`\`}),(0,z.jsx)(\`td\`,{className:\`px-2 py-1\`,children:e.status!==null&&(0,z.jsx)(\`span\`,{className:e.status>=500?\`text-destructive\`:e.status>=400?\`text-warning\`:\`text-brand\`,children:e.status})}),(0,z.jsx)(\`td\`,{className:\`max-w-0 truncate px-2 py-1 text-foreground/85\`,title:e.msg,children:e.path??e.msg})]},\`\${e.ts}-\${t}\`))})]})})]}),g&&(0,z.jsx)(M_,{entry:g,onClose:()=>v(null)}),y&&(0,z.jsx)(q,{open:!0,danger:!0,title:\`Clear all logs?\`,description:\`The in-memory log buffer is emptied — this cannot be undone.\`,confirmLabel:\`Clear logs\`,onConfirm:()=>{N.clearLogs().then(x),v(null)},onClose:()=>b(!1)})]})}function w_(e,t){let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n}function T_({title:e,children:t}){return(0,z.jsxs)(\`div\`,{className:\`px-2 pt-3\`,children:[(0,z.jsx)(\`p\`,{className:\`px-2 pb-1 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/60\`,children:e}),t]})}function E_({label:e,count:t,checked:n,onToggle:r,dot:i,mono:a}){return(0,z.jsxs)(\`button\`,{onClick:r,className:\`group flex w-full items-center gap-2 rounded px-2 py-1 text-left text-xs text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground\`,children:[(0,z.jsx)($t,{checked:n,onChange:r}),i&&(0,z.jsx)(\`span\`,{className:\`size-1.5 shrink-0 rounded-full \${i}\`}),(0,z.jsx)(\`span\`,{className:\`min-w-0 flex-1 truncate \`+(a?\`font-mono\`:\`\`),children:e}),(0,z.jsx)(\`span\`,{className:\`tabular-nums text-muted-foreground/50\`,children:t.toLocaleString()})]})}function D_({entries:e}){let t=(0,_.useMemo)(()=>{if(e.length===0)return null;let t=1/0,n=-1/0,r=e.map(e=>Date.parse(e.ts));for(let e of r)e<t&&(t=e),e>n&&(n=e);n===t&&(n=t+1);let i=n-t,a=Array.from({length:60},()=>({ok:0,err:0}));return e.forEach((e,n)=>{let o=Math.min(59,Math.floor((r[n]-t)/i*60));e.level===\`error\`||e.status!==null&&e.status>=500?a[o].err++:a[o].ok++}),{buckets:a,peak:Math.max(...a.map(e=>e.ok+e.err)),min:t,max:n}},[e]);return t?(0,z.jsx)(\`div\`,{className:\`flex h-12 shrink-0 items-end gap-px border-b border-border px-3 pb-1 pt-2\`,title:\`Event volume\`,children:t.buckets.map((e,n)=>{let r=e.ok+e.err,i=r===0?0:Math.max(8,r/t.peak*100);return(0,z.jsx)(\`div\`,{className:\`flex min-w-0 flex-1 flex-col justify-end self-stretch\`,title:\`\${r} events\`,children:r>0&&(0,z.jsxs)(\`div\`,{className:\`flex w-full flex-col overflow-hidden rounded-sm\`,style:{height:\`\${i}%\`},children:[e.err>0&&(0,z.jsx)(\`div\`,{className:\`w-full bg-destructive/70\`,style:{flexGrow:e.err}}),(0,z.jsx)(\`div\`,{className:\`w-full bg-brand/40\`,style:{flexGrow:e.ok}})]})},n)})}):null}var O_={200:\`OK\`,201:\`Created\`,204:\`No Content\`,206:\`Partial Content\`,301:\`Moved Permanently\`,303:\`See Other\`,304:\`Not Modified\`,400:\`Bad Request\`,401:\`Unauthorized\`,403:\`Forbidden\`,404:\`Not Found\`,405:\`Method Not Allowed\`,406:\`Not Acceptable\`,409:\`Conflict\`,422:\`Unprocessable Entity\`,429:\`Too Many Requests\`,500:\`Internal Server Error\`,503:\`Service Unavailable\`};function k_(e){let t=Date.now()-Date.parse(e);if(!Number.isFinite(t))return\`\`;for(let[e,n]of[[864e5,\`day\`],[36e5,\`hour\`],[6e4,\`minute\`],[1e3,\`second\`]])if(Math.abs(t)>=e){let r=Math.round(Math.abs(t)/e);return\`\${r} \${n}\${r===1?\`\`:\`s\`} ago\`}return\`just now\`}function A_({label:e,copy:t,children:n}){return(0,z.jsxs)(\`div\`,{className:\`group flex items-start gap-3 rounded px-1 py-1 -mx-1 hover:bg-accent/40\`,children:[(0,z.jsx)(\`span\`,{className:\`w-24 shrink-0 pt-px font-mono text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/60\`,children:e}),(0,z.jsx)(\`span\`,{className:\`min-w-0 flex-1 text-right text-[12.5px] text-foreground/90\`,children:n}),t!==void 0&&(0,z.jsx)(\`span\`,{className:\`shrink-0 opacity-0 transition-opacity group-hover:opacity-100\`,children:(0,z.jsx)(er,{value:t,label:e})})]})}function j_({title:e,children:t}){return(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(\`p\`,{className:\`mb-1.5 border-b border-border pb-1.5 font-mono text-[10px] font-semibold uppercase tracking-wider text-muted-foreground\`,children:e}),(0,z.jsx)(\`div\`,{className:\`space-y-0.5\`,children:t})]})}function M_({entry:e,onClose:t}){let n=new Date(e.ts),[r,i]=(e.path??\`\`).split(\`?\`),a=Intl.DateTimeFormat().resolvedOptions().timeZone;return(0,z.jsxs)(hf,{id:\`logs-detail\`,side:\`right\`,defaultSize:400,min:300,max:640,className:\`flex flex-col border-l border-border bg-card\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex shrink-0 items-center justify-between border-b border-border px-4 py-2.5\`,children:[(0,z.jsx)(\`span\`,{className:\`text-[13px] font-medium text-foreground\`,children:\`Event details\`}),(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-1\`,children:[(0,z.jsx)(er,{value:JSON.stringify(e,null,2),label:\`Event JSON\`}),(0,z.jsx)(\`button\`,{className:\`rounded p-1 text-muted-foreground hover:bg-accent hover:text-foreground\`,onClick:t,children:(0,z.jsx)(Lt,{size:14})})]})]}),(0,z.jsxs)(\`div\`,{className:\`min-h-0 flex-1 space-y-5 overflow-y-auto p-4\`,children:[(0,z.jsxs)(j_,{title:\`Event\`,children:[(0,z.jsx)(A_,{label:\`Timestamp\`,copy:e.ts,children:(0,z.jsx)(\`span\`,{className:\`font-mono text-[12px]\`,children:e.ts})}),(0,z.jsx)(A_,{label:\`Local\`,children:(0,z.jsx)(\`span\`,{className:\`font-mono text-[12px]\`,title:a,children:n.toLocaleString()})}),(0,z.jsx)(A_,{label:\`Relative\`,children:k_(e.ts)}),(0,z.jsx)(A_,{label:\`Level\`,children:(0,z.jsx)(B,{variant:e.level===\`error\`?\`red\`:e.level===\`warn\`?\`amber\`:\`neutral\`,children:e.level})}),(0,z.jsx)(A_,{label:\`Service\`,copy:e.service,children:e.service})]}),e.method&&(0,z.jsxs)(j_,{title:\`Request\`,children:[(0,z.jsx)(A_,{label:\`Method\`,copy:e.method,children:(0,z.jsx)(\`span\`,{className:\`font-mono text-[12px]\`,children:e.method})}),(0,z.jsx)(A_,{label:\`Path\`,copy:r,children:(0,z.jsx)(\`span\`,{className:\`break-all font-mono text-[12px]\`,children:r})}),i&&(0,z.jsx)(A_,{label:\`Query\`,copy:i,children:(0,z.jsx)(\`span\`,{className:\`break-all font-mono text-[11px] text-muted-foreground\`,children:i})}),e.status!==null&&(0,z.jsx)(A_,{label:\`Status\`,copy:String(e.status),children:(0,z.jsxs)(\`span\`,{className:\`inline-flex items-center gap-1.5\`,children:[(0,z.jsx)(B,{variant:e.status>=500?\`red\`:e.status>=400?\`amber\`:\`brand\`,children:e.status}),O_[e.status]&&(0,z.jsx)(\`span\`,{className:\`text-[11px] text-muted-foreground\`,children:O_[e.status]})]})})]}),(0,z.jsx)(j_,{title:\`Message\`,children:(0,z.jsx)(\`pre\`,{className:\`whitespace-pre-wrap wrap-break-word rounded-md border border-border bg-code p-3 font-mono text-[12px] leading-relaxed text-foreground/90\`,children:e.msg})}),(0,z.jsx)(j_,{title:\`Raw JSON\`,children:(0,z.jsx)(\`div\`,{className:\`overflow-hidden rounded-md border border-border bg-code px-1 py-2\`,children:(0,z.jsx)(nr,{value:JSON.stringify(e,null,2),lang:\`js\`,readOnly:!0,minLines:6,maxLines:16})})})]})]})}var N_=25e3;function P_(e){let t=\`\${e.baseUrl.replace(/^http/,\`ws\`)}/realtime/v1/websocket?apikey=\${encodeURIComponent(e.token)}&vsn=1.0.0\`,n=\`realtime:\${e.channel}\`,r=0,i=()=>String(++r),a=null,o=null,s=!1;e.onStatus(\`connecting\`);let c=new WebSocket(t),l=t=>{c.readyState===WebSocket.OPEN&&(c.send(JSON.stringify(t)),e.onMessage({dir:\`out\`,ts:Date.now(),event:t.event,topic:t.topic,payload:t.payload}))};return c.onopen=()=>{e.onStatus(\`open\`);let t=e.listenChanges?[{event:\`*\`,schema:e.schema,...e.table?{table:e.table}:{}}]:[];a=i(),l({topic:n,event:\`phx_join\`,ref:a,payload:{config:{broadcast:{self:!0},presence:{key:\`studio-\${Math.floor(performance.now()).toString(36)}\`},postgres_changes:t},access_token:e.token}}),o=setInterval(()=>{l({topic:\`phoenix\`,event:\`heartbeat\`,payload:{},ref:i()})},N_)},c.onmessage=t=>{try{let n=JSON.parse(String(t.data));if(n.topic===\`phoenix\`)return;if(n.event===\`phx_reply\`&&n.ref===a){let t=n.payload?.status===\`ok\`;e.onStatus(t?\`joined\`:\`error\`)}e.onMessage({dir:\`in\`,ts:Date.now(),event:n.event,topic:n.topic,payload:n.payload})}catch{e.onMessage({dir:\`in\`,ts:Date.now(),event:\`raw\`,payload:String(t.data)})}},c.onerror=()=>{s||e.onStatus(\`error\`)},c.onclose=()=>{o&&clearInterval(o),e.onStatus(\`closed\`)},{sendBroadcast:(e,t)=>{l({topic:n,event:\`broadcast\`,ref:i(),payload:{type:\`broadcast\`,event:e,payload:t}})},close:()=>{s=!0,o&&clearInterval(o);try{l({topic:n,event:\`phx_leave\`,payload:{},ref:i()})}finally{c.close()}}}}var F_=[\`inspector\`,\`policies\`,\`settings\`];function I_(){let{section:e}=Yt(),t=F_.includes(e)?e:\`inspector\`;return(0,z.jsxs)(\`div\`,{className:\`flex h-full\`,children:[(0,z.jsx)(Th,{title:\`Realtime\`,active:t,onSelect:e=>R(\`realtime\`,e),groups:[{title:\`Tools\`,items:[{id:\`inspector\`,label:\`Inspector\`}]},{title:\`Configuration\`,items:[{id:\`policies\`,label:\`Policies\`},{id:\`settings\`,label:\`Settings\`}]}]}),(0,z.jsxs)(\`div\`,{className:\`min-w-0 flex-1 overflow-y-auto\`,children:[t===\`inspector\`&&(0,z.jsx)(B_,{}),t===\`policies\`&&(0,z.jsx)(V_,{}),t===\`settings\`&&(0,z.jsx)(H_,{})]})]})}function L_(e){return e.event===\`broadcast\`?\`broadcast\`:e.event===\`postgres_changes\`?\`postgres\`:e.event.startsWith(\`presence\`)?\`presence\`:\`system\`}var R_={broadcast:\`brand\`,postgres:\`blue\`,presence:\`amber\`,system:\`neutral\`},z_={connecting:{label:\`connecting…\`,variant:\`amber\`},open:{label:\`connected\`,variant:\`amber\`},joined:{label:\`joined\`,variant:\`brand\`},closed:{label:\`disconnected\`,variant:\`neutral\`},error:{label:\`error\`,variant:\`red\`}};function B_(){let[e,t]=(0,_.useState)(\`room-1\`),[n,r]=(0,_.useState)(\`service_role\`),[i,a]=(0,_.useState)(!0),[o,s]=(0,_.useState)(\`\`),[c,l]=(0,_.useState)(\`closed\`),[u,d]=(0,_.useState)([]),[f,p]=(0,_.useState)(new Set),[m,h]=(0,_.useState)(\`test\`),[g,v]=(0,_.useState)(\`{ "hello": "world" }\`),y=(0,_.useRef)(null),b=c===\`joined\`||c===\`open\`||c===\`connecting\`;(0,_.useEffect)(()=>()=>y.current?.close(),[]);async function S(){let t=n===\`anon\`?(await N.keys()).anonKey??x():x();d([]),y.current?.close(),y.current=P_({baseUrl:lh(),token:t,channel:e.trim()||\`room-1\`,listenChanges:i,schema:\`public\`,table:o.trim()||void 0,onMessage:e=>d(t=>[e,...t].slice(0,500)),onStatus:l})}function C(){y.current?.close(),y.current=null}function w(){if(!y.current||c!==\`joined\`)return H.error(\`Join a channel first\`);let e;try{e=g.trim()?JSON.parse(g):{}}catch{return H.error(\`Payload is not valid JSON\`)}y.current.sendBroadcast(m.trim()||\`test\`,e)}let T=u.filter(e=>f.size===0||f.has(L_(e))),E=z_[c];return(0,z.jsxs)(\`div\`,{className:\`flex h-full flex-col\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex shrink-0 flex-wrap items-end gap-3 border-b border-border px-4 py-3\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Channel\`}),(0,z.jsx)(Y,{mono:!0,className:\`w-44\`,value:e,disabled:b,onChange:e=>t(e.target.value)})]}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Join as\`}),(0,z.jsx)(Wp,{className:\`w-36\`,value:n,disabled:b,onValueChange:e=>r(e),options:[{value:\`service_role\`,label:\`service_role\`},{value:\`anon\`,label:\`anon\`}]})]}),(0,z.jsxs)(\`label\`,{className:\`flex cursor-pointer items-center gap-2 pb-2 text-[13px] text-foreground/80\`,children:[(0,z.jsx)($t,{checked:i,disabled:b,onChange:a}),\`postgres_changes\`]}),i&&(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Table (empty = all public)\`}),(0,z.jsx)(Y,{mono:!0,className:\`w-40\`,value:o,disabled:b,placeholder:\`*\`,onChange:e=>s(e.target.value)})]}),(0,z.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-2 pb-0.5\`,children:[(0,z.jsxs)(B,{variant:E.variant,children:[(0,z.jsx)(ht,{size:10}),\` \`,E.label]}),b?(0,z.jsxs)(V,{variant:\`outline\`,size:\`xs\`,onClick:C,children:[(0,z.jsx)(Dt,{size:11}),\` Leave\`]}):(0,z.jsxs)(V,{size:\`xs\`,onClick:()=>void S(),children:[(0,z.jsx)(ft,{size:11}),\` Join channel\`]})]})]}),(0,z.jsxs)(\`div\`,{className:\`flex shrink-0 items-end gap-3 border-b border-border bg-card px-4 py-2.5\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Broadcast event\`}),(0,z.jsx)(Y,{mono:!0,className:\`w-36\`,value:m,onChange:e=>h(e.target.value)})]}),(0,z.jsxs)(\`div\`,{className:\`min-w-0 flex-1\`,children:[(0,z.jsx)(X,{children:\`Payload (JSON)\`}),(0,z.jsx)(Y,{mono:!0,value:g,onChange:e=>v(e.target.value),onKeyDown:e=>e.key===\`Enter\`&&w()})]}),(0,z.jsxs)(V,{size:\`xs\`,className:\`mb-0.5\`,onClick:w,disabled:c!==\`joined\`,children:[(0,z.jsx)(yt,{size:11}),\` Send\`]})]}),(0,z.jsxs)(\`div\`,{className:\`flex shrink-0 items-center gap-1.5 border-b border-border px-4 py-2\`,children:[[\`broadcast\`,\`postgres\`,\`presence\`,\`system\`].map(e=>(0,z.jsx)(\`button\`,{onClick:()=>p(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),className:\`rounded-md border px-2 py-1 text-[11px] font-medium transition-colors \`+(f.size===0||f.has(e)?\`border-input text-foreground/80\`:\`border-transparent text-muted-foreground/50 hover:text-muted-foreground\`),children:e},e)),(0,z.jsxs)(\`span\`,{className:\`ml-auto text-xs text-muted-foreground/60\`,children:[u.length,\` messages\`]}),(0,z.jsx)(V,{variant:\`ghost\`,size:\`iconXs\`,title:\`Clear feed\`,onClick:()=>d([]),children:(0,z.jsx)(At,{size:13})})]}),(0,z.jsx)(\`div\`,{className:\`min-h-0 flex-1 overflow-auto p-2\`,children:T.length===0?(0,z.jsx)(lf,{children:c===\`joined\`?\`Listening… insert a row in the table editor or send a broadcast to see messages.\`:\`Join a channel to start inspecting realtime traffic.\`}):T.map((e,t)=>{let n=L_(e);return(0,z.jsxs)(\`details\`,{className:\`group rounded px-2 py-1 hover:bg-accent/40\`,children:[(0,z.jsxs)(\`summary\`,{className:\`flex cursor-pointer list-none items-center gap-2.5 text-[12.5px]\`,children:[e.dir===\`out\`?(0,z.jsx)(fe,{size:11,className:\`shrink-0 text-brand\`}):(0,z.jsx)(le,{size:11,className:\`shrink-0 text-info\`}),(0,z.jsx)(\`span\`,{className:\`shrink-0 font-mono text-muted-foreground/60\`,children:(0,z.jsx)(qm,{value:e.ts,format:\`time\`})}),(0,z.jsx)(B,{variant:R_[n],children:n}),(0,z.jsx)(\`span\`,{className:\`truncate font-mono text-foreground/80\`,children:e.event})]}),(0,z.jsx)(\`pre\`,{className:\`mt-1 overflow-auto rounded-md border border-border bg-code p-2 font-mono text-[11px] text-foreground/80\`,children:JSON.stringify(e.payload,null,2)})]},t)})})]})}function V_(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(!1),[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(null),c=(0,_.useCallback)(()=>{N.policies(\`realtime\`).then(e=>t(e.filter(e=>e.table===\`messages\`)),()=>t([]))},[]);return(0,_.useEffect)(()=>{c();let e=setInterval(()=>void c(),5e3);return()=>clearInterval(e)},[c]),e===null?(0,z.jsx)(Jp,{}):(0,z.jsxs)(\`div\`,{className:\`mx-auto max-w-3xl px-8 py-8\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex items-start justify-between gap-4\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(\`h1\`,{className:\`text-lg font-semibold text-foreground\`,children:\`Policies\`}),(0,z.jsxs)(\`p\`,{className:\`mt-0.5 text-[13px] text-muted-foreground/80\`,children:[\`RLS on \`,(0,z.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`realtime.messages\`}),\` authorizes channels: SELECT gates receiving broadcast/presence, INSERT gates sending. Use \`,(0,z.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`realtime.topic()\`}),\` in expressions to scope a policy to specific channels.\`]})]}),(0,z.jsxs)(V,{size:\`xs\`,className:\`shrink-0\`,onClick:()=>r(!0),children:[(0,z.jsx)(mt,{size:12}),\` New policy\`]})]}),(0,z.jsxs)(\`div\`,{className:\`mt-6 space-y-2\`,children:[e.map(e=>(0,z.jsxs)(\`div\`,{className:\`cursor-pointer rounded-md border border-border bg-card p-3 transition-colors hover:border-muted-foreground/60\`,title:\`Edit policy\`,onClick:()=>a(e),children:[(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-2\`,children:[(0,z.jsx)(\`span\`,{className:\`truncate font-mono text-[13px] text-foreground\`,children:e.name}),(0,z.jsx)(B,{variant:\`blue\`,children:e.cmd}),(0,z.jsx)(B,{variant:\`neutral\`,children:Array.isArray(e.roles)?e.roles.join(\`, \`):String(e.roles)}),(0,z.jsx)(\`button\`,{className:\`ml-auto p-1 text-muted-foreground/80 hover:text-destructive\`,title:\`Drop policy\`,onClick:t=>{t.stopPropagation(),s(e)},children:(0,z.jsx)(At,{size:13})})]}),e.using_expr&&(0,z.jsxs)(\`p\`,{className:\`mt-1.5 truncate font-mono text-[11px] text-muted-foreground/80\`,title:e.using_expr,children:[\`using (\`,e.using_expr,\`)\`]}),e.with_check&&(0,z.jsxs)(\`p\`,{className:\`mt-0.5 truncate font-mono text-[11px] text-muted-foreground/80\`,title:e.with_check,children:[\`with check (\`,e.with_check,\`)\`]})]},e.name)),e.length===0&&(0,z.jsx)(\`p\`,{className:\`rounded-md border border-dashed border-border px-4 py-6 text-center text-xs text-muted-foreground/60\`,children:\`No channel policies yet — every channel is public. Create one to start requiring authorization.\`})]}),n&&(0,z.jsx)(Og,{table:\`messages\`,schema:\`realtime\`,onClose:()=>r(!1),onCreated:async()=>c()}),i&&(0,z.jsx)(Og,{table:\`messages\`,schema:\`realtime\`,existing:jg(i),onClose:()=>a(null),onCreated:async()=>c()}),o&&(0,z.jsx)(q,{open:!0,danger:!0,title:\`Drop policy "\${o.name}"?\`,description:\`Channel authorization changes immediately.\`,confirmLabel:\`Drop policy\`,onConfirm:()=>{N.dropPolicy(\`messages\`,o.name,\`realtime\`).then(c,e=>H.error(e.message))},onClose:()=>s(null)})]})}function H_(){let e=\`\${lh().replace(/^http/,\`ws\`)}/realtime/v1/websocket?apikey=<anon key>&vsn=1.0.0\`,t=({children:e})=>(0,z.jsx)(\`code\`,{className:\`rounded bg-code px-1 py-px font-mono text-foreground/90\`,children:e});return(0,z.jsxs)(xh,{title:\`Realtime Settings\`,children:[(0,z.jsxs)(Sh,{title:\`Connection\`,description:\`How clients reach the Realtime engine.\`,children:[(0,z.jsx)(Ch,{label:\`WebSocket endpoint\`,description:\`supabase-js connects here automatically from the project URL.\`,wide:!0,children:(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-1.5\`,children:[(0,z.jsx)(\`code\`,{className:\`min-w-0 flex-1 truncate rounded-md border border-border bg-code px-2.5 py-1.5 font-mono text-[12px] text-foreground/90\`,title:e,children:e}),(0,z.jsx)(er,{value:e,label:\`WebSocket URL\`})]})}),(0,z.jsxs)(Ch,{label:\`Protocol\`,description:\`The exact wire format supabase-js's RealtimeClient speaks.\`,children:[(0,z.jsx)(wh,{label:\`Format\`,value:\`Phoenix v1 JSON\`}),(0,z.jsx)(wh,{label:\`Heartbeat\`,value:\`every 25s\`})]})]}),(0,z.jsxs)(Sh,{title:\`Features\`,description:\`What channels can carry on this instance.\`,children:[(0,z.jsx)(Ch,{label:\`postgres_changes\`,description:\`Change-data-capture on every table — INSERT / UPDATE / DELETE, filterable by schema and table.\`,children:(0,z.jsx)(B,{variant:\`brand\`,children:\`Enabled\`})}),(0,z.jsx)(Ch,{label:\`Broadcast\`,description:(0,z.jsxs)(z.Fragment,{children:[\`Client-to-client messages; \`,(0,z.jsx)(t,{children:\`self: true\`}),\` echoes back to the sender.\`]}),children:(0,z.jsx)(B,{variant:\`brand\`,children:\`Enabled\`})}),(0,z.jsx)(Ch,{label:\`Presence\`,description:\`Join/leave state tracking per channel.\`,children:(0,z.jsx)(B,{variant:\`brand\`,children:\`Enabled\`})})]}),(0,z.jsx)(Sh,{title:\`Authorization\`,description:\`Who may join, read, and send on private channels.\`,children:(0,z.jsx)(Ch,{label:\`Channel policies\`,description:(0,z.jsxs)(z.Fragment,{children:[\`RLS on \`,(0,z.jsx)(t,{children:\`realtime.messages\`}),\`: SELECT gates receiving broadcast/presence, INSERT gates sending. Scope with \`,(0,z.jsx)(t,{children:\`realtime.topic()\`}),\`.\`]}),children:(0,z.jsx)(V,{variant:\`outline\`,size:\`xs\`,onClick:()=>R(\`realtime\`,\`policies\`),children:\`Manage policies\`})})})]})}function U_(){let[e,t]=(0,_.useState)(\`\`),n=lh();return(0,_.useEffect)(()=>{N.keys().then(e=>t(e.anonKey??\`\`),()=>t(\`\`))},[]),(0,z.jsxs)(Sh,{title:\`API keys\`,description:\`Long-lived JWTs signed with the project's JWT secret. Rotating the secret invalidates both.\`,children:[(0,z.jsx)(Ch,{label:\`Project URL\`,description:\`Point supabase-js (or any HTTP client) here.\`,children:(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-2\`,children:[(0,z.jsx)(Y,{mono:!0,readOnly:!0,value:n}),(0,z.jsx)(er,{value:n,label:\`API URL\`,variant:\`outline\`,size:\`icon\`,iconSize:13})]})}),(0,z.jsx)(Ch,{label:\`anon key\`,description:\`Safe for browsers — Row Level Security applies to every request.\`,children:(0,z.jsx)(df,{bare:!0,label:\`anon key\`,hint:\`\`,value:e})}),(0,z.jsx)(Ch,{label:\`service_role key\`,description:(0,z.jsx)(\`span\`,{className:\`text-destructive/80\`,children:\`Server-side only — bypasses Row Level Security.\`}),children:(0,z.jsx)(df,{bare:!0,label:\`service_role key\`,hint:\`\`,value:x(),danger:!0})}),(0,z.jsx)(Ch,{label:\`CLI\`,description:\`Keys are also printed on startup.\`,children:(0,z.jsx)(\`code\`,{className:\`rounded bg-code px-2 py-1 font-mono text-xs text-foreground/90\`,children:\`tinbase keys\`})})]})}function W_(){let[e,t]=pn(),[n,r]=gn();return(0,z.jsxs)(Sh,{title:\`Appearance\`,description:\`Preferences are stored in this browser and apply instantly.\`,children:[(0,z.jsx)(Ch,{label:\`Theme\`,description:\`Choose your interface color theme. System follows your OS preference.\`,wide:!0,children:(0,z.jsx)(Q_,{value:e,onChange:t})}),(0,z.jsx)(Ch,{label:\`Sidebar\`,description:\`How the navigation sidebar behaves.\`,wide:!0,children:(0,z.jsx)(J_,{value:n,onChange:r})})]})}var G_=[{value:\`expanded\`,label:\`Expanded\`},{value:\`collapsed\`,label:\`Collapsed\`},{value:\`hover\`,label:\`Expand on hover\`}];function K_({label:e}){return(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-1.5\`,children:[(0,z.jsx)(\`div\`,{className:\`size-1.5 shrink-0 rounded-full bg-muted-foreground/60\`}),e&&(0,z.jsx)(\`div\`,{className:\`h-1 flex-1 rounded-full bg-muted-foreground/25\`})]})}function q_({variant:e}){return(0,z.jsxs)(\`div\`,{className:\`absolute inset-0 flex\`,children:[(0,z.jsx)(\`div\`,{className:\`flex shrink-0 flex-col gap-2 border-r border-border bg-accent/50 p-2.5 \`+(e===\`expanded\`?\`w-[42%]\`:\`w-[22%]\`),children:[0,1,2,3].map(t=>(0,z.jsx)(K_,{label:e===\`expanded\`},t))}),e===\`hover\`&&(0,z.jsx)(\`div\`,{className:\`absolute inset-y-0 left-[22%] flex w-[42%] flex-col gap-2 border-r border-border bg-popover/95 p-2.5 shadow-xl backdrop-blur-sm\`,children:[0,1,2,3].map(e=>(0,z.jsx)(K_,{label:!0},e))}),(0,z.jsx)(\`div\`,{className:\`flex-1 bg-card\`})]})}function J_({value:e,onChange:t}){return(0,z.jsx)(\`div\`,{className:\`grid max-w-2xl grid-cols-1 gap-4 sm:grid-cols-3\`,children:G_.map(n=>{let r=e===n.value;return(0,z.jsxs)(\`button\`,{onClick:()=>t(n.value),"aria-pressed":r,className:\`group relative flex h-32 flex-col overflow-hidden rounded-lg border-2 text-left transition-colors \`+(r?\`border-brand\`:\`border-border hover:border-muted-foreground\`),children:[(0,z.jsx)(\`div\`,{className:\`relative flex-1 overflow-hidden\`,children:(0,z.jsx)(q_,{variant:n.value})}),(0,z.jsx)(\`div\`,{className:\`flex h-8 shrink-0 items-center border-t px-3 text-xs font-medium transition-colors \`+(r?\`border-brand/40 bg-brand/10 text-foreground\`:\`border-border bg-card text-muted-foreground group-hover:text-foreground\`),children:n.label})]},n.value)})})}var Y_={light:{bg:\`#ffffff\`,panel:\`#f4f4f5\`,line:\`#d9d9de\`,block:\`#e8e8ea\`,card:\`#fafafa\`,border:\`#e4e4e7\`},dark:{bg:\`#1c1c1c\`,panel:\`#141414\`,line:\`#3a3a3a\`,block:\`#2a2a2a\`,card:\`#212121\`,border:\`#333333\`}};function X_({variant:e}){let t=Y_[e];return(0,z.jsxs)(\`div\`,{className:\`absolute inset-0 flex gap-2 p-3\`,style:{background:t.bg},children:[(0,z.jsxs)(\`div\`,{className:\`flex w-1/4 shrink-0 flex-col gap-1.5 rounded-sm p-1.5\`,style:{background:t.panel},children:[(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-1\`,children:[(0,z.jsx)(\`div\`,{className:\`h-1.5 w-2/3 rounded-full\`,style:{background:t.line}}),(0,z.jsx)(\`div\`,{className:\`ml-auto size-2 rounded-full\`,style:{background:t.line}})]}),[80,60,70,50].map((e,n)=>(0,z.jsx)(\`div\`,{className:\`h-1.5 rounded-full\`,style:{width:\`\${e}%\`,background:t.block}},n))]}),(0,z.jsxs)(\`div\`,{className:\`flex min-w-0 flex-1 flex-col gap-1.5 rounded-sm border p-2\`,style:{background:t.card,borderColor:t.border},children:[(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-1.5\`,children:[(0,z.jsx)(\`div\`,{className:\`size-2.5 rounded-full\`,style:{background:t.block}}),(0,z.jsx)(\`div\`,{className:\`h-1.5 w-1/3 rounded-full\`,style:{background:t.line}}),(0,z.jsx)(\`div\`,{className:\`h-1.5 w-1/4 rounded-full\`,style:{background:t.block}})]}),(0,z.jsx)(\`div\`,{className:\`h-1.5 w-3/4 rounded-full\`,style:{background:t.block}}),(0,z.jsx)(\`div\`,{className:\`mt-auto h-1/2 w-full rounded-sm\`,style:{background:t.block}})]})]})}var Z_=[{value:\`light\`,label:\`Light\`},{value:\`dark\`,label:\`Dark\`},{value:\`system\`,label:\`System\`}];function Q_({value:e,onChange:t}){return(0,z.jsx)(\`div\`,{className:\`grid max-w-2xl grid-cols-1 gap-4 sm:grid-cols-3\`,children:Z_.map(n=>{let r=e===n.value;return(0,z.jsxs)(\`button\`,{onClick:()=>t(n.value),"aria-pressed":r,className:\`group relative flex h-32 flex-col overflow-hidden rounded-lg border-2 text-left transition-colors \`+(r?\`border-brand\`:\`border-border hover:border-muted-foreground\`),children:[(0,z.jsx)(\`div\`,{className:\`relative flex-1 overflow-hidden\`,children:n.value===\`system\`?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(X_,{variant:\`light\`}),(0,z.jsx)(\`div\`,{className:\`absolute inset-0\`,style:{clipPath:\`polygon(100% 0, 100% 100%, 0 100%)\`},children:(0,z.jsx)(X_,{variant:\`dark\`})})]}):(0,z.jsx)(X_,{variant:n.value})}),(0,z.jsx)(\`div\`,{className:\`flex h-8 shrink-0 items-center border-t px-3 text-xs font-medium transition-colors \`+(r?\`border-brand/40 bg-brand/10 text-foreground\`:\`border-border bg-card text-muted-foreground group-hover:text-foreground\`),children:n.label})]},n.value)})})}var $_=({children:e})=>(0,z.jsx)(\`code\`,{className:\`rounded bg-code px-1 py-px font-mono text-foreground/90\`,children:e});function ev(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(null);return(0,_.useEffect)(()=>{N.stats().then(e=>{t(e),r(!0)},()=>r(!1))},[]),e===null&&n===null?(0,z.jsx)(Jp,{}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(Sh,{title:\`Instance\`,description:\`One process — embedded Postgres, no Docker.\`,children:[(0,z.jsx)(Ch,{label:\`Status\`,description:\`Whether the admin API responds.\`,children:n?(0,z.jsx)(B,{variant:\`brand\`,children:\`Healthy\`}):(0,z.jsx)(B,{variant:\`red\`,children:\`Unreachable\`})}),(0,z.jsxs)(Ch,{label:\`Database\`,description:\`Engine version and current on-disk size.\`,children:[(0,z.jsx)(wh,{label:\`Postgres\`,value:e?.version??\`—\`}),(0,z.jsx)(wh,{label:\`Size\`,value:e?.dbSize??\`—\`}),(0,z.jsx)(wh,{label:\`Tables (public)\`,value:e?.tables??\`—\`}),(0,z.jsx)(wh,{label:\`Applied migrations\`,value:e?.migrations??\`—\`})]}),(0,z.jsxs)(Ch,{label:\`Services\`,description:\`Counts across auth and storage.\`,children:[(0,z.jsx)(wh,{label:\`Auth users\`,value:e?.users??\`—\`}),(0,z.jsx)(wh,{label:\`Buckets\`,value:e?.buckets??\`—\`}),(0,z.jsx)(wh,{label:\`Objects\`,value:e?.objects??\`—\`})]})]}),(0,z.jsx)(Sh,{title:\`Data locations\`,description:\`Configured by CLI flags when starting tinbase.\`,children:(0,z.jsx)(Ch,{label:\`On disk\`,description:\`Where this project's data lives, relative to the project directory.\`,children:(0,z.jsxs)(\`div\`,{className:\`space-y-1.5 text-xs leading-relaxed text-muted-foreground\`,children:[(0,z.jsxs)(\`p\`,{children:[\`Database: \`,(0,z.jsx)($_,{children:\`.tinbase/db\`}),\` (PGlite) or \`,(0,z.jsx)($_,{children:\`.tinbase/pgdata\`}),\` (native)\`]}),(0,z.jsxs)(\`p\`,{children:[\`Storage objects: \`,(0,z.jsx)($_,{children:\`.tinbase/storage\`})]}),(0,z.jsxs)(\`p\`,{children:[\`Override with \`,(0,z.jsx)($_,{children:\`--data-dir\`}),\` / \`,(0,z.jsx)($_,{children:\`--storage-dir\`}),\` · wipe + reseed with \`,(0,z.jsx)($_,{children:\`tinbase db reset\`})]})]})})})]})}var tv=({children:e})=>(0,z.jsx)(\`code\`,{className:\`rounded bg-code px-1 py-px font-mono text-foreground/90\`,children:e});function nv(){return(0,z.jsxs)(Sh,{title:\`JWT keys\`,description:\`All tokens — anon key, service_role key, and user sessions — are HS256 JWTs signed with one secret.\`,children:[(0,z.jsx)(Ch,{label:\`Secret\`,description:\`Never exposed over the API. Configured where tinbase starts.\`,children:(0,z.jsxs)(\`div\`,{className:\`space-y-1.5 text-xs leading-relaxed text-muted-foreground\`,children:[(0,z.jsxs)(\`p\`,{children:[(0,z.jsx)(tv,{children:\`TINBASE_JWT_SECRET\`}),\` environment variable, or the \`,(0,z.jsx)(tv,{children:\`--jwt-secret\`}),\` CLI flag.\`]}),(0,z.jsx)(\`p\`,{children:\`Without either, a well-known development default is used — fine locally, but set a real secret before exposing the server to anything.\`})]})}),(0,z.jsx)(Ch,{label:\`Rotation\`,description:\`Rotating the secret invalidates every existing token.\`,children:(0,z.jsxs)(\`ol\`,{className:\`list-inside list-decimal space-y-1.5 text-xs leading-relaxed text-muted-foreground\`,children:[(0,z.jsxs)(\`li\`,{children:[\`Restart with the new secret: \`,(0,z.jsx)(tv,{children:\`TINBASE_JWT_SECRET=… tinbase start\`})]}),(0,z.jsxs)(\`li\`,{children:[\`Grab the re-derived keys from the startup banner or \`,(0,z.jsx)(tv,{children:\`tinbase keys\`})]}),(0,z.jsx)(\`li\`,{children:\`Update every client using the old keys — and sign back in to this studio\`})]})})]})}var rv=[{id:\`general\`,label:\`General\`,component:W_},{id:\`infrastructure\`,label:\`Infrastructure\`,component:ev},{id:\`api-keys\`,label:\`API Keys\`,component:U_},{id:\`jwt\`,label:\`JWT Keys\`,component:nv}];function iv(){let{section:e}=Yt(),t=rv.some(t=>t.id===e)?e:\`general\`,n=rv.find(e=>e.id===t).component;return(0,z.jsxs)(\`div\`,{className:\`flex h-full\`,children:[(0,z.jsx)(Th,{title:\`Project Settings\`,active:t,onSelect:e=>R(\`settings\`,e),groups:[{items:rv.map(e=>({id:e.id,label:e.label}))}]}),(0,z.jsx)(\`div\`,{className:\`min-w-0 flex-1 overflow-y-auto\`,children:(0,z.jsxs)(\`div\`,{className:\`mx-auto max-w-4xl px-10 py-8\`,children:[(0,z.jsx)(\`h1\`,{className:\`border-b border-border pb-4 text-xl font-semibold text-foreground\`,children:rv.find(e=>e.id===t).label}),(0,z.jsx)(n,{})]})})]})}var av=[{kind:\`postgres\`,icon:we,title:\`Postgres\`,sub:\`Superuser\`,blurb:\`Full admin access — the service_role, which bypasses all Row Level Security (RLS) policies.\`},{kind:\`anon\`,icon:Nt,title:\`Anonymous\`,sub:\`Not logged in\`,blurb:\`The anon key — what an unauthenticated visitor sees. RLS policies apply.\`},{kind:\`authenticated\`,icon:Pt,title:\`Authenticated\`,sub:\`Specific logged in user\`,blurb:\`Impersonate a real user — auth.uid() resolves to them. RLS policies apply.\`}];function ov({value:e,onChange:t,align:n=\`end\`}){let[r,i]=(0,_.useState)(!1),[a,o]=(0,_.useState)([]);(0,_.useEffect)(()=>{r&&a.length===0&&N.users().then(o,()=>{})},[r,a.length]);async function s(e,n){try{if(e===\`postgres\`)t({kind:\`postgres\`},null);else if(e===\`anon\`){let{anonKey:e}=await N.keys();t({kind:\`anon\`},e??(await N.impersonate(\`anon\`)).token)}else{if(!n)return;let{token:e}=await N.impersonate(\`authenticated\`,{sub:n.id,email:n.email});t({kind:\`authenticated\`,sub:n.id,email:n.email},e)}(e!==\`authenticated\`||n)&&i(!1)}catch(e){H.error(e.message)}}let c=e.kind===\`authenticated\`?e.email??e.sub.slice(0,8):e.kind,l=av.find(t=>t.kind===e.kind);return(0,z.jsxs)(pf,{open:r,onOpenChange:i,align:n,className:\`w-105 p-3\`,trigger:(0,z.jsxs)(V,{variant:\`outline\`,size:\`xs\`,onClick:()=>i(e=>!e),children:[\`Role \`,(0,z.jsx)(\`span\`,{className:\`font-mono \`+(e.kind===\`postgres\`?\`text-foreground\`:\`text-brand\`),children:c}),(0,z.jsx)(me,{size:11})]}),children:[(0,z.jsx)(\`p\`,{className:\`mb-2 px-0.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/80\`,children:\`View data as a role\`}),(0,z.jsx)(\`div\`,{className:\`grid grid-cols-3 gap-2\`,children:av.map(t=>{let n=t.icon,r=e.kind===t.kind;return(0,z.jsxs)(\`button\`,{onClick:()=>t.kind===\`authenticated\`?void 0:void s(t.kind),className:\`relative rounded-md border p-3 text-left transition-colors \`+(r?\`border-foreground bg-accent/60\`:\`border-input hover:border-muted-foreground\`),children:[r&&(0,z.jsx)(\`span\`,{className:\`absolute right-2 top-2 flex size-4 items-center justify-center rounded-full bg-foreground text-background\`,children:(0,z.jsx)(pe,{size:10,strokeWidth:3})}),(0,z.jsx)(n,{size:15,className:\`text-muted-foreground\`}),(0,z.jsx)(\`p\`,{className:\`mt-2 text-[13px] font-medium text-foreground\`,children:t.title}),(0,z.jsx)(\`p\`,{className:\`text-[11px] text-muted-foreground/80\`,children:t.sub})]},t.kind)})}),(0,z.jsx)(\`div\`,{className:\`mt-2\`,children:(0,z.jsx)(Wp,{value:e.kind===\`authenticated\`?e.sub:\`\`,onValueChange:e=>{let t=a.find(t=>t.id===e);t&&s(\`authenticated\`,t)},placeholder:a.length===0?\`No auth users — sign someone up first\`:\`Impersonate a user…\`,disabled:a.length===0,options:a.map(e=>({value:e.id,label:e.email??e.id}))})}),(0,z.jsxs)(\`p\`,{className:\`mt-3 border-t border-border pt-2.5 text-[11px] leading-relaxed text-muted-foreground/80\`,children:[(0,z.jsx)(\`span\`,{className:\`font-medium text-foreground/80\`,children:l.title}),e.kind===\`postgres\`&&(0,z.jsx)(\`span\`,{className:\`ml-1.5 rounded border border-input px-1 py-px text-[9px] uppercase text-muted-foreground/80\`,children:\`default\`}),(0,z.jsx)(\`br\`,{}),l.blurb]})]})}function sv({result:e}){if(!e)return(0,z.jsx)(lf,{children:\`Run a query to see results. ⌘⏎ / Ctrl+⏎\`});if(!e.ok)return(0,z.jsxs)(\`div\`,{className:\`m-4 rounded-md border border-destructive/30 bg-destructive/10 p-3 text-[13px] text-destructive\`,children:[(0,z.jsx)(\`div\`,{className:\`font-mono\`,children:e.error}),e.code&&(0,z.jsxs)(\`div\`,{className:\`mt-1 text-xs text-destructive/70\`,children:[\`SQLSTATE \`,e.code]}),e.detail&&(0,z.jsx)(\`div\`,{className:\`mt-1 text-xs text-muted-foreground\`,children:e.detail}),e.hint&&(0,z.jsxs)(\`div\`,{className:\`mt-1 text-xs text-muted-foreground\`,children:[\`Hint: \`,e.hint]})]});let t=e.rows??[],n=t[0]?Object.keys(t[0]):[];return n.length===0?(0,z.jsxs)(lf,{children:[\`Statement executed\`,e.affectedRows==null?\`\`:\` · \${e.affectedRows} rows affected\`,\`.\`]}):(0,z.jsxs)(\`div\`,{className:\`flex h-full min-h-0 flex-col\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex shrink-0 items-center gap-3 border-b border-border px-3 py-1.5 text-xs text-muted-foreground/80\`,children:[(0,z.jsxs)(\`span\`,{children:[e.rowCount,\` row\`,e.rowCount===1?\`\`:\`s\`,\` · \`,e.ms,\` ms\`]}),(0,z.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-1\`,children:[(0,z.jsxs)(V,{variant:\`ghost\`,size:\`xs\`,onClick:()=>__(\`results.csv\`,\`text/csv\`,g_(n,t)),children:[(0,z.jsx)(Ee,{size:12}),\` CSV\`]}),(0,z.jsxs)(V,{variant:\`ghost\`,size:\`xs\`,onClick:()=>__(\`results.json\`,\`application/json\`,JSON.stringify(t,null,2)),children:[(0,z.jsx)(Ee,{size:12}),\` JSON\`]}),(0,z.jsx)(er,{variant:\`ghost\`,size:\`xs\`,label:\`results as JSON\`,value:()=>JSON.stringify(t,null,2),children:\`Copy\`})]})]}),(0,z.jsx)(\`div\`,{className:\`min-h-0 flex-1 overflow-auto\`,children:(0,z.jsxs)(Xp,{children:[(0,z.jsx)(Zp,{children:(0,z.jsx)(\`tr\`,{children:n.map(e=>(0,z.jsx)(Z,{className:\`font-mono text-foreground/80\`,children:e},e))})}),(0,z.jsx)(\`tbody\`,{children:t.map((e,t)=>(0,z.jsx)(Qp,{children:n.map(t=>(0,z.jsx)(Q,{className:\`max-w-90 cursor-cell truncate font-mono text-foreground/80\`,title:Ym(e[t])??\`Double-click to copy\`,onDoubleClick:()=>{let n=e[t];Qn(n==null?\`\`:typeof n==\`object\`?JSON.stringify(n):String(n),t)},children:(0,z.jsx)(Jm,{value:e[t]})},t))},t))})]})})]})}var cv=\`tinbase_sql_queries\`,lv=\`tinbase_sql_tabs\`,uv=\`tinbase_sql_history\`,dv=50;function fv(e,t){try{let n=localStorage.getItem(e);return n?JSON.parse(n):t}catch{return t}}function pv(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{}}var mv=()=>fv(cv,[]),hv=e=>pv(cv,e),gv=()=>fv(lv,{tabs:[],active:null}),_v=(e,t)=>pv(lv,{tabs:e,active:t}),vv=()=>fv(uv,[]);function yv(e){let t=[e,...vv()].slice(0,dv);return pv(uv,t),t}function bv(){return pv(uv,[]),[]}var xv=()=>crypto.randomUUID();function Sv(e,t){if(t)return t.name;let n=e.replace(/--[^\\n]*/g,\` \`).replace(/\\/\\*[\\s\\S]*?\\*\\//g,\` \`).replace(/\\s+/g,\` \`).trim();return n?n.length>32?n.slice(0,32)+\`…\`:n:\`Untitled query\`}function Cv(e,t){if(!t)return e;let n=e.trim().replace(/;+\\s*$/,\`\`);return!/^\\s*(select|with)\\b/i.test(n)||/\\blimit\\s+\\d+/i.test(n)?e:\`\${n} limit \${t}\`}var wv=/\\b(select|from|where|group by|order by|having|limit|offset|left join|right join|inner join|join|union|insert into|values|update|set|delete from|returning)\\b/gi;function Tv(e){return e.replace(wv,e=>\`\\n\${e.toUpperCase()}\`).replace(/^\\n/,\`\`).replace(/\\n{2,}/g,\`
|
|
1566
|
+
\`).trim()}var Ev=!1;function Dv(e){Ev||(Ev=!0,sn.default.require(\`ace/ext/language_tools\`).addCompleter({getCompletions:(t,n,r,i,a)=>{a(null,e().map(e=>({...e,score:500})))}}))}function Ov(){let[e,t]=(0,_.useState)(mv),[n,r]=(0,_.useState)(\`\`),[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(null),c=gv(),[l,u]=(0,_.useState)(c.tabs.length?c.tabs:[{id:xv(),queryId:null,sql:\`\`}]),[d,f]=(0,_.useState)(c.active??(c.tabs[0]?.id||\`\`)),p=l.find(e=>e.id===d)??l[0],[m,h]=(0,_.useState)({kind:\`postgres\`}),[g,v]=(0,_.useState)(100),[y,b]=(0,_.useState)(null),[x,S]=(0,_.useState)(!1),[C,w]=(0,_.useState)(vv),[T,E]=(0,_.useState)(!1),[D,O]=(0,_.useState)(!1),k=(0,_.useRef)([]);(0,_.useEffect)(()=>{Dv(()=>k.current),N.tables().then(e=>{let t=[];for(let n of e){t.push({caption:n.name,value:n.name,meta:\`table\`});for(let e of n.columns)t.push({caption:\`\${n.name}.\${e.name}\`,value:e.name,meta:e.type})}k.current=t},()=>{})},[]),(0,_.useEffect)(()=>_v(l,p?.id??null),[l,p]);let A=(0,_.useCallback)(e=>{t(e),hv(e)},[]);if(!p)return(0,z.jsx)(lf,{children:\`Something went wrong — reload.\`});let j=t=>e.find(e=>e.id===t.queryId)??null,M=e=>{let t=j(e);return t?t.sql!==e.sql:e.sql.trim()!==\`\`};function ee(e){u(t=>t.map(t=>t.id===d?{...t,sql:e}:t))}function te(e=\`\`,t=null){let n={id:xv(),queryId:t,sql:e};u(e=>[...e,n]),f(n.id),b(null)}function P(e){u(t=>{let n=t.filter(t=>t.id!==e);if(n.length===0){let e={id:xv(),queryId:null,sql:\`\`};return f(e.id),[e]}return e===d&&f(n[Math.max(0,t.findIndex(t=>t.id===e)-1)].id),n})}function F(e){let t=l.find(t=>t.queryId===e.id);t?f(t.id):te(e.sql,e.id)}function ne(t){let n=j(p);if(n)A(e.map(e=>e.id===n.id?{...e,sql:p.sql,updatedAt:Date.now()}:e)),H.success(\`Saved "\${n.name}"\`);else if(t){let n={id:xv(),name:t,sql:p.sql,favorite:!1,updatedAt:Date.now()};A([n,...e]),u(e=>e.map(e=>e.id===d?{...e,queryId:n.id}:e)),H.success(\`Saved "\${t}"\`)}else O(!0)}async function re(){let e=p.sql.trim();if(!e||x)return;S(!0);let t=m.kind===\`postgres\`?void 0:m.kind===\`anon\`?{role:\`anon\`,claims:{role:\`anon\`}}:{role:\`authenticated\`,claims:{role:\`authenticated\`,sub:m.sub,email:m.email}};try{let n=await N.sql(Cv(e,g),t);b(n),w(yv({sql:e,ts:Date.now(),ms:n.ms,ok:n.ok,rows:n.rowCount}))}catch(e){b({ok:!1,error:e instanceof Error?e.message:String(e)})}finally{S(!1)}}let ie=n.toLowerCase(),ae=e.filter(e=>e.name.toLowerCase().includes(ie)||e.sql.toLowerCase().includes(ie)),oe=ae.filter(e=>e.favorite),I=ae.filter(e=>!e.favorite);return(0,z.jsxs)(\`div\`,{className:\`flex h-full\`,children:[(0,z.jsxs)(hf,{id:\`sql-saved\`,side:\`left\`,defaultSize:240,min:200,max:400,className:\`flex flex-col border-r border-border bg-card\`,children:[(0,z.jsx)(\`div\`,{className:\`px-4 pb-1 pt-4 text-sm font-semibold text-foreground\`,children:\`SQL Editor\`}),(0,z.jsxs)(\`div\`,{className:\`space-y-1.5 px-2 pb-2 pt-1\`,children:[(0,z.jsxs)(V,{variant:\`outline\`,size:\`xs\`,className:\`w-full\`,onClick:()=>te(),children:[(0,z.jsx)(mt,{size:12}),\` New query\`]}),(0,z.jsxs)(\`div\`,{className:\`relative\`,children:[(0,z.jsx)(vt,{size:13,className:\`pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground/60\`}),(0,z.jsx)(\`input\`,{value:n,onChange:e=>r(e.target.value),placeholder:\`Search queries…\`,className:\`h-7 w-full rounded-md border border-border bg-field pl-7 pr-2 text-xs text-foreground placeholder:text-muted-foreground/60 focus:border-muted-foreground focus:outline-none\`})]})]}),(0,z.jsxs)(\`div\`,{className:\`min-h-0 flex-1 overflow-y-auto pb-2\`,children:[oe.length>0&&(0,z.jsx)(kv,{title:\`Favorites\`,items:oe,onOpen:F,onRename:a,onDelete:s,onFav:t=>A(e.map(e=>e.id===t.id?{...e,favorite:!e.favorite}:e))}),(0,z.jsx)(kv,{title:\`Saved (\${I.length})\`,items:I,onOpen:F,onRename:a,onDelete:s,onFav:t=>A(e.map(e=>e.id===t.id?{...e,favorite:!e.favorite}:e))}),ae.length===0&&(0,z.jsx)(\`p\`,{className:\`px-4 py-6 text-center text-xs text-muted-foreground/60\`,children:e.length===0?\`No saved queries yet — write one and hit Save.\`:\`No match.\`})]})]}),(0,z.jsxs)(\`div\`,{className:\`flex min-w-0 flex-1 flex-col\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex shrink-0 items-center gap-px overflow-x-auto border-b border-border bg-card px-1 pt-1\`,children:[l.map(e=>(0,z.jsxs)(\`div\`,{className:\`group flex shrink-0 cursor-pointer items-center gap-1.5 rounded-t-md border-x border-t px-3 py-1.5 text-xs \`+(e.id===d?\`border-border bg-background text-foreground\`:\`border-transparent text-muted-foreground hover:text-foreground\`),onClick:()=>f(e.id),children:[(0,z.jsx)(\`span\`,{className:\`max-w-40 truncate\`,children:Sv(e.sql,j(e))}),M(e)&&(0,z.jsx)(\`span\`,{className:\`size-1.5 shrink-0 rounded-full bg-brand\`,title:\`Unsaved changes\`}),(0,z.jsx)(\`button\`,{className:\`rounded p-px text-muted-foreground/60 opacity-0 hover:bg-accent hover:text-foreground group-hover:opacity-100\`,onClick:t=>{t.stopPropagation(),P(e.id)},children:(0,z.jsx)(Lt,{size:11})})]},e.id)),(0,z.jsx)(\`button\`,{className:\`ml-1 rounded p-1 text-muted-foreground/80 hover:bg-accent hover:text-foreground\`,title:\`New tab\`,onClick:()=>te(),children:(0,z.jsx)(mt,{size:13})})]}),(0,z.jsxs)(\`div\`,{className:\`flex shrink-0 items-center gap-1.5 border-b border-border px-3 py-1.5\`,children:[(0,z.jsx)(ov,{align:\`start\`,value:m,onChange:e=>h(e)}),(0,z.jsx)(Wp,{size:\`xs\`,className:\`w-26 shrink-0\`,value:g===null?\`none\`:String(g),onValueChange:e=>v(e===\`none\`?null:parseInt(e,10)),options:[{value:\`100\`,label:\`Limit 100\`},{value:\`500\`,label:\`Limit 500\`},{value:\`1000\`,label:\`Limit 1000\`},{value:\`none\`,label:\`No limit\`}]}),(0,z.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-1.5\`,children:[(0,z.jsxs)(pf,{open:T,onOpenChange:E,align:\`end\`,className:\`max-h-96 w-105 overflow-y-auto p-1.5\`,trigger:(0,z.jsxs)(V,{variant:\`ghost\`,size:\`xs\`,onClick:()=>E(e=>!e),children:[(0,z.jsx)(He,{size:12}),\` History\`]}),children:[C.length===0&&(0,z.jsx)(\`p\`,{className:\`px-3 py-4 text-center text-xs text-muted-foreground/60\`,children:\`No runs yet.\`}),C.map((e,t)=>(0,z.jsxs)(\`button\`,{className:\`block w-full rounded px-2.5 py-1.5 text-left hover:bg-accent\`,onClick:()=>{te(e.sql),E(!1)},children:[(0,z.jsx)(\`span\`,{className:\`block truncate font-mono text-xs text-foreground/80\`,children:e.sql}),(0,z.jsxs)(\`span\`,{className:\`text-[10px] text-muted-foreground/60\`,children:[(0,z.jsx)(qm,{value:e.ts,format:\`time\`}),\` · \`,e.ok?\`\${e.rows??0} rows · \${e.ms} ms\`:\`error\`]})]},t)),C.length>0&&(0,z.jsx)(\`button\`,{className:\`mt-1 w-full rounded px-2.5 py-1.5 text-left text-xs text-muted-foreground hover:bg-accent\`,onClick:()=>w(bv()),children:\`Clear history\`})]}),(0,z.jsxs)(V,{variant:\`ghost\`,size:\`xs\`,title:\`Format query\`,onClick:()=>ee(Tv(p.sql)),children:[(0,z.jsx)(Ft,{size:12}),\` Format\`]}),(0,z.jsx)(V,{variant:\`outline\`,size:\`xs\`,onClick:()=>ne(),disabled:!p.sql.trim(),children:j(p)?\`Save\`:\`Save as…\`}),(0,z.jsxs)(V,{size:\`xs\`,onClick:()=>void re(),disabled:x||!p.sql.trim(),children:[(0,z.jsx)(ft,{size:12}),\` \`,x?\`Running…\`:\`Run\`,\` \`,(0,z.jsx)(uf,{children:\`⌘⏎\`})]})]})]}),(0,z.jsx)(\`div\`,{className:\`min-h-0 flex-1 p-3 pb-0\`,children:(0,z.jsx)(ir,{lang:\`sql\`,className:\`h-full\`,value:p.sql,onChange:ee,onCmdEnter:()=>void re(),placeholder:\`select * from … (⌘⏎ to run)\`})}),(0,z.jsx)(hf,{id:\`sql-results\`,axis:\`y\`,side:\`right\`,defaultSize:300,min:140,max:640,className:\`overflow-hidden border-t border-border\`,children:(0,z.jsx)(sv,{result:y})})]}),i&&(0,z.jsx)(Av,{query:i,onClose:()=>a(null),onSave:t=>{A(e.map(e=>e.id===i.id?{...e,name:t}:e)),a(null)}}),D&&(0,z.jsx)(jv,{suggested:Sv(p.sql,null),onClose:()=>O(!1),onSave:e=>{ne(e),O(!1)}}),o&&(0,z.jsx)(q,{open:!0,danger:!0,title:\`Delete query "\${o.name}"?\`,description:\`The saved query will be removed from this browser.\`,confirmLabel:\`Delete query\`,onConfirm:()=>{A(e.filter(e=>e.id!==o.id)),u(e=>e.map(e=>e.queryId===o.id?{...e,queryId:null}:e))},onClose:()=>s(null)})]})}function kv({title:e,items:t,onOpen:n,onRename:r,onDelete:i,onFav:a}){return(0,z.jsxs)(\`div\`,{className:\`pt-2\`,children:[(0,z.jsx)(\`p\`,{className:\`px-4 pb-1 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/60\`,children:e}),t.map(e=>(0,z.jsxs)(\`div\`,{className:\`group flex items-center gap-1 pl-4 pr-1.5 text-[13px] text-muted-foreground hover:bg-accent/50\`,children:[(0,z.jsxs)(\`button\`,{className:\`flex min-w-0 flex-1 items-center gap-1.5 py-1.5 text-left\`,onClick:()=>n(e),title:e.sql,children:[e.favorite&&(0,z.jsx)(Ve,{size:10,className:\`shrink-0 fill-brand text-brand\`}),(0,z.jsx)(\`span\`,{className:\`truncate\`,children:e.name})]}),(0,z.jsxs)(Qd,{children:[(0,z.jsx)($d,{asChild:!0,children:(0,z.jsx)(\`button\`,{className:\`hidden shrink-0 rounded p-1 text-muted-foreground/80 hover:bg-muted hover:text-foreground group-hover:block data-[state=open]:block\`,children:(0,z.jsx)(De,{size:12})})}),(0,z.jsxs)(nf,{align:\`start\`,children:[(0,z.jsxs)(rf,{onSelect:()=>a(e),children:[(0,z.jsx)(Ve,{size:13}),\` \`,e.favorite?\`Unfavorite\`:\`Favorite\`]}),(0,z.jsxs)(rf,{onSelect:()=>r(e),children:[(0,z.jsx)(lt,{size:13}),\` Rename\`]}),(0,z.jsx)(sf,{}),(0,z.jsxs)(rf,{danger:!0,onSelect:()=>i(e),children:[(0,z.jsx)(At,{size:13}),\` Delete\`]})]})]})]},e.id))]})}function Av({query:e,onClose:t,onSave:n}){let[r,i]=(0,_.useState)(e.name);return(0,z.jsx)(go,{open:!0,onClose:t,title:\`Rename query\`,children:(0,z.jsxs)(\`div\`,{className:\`space-y-3\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Name\`}),(0,z.jsx)(Y,{value:r,autoFocus:!0,onChange:e=>i(e.target.value),onKeyDown:e=>e.key===\`Enter\`&&r.trim()&&n(r.trim())})]}),(0,z.jsxs)(\`div\`,{className:\`flex justify-end gap-2\`,children:[(0,z.jsx)(V,{variant:\`outline\`,onClick:t,children:\`Cancel\`}),(0,z.jsx)(V,{onClick:()=>n(r.trim()),disabled:!r.trim(),children:\`Rename\`})]})]})})}function jv({suggested:e,onClose:t,onSave:n}){let[r,i]=(0,_.useState)(e===\`Untitled query\`?\`\`:e);return(0,z.jsx)(go,{open:!0,onClose:t,title:\`Save query\`,children:(0,z.jsxs)(\`div\`,{className:\`space-y-3\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Name\`}),(0,z.jsx)(Y,{value:r,autoFocus:!0,placeholder:\`My query\`,onChange:e=>i(e.target.value),onKeyDown:e=>e.key===\`Enter\`&&r.trim()&&n(r.trim())})]}),(0,z.jsxs)(\`div\`,{className:\`flex justify-end gap-2\`,children:[(0,z.jsx)(V,{variant:\`outline\`,onClick:t,children:\`Cancel\`}),(0,z.jsx)(V,{onClick:()=>n(r.trim()),disabled:!r.trim(),children:\`Save\`})]})]})})}function Mv({bucket:e}){let[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(!1),[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(null),l=(0,_.useCallback)(()=>{N.policies(\`storage\`).then(e=>n(e.filter(e=>e.table===\`objects\`)),()=>n([]))},[]);(0,_.useEffect)(()=>{l();let e=setInterval(()=>void l(),5e3);return()=>clearInterval(e)},[l]);async function u(e){try{await N.dropPolicy(\`objects\`,e.name,\`storage\`),H.success(\`Dropped policy \${e.name}\`),l()}catch(e){H.error(e.message)}}if(t===null)return(0,z.jsx)(Jp,{});let d=t=>\`\${t.using_expr??\`\`} \${t.with_check??\`\`}\`.includes(\`'\${e}'\`),f=e?t.filter(d):[],p=e?t.filter(e=>!d(e)):t,m=e=>(0,z.jsxs)(\`div\`,{className:\`cursor-pointer rounded-md border border-border bg-card p-3 transition-colors hover:border-muted-foreground/60\`,title:\`Edit policy\`,onClick:()=>o(e),children:[(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-2\`,children:[(0,z.jsx)(\`span\`,{className:\`truncate font-mono text-[13px] text-foreground\`,children:e.name}),(0,z.jsx)(B,{variant:\`blue\`,children:e.cmd}),String(e.permissive).toUpperCase()!==\`PERMISSIVE\`&&(0,z.jsx)(B,{variant:\`red\`,children:\`restrictive\`}),(0,z.jsx)(B,{variant:\`neutral\`,children:Array.isArray(e.roles)?e.roles.join(\`, \`):String(e.roles)}),(0,z.jsx)(\`button\`,{className:\`ml-auto p-1 text-muted-foreground/80 hover:text-destructive\`,title:\`Drop policy\`,onClick:t=>{t.stopPropagation(),c(e)},children:(0,z.jsx)(At,{size:13})})]}),e.using_expr&&(0,z.jsxs)(\`p\`,{className:\`mt-1.5 truncate font-mono text-[11px] text-muted-foreground/80\`,title:e.using_expr,children:[\`using (\`,e.using_expr,\`)\`]}),e.with_check&&(0,z.jsxs)(\`p\`,{className:\`mt-0.5 truncate font-mono text-[11px] text-muted-foreground/80\`,title:e.with_check,children:[\`with check (\`,e.with_check,\`)\`]})]},e.name);return(0,z.jsxs)(\`div\`,{className:\`h-full overflow-y-auto px-6 py-5\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex max-w-2xl items-start justify-between gap-4\`,children:[(0,z.jsxs)(\`p\`,{className:\`text-xs text-muted-foreground/80\`,children:[\`Object access is controlled by RLS policies on \`,(0,z.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`storage.objects\`}),\`. The service_role (this studio) bypasses them; your app's anon/authenticated requests do not. Scope a policy to a bucket with\`,\` \`,(0,z.jsxs)(\`code\`,{className:\`text-muted-foreground\`,children:[\`bucket_id = '\`,e??\`name\`,\`'\`]}),\`.\`]}),(0,z.jsxs)(V,{size:\`xs\`,className:\`shrink-0\`,onClick:()=>i(!0),children:[(0,z.jsx)(mt,{size:12}),\` New policy\`]})]}),(0,z.jsxs)(\`div\`,{className:\`mt-4 max-w-2xl space-y-5\`,children:[e&&(0,z.jsxs)(\`div\`,{children:[(0,z.jsxs)(\`p\`,{className:\`mb-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/60\`,children:[\`Policies for \`,e,\` \`,(0,z.jsx)(\`span\`,{className:\`text-muted-foreground/40\`,children:f.length})]}),(0,z.jsxs)(\`div\`,{className:\`space-y-2\`,children:[f.map(m),f.length===0&&(0,z.jsx)(\`p\`,{className:\`rounded-md border border-dashed border-border px-3 py-3 text-center text-xs text-muted-foreground/60\`,children:\`No policies mention this bucket yet.\`})]})]}),(0,z.jsxs)(\`div\`,{children:[e&&(0,z.jsxs)(\`p\`,{className:\`mb-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/60\`,children:[\`Other policies on storage.objects \`,(0,z.jsx)(\`span\`,{className:\`text-muted-foreground/40\`,children:p.length})]}),(0,z.jsxs)(\`div\`,{className:\`space-y-2\`,children:[p.map(m),t.length===0&&(0,z.jsx)(lf,{children:\`No policies on storage.objects — only the service_role can access objects in private buckets. Create one to open access up.\`})]})]})]}),r&&(0,z.jsx)(Og,{table:\`objects\`,schema:\`storage\`,onClose:()=>i(!1),onCreated:async()=>l()}),a&&(0,z.jsx)(Og,{table:\`objects\`,schema:\`storage\`,existing:jg(a),onClose:()=>o(null),onCreated:async()=>l()}),s&&(0,z.jsx)(q,{open:!0,danger:!0,title:\`Drop policy "\${s.name}"?\`,description:\`Object access rules change immediately.\`,confirmLabel:\`Drop policy\`,onConfirm:()=>void u(s),onClose:()=>c(null)})]})}var Nv=e=>e==null?\`Unlimited\`:e<1024*1024?\`\${(e/1024).toFixed(0)} KB\`:\`\${(e/1024/1024).toFixed(0)} MB\`;function Pv({bucket:e,onDelete:t}){return(0,z.jsxs)(\`div\`,{className:\`h-full overflow-y-auto px-6 py-5\`,children:[(0,z.jsxs)(\`div\`,{className:\`max-w-2xl divide-y divide-border/70\`,children:[(0,z.jsx)(Fv,{label:\`Visibility\`,description:\`Public buckets serve objects without authentication.\`,children:e.public?(0,z.jsx)(B,{variant:\`brand\`,children:\`public\`}):(0,z.jsx)(B,{variant:\`neutral\`,children:\`private\`})}),(0,z.jsx)(Fv,{label:\`File size limit\`,description:\`Uploads above the limit are rejected.\`,children:(0,z.jsx)(\`span\`,{className:\`font-mono text-[13px] text-foreground/90\`,children:Nv(e.file_size_limit)})}),(0,z.jsx)(Fv,{label:\`Allowed MIME types\`,description:\`Empty means every type is accepted.\`,children:e.allowed_mime_types?.length?(0,z.jsx)(\`div\`,{className:\`flex flex-wrap gap-1.5\`,children:e.allowed_mime_types.map(e=>(0,z.jsx)(B,{variant:\`outline\`,className:\`font-mono\`,children:e},e))}):(0,z.jsx)(\`span\`,{className:\`text-[13px] text-muted-foreground\`,children:\`Any\`})}),(0,z.jsx)(Fv,{label:\`Created\`,description:\`\`,children:(0,z.jsx)(\`span\`,{className:\`font-mono text-[13px] text-foreground/90\`,children:(0,z.jsx)(qm,{value:e.created_at})})}),(0,z.jsx)(Fv,{label:\`Delete bucket\`,description:\`The bucket must be empty. This cannot be undone.\`,children:(0,z.jsxs)(V,{variant:\`danger\`,size:\`xs\`,onClick:t,children:[(0,z.jsx)(At,{size:12}),\` Delete bucket\`]})})]}),(0,z.jsxs)(\`p\`,{className:\`mt-4 max-w-2xl text-[11px] text-muted-foreground/60\`,children:[\`Limits and visibility are set when the bucket is created (or via \`,(0,z.jsx)(\`code\`,{children:\`supabase-js\`}),\`'s\`,\` \`,(0,z.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`updateBucket\`}),\`).\`]})]})}function Fv({label:e,description:t,children:n}){return(0,z.jsxs)(\`div\`,{className:\`flex flex-col gap-3 py-5 sm:flex-row sm:items-start sm:gap-10\`,children:[(0,z.jsxs)(\`div\`,{className:\`w-56 shrink-0\`,children:[(0,z.jsx)(\`p\`,{className:\`text-[13px] font-medium text-foreground\`,children:e}),t&&(0,z.jsx)(\`p\`,{className:\`mt-1 text-xs leading-relaxed text-muted-foreground/80\`,children:t})]}),(0,z.jsx)(\`div\`,{className:\`min-w-0 flex-1 pt-0.5\`,children:n})]})}var Iv=e=>e.id===null&&!e.metadata;function Lv(e){return e==null?\`—\`:e<1024?\`\${e} B\`:e<1024*1024?\`\${(e/1024).toFixed(1)} KB\`:\`\${(e/1024/1024).toFixed(1)} MB\`}function Rv({bucket:e}){let[t,n]=(0,_.useState)(\`\`),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(new Set),[s,c]=(0,_.useState)(null),[l,u]=(0,_.useState)(!1),[d,f]=(0,_.useState)(!1),p=(0,_.useRef)(null),m=(0,_.useCallback)(async()=>{try{i(await N.listObjects(e.id,t))}catch(e){H.error(e.message),i([])}},[e.id,t]);(0,_.useEffect)(()=>{o(new Set),c(null),m()},[m]);let h=e=>t?\`\${t}/\${e.name}\`:e.name;async function g(n){for(let r of Array.from(n))try{await N.uploadObject(e.id,t?\`\${t}/\${r.name}\`:r.name,r)}catch(e){H.error(\`\${r.name}: \${e.message}\`)}H.success(\`Uploaded \${n.length} file\${n.length===1?\`\`:\`s\`}\`),await m()}async function v(){try{await N.removeObjects(e.id,[...a]),H.success(\`Deleted \${a.size} object\${a.size===1?\`\`:\`s\`}\`),o(new Set),await m()}catch(e){H.error(e.message)}}async function y(t){let n=h(t);if(e.public)await Qn(\`\${lh()}/storage/v1/object/public/\${e.id}/\${n}\`,\`Public URL\`);else try{await Qn(await N.signUrl(e.id,n,3600),\`Signed URL (1h)\`)}catch(e){H.error(e.message)}}if(r===null)return(0,z.jsx)(Jp,{});let b=t?t.split(\`/\`):[],x=r.filter(e=>!Iv(e)).map(h),S=x.length>0&&x.every(e=>a.has(e));return(0,z.jsxs)(\`div\`,{className:\`relative flex h-full min-h-0\`,onDragOver:e=>{e.preventDefault(),f(!0)},onDragLeave:()=>f(!1),onDrop:e=>{e.preventDefault(),f(!1),e.dataTransfer.files.length&&g(e.dataTransfer.files)},children:[(0,z.jsxs)(\`div\`,{className:\`flex min-w-0 flex-1 flex-col\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex shrink-0 items-center gap-1 border-b border-border px-4 py-2 text-[13px]\`,children:[(0,z.jsxs)(\`button\`,{className:\`flex items-center gap-1 text-muted-foreground hover:text-foreground\`,onClick:()=>n(\`\`),children:[(0,z.jsx)(Ue,{size:12}),\` \`,e.id]}),b.map((e,t)=>(0,z.jsxs)(\`span\`,{className:\`flex items-center gap-1\`,children:[(0,z.jsx)(ge,{size:11,className:\`text-muted-foreground/60\`}),(0,z.jsx)(\`button\`,{className:\`font-mono text-muted-foreground hover:text-foreground\`,onClick:()=>n(b.slice(0,t+1).join(\`/\`)),children:e})]},t)),(0,z.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-1.5\`,children:[a.size>0&&(0,z.jsxs)(V,{variant:\`dangerSolid\`,size:\`xs\`,onClick:()=>u(!0),children:[(0,z.jsx)(At,{size:12}),\` Delete \`,a.size]}),(0,z.jsx)(V,{variant:\`ghost\`,size:\`iconXs\`,title:\`Refresh\`,onClick:()=>void m(),children:(0,z.jsx)(gt,{size:13})}),(0,z.jsx)(\`input\`,{ref:p,type:\`file\`,multiple:!0,className:\`hidden\`,onChange:e=>e.target.files&&void g(e.target.files)}),(0,z.jsxs)(V,{size:\`xs\`,onClick:()=>p.current?.click(),children:[(0,z.jsx)(Mt,{size:12}),\` Upload\`]})]})]}),(0,z.jsxs)(\`div\`,{className:\`min-h-0 flex-1 overflow-auto\`,children:[(0,z.jsxs)(Xp,{children:[(0,z.jsx)(Zp,{children:(0,z.jsxs)(\`tr\`,{children:[(0,z.jsx)(Z,{className:\`w-10\`,children:(0,z.jsx)($t,{checked:S,indeterminate:!S&&x.some(e=>a.has(e)),disabled:x.length===0,onChange:e=>o(e?new Set(x):new Set)})}),(0,z.jsx)(Z,{children:\`Name\`}),(0,z.jsx)(Z,{children:\`Size\`}),(0,z.jsx)(Z,{children:\`Type\`}),(0,z.jsx)(Z,{children:\`Modified\`}),(0,z.jsx)(Z,{className:\`w-16\`})]})}),(0,z.jsx)(\`tbody\`,{children:r.map(t=>{let r=Iv(t),i=h(t);return(0,z.jsxs)(Qp,{className:\`cursor-pointer\`,onClick:()=>r?n(i):c(t),children:[(0,z.jsx)(Q,{onClick:e=>e.stopPropagation(),children:!r&&(0,z.jsx)($t,{checked:a.has(i),onChange:e=>o(t=>{let n=new Set(t);return e?n.add(i):n.delete(i),n})})}),(0,z.jsx)(Q,{className:\`font-mono text-foreground/90\`,children:(0,z.jsxs)(\`span\`,{className:\`flex items-center gap-2\`,children:[r?(0,z.jsx)(Ie,{size:13,className:\`text-info\`}):(0,z.jsx)(Ne,{size:13,className:\`text-muted-foreground/70\`}),t.name]})}),(0,z.jsx)(Q,{className:\`text-muted-foreground\`,children:r?\`—\`:Lv(t.metadata?.size)}),(0,z.jsx)(Q,{className:\`text-muted-foreground\`,children:r?\`folder\`:t.metadata?.mimetype??\`—\`}),(0,z.jsx)(Q,{className:\`text-muted-foreground\`,children:(0,z.jsx)(qm,{value:t.updated_at})}),(0,z.jsx)(Q,{onClick:e=>e.stopPropagation(),children:!r&&(0,z.jsxs)(\`div\`,{className:\`flex justify-end gap-0.5 opacity-0 group-hover:opacity-100\`,children:[(0,z.jsx)(\`button\`,{className:\`p-1 text-muted-foreground/80 hover:text-foreground\`,title:e.public?\`Copy public URL\`:\`Copy signed URL (1h)\`,onClick:()=>void y(t),children:(0,z.jsx)(Ye,{size:13})}),(0,z.jsx)(\`button\`,{className:\`p-1 text-muted-foreground/80 hover:text-destructive\`,title:\`Delete\`,onClick:()=>{o(new Set([i])),u(!0)},children:(0,z.jsx)(At,{size:13})})]})})]},t.name)})})]}),r.length===0&&(0,z.jsxs)(lf,{children:[\`Empty\`,t?\` folder\`:\` bucket\`,\` — drop files here or hit Upload.\`]})]})]}),s&&(0,z.jsx)(zv,{bucket:e,path:h(s),entry:s,onClose:()=>c(null),onCopyUrl:()=>void y(s)}),d&&(0,z.jsx)(\`div\`,{className:\`pointer-events-none absolute inset-0 z-10 flex items-center justify-center border-2 border-dashed border-brand bg-brand/5\`,children:(0,z.jsxs)(\`p\`,{className:\`rounded-md bg-popover px-4 py-2 text-sm text-foreground shadow-lg\`,children:[\`Drop to upload\`,t?\` into \${t}/\`:\`\`]})}),l&&(0,z.jsx)(q,{open:!0,danger:!0,title:\`Delete \${a.size} object\${a.size===1?\`\`:\`s\`}?\`,description:\`Objects are permanently removed from the bucket.\`,confirmLabel:\`Delete\`,onConfirm:()=>void v(),onClose:()=>u(!1)})]})}function zv({bucket:e,path:t,entry:n,onClose:r,onCopyUrl:i}){let[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(!1),l=n.metadata?.mimetype??\`\`,u=l.startsWith(\`image/\`),d=l.startsWith(\`text/\`)||l===\`application/json\`,[f,p]=(0,_.useState)(null);return(0,_.useEffect)(()=>{let n=null;if(o(null),p(null),c(!1),!(!u&&!d))return N.downloadObject(e.id,t).then(async e=>{u?(n=URL.createObjectURL(e),o(n)):p((await e.text()).slice(0,4e3))},()=>c(!0)),()=>{n&&URL.revokeObjectURL(n)}},[e.id,t,u,d]),(0,z.jsxs)(hf,{id:\`storage-preview\`,side:\`right\`,defaultSize:320,min:260,max:560,className:\`flex flex-col border-l border-border bg-card\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex items-center justify-between border-b border-border px-4 py-2.5\`,children:[(0,z.jsx)(\`span\`,{className:\`truncate font-mono text-[13px] text-foreground\`,children:n.name}),(0,z.jsx)(\`button\`,{className:\`text-muted-foreground/80 hover:text-foreground\`,onClick:r,children:\`✕\`})]}),(0,z.jsxs)(\`div\`,{className:\`min-h-0 flex-1 overflow-y-auto p-4\`,children:[u&&(a?(0,z.jsx)(\`img\`,{src:a,alt:n.name,className:\`max-h-64 w-full rounded-md border border-border object-contain\`}):s?(0,z.jsx)(\`p\`,{className:\`text-xs text-destructive\`,children:\`Preview failed.\`}):(0,z.jsx)(\`div\`,{className:\`h-40 animate-pulse rounded-md bg-accent\`})),d&&f!==null&&(0,z.jsx)(\`pre\`,{className:\`max-h-64 overflow-auto rounded-md border border-border bg-code p-2 font-mono text-[11px] text-foreground/80\`,children:f}),!u&&!d&&(0,z.jsxs)(\`p\`,{className:\`text-xs text-muted-foreground/80\`,children:[\`No inline preview for \`,l||\`this type\`,\`.\`]}),(0,z.jsxs)(\`div\`,{className:\`mt-4 space-y-1.5 text-[13px]\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex justify-between gap-4\`,children:[(0,z.jsx)(\`span\`,{className:\`text-muted-foreground\`,children:\`Size\`}),(0,z.jsx)(\`span\`,{className:\`font-mono text-foreground/90\`,children:Lv(n.metadata?.size)})]}),(0,z.jsxs)(\`div\`,{className:\`flex justify-between gap-4\`,children:[(0,z.jsx)(\`span\`,{className:\`text-muted-foreground\`,children:\`Type\`}),(0,z.jsx)(\`span\`,{className:\`truncate font-mono text-foreground/90\`,children:l||\`—\`})]}),(0,z.jsxs)(\`div\`,{className:\`flex justify-between gap-4\`,children:[(0,z.jsx)(\`span\`,{className:\`text-muted-foreground\`,children:\`Path\`}),(0,z.jsx)(\`span\`,{className:\`truncate font-mono text-foreground/90\`,title:t,children:t})]})]}),(0,z.jsxs)(V,{variant:\`outline\`,size:\`xs\`,className:\`mt-4 w-full\`,onClick:i,children:[(0,z.jsx)(Ye,{size:12}),\` \`,e.public?\`Copy public URL\`:\`Copy signed URL (1h)\`]})]})]})}function Bv(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(\`files\`),[i,a]=(0,_.useState)(!1),[o,s]=(0,_.useState)(null),{section:c}=Yt(),l=(0,_.useCallback)(async()=>{try{let e=await N.buckets();return t(e),e}catch{return t([]),[]}},[]);if((0,_.useEffect)(()=>{l()},[l]),e===null)return(0,z.jsx)(Jp,{});let u=e.find(e=>e.id===c)??null;!u&&e.length>0&&c===null&&R(\`storage\`,e[0].id,{replace:!0});async function d(e){try{await N.deleteBucket(e.id),H.success(\`Deleted bucket \${e.id}\`),R(\`storage\`,(await l())[0]?.id??null,{replace:!0})}catch(e){H.error(e.message)}}return(0,z.jsxs)(\`div\`,{className:\`flex h-full\`,children:[(0,z.jsxs)(hf,{id:\`storage-rail\`,side:\`left\`,defaultSize:224,min:180,max:360,className:\`flex flex-col border-r border-border bg-card\`,children:[(0,z.jsx)(\`div\`,{className:\`px-4 pb-1 pt-4 text-sm font-semibold text-foreground\`,children:\`Storage\`}),(0,z.jsx)(\`div\`,{className:\`px-2 pb-2 pt-1\`,children:(0,z.jsxs)(V,{variant:\`outline\`,size:\`xs\`,className:\`w-full\`,onClick:()=>a(!0),children:[(0,z.jsx)(mt,{size:12}),\` New bucket\`]})}),(0,z.jsxs)(\`div\`,{className:\`min-h-0 flex-1 overflow-y-auto px-2 pb-3\`,children:[e.map(e=>(0,z.jsxs)(\`button\`,{onClick:()=>R(\`storage\`,e.id),className:\`mb-px flex w-full items-center gap-2 rounded-md px-2.5 py-1.5 text-left text-[13px] transition-colors \`+(u?.id===e.id?\`bg-accent text-foreground\`:\`text-muted-foreground hover:bg-accent/50 hover:text-foreground\`),children:[(0,z.jsx)(\`span\`,{className:\`min-w-0 flex-1 truncate font-mono\`,children:e.id}),e.public&&(0,z.jsx)(B,{variant:\`brand\`,children:\`public\`})]},e.id)),e.length===0&&(0,z.jsx)(\`p\`,{className:\`px-3 py-4 text-center text-xs text-muted-foreground/60\`,children:\`No buckets yet.\`})]})]}),(0,z.jsx)(\`div\`,{className:\`flex min-w-0 flex-1 flex-col\`,children:u?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(\`div\`,{className:\`shrink-0 px-6 pt-5\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-2\`,children:[(0,z.jsx)(\`h1\`,{className:\`font-mono text-lg font-semibold text-foreground\`,children:u.id}),u.public&&(0,z.jsx)(B,{variant:\`brand\`,children:\`public\`})]}),(0,z.jsx)(\`div\`,{className:\`mt-3\`,children:(0,z.jsx)($p,{tabs:[{id:\`files\`,label:\`Files\`},{id:\`settings\`,label:\`Settings\`},{id:\`policies\`,label:\`Policies\`}],active:n,onSelect:r})})]}),(0,z.jsxs)(\`div\`,{className:\`min-h-0 flex-1\`,children:[n===\`files\`&&(0,z.jsx)(Rv,{bucket:u}),n===\`settings\`&&(0,z.jsx)(Pv,{bucket:u,onDelete:()=>s(u)}),n===\`policies\`&&(0,z.jsx)(Mv,{bucket:u.id})]})]}):(0,z.jsx)(\`div\`,{className:\`flex flex-1 items-center justify-center\`,children:(0,z.jsxs)(\`div\`,{className:\`rounded-lg border border-dashed border-border px-16 py-12 text-center\`,children:[(0,z.jsx)(Fe,{size:22,className:\`mx-auto text-muted-foreground/60\`}),(0,z.jsx)(\`p\`,{className:\`mt-3 text-sm font-medium text-foreground\`,children:\`Create a file bucket\`}),(0,z.jsx)(\`p\`,{className:\`mt-1 text-xs text-muted-foreground/80\`,children:\`Store images, videos, documents, and any other file type.\`}),(0,z.jsxs)(V,{size:\`xs\`,className:\`mt-4\`,onClick:()=>a(!0),children:[(0,z.jsx)(mt,{size:12}),\` New bucket\`]})]})})}),i&&(0,z.jsx)(Vv,{onClose:()=>a(!1),onDone:async e=>{a(!1),await l(),R(\`storage\`,e,{replace:!0})}}),o&&(0,z.jsx)(q,{open:!0,danger:!0,title:\`Delete bucket "\${o.id}"?\`,description:\`The bucket must be empty before it can be deleted.\`,confirmLabel:\`Delete bucket\`,onConfirm:()=>void d(o),onClose:()=>s(null)})]})}function Vv({onClose:e,onDone:t}){let[n,r]=(0,_.useState)(\`\`),[i,a]=(0,_.useState)(!1),[o,s]=(0,_.useState)(\`\`),[c,l]=(0,_.useState)(!1);async function u(){l(!0),s(\`\`);try{await N.createBucket({id:n,name:n,public:i}),H.success(\`Created bucket \${n}\`),await t(n)}catch(e){s(e.message),l(!1)}}return(0,z.jsx)(go,{open:!0,onClose:e,title:\`New bucket\`,children:(0,z.jsxs)(\`div\`,{className:\`space-y-3\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Name — lowercase, no spaces\`}),(0,z.jsx)(Y,{mono:!0,value:n,autoFocus:!0,placeholder:\`avatars\`,onChange:e=>r(e.target.value.toLowerCase()),onKeyDown:e=>e.key===\`Enter\`&&n&&void u()})]}),(0,z.jsxs)(\`label\`,{className:\`flex cursor-pointer items-center gap-2 text-[13px] text-foreground/80\`,children:[(0,z.jsx)($t,{checked:i,onChange:a}),\`Public bucket — objects readable without auth\`]}),o&&(0,z.jsx)(\`p\`,{className:\`text-xs text-destructive\`,children:o}),(0,z.jsxs)(\`div\`,{className:\`flex justify-end gap-2\`,children:[(0,z.jsx)(V,{variant:\`outline\`,onClick:e,children:\`Cancel\`}),(0,z.jsx)(V,{onClick:()=>void u(),disabled:c||!n,children:c?\`Creating…\`:\`Create bucket\`})]})]})})}var Hv=[{op:\`eq\`,label:\`Equals\`,sym:\`=\`,group:\`Comparison\`},{op:\`neq\`,label:\`Not equal\`,sym:\`<>\`,group:\`Comparison\`},{op:\`gt\`,label:\`Greater than\`,sym:\`>\`,group:\`Comparison\`},{op:\`lt\`,label:\`Less than\`,sym:\`<\`,group:\`Comparison\`},{op:\`gte\`,label:\`Greater or equal\`,sym:\`>=\`,group:\`Comparison\`},{op:\`lte\`,label:\`Less or equal\`,sym:\`<=\`,group:\`Comparison\`},{op:\`like\`,label:\`Like\`,sym:\`~~\`,group:\`Pattern matching\`},{op:\`ilike\`,label:\`iLike\`,sym:\`~~*\`,group:\`Pattern matching\`},{op:\`in\`,label:\`In list\`,sym:\`in\`,group:\`Lists\`},{op:\`is\`,label:\`Is NULL\`,sym:\`null\`,group:\`Null\`,noValue:!0},{op:\`not.is\`,label:\`Is not NULL\`,sym:\`!null\`,group:\`Null\`,noValue:!0}],Uv=[\`Comparison\`,\`Pattern matching\`,\`Lists\`,\`Null\`],Wv=new Set([\`text\`,\`varchar\`,\`bpchar\`,\`char\`,\`name\`,\`citext\`]);function Gv(e,t){let n=e.filter(e=>Wv.has(e.type)).map(e=>e.name);if(n.length===0)return null;let r=t.replace(/[(),]/g,\` \`).trim();return[\`or\`,\`(\${n.map(e=>\`\${e}.ilike.*\${r}*\`).join(\`,\`)})\`]}function Kv(e,t){let n=[];for(let r of t)if(r.column===\`*\`){let t=Gv(e,r.value);t&&n.push(t)}else r.op===\`is\`||r.op===\`not.is\`?n.push([r.column,\`\${r.op}.null\`]):r.op===\`in\`?n.push([r.column,\`in.(\${r.value})\`]):n.push([r.column,\`\${r.op}.\${r.value}\`]);return n}function qv(e){let t=e.type;return t===\`uuid\`?300:t===\`bool\`?100:/^(int|float|numeric)/.test(t)?110:/timestamp|date|time/.test(t)?220:t===\`json\`||t===\`jsonb\`||t.startsWith(\`_\`)?240:190}function Jv(e){let t=new Date().toISOString();return e.startsWith(\`timestamp\`)?t.replace(\`T\`,\` \`).replace(\`Z\`,\`+00\`):e===\`date\`?t.slice(0,10):e===\`timetz\`?t.slice(11,23)+\`+00\`:e.startsWith(\`time\`)?t.slice(11,19):t}function Yv(e){let t=e.trim();if(!t)return null;let n=t.includes(\`T\`)?t:t.replace(\` \`,\`T\`);/[+-]\\d\\d$/.test(n)&&(n+=\`:00\`);let r=new Date(n);return Number.isNaN(r.getTime())?null:r}function Xv(e,t){if(t===\`bool\`)return e===\`true\`||e===\`t\`||e===\`1\`;if([\`int2\`,\`int4\`,\`int8\`,\`float4\`,\`float8\`,\`numeric\`].includes(t)){let t=Number(e);return Number.isNaN(t)?e:t}if(t===\`json\`||t===\`jsonb\`||t.startsWith(\`_\`))try{return JSON.parse(e)}catch{return e}return e}function Zv(e){if(e==null)return;let t=typeof e==\`object\`?JSON.stringify(e):String(e);return t.length>40?t:void 0}function Qv({value:e}){return e==null?(0,z.jsx)(\`span\`,{className:\`select-none text-muted-foreground/60\`,children:\`NULL\`}):e===\`\`?(0,z.jsx)(\`span\`,{className:\`select-none italic text-muted-foreground/60\`,children:\`empty\`}):typeof e==\`boolean\`?(0,z.jsx)(\`span\`,{className:\`text-info\`,children:String(e)}):typeof e==\`object\`?(0,z.jsx)(\`span\`,{className:\`text-warning/90\`,children:JSON.stringify(e)}):(0,z.jsx)(z.Fragment,{children:String(e)})}function $v(e){let t=e.getTime()-Date.now(),n=Math.abs(t);for(let[e,r]of[[31536e6,\`year\`],[2592e6,\`month\`],[864e5,\`day\`],[36e5,\`hour\`],[6e4,\`minute\`],[1e3,\`second\`]])if(n>=e){let i=Math.round(n/e);return t<0?\`\${i} \${r}\${i>1?\`s\`:\`\`} ago\`:\`in \${i} \${r}\${i>1?\`s\`:\`\`}\`}return\`just now\`}function ey({col:e,value:t,anchor:n,enumValues:r,onCommit:i,onCancel:a}){let o=t==null?\`\`:typeof t==\`object\`?JSON.stringify(t,null,2):String(t),[s,c]=(0,_.useState)(o),l=(0,_.useRef)(!1),u=e=>{l.current||(l.current=!0,e())},d=(e=0)=>u(()=>i(s,e)),f=()=>u(a),p=e.type===\`bool\`,m=!p&&(r?.length??0)>0,h=/^(timestamp|date|time)/.test(e.type),g=!p&&!m&&!h&&!/^(int|float|numeric|uuid)/.test(e.type),v=/^(timestamp|date)/.test(e.type),y=v&&s?Yv(s):null,b=y!==null,x=Intl.DateTimeFormat().resolvedOptions().timeZone,S=Math.max(n.width+2,h?320:280),C=Math.max(8,Math.min(n.top,window.innerHeight-(g?320:h?300:m?320:160)))-1,w=Math.max(8,Math.min(n.left,window.innerWidth-S-12))-1,T=p?[\`true\`,\`false\`,...e.nullable?[\`__null\`]:[]]:m?[...r,...e.nullable?[\`__null\`]:[]]:null;return(0,_n.createPortal)((0,z.jsxs)(\`div\`,{style:{position:\`fixed\`,top:C,left:w,width:S},className:\`z-80 overflow-hidden rounded-md border border-muted-foreground bg-card shadow-[0_16px_48px_rgba(0,0,0,0.6)] animate-[fade-in_.1s_ease-out]\`,onKeyDown:e=>{e.key===\`Escape\`?(e.stopPropagation(),f()):e.key===\`Enter\`&&!(g&&e.shiftKey)?(e.preventDefault(),d()):e.key===\`Tab\`&&(e.preventDefault(),d(e.shiftKey?-1:1))},onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||d()},children:[T?(0,z.jsx)(\`div\`,{className:\`max-h-64 overflow-y-auto p-1\`,children:T.map(e=>(0,z.jsxs)(\`button\`,{autoFocus:e===(o||T[0]),onFocus:()=>c(e),onMouseDown:e=>e.preventDefault(),onClick:()=>u(()=>i(e,0)),className:\`flex w-full items-center gap-2 rounded px-2.5 py-1.5 text-left font-mono text-[13px] transition-colors hover:bg-accent focus:bg-accent focus:outline-none \`+(e===o?\`text-brand\`:e===\`__null\`?\`text-muted-foreground/80\`:\`text-foreground\`),children:[e===\`__null\`?\`NULL\`:e,e===o&&(0,z.jsx)(pe,{size:12,className:\`ml-auto shrink-0\`})]},e))}):g?(0,z.jsx)(\`textarea\`,{autoFocus:!0,value:s,onChange:e=>c(e.target.value),onFocus:e=>e.target.select(),placeholder:e.nullable?\`NULL\`:\`\`,className:\`block h-52 w-full resize-none bg-transparent px-2.5 py-2 font-mono text-[13px] leading-relaxed text-foreground selection:bg-brand/40 placeholder:text-muted-foreground/60 focus:outline-none\`}):(0,z.jsx)(\`input\`,{autoFocus:!0,value:s,onChange:e=>c(e.target.value),onFocus:e=>e.target.select(),placeholder:e.nullable?\`NULL\`:\`\`,className:\`block w-full bg-transparent px-2.5 py-2 font-mono text-[13px] text-foreground selection:bg-brand/40 placeholder:text-muted-foreground/60 focus:outline-none\`}),v&&(0,z.jsxs)(\`div\`,{className:\`border-t border-border px-2.5 py-2 font-mono text-[11px]\`,children:[(0,z.jsx)(\`p\`,{className:\`mb-1 font-sans text-muted-foreground/80\`,children:\`Formatted value:\`}),s===\`\`?(0,z.jsx)(\`p\`,{className:\`text-muted-foreground/60\`,children:e.nullable?\`NULL\`:\`empty\`}):b?(0,z.jsxs)(\`div\`,{className:\`space-y-0.5\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex justify-between gap-4\`,children:[(0,z.jsx)(\`span\`,{className:\`text-muted-foreground/80\`,children:\`UTC\`}),(0,z.jsx)(\`span\`,{className:\`text-foreground/80\`,children:y.toISOString().replace(\`T\`,\` \`).slice(0,19)})]}),(0,z.jsxs)(\`div\`,{className:\`flex justify-between gap-4\`,children:[(0,z.jsx)(\`span\`,{className:\`truncate text-muted-foreground/80\`,children:x}),(0,z.jsx)(\`span\`,{className:\`shrink-0 text-foreground/80\`,children:y.toLocaleString()})]}),(0,z.jsxs)(\`div\`,{className:\`flex justify-between gap-4\`,children:[(0,z.jsx)(\`span\`,{className:\`text-muted-foreground/80\`,children:\`Relative\`}),(0,z.jsx)(\`span\`,{className:\`text-foreground/80\`,children:$v(y)})]})]}):(0,z.jsx)(\`p\`,{className:\`text-destructive\`,children:\`Invalid date\`})]}),(0,z.jsxs)(\`div\`,{className:\`border-t border-border p-1.5\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-1\`,children:[(0,z.jsxs)(\`button\`,{className:\`flex flex-1 items-center gap-2 rounded px-2 py-1.5 text-left text-xs text-foreground/80 hover:bg-accent\`,onMouseDown:e=>e.preventDefault(),onClick:()=>d(),children:[(0,z.jsx)(uf,{children:\`↵\`}),\` Save changes\`]}),h&&(0,z.jsxs)(\`button\`,{className:\`flex shrink-0 items-center gap-1.5 rounded border border-input px-2 py-1 text-xs text-foreground/80 hover:bg-accent\`,onMouseDown:e=>e.preventDefault(),onClick:()=>c(Jv(e.type)),children:[(0,z.jsx)(xe,{size:11}),\` Set to NOW\`]})]}),(0,z.jsxs)(\`button\`,{className:\`flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs text-muted-foreground hover:bg-accent\`,onMouseDown:e=>e.preventDefault(),onClick:f,children:[(0,z.jsx)(uf,{children:\`Esc\`}),\` Cancel changes\`]})]})]}),document.body)}var ty=e=>e.replace(/'/g,\`''\`);async function ny(e,t){let n=ty(e),r=ty(t),i=\`'"\${n}"."\${r}"'::regclass\`,a=await N.sql(\`select
|
|
1567
1567
|
(select json_agg(json_build_object(
|
|
1568
1568
|
'name', column_name, 'type', data_type,
|
|
1569
1569
|
'nullable', is_nullable = 'YES',
|
|
@@ -1581,19 +1581,19 @@ with (security_invoker = on)\`:\`\`} as\\n\${(i?.def??\`…\`).trim()}\`,g=Math.
|
|
|
1581
1581
|
\`)}\\n);\`;return u.length>0&&(m+=\`
|
|
1582
1582
|
|
|
1583
1583
|
\`+u.map(e=>e+\`;\`).join(\`
|
|
1584
|
-
\`)),m}function ny({schema:e=\`public\`,table:t,refreshKey:n}){let[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(\`\`);return(0,_.useEffect)(()=>{i(null),o(\`\`),ty(e,t).then(i,e=>o(e.message))},[e,t,n]),a?(0,z.jsxs)(\`div\`,{className:\`flex flex-1 items-center justify-center p-8 text-center text-[13px] text-muted-foreground/80\`,children:[\`Could not generate the definition: \`,(0,z.jsx)(\`span\`,{className:\`ml-1 text-destructive\`,children:a})]}):r===null?(0,z.jsx)(\`div\`,{className:\`flex-1\`,children:(0,z.jsx)(Jp,{})}):(0,z.jsxs)(\`div\`,{className:\`min-h-0 flex-1 overflow-auto\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex items-center justify-between px-5 pb-1 pt-4\`,children:[(0,z.jsxs)(\`h2\`,{className:\`text-sm text-foreground/80\`,children:[\`SQL definition of \`,(0,z.jsx)(\`code\`,{className:\`rounded bg-accent px-1.5 py-0.5 font-mono text-xs text-foreground\`,children:t}),\` \`,(0,z.jsx)(\`span\`,{className:\`text-xs text-muted-foreground/60\`,children:\`(read only)\`})]}),(0,z.jsx)(er,{value:r,label:\`Definition\`,variant:\`outline\`,size:\`xs\`,children:\`Copy\`})]}),(0,z.jsx)(\`div\`,{className:\`px-3 pb-4\`,children:(0,z.jsx)(nr,{value:r,lang:\`sql\`,readOnly:!0,gutter:!0,minLines:4,maxLines:500})})]})}var ry=e=>e.target.split(\`.\`).pop(),iy=e=>e.target===\`auth.users\`;function ay(e,t){return e?e.columns.filter(e=>!t.targetColumns.includes(e.name)&&Uv.has(e.type)).slice(0,2).map(e=>e.name):[]}async function oy(e,t,n){if(iy(e)){let e=await N.users();if(n.exact!==void 0&&(e=e.filter(e=>String(e.id)===String(n.exact))),n.search){let t=n.search.toLowerCase();e=e.filter(e=>String(e.email??\`\`).toLowerCase().includes(t)||String(e.id).includes(t))}return{rows:e,total:e.length}}let r=[];if(n.exact!==void 0&&r.push([e.targetColumns[0],\`eq.\${n.exact}\`]),n.search?.trim()&&t){let e=Wv(t.columns,n.search);e&&r.push(e)}let i=n.perPage??100;return N.rows(ry(e),{limit:n.exact===void 0?i:1,offset:(n.page??0)*i,order:t?.primaryKey[0]?\`\${t.primaryKey[0]}.asc\`:void 0,filters:r})}function sy({fk:e,value:t,anchor:n,tables:r,onClose:i,onOpenTable:a}){let o=r.find(t=>t.name===ry(e)),[s,c]=(0,_.useState)(void 0);(0,_.useEffect)(()=>{oy(e,o,{exact:t}).then(({rows:e})=>c(e[0]??null),()=>c(null))},[e,o,t]);let l=iy(e)?\`id\`:e.targetColumns[0],u=iy(e)?[\`email\`]:ay(o,e),d=t=>iy(e)?t===\`id\`?\`uuid\`:\`text\`:o?.columns.find(e=>e.name===t)?.type??\`\`,f=Math.min(n.top+n.height+4,window.innerHeight-190),p=Math.max(8,Math.min(n.left,window.innerWidth-400-12));return(0,_n.createPortal)((0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(\`div\`,{className:\`fixed inset-0 z-[70]\`,onClick:i}),(0,z.jsxs)(\`div\`,{style:{position:\`fixed\`,top:f,left:p,width:400},className:\`z-[80] overflow-hidden rounded-md border border-muted-foreground bg-card shadow-[0_16px_48px_rgba(0,0,0,0.6)] animate-[fade-in_.1s_ease-out]\`,children:[(0,z.jsxs)(\`p\`,{className:\`border-b border-border px-3 py-2 text-xs text-muted-foreground\`,children:[\`Referencing record from \`,(0,z.jsx)(\`code\`,{className:\`font-mono text-foreground\`,children:e.target}),\`:\`]}),s===void 0?(0,z.jsx)(Jp,{}):s===null?(0,z.jsx)(\`p\`,{className:\`px-3 py-4 text-center text-xs text-muted-foreground/60\`,children:\`No matching record found.\`}):(0,z.jsxs)(\`table\`,{className:\`w-full border-collapse text-[13px]\`,children:[(0,z.jsx)(\`thead\`,{children:(0,z.jsx)(\`tr\`,{children:[l,...u].map((e,t)=>(0,z.jsx)(\`th\`,{className:\`border-b border-r border-border px-3 py-1.5 text-left font-normal last:border-r-0\`,children:(0,z.jsxs)(\`span\`,{className:\`flex items-center gap-1.5\`,children:[t===0&&(0,z.jsx)(Ke,{size:10,className:\`text-brand\`}),(0,z.jsx)(\`span\`,{className:\`font-mono font-medium text-foreground\`,children:e}),(0,z.jsx)(\`span\`,{className:\`text-[11px] text-muted-foreground/60\`,children:d(e)})]})},e))})}),(0,z.jsx)(\`tbody\`,{children:(0,z.jsx)(\`tr\`,{children:[l,...u].map(e=>(0,z.jsx)(\`td\`,{className:\`max-w-[220px] truncate border-r border-border/60 px-3 py-2 font-mono text-foreground/80 last:border-r-0\`,children:(0,z.jsx)(Zv,{value:s[e]})},e))})})]}),!iy(e)&&(0,z.jsx)(\`div\`,{className:\`flex justify-end border-t border-border px-2 py-1.5\`,children:(0,z.jsx)(V,{variant:\`outline\`,size:\`xs\`,onClick:()=>a(ry(e)),children:\`Open table\`})})]})]}),document.body)}function cy({fk:e,tables:t,currentKey:n,onPick:r,onClose:i}){let a=t.find(t=>t.name===ry(e)),[o,s]=(0,_.useState)(\`\`),[c,l]=(0,_.useState)(0),[u,d]=(0,_.useState)(null),[f,p]=(0,_.useState)(0),[m,h]=(0,_.useState)(\`\`),g=iy(e),v=g?[\`id\`,\`email\`,\`created_at\`]:a?[...e.targetColumns,...a.columns.map(e=>e.name).filter(t=>!e.targetColumns.includes(t))].slice(0,6):e.targetColumns,y=(0,_.useCallback)(()=>{h(\`\`),oy(e,a,{search:o,page:c,perPage:100}).then(({rows:e,total:t})=>{d(e),p(t)},e=>h(e.message))},[e,a,o,c]);(0,_.useEffect)(()=>{y()},[y]);let b=Math.max(1,Math.ceil(f/100));return(0,z.jsx)(qp,{open:!0,onClose:i,flush:!0,width:\`w-[640px]\`,title:(0,z.jsxs)(\`span\`,{children:[\`Select a record to reference from\`,\` \`,(0,z.jsx)(\`code\`,{className:\`rounded bg-accent px-1.5 py-0.5 font-mono text-xs text-foreground\`,children:e.target})]}),footer:(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(\`span\`,{className:\`text-xs text-muted-foreground/80\`,children:[f.toLocaleString(),\` record\`,f===1?\`\`:\`s\`,b>1&&\` · page \${c+1} of \${b}\`]}),b>1&&(0,z.jsxs)(\`span\`,{className:\`flex items-center gap-1\`,children:[(0,z.jsx)(V,{variant:\`outline\`,size:\`xs\`,disabled:c===0,onClick:()=>l(e=>e-1),children:\`Prev\`}),(0,z.jsx)(V,{variant:\`outline\`,size:\`xs\`,disabled:c+1>=b,onClick:()=>l(e=>e+1),children:\`Next\`})]}),(0,z.jsx)(Kp,{asChild:!0,children:(0,z.jsx)(V,{variant:\`outline\`,className:\`ml-auto\`,children:\`Cancel\`})})]}),children:(0,z.jsxs)(\`div\`,{className:\`flex h-full flex-col\`,children:[(0,z.jsxs)(\`div\`,{className:\`relative border-b border-border\`,children:[(0,z.jsx)(vt,{size:13,className:\`pointer-events-none absolute left-4 top-1/2 -translate-y-1/2 text-muted-foreground/60\`}),(0,z.jsx)(\`input\`,{autoFocus:!0,value:o,onChange:e=>{s(e.target.value),l(0)},placeholder:\`Search \${ry(e)}…\`,className:\`h-10 w-full bg-transparent pl-10 pr-10 text-[13px] text-foreground placeholder:text-muted-foreground/60 focus:outline-none\`}),(0,z.jsx)(\`button\`,{className:\`absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground/80 hover:text-foreground\`,title:\`Refresh\`,onClick:y,children:(0,z.jsx)(gt,{size:13})})]}),(0,z.jsxs)(\`div\`,{className:\`min-h-0 flex-1 overflow-auto\`,children:[m&&(0,z.jsx)(\`p\`,{className:\`px-4 py-3 text-xs text-destructive\`,children:m}),!m&&u===null&&(0,z.jsx)(Jp,{}),!m&&u!==null&&u.length===0&&(0,z.jsxs)(\`p\`,{className:\`py-10 text-center text-xs text-muted-foreground/60\`,children:[\`No records\`,o?\` match your search\`:\`\`,\`.\`]}),!m&&u!==null&&u.length>0&&(0,z.jsxs)(\`table\`,{className:\`w-full border-collapse text-[13px]\`,children:[(0,z.jsx)(\`thead\`,{className:\`sticky top-0 z-10 bg-card\`,children:(0,z.jsx)(\`tr\`,{children:v.map((t,n)=>(0,z.jsx)(\`th\`,{className:\`whitespace-nowrap border-b border-r border-border px-3 py-1.5 text-left font-normal last:border-r-0\`,children:(0,z.jsxs)(\`span\`,{className:\`flex items-center gap-1.5\`,children:[n<e.targetColumns.length&&(0,z.jsx)(Ke,{size:10,className:\`text-brand\`}),(0,z.jsx)(\`span\`,{className:\`font-mono font-medium text-foreground\`,children:t})]})},t))})}),(0,z.jsx)(\`tbody\`,{children:u.map((t,a)=>(0,z.jsx)(\`tr\`,{onClick:()=>{let n={};e.columns.forEach((r,i)=>n[r]=t[g?\`id\`:e.targetColumns[i]]),r(n),i()},className:\`cursor-pointer \`+(n!=null&&String(t[g?\`id\`:e.targetColumns[0]])===String(n)?\`bg-brand/10\`:\`hover:bg-accent/50\`),children:v.map(e=>(0,z.jsx)(\`td\`,{className:\`max-w-[200px] truncate border-b border-r border-border/60 px-3 py-1.5 font-mono text-foreground/80 last:border-r-0\`,children:(0,z.jsx)(Zv,{value:t[e]})},e))},a))})]})]})]})})}function ly({fk:e,value:t,disabled:n,placeholder:r,onOpen:i}){return(0,z.jsxs)(\`button\`,{type:\`button\`,disabled:n,onClick:i,className:\`flex h-8 w-full items-center gap-2 rounded-md border border-input bg-field px-2.5 text-left font-mono text-[13px] text-foreground transition-colors hover:border-muted-foreground focus:border-brand focus:outline-none disabled:pointer-events-none disabled:opacity-50\`,title:\`Select a record from \${e.target}\`,children:[t?(0,z.jsx)(\`span\`,{className:\`truncate\`,children:t}):(0,z.jsx)(\`span\`,{className:\`text-muted-foreground/60\`,children:n?\`NULL\`:r}),(0,z.jsxs)(\`span\`,{className:\`ml-auto flex shrink-0 items-center gap-1 font-sans text-[11px] text-muted-foreground/80\`,children:[e.target,\` \`,(0,z.jsx)(de,{size:11})]})]})}var uy=1;function dy({columns:e,filters:t,onChange:n}){let[r,i]=(0,_.useState)(!1),[a,o]=(0,_.useState)(\`\`),[s,c]=(0,_.useState)(null),[l,u]=(0,_.useState)(0),d=(0,_.useRef)(null),f=e.filter(e=>e.name.toLowerCase().includes(a.toLowerCase())),p=a.trim().length>0&&!s,m=+!!p+f.length;function h(e){n([...t,{...e,id:uy++}]),c(null),o(\`\`),i(!1)}function g(e){c({column:e}),o(\`\`),u(0),d.current?.focus()}function v(e){if(e.noValue)return h({column:s.column,op:e.op,value:\`\`});c({column:s.column,op:e}),o(\`\`),i(!1),d.current?.focus()}function y(e){if(e.key===\`Escape\`){c(null),o(\`\`),i(!1);return}if(s?.op){e.key===\`Enter\`&&a.trim()&&h({column:s.column,op:s.op.op,value:a.trim()}),e.key===\`Backspace\`&&a===\`\`&&(c({column:s.column}),i(!0));return}if(s?.column){e.key===\`Backspace\`&&a===\`\`&&(c(null),i(!0));return}if(e.key===\`ArrowDown\`)e.preventDefault(),u(e=>Math.min(e+1,m-1));else if(e.key===\`ArrowUp\`)e.preventDefault(),u(e=>Math.max(e-1,0));else if(e.key===\`Enter\`)if(p&&l===0)h({column:\`*\`,op:\`search\`,value:a.trim()});else{let e=f[l-+!!p];e&&g(e.name)}else e.key===\`Backspace\`&&a===\`\`&&t.length>0&&n(t.slice(0,-1))}let b=s?.op?s.op.op===\`in\`?\`comma,separated,values — Enter to apply\`:s.op.op===\`like\`||s.op.op===\`ilike\`?\`%pattern% — Enter to apply\`:\`value — Enter to apply\`:s?.column?\`pick an operator…\`:\`Filter by \${e.slice(0,3).map(e=>e.name).join(\`, \`)}… or type to search\`;return(0,z.jsxs)(\`div\`,{className:\`relative min-w-0 flex-1\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex min-h-[30px] cursor-text flex-wrap items-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 hover:border-border focus-within:border-input\`,onClick:()=>{d.current?.focus(),s?.op||i(!0)},children:[(0,z.jsx)(vt,{size:13,className:\`shrink-0 text-muted-foreground/60\`}),t.map(e=>{let r=Vv.find(t=>t.op===e.op);return(0,z.jsxs)(\`span\`,{className:\`flex max-w-[260px] shrink-0 items-center gap-1 rounded border border-input bg-accent/80 py-0.5 pl-1.5 pr-0.5 text-xs\`,children:[e.column===\`*\`?(0,z.jsxs)(\`span\`,{className:\`truncate text-foreground/80\`,children:[\`search \`,(0,z.jsxs)(\`span\`,{className:\`text-brand\`,children:[\`“\`,e.value,\`”\`]})]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(\`span\`,{className:\`font-mono text-foreground\`,children:e.column}),(0,z.jsx)(\`span\`,{className:\`text-muted-foreground/80\`,children:r?.sym??e.op}),!r?.noValue&&(0,z.jsx)(\`span\`,{className:\`truncate text-brand\`,children:e.value})]}),(0,z.jsx)(\`button\`,{className:\`rounded p-0.5 text-muted-foreground/80 hover:bg-muted hover:text-foreground\`,onClick:r=>{r.stopPropagation(),n(t.filter(t=>t.id!==e.id))},children:(0,z.jsx)(Lt,{size:11})})]},e.id)}),s?.column&&(0,z.jsxs)(\`span\`,{className:\`flex shrink-0 items-center gap-1 rounded border border-brand/40 bg-brand/10 px-1.5 py-0.5 text-xs\`,children:[(0,z.jsx)(\`span\`,{className:\`font-mono text-foreground\`,children:s.column}),s.op&&(0,z.jsx)(\`span\`,{className:\`text-brand\`,children:s.op.sym})]}),(0,z.jsx)(\`input\`,{ref:d,value:a,onChange:e=>{o(e.target.value),u(0),s?.op||i(!0)},onFocus:()=>!s?.op&&i(!0),onKeyDown:y,placeholder:t.length===0||s?b:\`Add more filters…\`,className:\`h-6 min-w-[140px] flex-1 bg-transparent text-[13px] text-foreground placeholder:text-muted-foreground/60 focus:outline-none\`})]}),r&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(\`div\`,{className:\`fixed inset-0 z-40\`,onClick:()=>i(!1)}),(0,z.jsx)(\`div\`,{className:\`absolute left-0 top-full z-50 mt-1 max-h-[340px] w-[300px] overflow-auto rounded-md border border-input bg-popover py-1 shadow-xl animate-[fade-in_.1s_ease-out]\`,children:s?.column?Hv.map(e=>{let t=Vv.filter(t=>t.group===e&&t.label.toLowerCase().includes(a.toLowerCase()));return t.length===0?null:(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(\`p\`,{className:\`px-3 pb-1 pt-2 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/80\`,children:e}),t.map(e=>(0,z.jsxs)(\`button\`,{className:\`flex w-full items-center px-3 py-1.5 text-left text-[13px] text-foreground hover:bg-accent\`,onClick:()=>v(e),children:[e.label,(0,z.jsx)(\`span\`,{className:\`ml-auto rounded border border-input bg-accent px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground\`,children:e.sym})]},e.op))]},e)}):(0,z.jsxs)(z.Fragment,{children:[p&&(0,z.jsxs)(\`button\`,{className:\`flex w-full items-center gap-2 px-3 py-1.5 text-left text-[13px] text-foreground \`+(l===0?\`bg-accent\`:\`hover:bg-accent\`),onClick:()=>h({column:\`*\`,op:\`search\`,value:a.trim()}),children:[(0,z.jsx)(vt,{size:13,className:\`text-muted-foreground/80\`}),\`Search all text columns for \`,(0,z.jsxs)(\`span\`,{className:\`text-brand\`,children:[\`“\`,a.trim(),\`”\`]})]}),f.map((e,t)=>{let n=t+ +!!p;return(0,z.jsxs)(\`button\`,{className:\`flex w-full items-center gap-2 px-3 py-1.5 text-left text-[13px] \`+(l===n?\`bg-accent\`:\`hover:bg-accent\`),onClick:()=>g(e.name),children:[(0,z.jsx)(\`span\`,{className:\`font-mono text-foreground\`,children:e.name}),(0,z.jsx)(\`span\`,{className:\`ml-auto text-[11px] text-muted-foreground/60\`,children:e.type})]},e.name)}),f.length===0&&!p&&(0,z.jsx)(\`p\`,{className:\`px-3 py-2 text-xs text-muted-foreground/80\`,children:\`No matching column.\`})]})})]})]})}function fy({table:e,schema:t=\`public\`,column:n,onClose:r,onDone:i}){let[a,o]=(0,_.useState)(n),[s,c]=(0,_.useState)(!1);async function l(){let o=a.trim();if(!o||o===n)return r();c(!0);let s=await N.sql(\`alter table \${Jh(t,e)} rename column "\${n}" to "\${o.replace(/"/g,\`""\`)}"\`);if(c(!1),!s.ok){H.error(s.error??\`Rename failed\`);return}H.success(\`Renamed \${n} → \${o}\`),await i()}return(0,z.jsx)(go,{open:!0,onClose:r,title:\`Rename column "\${n}"\`,children:(0,z.jsxs)(\`div\`,{className:\`space-y-3\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`New name\`}),(0,z.jsx)(lf,{mono:!0,value:a,autoFocus:!0,onChange:e=>o(e.target.value),onKeyDown:e=>e.key===\`Enter\`&&void l()})]}),(0,z.jsxs)(\`div\`,{className:\`flex justify-end gap-2\`,children:[(0,z.jsx)(V,{variant:\`outline\`,onClick:r,children:\`Cancel\`}),(0,z.jsx)(V,{onClick:()=>void l(),disabled:s||!a.trim(),children:s?\`Renaming…\`:\`Rename\`})]})]})})}var py=e=>\`"\`+e.replace(/"/g,\`""\`)+\`"\`;async function my(e){let t=await N.sql(e);return t.ok?null:t.error??\`Statement failed\`}var hy=\`create table new_table (
|
|
1584
|
+
\`)),m}function ry({schema:e=\`public\`,table:t,refreshKey:n}){let[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(\`\`);return(0,_.useEffect)(()=>{i(null),o(\`\`),ny(e,t).then(i,e=>o(e.message))},[e,t,n]),a?(0,z.jsxs)(\`div\`,{className:\`flex flex-1 items-center justify-center p-8 text-center text-[13px] text-muted-foreground/80\`,children:[\`Could not generate the definition: \`,(0,z.jsx)(\`span\`,{className:\`ml-1 text-destructive\`,children:a})]}):r===null?(0,z.jsx)(\`div\`,{className:\`flex-1\`,children:(0,z.jsx)(Jp,{})}):(0,z.jsxs)(\`div\`,{className:\`min-h-0 flex-1 overflow-auto\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex items-center justify-between px-5 pb-1 pt-4\`,children:[(0,z.jsxs)(\`h2\`,{className:\`text-sm text-foreground/80\`,children:[\`SQL definition of \`,(0,z.jsx)(\`code\`,{className:\`rounded bg-accent px-1.5 py-0.5 font-mono text-xs text-foreground\`,children:t}),\` \`,(0,z.jsx)(\`span\`,{className:\`text-xs text-muted-foreground/60\`,children:\`(read only)\`})]}),(0,z.jsx)(er,{value:r,label:\`Definition\`,variant:\`outline\`,size:\`xs\`,children:\`Copy\`})]}),(0,z.jsx)(\`div\`,{className:\`px-3 pb-4\`,children:(0,z.jsx)(nr,{value:r,lang:\`sql\`,readOnly:!0,gutter:!0,minLines:4,maxLines:500})})]})}var iy=e=>e.target.split(\`.\`).pop(),ay=e=>e.target===\`auth.users\`;function oy(e,t){return e?e.columns.filter(e=>!t.targetColumns.includes(e.name)&&Wv.has(e.type)).slice(0,2).map(e=>e.name):[]}async function sy(e,t,n){if(ay(e)){let e=await N.users();if(n.exact!==void 0&&(e=e.filter(e=>String(e.id)===String(n.exact))),n.search){let t=n.search.toLowerCase();e=e.filter(e=>String(e.email??\`\`).toLowerCase().includes(t)||String(e.id).includes(t))}return{rows:e,total:e.length}}let r=[];if(n.exact!==void 0&&r.push([e.targetColumns[0],\`eq.\${n.exact}\`]),n.search?.trim()&&t){let e=Gv(t.columns,n.search);e&&r.push(e)}let i=n.perPage??100;return N.rows(iy(e),{limit:n.exact===void 0?i:1,offset:(n.page??0)*i,order:t?.primaryKey[0]?\`\${t.primaryKey[0]}.asc\`:void 0,filters:r})}function cy({fk:e,value:t,anchor:n,tables:r,onClose:i,onOpenTable:a}){let o=r.find(t=>t.name===iy(e)),[s,c]=(0,_.useState)(void 0);(0,_.useEffect)(()=>{sy(e,o,{exact:t}).then(({rows:e})=>c(e[0]??null),()=>c(null))},[e,o,t]);let l=ay(e)?\`id\`:e.targetColumns[0],u=ay(e)?[\`email\`]:oy(o,e),d=t=>ay(e)?t===\`id\`?\`uuid\`:\`text\`:o?.columns.find(e=>e.name===t)?.type??\`\`,f=Math.min(n.top+n.height+4,window.innerHeight-190),p=Math.max(8,Math.min(n.left,window.innerWidth-400-12));return(0,_n.createPortal)((0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(\`div\`,{className:\`fixed inset-0 z-[70]\`,onClick:i}),(0,z.jsxs)(\`div\`,{style:{position:\`fixed\`,top:f,left:p,width:400},className:\`z-[80] overflow-hidden rounded-md border border-muted-foreground bg-card shadow-[0_16px_48px_rgba(0,0,0,0.6)] animate-[fade-in_.1s_ease-out]\`,children:[(0,z.jsxs)(\`p\`,{className:\`border-b border-border px-3 py-2 text-xs text-muted-foreground\`,children:[\`Referencing record from \`,(0,z.jsx)(\`code\`,{className:\`font-mono text-foreground\`,children:e.target}),\`:\`]}),s===void 0?(0,z.jsx)(Jp,{}):s===null?(0,z.jsx)(\`p\`,{className:\`px-3 py-4 text-center text-xs text-muted-foreground/60\`,children:\`No matching record found.\`}):(0,z.jsxs)(\`table\`,{className:\`w-full border-collapse text-[13px]\`,children:[(0,z.jsx)(\`thead\`,{children:(0,z.jsx)(\`tr\`,{children:[l,...u].map((e,t)=>(0,z.jsx)(\`th\`,{className:\`border-b border-r border-border px-3 py-1.5 text-left font-normal last:border-r-0\`,children:(0,z.jsxs)(\`span\`,{className:\`flex items-center gap-1.5\`,children:[t===0&&(0,z.jsx)(Ke,{size:10,className:\`text-brand\`}),(0,z.jsx)(\`span\`,{className:\`font-mono font-medium text-foreground\`,children:e}),(0,z.jsx)(\`span\`,{className:\`text-[11px] text-muted-foreground/60\`,children:d(e)})]})},e))})}),(0,z.jsx)(\`tbody\`,{children:(0,z.jsx)(\`tr\`,{children:[l,...u].map(e=>(0,z.jsx)(\`td\`,{className:\`max-w-[220px] truncate border-r border-border/60 px-3 py-2 font-mono text-foreground/80 last:border-r-0\`,children:(0,z.jsx)(Qv,{value:s[e]})},e))})})]}),!ay(e)&&(0,z.jsx)(\`div\`,{className:\`flex justify-end border-t border-border px-2 py-1.5\`,children:(0,z.jsx)(V,{variant:\`outline\`,size:\`xs\`,onClick:()=>a(iy(e)),children:\`Open table\`})})]})]}),document.body)}function ly({fk:e,tables:t,currentKey:n,onPick:r,onClose:i}){let a=t.find(t=>t.name===iy(e)),[o,s]=(0,_.useState)(\`\`),[c,l]=(0,_.useState)(0),[u,d]=(0,_.useState)(null),[f,p]=(0,_.useState)(0),[m,h]=(0,_.useState)(\`\`),g=ay(e),v=g?[\`id\`,\`email\`,\`created_at\`]:a?[...e.targetColumns,...a.columns.map(e=>e.name).filter(t=>!e.targetColumns.includes(t))].slice(0,6):e.targetColumns,y=(0,_.useCallback)(()=>{h(\`\`),sy(e,a,{search:o,page:c,perPage:100}).then(({rows:e,total:t})=>{d(e),p(t)},e=>h(e.message))},[e,a,o,c]);(0,_.useEffect)(()=>{y()},[y]);let b=Math.max(1,Math.ceil(f/100));return(0,z.jsx)(qp,{open:!0,onClose:i,flush:!0,width:\`w-[640px]\`,title:(0,z.jsxs)(\`span\`,{children:[\`Select a record to reference from\`,\` \`,(0,z.jsx)(\`code\`,{className:\`rounded bg-accent px-1.5 py-0.5 font-mono text-xs text-foreground\`,children:e.target})]}),footer:(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(\`span\`,{className:\`text-xs text-muted-foreground/80\`,children:[f.toLocaleString(),\` record\`,f===1?\`\`:\`s\`,b>1&&\` · page \${c+1} of \${b}\`]}),b>1&&(0,z.jsxs)(\`span\`,{className:\`flex items-center gap-1\`,children:[(0,z.jsx)(V,{variant:\`outline\`,size:\`xs\`,disabled:c===0,onClick:()=>l(e=>e-1),children:\`Prev\`}),(0,z.jsx)(V,{variant:\`outline\`,size:\`xs\`,disabled:c+1>=b,onClick:()=>l(e=>e+1),children:\`Next\`})]}),(0,z.jsx)(Kp,{asChild:!0,children:(0,z.jsx)(V,{variant:\`outline\`,className:\`ml-auto\`,children:\`Cancel\`})})]}),children:(0,z.jsxs)(\`div\`,{className:\`flex h-full flex-col\`,children:[(0,z.jsxs)(\`div\`,{className:\`relative border-b border-border\`,children:[(0,z.jsx)(vt,{size:13,className:\`pointer-events-none absolute left-4 top-1/2 -translate-y-1/2 text-muted-foreground/60\`}),(0,z.jsx)(\`input\`,{autoFocus:!0,value:o,onChange:e=>{s(e.target.value),l(0)},placeholder:\`Search \${iy(e)}…\`,className:\`h-10 w-full bg-transparent pl-10 pr-10 text-[13px] text-foreground placeholder:text-muted-foreground/60 focus:outline-none\`}),(0,z.jsx)(\`button\`,{className:\`absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground/80 hover:text-foreground\`,title:\`Refresh\`,onClick:y,children:(0,z.jsx)(gt,{size:13})})]}),(0,z.jsxs)(\`div\`,{className:\`min-h-0 flex-1 overflow-auto\`,children:[m&&(0,z.jsx)(\`p\`,{className:\`px-4 py-3 text-xs text-destructive\`,children:m}),!m&&u===null&&(0,z.jsx)(Jp,{}),!m&&u!==null&&u.length===0&&(0,z.jsxs)(\`p\`,{className:\`py-10 text-center text-xs text-muted-foreground/60\`,children:[\`No records\`,o?\` match your search\`:\`\`,\`.\`]}),!m&&u!==null&&u.length>0&&(0,z.jsxs)(\`table\`,{className:\`w-full border-collapse text-[13px]\`,children:[(0,z.jsx)(\`thead\`,{className:\`sticky top-0 z-10 bg-card\`,children:(0,z.jsx)(\`tr\`,{children:v.map((t,n)=>(0,z.jsx)(\`th\`,{className:\`whitespace-nowrap border-b border-r border-border px-3 py-1.5 text-left font-normal last:border-r-0\`,children:(0,z.jsxs)(\`span\`,{className:\`flex items-center gap-1.5\`,children:[n<e.targetColumns.length&&(0,z.jsx)(Ke,{size:10,className:\`text-brand\`}),(0,z.jsx)(\`span\`,{className:\`font-mono font-medium text-foreground\`,children:t})]})},t))})}),(0,z.jsx)(\`tbody\`,{children:u.map((t,a)=>(0,z.jsx)(\`tr\`,{onClick:()=>{let n={};e.columns.forEach((r,i)=>n[r]=t[g?\`id\`:e.targetColumns[i]]),r(n),i()},className:\`cursor-pointer \`+(n!=null&&String(t[g?\`id\`:e.targetColumns[0]])===String(n)?\`bg-brand/10\`:\`hover:bg-accent/50\`),children:v.map(e=>(0,z.jsx)(\`td\`,{className:\`max-w-[200px] truncate border-b border-r border-border/60 px-3 py-1.5 font-mono text-foreground/80 last:border-r-0\`,children:(0,z.jsx)(Qv,{value:t[e]})},e))},a))})]})]})]})})}function uy({fk:e,value:t,disabled:n,placeholder:r,onOpen:i}){return(0,z.jsxs)(\`button\`,{type:\`button\`,disabled:n,onClick:i,className:\`flex h-8 w-full items-center gap-2 rounded-md border border-input bg-field px-2.5 text-left font-mono text-[13px] text-foreground transition-colors hover:border-muted-foreground focus:border-brand focus:outline-none disabled:pointer-events-none disabled:opacity-50\`,title:\`Select a record from \${e.target}\`,children:[t?(0,z.jsx)(\`span\`,{className:\`truncate\`,children:t}):(0,z.jsx)(\`span\`,{className:\`text-muted-foreground/60\`,children:n?\`NULL\`:r}),(0,z.jsxs)(\`span\`,{className:\`ml-auto flex shrink-0 items-center gap-1 font-sans text-[11px] text-muted-foreground/80\`,children:[e.target,\` \`,(0,z.jsx)(de,{size:11})]})]})}var dy=1;function fy({columns:e,filters:t,onChange:n}){let[r,i]=(0,_.useState)(!1),[a,o]=(0,_.useState)(\`\`),[s,c]=(0,_.useState)(null),[l,u]=(0,_.useState)(0),d=(0,_.useRef)(null),f=e.filter(e=>e.name.toLowerCase().includes(a.toLowerCase())),p=a.trim().length>0&&!s,m=+!!p+f.length;function h(e){n([...t,{...e,id:dy++}]),c(null),o(\`\`),i(!1)}function g(e){c({column:e}),o(\`\`),u(0),d.current?.focus()}function v(e){if(e.noValue)return h({column:s.column,op:e.op,value:\`\`});c({column:s.column,op:e}),o(\`\`),i(!1),d.current?.focus()}function y(e){if(e.key===\`Escape\`){c(null),o(\`\`),i(!1);return}if(s?.op){e.key===\`Enter\`&&a.trim()&&h({column:s.column,op:s.op.op,value:a.trim()}),e.key===\`Backspace\`&&a===\`\`&&(c({column:s.column}),i(!0));return}if(s?.column){e.key===\`Backspace\`&&a===\`\`&&(c(null),i(!0));return}if(e.key===\`ArrowDown\`)e.preventDefault(),u(e=>Math.min(e+1,m-1));else if(e.key===\`ArrowUp\`)e.preventDefault(),u(e=>Math.max(e-1,0));else if(e.key===\`Enter\`)if(p&&l===0)h({column:\`*\`,op:\`search\`,value:a.trim()});else{let e=f[l-+!!p];e&&g(e.name)}else e.key===\`Backspace\`&&a===\`\`&&t.length>0&&n(t.slice(0,-1))}let b=s?.op?s.op.op===\`in\`?\`comma,separated,values — Enter to apply\`:s.op.op===\`like\`||s.op.op===\`ilike\`?\`%pattern% — Enter to apply\`:\`value — Enter to apply\`:s?.column?\`pick an operator…\`:\`Filter by \${e.slice(0,3).map(e=>e.name).join(\`, \`)}… or type to search\`;return(0,z.jsxs)(\`div\`,{className:\`relative min-w-0 flex-1\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex min-h-[30px] cursor-text flex-wrap items-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 hover:border-border focus-within:border-input\`,onClick:()=>{d.current?.focus(),s?.op||i(!0)},children:[(0,z.jsx)(vt,{size:13,className:\`shrink-0 text-muted-foreground/60\`}),t.map(e=>{let r=Hv.find(t=>t.op===e.op);return(0,z.jsxs)(\`span\`,{className:\`flex max-w-[260px] shrink-0 items-center gap-1 rounded border border-input bg-accent/80 py-0.5 pl-1.5 pr-0.5 text-xs\`,children:[e.column===\`*\`?(0,z.jsxs)(\`span\`,{className:\`truncate text-foreground/80\`,children:[\`search \`,(0,z.jsxs)(\`span\`,{className:\`text-brand\`,children:[\`“\`,e.value,\`”\`]})]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(\`span\`,{className:\`font-mono text-foreground\`,children:e.column}),(0,z.jsx)(\`span\`,{className:\`text-muted-foreground/80\`,children:r?.sym??e.op}),!r?.noValue&&(0,z.jsx)(\`span\`,{className:\`truncate text-brand\`,children:e.value})]}),(0,z.jsx)(\`button\`,{className:\`rounded p-0.5 text-muted-foreground/80 hover:bg-muted hover:text-foreground\`,onClick:r=>{r.stopPropagation(),n(t.filter(t=>t.id!==e.id))},children:(0,z.jsx)(Lt,{size:11})})]},e.id)}),s?.column&&(0,z.jsxs)(\`span\`,{className:\`flex shrink-0 items-center gap-1 rounded border border-brand/40 bg-brand/10 px-1.5 py-0.5 text-xs\`,children:[(0,z.jsx)(\`span\`,{className:\`font-mono text-foreground\`,children:s.column}),s.op&&(0,z.jsx)(\`span\`,{className:\`text-brand\`,children:s.op.sym})]}),(0,z.jsx)(\`input\`,{ref:d,value:a,onChange:e=>{o(e.target.value),u(0),s?.op||i(!0)},onFocus:()=>!s?.op&&i(!0),onKeyDown:y,placeholder:t.length===0||s?b:\`Add more filters…\`,className:\`h-6 min-w-[140px] flex-1 bg-transparent text-[13px] text-foreground placeholder:text-muted-foreground/60 focus:outline-none\`})]}),r&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(\`div\`,{className:\`fixed inset-0 z-40\`,onClick:()=>i(!1)}),(0,z.jsx)(\`div\`,{className:\`absolute left-0 top-full z-50 mt-1 max-h-[340px] w-[300px] overflow-auto rounded-md border border-input bg-popover py-1 shadow-xl animate-[fade-in_.1s_ease-out]\`,children:s?.column?Uv.map(e=>{let t=Hv.filter(t=>t.group===e&&t.label.toLowerCase().includes(a.toLowerCase()));return t.length===0?null:(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(\`p\`,{className:\`px-3 pb-1 pt-2 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/80\`,children:e}),t.map(e=>(0,z.jsxs)(\`button\`,{className:\`flex w-full items-center px-3 py-1.5 text-left text-[13px] text-foreground hover:bg-accent\`,onClick:()=>v(e),children:[e.label,(0,z.jsx)(\`span\`,{className:\`ml-auto rounded border border-input bg-accent px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground\`,children:e.sym})]},e.op))]},e)}):(0,z.jsxs)(z.Fragment,{children:[p&&(0,z.jsxs)(\`button\`,{className:\`flex w-full items-center gap-2 px-3 py-1.5 text-left text-[13px] text-foreground \`+(l===0?\`bg-accent\`:\`hover:bg-accent\`),onClick:()=>h({column:\`*\`,op:\`search\`,value:a.trim()}),children:[(0,z.jsx)(vt,{size:13,className:\`text-muted-foreground/80\`}),\`Search all text columns for \`,(0,z.jsxs)(\`span\`,{className:\`text-brand\`,children:[\`“\`,a.trim(),\`”\`]})]}),f.map((e,t)=>{let n=t+ +!!p;return(0,z.jsxs)(\`button\`,{className:\`flex w-full items-center gap-2 px-3 py-1.5 text-left text-[13px] \`+(l===n?\`bg-accent\`:\`hover:bg-accent\`),onClick:()=>g(e.name),children:[(0,z.jsx)(\`span\`,{className:\`font-mono text-foreground\`,children:e.name}),(0,z.jsx)(\`span\`,{className:\`ml-auto text-[11px] text-muted-foreground/60\`,children:e.type})]},e.name)}),f.length===0&&!p&&(0,z.jsx)(\`p\`,{className:\`px-3 py-2 text-xs text-muted-foreground/80\`,children:\`No matching column.\`})]})})]})]})}function py({table:e,schema:t=\`public\`,column:n,onClose:r,onDone:i}){let[a,o]=(0,_.useState)(n),[s,c]=(0,_.useState)(!1);async function l(){let o=a.trim();if(!o||o===n)return r();c(!0);let s=await N.sql(\`alter table \${Yh(t,e)} rename column "\${n}" to "\${o.replace(/"/g,\`""\`)}"\`);if(c(!1),!s.ok){H.error(s.error??\`Rename failed\`);return}H.success(\`Renamed \${n} → \${o}\`),await i()}return(0,z.jsx)(go,{open:!0,onClose:r,title:\`Rename column "\${n}"\`,children:(0,z.jsxs)(\`div\`,{className:\`space-y-3\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`New name\`}),(0,z.jsx)(Y,{mono:!0,value:a,autoFocus:!0,onChange:e=>o(e.target.value),onKeyDown:e=>e.key===\`Enter\`&&void l()})]}),(0,z.jsxs)(\`div\`,{className:\`flex justify-end gap-2\`,children:[(0,z.jsx)(V,{variant:\`outline\`,onClick:r,children:\`Cancel\`}),(0,z.jsx)(V,{onClick:()=>void l(),disabled:s||!a.trim(),children:s?\`Renaming…\`:\`Rename\`})]})]})})}var my=e=>\`"\`+e.replace(/"/g,\`""\`)+\`"\`;async function hy(e){let t=await N.sql(e);return t.ok?null:t.error??\`Statement failed\`}var gy=\`create table new_table (
|
|
1585
1585
|
id uuid primary key default gen_random_uuid(),
|
|
1586
1586
|
name text not null,
|
|
1587
1587
|
created_at timestamptz not null default now()
|
|
1588
|
-
);\`;function
|
|
1588
|
+
);\`;function _y({schema:e=\`public\`,onClose:t,onDone:n}){let[r,i]=(0,_.useState)(e===\`public\`?gy:gy.replace(\`create table \`,\`create table \${my(e)}.\`)),[a,o]=(0,_.useState)(\`\`),[s,c]=(0,_.useState)(!1);async function l(){c(!0),o(\`\`);let e=await hy(r);if(e){o(e),c(!1);return}let i=/create\\s+table\\s+(?:if\\s+not\\s+exists\\s+)?(?:"([^"]+)"|([\\w.]+))/i.exec(r),a=(i?.[1]??i?.[2])?.split(\`.\`).pop();H.success(\`Created table\${a?\` \${a}\`:\`\`}\`),await n(a??void 0),t()}return(0,z.jsx)(go,{open:!0,onClose:t,title:\`New table\`,wide:!0,children:(0,z.jsxs)(\`div\`,{className:\`space-y-3\`,children:[(0,z.jsx)(\`p\`,{className:\`text-xs text-muted-foreground/80\`,children:\`Define the table in SQL — full Postgres DDL is supported (constraints, references, checks…).\`}),(0,z.jsx)(ir,{lang:\`sql\`,className:\`h-56\`,value:r,onChange:i,onCmdEnter:()=>void l()}),a&&(0,z.jsx)(\`p\`,{className:\`rounded border border-destructive/30 bg-destructive/10 px-3 py-2 text-xs text-destructive\`,children:a}),(0,z.jsxs)(\`div\`,{className:\`flex justify-end gap-2\`,children:[(0,z.jsx)(V,{variant:\`outline\`,onClick:t,children:\`Cancel\`}),(0,z.jsx)(V,{onClick:()=>void l(),disabled:s||!r.trim(),children:s?\`Creating…\`:\`Create table\`})]})]})})}var vy=[\`text\`,\`int8\`,\`int4\`,\`numeric\`,\`float8\`,\`bool\`,\`uuid\`,\`timestamptz\`,\`date\`,\`jsonb\`];function yy({table:e,schema:t=\`public\`,onClose:n,onDone:r}){let[i,a]=(0,_.useState)(\`\`),[o,s]=(0,_.useState)(\`text\`),[c,l]=(0,_.useState)(!0),[u,d]=(0,_.useState)(\`\`),[f,p]=(0,_.useState)(!1),[m,h]=(0,_.useState)(\`\`);async function g(){if(!i.trim())return;p(!0),h(\`\`);let a=\`alter table \${Yh(t,e)} add column \${my(i.trim())} \${o}\`;c||(a+=\` not null\`),u.trim()&&(a+=\` default \${u.trim()}\`);let s=await hy(a);if(s){h(s),p(!1);return}H.success(\`Added column \${i.trim()}\`),await r(),n()}return(0,z.jsx)(go,{open:!0,onClose:n,title:\`Add column to "\${e}"\`,children:(0,z.jsxs)(\`div\`,{className:\`space-y-3\`,children:[(0,z.jsxs)(\`div\`,{className:\`grid grid-cols-2 gap-3\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Name\`}),(0,z.jsx)(Y,{mono:!0,value:i,autoFocus:!0,placeholder:\`status\`,onChange:e=>a(e.target.value)})]}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`Type\`}),(0,z.jsx)(Wp,{mono:!0,value:o,onValueChange:s,options:vy.map(e=>({value:e}))})]})]}),(0,z.jsxs)(\`label\`,{className:\`flex cursor-pointer items-center gap-2 text-[13px] text-foreground/80\`,children:[(0,z.jsx)($t,{checked:c,onChange:l}),\`Nullable\`]}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsxs)(X,{children:[\`Default \`,(0,z.jsx)(\`span\`,{className:\`font-normal text-muted-foreground/60\`,children:\`— raw SQL expression, e.g. now() or 'draft'\`})]}),(0,z.jsx)(Y,{mono:!0,value:u,placeholder:\`(none)\`,onChange:e=>d(e.target.value),onKeyDown:e=>e.key===\`Enter\`&&void g()})]}),m&&(0,z.jsx)(\`p\`,{className:\`rounded border border-destructive/30 bg-destructive/10 px-3 py-2 text-xs text-destructive\`,children:m}),(0,z.jsxs)(\`div\`,{className:\`flex justify-end gap-2\`,children:[(0,z.jsx)(V,{variant:\`outline\`,onClick:n,children:\`Cancel\`}),(0,z.jsx)(V,{onClick:()=>void g(),disabled:f||!i.trim(),children:f?\`Adding…\`:\`Add column\`})]})]})})}function by({table:e,schema:t=\`public\`,onClose:n,onDone:r}){let[i,a]=(0,_.useState)(e),[o,s]=(0,_.useState)(!1);async function c(){let a=i.trim();if(!a||a===e)return n();s(!0);let o=await hy(\`alter table \${Yh(t,e)} rename to \${my(a)}\`);if(s(!1),o){H.error(o);return}H.success(\`Renamed \${e} → \${a}\`),await r(a),n()}return(0,z.jsx)(go,{open:!0,onClose:n,title:\`Rename table "\${e}"\`,children:(0,z.jsxs)(\`div\`,{className:\`space-y-3\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`New name\`}),(0,z.jsx)(Y,{mono:!0,value:i,autoFocus:!0,onChange:e=>a(e.target.value),onKeyDown:e=>e.key===\`Enter\`&&void c()})]}),(0,z.jsxs)(\`div\`,{className:\`flex justify-end gap-2\`,children:[(0,z.jsx)(V,{variant:\`outline\`,onClick:n,children:\`Cancel\`}),(0,z.jsx)(V,{onClick:()=>void c(),disabled:o||!i.trim(),children:o?\`Renaming…\`:\`Rename\`})]})]})})}function xy({table:e,schema:t=\`public\`,onClose:n,onDone:r}){let[i,a]=(0,_.useState)(\`\${e}_copy\`),[o,s]=(0,_.useState)(!0),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)(\`\`);async function f(){let a=i.trim();if(!a)return;l(!0),d(\`\`);let s=await hy(\`create table \${Yh(t,a)} (like \${Yh(t,e)} including all)\`);if(s){d(s),l(!1);return}if(o){let n=await hy(\`insert into \${Yh(t,a)} select * from \${Yh(t,e)}\`);if(n){d(\`Table created, but copying rows failed: \${n}\`),l(!1),await r(a);return}}H.success(\`Duplicated \${e} → \${a}\`),await r(a),n()}return(0,z.jsx)(go,{open:!0,onClose:n,title:\`Duplicate table "\${e}"\`,children:(0,z.jsxs)(\`div\`,{className:\`space-y-3\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(X,{children:\`New table name\`}),(0,z.jsx)(Y,{mono:!0,value:i,autoFocus:!0,onChange:e=>a(e.target.value),onKeyDown:e=>e.key===\`Enter\`&&void f()})]}),(0,z.jsxs)(\`label\`,{className:\`flex cursor-pointer items-center gap-2 text-[13px] text-foreground/80\`,children:[(0,z.jsx)($t,{checked:o,onChange:s}),\`Copy the rows too\`]}),(0,z.jsx)(\`p\`,{className:\`text-[11px] text-muted-foreground/60\`,children:\`Copies columns, defaults, not-null constraints and indexes. Foreign keys are not copied.\`}),u&&(0,z.jsx)(\`p\`,{className:\`rounded border border-destructive/30 bg-destructive/10 px-3 py-2 text-xs text-destructive\`,children:u}),(0,z.jsxs)(\`div\`,{className:\`flex justify-end gap-2\`,children:[(0,z.jsx)(V,{variant:\`outline\`,onClick:n,children:\`Cancel\`}),(0,z.jsx)(V,{onClick:()=>void f(),disabled:c||!i.trim(),children:c?\`Duplicating…\`:\`Duplicate\`})]})]})})}function Sy({table:e,schema:t=\`public\`,onClose:n,onDone:r}){let[i,a]=(0,_.useState)(!1),[o,s]=(0,_.useState)(!1),[c,l]=(0,_.useState)(\`\`);async function u(){s(!0),l(\`\`);let a=await hy(\`drop table \${Yh(t,e)}\${i?\` cascade\`:\`\`}\`);if(a){l(a),s(!1);return}H.success(\`Dropped table \${e}\`),await r(),n()}return(0,z.jsx)(go,{open:!0,onClose:n,title:\`Delete table "\${e}"?\`,children:(0,z.jsxs)(\`div\`,{className:\`space-y-3\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex items-start gap-3\`,children:[(0,z.jsx)(\`div\`,{className:\`flex size-8 shrink-0 items-center justify-center rounded-full bg-destructive/15\`,children:(0,z.jsx)(jt,{size:15,className:\`text-destructive\`})}),(0,z.jsx)(\`p\`,{className:\`text-[13px] leading-relaxed text-muted-foreground\`,children:\`The table and all of its rows will be permanently deleted. This cannot be undone.\`})]}),(0,z.jsxs)(\`label\`,{className:\`flex cursor-pointer items-center gap-2 text-[13px] text-foreground/80\`,children:[(0,z.jsx)($t,{checked:i,onChange:a}),\`Also drop dependent objects (CASCADE)\`]}),c&&(0,z.jsx)(\`p\`,{className:\`rounded border border-destructive/30 bg-destructive/10 px-3 py-2 text-xs text-destructive\`,children:c}),(0,z.jsxs)(\`div\`,{className:\`flex justify-end gap-2\`,children:[(0,z.jsx)(V,{variant:\`outline\`,onClick:n,children:\`Cancel\`}),(0,z.jsx)(V,{variant:\`dangerSolid\`,onClick:()=>void u(),disabled:o,children:o?\`Deleting…\`:\`Delete table\`})]})]})})}function Cy({table:e,tables:t,initial:n,isNew:r,readOnly:i,onClose:a,onSave:o,onDelete:s}){let c=e.columns.filter(e=>!(r&&e.isPrimaryKey&&e.hasDefault)),[l,u]=(0,_.useState)(()=>{let e={};for(let t of c){let r=n[t.name];e[t.name]=r==null?\`\`:typeof r==\`object\`?JSON.stringify(r,null,2):String(r)}return e}),[d,f]=(0,_.useState)(()=>{let e=new Set;if(!r)for(let t of c)n[t.name]===null&&e.add(t.name);return e}),[p,m]=(0,_.useState)(new Set),[h,g]=(0,_.useState)(null),[v,y]=(0,_.useState)(!1),[b,x]=(0,_.useState)(\`\`),[S,C]=(0,_.useState)(!1),[w,T]=(0,_.useState)({});(0,_.useEffect)(()=>{N.sql(\`select t.typname as name, e.enumlabel as label
|
|
1589
1589
|
from pg_enum e join pg_type t on t.oid = e.enumtypid
|
|
1590
|
-
order by t.typname, e.enumsortorder\`).then(e=>{if(!e.ok||!e.rows)return;let t={};for(let n of e.rows)(t[n.name]??=[]).push(n.label);T(t)}).catch(()=>{})},[]);function E(e,t){u(n=>({...n,[e]:t})),m(t=>new Set(t).add(e)),f(t=>{if(!t.has(e))return t;let n=new Set(t);return n.delete(e),n})}function D(e){m(t=>new Set(t).add(e)),f(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}async function O(){if(i)return;x(\`\`);for(let e of c){let t=l[e.name]??\`\`;if(!(d.has(e.name)||t===\`\`||t===\`__null\`)){if(e.type===\`json\`||e.type===\`jsonb\`||e.type.startsWith(\`_\`))try{JSON.parse(t)}catch{return x(\`"\${e.name}": not valid JSON — fix it or set the field to NULL.\`)}if(/^(int|float|numeric)/.test(e.type)&&Number.isNaN(Number(t)))return x(\`"\${e.name}": "\${t}" is not a number.\`)}}if(r){for(let e of c)if(!e.nullable&&!e.hasDefault&&(l[e.name]??\`\`)===\`\`&&!d.has(e.name))return x(\`"\${e.name}" is required.\`)}C(!0);let e={};for(let t of c){if(!r&&t.isPrimaryKey||!r&&!p.has(t.name))continue;if(d.has(t.name)){e[t.name]=null;continue}let n=l[t.name]??\`\`;if(n===\`__null\`){e[t.name]=null;continue}if(n===\`\`){!r&&t.nullable&&(e[t.name]=null);continue}e[t.name]=
|
|
1591
|
-
\`)?4:2,value:n,disabled:r,placeholder:a,onChange:e=>i(e.target.value)}):(0,z.jsx)(
|
|
1590
|
+
order by t.typname, e.enumsortorder\`).then(e=>{if(!e.ok||!e.rows)return;let t={};for(let n of e.rows)(t[n.name]??=[]).push(n.label);T(t)}).catch(()=>{})},[]);function E(e,t){u(n=>({...n,[e]:t})),m(t=>new Set(t).add(e)),f(t=>{if(!t.has(e))return t;let n=new Set(t);return n.delete(e),n})}function D(e){m(t=>new Set(t).add(e)),f(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}async function O(){if(i)return;x(\`\`);for(let e of c){let t=l[e.name]??\`\`;if(!(d.has(e.name)||t===\`\`||t===\`__null\`)){if(e.type===\`json\`||e.type===\`jsonb\`||e.type.startsWith(\`_\`))try{JSON.parse(t)}catch{return x(\`"\${e.name}": not valid JSON — fix it or set the field to NULL.\`)}if(/^(int|float|numeric)/.test(e.type)&&Number.isNaN(Number(t)))return x(\`"\${e.name}": "\${t}" is not a number.\`)}}if(r){for(let e of c)if(!e.nullable&&!e.hasDefault&&(l[e.name]??\`\`)===\`\`&&!d.has(e.name))return x(\`"\${e.name}" is required.\`)}C(!0);let e={};for(let t of c){if(!r&&t.isPrimaryKey||!r&&!p.has(t.name))continue;if(d.has(t.name)){e[t.name]=null;continue}let n=l[t.name]??\`\`;if(n===\`__null\`){e[t.name]=null;continue}if(n===\`\`){!r&&t.nullable&&(e[t.name]=null);continue}e[t.name]=Xv(n,t.type)}try{await o(e)}catch(e){x(e.message),C(!1)}}return(0,z.jsxs)(qp,{open:!0,onClose:a,title:(0,z.jsxs)(\`span\`,{children:[i?\`View row from \`:r?\`Insert row into \`:\`Update row from \`,(0,z.jsx)(\`code\`,{className:\`rounded bg-accent px-1.5 py-0.5 font-mono text-xs text-foreground\`,children:e.name})]}),footer:i?(0,z.jsx)(Kp,{asChild:!0,children:(0,z.jsx)(V,{variant:\`outline\`,className:\`ml-auto\`,children:\`Close\`})}):(0,z.jsxs)(z.Fragment,{children:[!r&&s&&(0,z.jsxs)(V,{variant:\`danger\`,onClick:()=>y(!0),children:[(0,z.jsx)(At,{size:13}),\` Delete row\`]}),(0,z.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-2\`,children:[(0,z.jsxs)(\`span\`,{className:\`mr-1 hidden items-center gap-1 text-[11px] text-muted-foreground/60 sm:flex\`,children:[(0,z.jsx)(uf,{children:\`Ctrl\`}),\`+\`,(0,z.jsx)(uf,{children:\`↵\`}),\` to save\`]}),(0,z.jsx)(Kp,{asChild:!0,children:(0,z.jsx)(V,{variant:\`outline\`,children:\`Cancel\`})}),(0,z.jsx)(V,{onClick:()=>void O(),disabled:S,children:S?\`Saving…\`:r?\`Insert row\`:\`Save changes\`})]})]}),children:[(0,z.jsxs)(\`div\`,{className:\`space-y-4\`,onKeyDown:e=>{e.key===\`Enter\`&&(e.ctrlKey||e.metaKey)&&O()},children:[r&&e.columns.some(e=>e.isPrimaryKey&&e.hasDefault)&&(0,z.jsxs)(\`p\`,{className:\`rounded-md border border-border bg-card px-3 py-2 text-[11px] text-muted-foreground/80\`,children:[\`Primary key\`,\` \`,(0,z.jsx)(\`span\`,{className:\`font-mono text-muted-foreground\`,children:e.columns.filter(e=>e.isPrimaryKey&&e.hasDefault).map(e=>e.name).join(\`, \`)}),\` \`,\`is generated automatically.\`]}),c.map(t=>{let n=e.foreignKeys.find(e=>e.columns.includes(t.name)),a=d.has(t.name),o=!t.nullable&&!t.hasDefault,s=/^(timestamp|date|time)/.test(t.type),c=i||!r&&t.isPrimaryKey;return(0,z.jsxs)(\`div\`,{children:[(0,z.jsxs)(\`div\`,{className:\`mb-1 flex items-center gap-1.5\`,children:[(0,z.jsx)(X,{children:(0,z.jsx)(\`span\`,{className:\`font-mono text-foreground/80\`,children:t.name})}),(0,z.jsx)(\`span\`,{className:\`mb-1 text-[11px] text-muted-foreground/60\`,children:t.type}),t.isPrimaryKey&&(0,z.jsxs)(B,{variant:\`amber\`,className:\`mb-1\`,children:[c&&(0,z.jsx)(Ze,{size:9}),\` PK\`]}),o&&!c&&(0,z.jsx)(B,{variant:\`red\`,className:\`mb-1\`,children:\`required\`}),!c&&(0,z.jsxs)(\`span\`,{className:\`mb-1 ml-auto flex items-center gap-1\`,children:[s&&!a&&(0,z.jsx)(wy,{label:\`now\`,onClick:()=>E(t.name,Jv(t.type))}),t.type===\`uuid\`&&!n&&!a&&(0,z.jsx)(wy,{label:\`generate\`,onClick:()=>E(t.name,crypto.randomUUID())}),t.nullable&&t.type!==\`bool\`&&(0,z.jsx)(wy,{label:\`NULL\`,active:a,onClick:()=>D(t.name)})]})]}),c?(0,z.jsxs)(\`div\`,{className:\`flex h-8 items-center gap-2 rounded-md border border-border bg-card px-2.5 font-mono text-[13px] text-muted-foreground/80\`,children:[(0,z.jsx)(Ze,{size:11,className:\`shrink-0 text-muted-foreground/60\`}),(0,z.jsx)(\`span\`,{className:\`truncate\`,children:l[t.name]||\`NULL\`})]}):n?(0,z.jsx)(uy,{fk:n,value:a?\`\`:l[t.name]??\`\`,disabled:a,placeholder:t.hasDefault?\`default — or select a record\`:\`Select a record…\`,onOpen:()=>g({col:t.name,fk:n})}):(0,z.jsx)(Ty,{col:t,enums:w,value:a?\`\`:l[t.name]??\`\`,disabled:a,onChange:e=>E(t.name,e)})]},t.name)}),b&&(0,z.jsx)(\`p\`,{className:\`wrap-break-word rounded border border-destructive/30 bg-destructive/10 px-3 py-2 text-xs text-destructive\`,children:b})]}),v&&s&&(0,z.jsx)(q,{open:!0,danger:!0,title:\`Delete this row?\`,description:\`The row will be permanently deleted. This cannot be undone.\`,confirmLabel:\`Delete row\`,onConfirm:()=>void s().catch(e=>x(e.message)),onClose:()=>y(!1)}),h&&(0,z.jsx)(ly,{fk:h.fk,tables:t,currentKey:l[h.col]||null,onClose:()=>g(null),onPick:e=>{for(let[t,n]of Object.entries(e))E(t,n==null?\`\`:String(n))}})]})}function wy({label:e,active:t,onClick:n}){return(0,z.jsx)(\`button\`,{type:\`button\`,className:\`rounded border px-1.5 py-px text-[10px] transition-colors \`+(t?\`border-brand/50 bg-brand/15 text-brand\`:\`border-input text-muted-foreground/80 hover:border-muted-foreground hover:text-foreground/80\`),onClick:n,children:e})}function Ty({col:e,enums:t,value:n,disabled:r,onChange:i}){let a=r?\`NULL\`:e.hasDefault?\`default\`:e.nullable?\`NULL\`:\`\`,o=e.hasDefault?\`default\`:e.nullable?\`NULL\`:\`—\`;return e.type===\`bool\`?(0,z.jsx)(Wp,{mono:!0,value:n,disabled:r,onValueChange:i,options:[{value:\`\`,label:o},{value:\`true\`},{value:\`false\`},...e.nullable?[{value:\`__null\`,label:\`NULL\`}]:[]]}):t[e.type]?(0,z.jsx)(Wp,{mono:!0,value:n,disabled:r,onValueChange:i,options:[{value:\`\`,label:o},...t[e.type].map(e=>({value:e}))]}):e.type===\`json\`||e.type===\`jsonb\`||e.type.startsWith(\`_\`)?(0,z.jsx)(em,{rows:4,value:n,disabled:r,placeholder:a||\`{ }\`,onChange:e=>i(e.target.value)}):e.type===\`text\`?(0,z.jsx)(em,{rows:n.length>80||n.includes(\`
|
|
1591
|
+
\`)?4:2,value:n,disabled:r,placeholder:a,onChange:e=>i(e.target.value)}):(0,z.jsx)(Y,{mono:!0,value:n,disabled:r,placeholder:a,inputMode:/^(int|float|numeric)/.test(e.type)?\`decimal\`:void 0,onChange:e=>i(e.target.value)})}function Ey({tables:e,schema:t,managed:n,active:r,onSelect:i,onTablesChanged:a,onOpenPolicies:o,refreshKey:s}){let[c,l]=(0,_.useState)(\`\`),[u,d]=(0,_.useState)(null),[f,p]=(0,_.useState)({});(0,_.useEffect)(()=>{let e=!1;return N.sql(\`select c.relname as name, c.relkind = 'v' as is_view, c.relrowsecurity as rls,
|
|
1592
1592
|
coalesce('security_invoker=true' = any(c.reloptions) or 'security_invoker=on' = any(c.reloptions), false) as invoker
|
|
1593
1593
|
from pg_class c join pg_namespace n on n.oid = c.relnamespace
|
|
1594
|
-
where n.nspname = '\${t.replace(/'/g,\`''\`)}' and c.relkind in ('r','v')\`).then(t=>{if(e||!t.ok||!t.rows)return;let n={};for(let e of t.rows)n[e.name]=e.is_view?!e.invoker:!e.rls;p(n)}).catch(()=>{}),()=>{e=!0}},[e,t,s]);async function m(e){try{await Qn(await
|
|
1594
|
+
where n.nspname = '\${t.replace(/'/g,\`''\`)}' and c.relkind in ('r','v')\`).then(t=>{if(e||!t.ok||!t.rows)return;let n={};for(let e of t.rows)n[e.name]=e.is_view?!e.invoker:!e.rls;p(n)}).catch(()=>{}),()=>{e=!0}},[e,t,s]);async function m(e){try{await Qn(await ny(t,e),\`\${e} schema\`)}catch(e){H.error(e.message)}}async function h(e,n){try{let{rows:r,total:i}=await N.rows(e,{limit:1e4,offset:0,schema:t});if(n===\`json\`)__(\`\${e}.json\`,\`application/json\`,JSON.stringify(r,null,2));else{let t=r[0]?Object.keys(r[0]):[];__(\`\${e}.csv\`,\`text/csv\`,g_(t,r))}i>r.length?H(\`Exported the first \${r.length.toLocaleString()} of \${i.toLocaleString()} rows\`):H.success(\`Exported \${r.length.toLocaleString()} rows\`)}catch(e){H.error(e.message)}}let g=e.filter(e=>e.name.toLowerCase().includes(c.toLowerCase()));return(0,z.jsxs)(hf,{id:\`table-editor-rail\`,side:\`left\`,defaultSize:240,min:200,max:420,className:\`flex flex-col border-r border-border bg-card\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex items-center justify-between px-3 py-2.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground/80\`,children:[\`Tables \`,(0,z.jsx)(\`span\`,{className:\`text-muted-foreground/60\`,children:e.length})]}),(0,z.jsxs)(\`div\`,{className:\`space-y-1.5 px-2 pb-2\`,children:[(0,z.jsx)(Qh,{className:\`w-full\`}),!n&&(0,z.jsxs)(V,{variant:\`outline\`,size:\`xs\`,className:\`w-full\`,onClick:()=>d({kind:\`new\`}),children:[(0,z.jsx)(mt,{size:12}),\` New table\`]}),(0,z.jsxs)(\`div\`,{className:\`relative\`,children:[(0,z.jsx)(vt,{size:13,className:\`pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground/60\`}),(0,z.jsx)(\`input\`,{value:c,onChange:e=>l(e.target.value),placeholder:\`Search tables…\`,className:\`h-7 w-full rounded-md border border-border bg-field pl-7 pr-2 text-xs text-foreground placeholder:text-muted-foreground/60 focus:border-muted-foreground focus:outline-none\`})]})]}),(0,z.jsxs)(\`div\`,{className:\`flex-1 overflow-auto pb-2\`,children:[g.map(e=>{let t=!n&&f[e.name]===!0;return(0,z.jsxs)(\`div\`,{className:\`group flex w-full items-center gap-1.5 pl-3 pr-1.5 text-left text-[13px] \`+(r===e.name?\`bg-accent text-foreground\`:\`text-muted-foreground hover:bg-accent/50\`),children:[(0,z.jsxs)(\`button\`,{className:\`flex min-w-0 flex-1 items-center gap-2 py-1.5 text-left\`,onClick:()=>i(e.name),children:[e.isView?(0,z.jsx)(\`span\`,{title:\`View (read-only)\`,children:(0,z.jsx)(Ae,{size:12,className:\`shrink-0 text-muted-foreground/60\`})}):(0,z.jsx)(Ot,{size:12,className:\`shrink-0 text-muted-foreground/50\`}),(0,z.jsx)(\`span\`,{className:\`truncate font-mono\`,children:e.name}),t&&(0,z.jsx)(\`span\`,{className:\`shrink-0 rounded border border-destructive/30 bg-destructive/10 px-1 py-px text-[8px] font-semibold tracking-wider text-destructive\`,title:e.isView?\`View runs with the owner’s permissions (no security_invoker) — RLS on the underlying tables is bypassed\`:\`RLS is disabled — all rows are exposed to every role\`,children:\`UNRESTRICTED\`})]}),(0,z.jsx)(\`span\`,{className:\`shrink-0 text-[11px] text-muted-foreground/60 group-hover:hidden\`,children:e.rowCount}),(0,z.jsxs)(Qd,{children:[(0,z.jsx)($d,{asChild:!0,children:(0,z.jsx)(\`button\`,{className:\`hidden shrink-0 rounded p-1 text-muted-foreground/80 hover:bg-muted hover:text-foreground group-hover:block data-[state=open]:block data-[state=open]:bg-muted data-[state=open]:text-foreground\`,title:\`Table actions\`,children:(0,z.jsx)(De,{size:13})})}),(0,z.jsxs)(nf,{align:\`start\`,children:[(0,z.jsxs)(rf,{onSelect:()=>void Qn(e.name,\`"\${e.name}"\`),children:[(0,z.jsx)(Se,{size:13}),\` Copy name\`]}),!e.isView&&(0,z.jsxs)(rf,{onSelect:()=>void m(e.name),children:[(0,z.jsx)(Me,{size:13}),\` Copy table schema\`]}),(0,z.jsx)(sf,{}),!e.isView&&!n&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(rf,{onSelect:()=>d({kind:\`rename\`,table:e.name}),children:[(0,z.jsx)(lt,{size:13}),\` Rename table\`]}),(0,z.jsxs)(rf,{onSelect:()=>d({kind:\`duplicate\`,table:e.name}),children:[(0,z.jsx)(Pe,{size:13}),\` Duplicate table\`]}),(0,z.jsxs)(rf,{onSelect:()=>o(e.name),children:[(0,z.jsx)(St,{size:13}),\` View policies\`]})]}),(0,z.jsxs)(ef,{children:[(0,z.jsxs)(af,{children:[(0,z.jsx)(Ee,{size:13}),\` Export data\`]}),(0,z.jsxs)(of,{children:[(0,z.jsx)(rf,{onSelect:()=>void h(e.name,\`csv\`),children:\`Export as CSV\`}),(0,z.jsx)(rf,{onSelect:()=>void h(e.name,\`json\`),children:\`Export as JSON\`})]})]}),!e.isView&&!n&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(sf,{}),(0,z.jsxs)(rf,{danger:!0,onSelect:()=>d({kind:\`delete\`,table:e.name}),children:[(0,z.jsx)(At,{size:13}),\` Delete table\`]})]})]})]})]},e.name)}),g.length===0&&(0,z.jsx)(lf,{children:e.length===0?\`No tables yet — create one.\`:\`No match.\`})]}),u?.kind===\`new\`&&(0,z.jsx)(_y,{schema:t,onClose:()=>d(null),onDone:async e=>{await a(),e&&i(e)}}),u?.kind===\`rename\`&&(0,z.jsx)(by,{table:u.table,schema:t,onClose:()=>d(null),onDone:async e=>{await a(),i(e)}}),u?.kind===\`duplicate\`&&(0,z.jsx)(xy,{table:u.table,schema:t,onClose:()=>d(null),onDone:async e=>{await a(),i(e)}}),u?.kind===\`delete\`&&(0,z.jsx)(Sy,{table:u.table,schema:t,onClose:()=>d(null),onDone:a})]})}function Dy(){let[e]=qh(),[t,n]=(0,_.useState)([]),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(!0),[s,c]=(0,_.useState)([]),[l,u]=(0,_.useState)(0),[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)(0),[h,g]=(0,_.useState)(100),[v,y]=(0,_.useState)([]),[b,x]=(0,_.useState)([]),[S,C]=(0,_.useState)(new Set),[w,E]=(0,_.useState)(new Set),[D,O]=(0,_.useState)({}),[k,A]=(0,_.useState)(new Set),j=(0,_.useRef)(null),[M,ee]=(0,_.useState)(null),[te,P]=(0,_.useState)(!1),[F,ne]=(0,_.useState)(null),[re,ie]=(0,_.useState)(!1),[ae,oe]=(0,_.useState)(null),[I,se]=(0,_.useState)(!1),[de,pe]=(0,_.useState)(null),[_e,ve]=(0,_.useState)(null),[ye,be]=(0,_.useState)(null),[xe,Ce]=(0,_.useState)(!1),[we,Te]=(0,_.useState)(\`data\`),[Oe,je]=(0,_.useState)({kind:\`postgres\`}),[Me,Ne]=(0,_.useState)(null),[Pe,Fe]=(0,_.useState)(0),Ie=(0,_.useCallback)(()=>Fe(e=>e+1),[]),L=t.find(e=>e.name===r)||null,Re=Zh(e),ze=!!L&&L.primaryKey.length>0&&!L.isView&&!Re,[Be,Ve]=(0,_.useState)({});(0,_.useEffect)(()=>{N.sql(\`select t.typname as name, e.enumlabel as label
|
|
1595
1595
|
from pg_enum e join pg_type t on t.oid = e.enumtypid
|
|
1596
|
-
order by t.typname, e.enumsortorder\`).then(e=>{if(!e.ok||!e.rows)return;let t={};for(let n of e.rows)(t[n.name]??=[]).push(n.label);Ve(t)}).catch(()=>{})},[e]);let He=(0,_.useMemo)(()=>L?L.columns.filter(e=>!S.has(e.name)):[],[L,S]),Ue=(0,_.useMemo)(()=>He.filter(e=>w.has(e.name)),[He,w]),We=(0,_.useCallback)(e=>D[e.name]??Kv(e),[D]),Ge=(0,_.useCallback)(e=>L?.foreignKeys.find(t=>t.columns.includes(e)),[L]),qe=(0,_.useCallback)(e=>{if(!w.has(e))return null;let t=56;for(let n of Ue){if(n.name===e)return t;t+=We(n)}return t},[w,Ue,We]),Je=Yt(),Qe=Je.tab===\`table\`?Je.section:null,$e=(0,_.useRef)(Qe);$e.current=Qe;let et=(0,_.useCallback)(async()=>{try{let t=await N.tables(e);n(t),i(e=>{if(e&&t.some(t=>t.name===e))return e;let n=$e.current;return n&&t.some(e=>e.name===n)?n:t[0]?.name??null})}catch(e){H.error(e.message)}},[e]);(0,_.useEffect)(()=>{i(null),n([]),o(!0),et().finally(()=>o(!1))},[et]),(0,_.useEffect)(()=>{Qe&&Qe!==r&&t.some(e=>e.name===Qe)&&i(Qe)},[Qe,t]),(0,_.useEffect)(()=>{!r||Je.tab!==\`table\`||Je.section===r||Qe&&t.some(e=>e.name===Qe)||R(\`table\`,r,{replace:!0})},[r,t]);let nt=(0,_.useRef)(0),rt=(0,_.useCallback)(async()=>{if(!r||!L)return;let t=++nt.current;f(!0);try{let n=v.length>0?v.map(e=>\`\${e.column}.\${e.dir}\`).join(\`,\`):L.primaryKey[0]?\`\${L.primaryKey[0]}.asc\`:void 0,{rows:i,total:a}=await N.rows(r,{limit:h,offset:p*h,order:n,schema:e,filters:Gv(L.columns,b)});if(t!==nt.current)return;c(i),u(a)}catch(e){t===nt.current&&H.error(e.message)}finally{t===nt.current&&f(!1)}},[r,L,p,h,v,b,Oe,Pe,e]);(0,_.useEffect)(()=>()=>T(null),[]),(0,_.useEffect)(()=>{rt()},[rt]),(0,_.useEffect)(()=>{c([]),u(0),m(0),y([]),x([]),A(new Set),C(new Set),E(new Set),O({}),pe(null),ve(null),be(null),ee(null),j.current=null},[r,e]),(0,_.useEffect)(()=>{m(0),A(new Set)},[b,h]),(0,_.useEffect)(()=>{if(!L)return;let e=new Set(L.columns.map(e=>e.name));y(t=>t.some(t=>!e.has(t.column))?t.filter(t=>e.has(t.column)):t),x(t=>t.some(t=>t.column!==\`*\`&&!e.has(t.column))?t.filter(t=>t.column===\`*\`||e.has(t.column)):t),C(t=>[...t].some(t=>!e.has(t))?new Set([...t].filter(t=>e.has(t))):t),E(t=>[...t].some(t=>!e.has(t))?new Set([...t].filter(t=>e.has(t))):t)},[L]);let it=(0,_.useCallback)(e=>JSON.stringify(L.primaryKey.map(t=>e[t])),[L]),at=(0,_.useCallback)(e=>{let t={};for(let n of L.primaryKey)t[n]=e[n];return t},[L]);function ot(e,t,n){A(r=>{let i=new Set(r),a=e=>{let n=it(s[e]);t?i.add(n):i.delete(n)};if(n&&j.current!==null){let[t,n]=[Math.min(j.current,e),Math.max(j.current,e)];for(let e=t;e<=n;e++)a(e)}else a(e);return i}),j.current=e}let st=(0,_.useMemo)(()=>ze?s.map(e=>it(e)):[],[s,it,ze]),ct=st.length>0&&st.every(e=>k.has(e)),ft=st.some(e=>k.has(e)),pt=(0,_.useMemo)(()=>ze?s.filter(e=>k.has(it(e))):[],[s,k,it,ze]),ht=(0,_.useCallback)(async()=>{if(!(!L||k.size===0))try{let t=[...k].map(e=>JSON.parse(e));if(L.primaryKey.length===1)await N.deleteRows(L.name,L.primaryKey[0],t.map(e=>e[0]),e);else for(let n of t){let t={};L.primaryKey.forEach((e,r)=>t[e]=n[r]),await N.deleteRow(L.name,t,e)}H.success(\`Deleted \${k.size} row(s)\`),A(new Set),await rt(),await et()}catch(e){H.error(e.message)}},[L,k,rt,et]);function _t(e){let t=He.map(e=>e.name);e===\`json\`?g_(\`\${r}-page\${p+1}.json\`,\`application/json\`,JSON.stringify(s,null,2)):g_(\`\${r}-page\${p+1}.csv\`,\`text/csv\`,h_(t,s))}function vt(e,t){y(n=>{let r=n.find(t=>t.column===e),i=r?r.dir===\`asc\`?{column:e,dir:\`desc\`}:null:{column:e,dir:\`asc\`};if(!t)return i?[i]:[];let a=n.filter(t=>t.column!==e);return i?[...a,i]:a})}function yt(e,t,n){if(!ze)return;if(t.isPrimaryKey)return H(\`Primary key columns are locked — use the SQL editor to change keys\`);let r=Ge(t.name);if(r)return be({row:e,fk:r,col:t.name});let i=n.getBoundingClientRect();pe({key:it(e),col:t.name,rect:{top:i.top,left:i.left,width:i.width,height:i.height}})}async function bt(t,n){try{let i=await N.updateRow(r,at(t),n,e),a=Array.isArray(i)?i[0]:null;c(e=>e.map(e=>e===t?a??{...e,...n}:e)),H.success(\`Row updated\`)}catch(e){H.error(e.message)}}async function xt(t,n,i,a){let o=t[n.name],s=o==null?\`\`:typeof o==\`object\`?JSON.stringify(o):String(o),l=t;if(i!==s){let a=i===\`__null\`||i===\`\`&&n.nullable?null:Yv(i,n.type);try{let i=await N.updateRow(r,at(t),{[n.name]:a},e);l=(Array.isArray(i)?i[0]:null)??{...t,[n.name]:a},c(e=>e.map(e=>e===t?l:e)),H.success(\`Row updated\`)}catch(e){H.error(e.message),pe(null);return}}if(a!==0&&de){let e=He.findIndex(e=>e.name===n.name),t=a,r=He[e+t],i=de.rect.left,o=n;for(;r&&(r.isPrimaryKey||Ge(r.name));)i+=a===1?We(o):-We(r),o=r,t+=a,r=He[e+t];if(r)return i+=a===1?We(o):-We(r),pe({key:it(l),col:r.name,rect:{...de.rect,left:i,width:We(r)}})}pe(null)}async function St(t){if(!r)return;let n=await N.sql(\`alter table \${Jh(e,r)} drop column "\${t}"\`);if(!n.ok)return H.error(n.error??\`Failed to drop column\`);H.success(\`Dropped column \${t}\`),await et()}let[Ct,wt]=(0,_.useState)(null);(0,_.useEffect)(()=>wt(null),[r,p,s.length,He.length]),(0,_.useEffect)(()=>{let e=e=>{let t=e.target;if(!(M||te||F||de||t.closest(\`input, textarea, select, [role="dialog"]\`))){if(Ct&&ze){let t=(t,n)=>{e.preventDefault();let r=Math.max(0,Math.min(s.length-1,Ct.r+t)),i=Math.max(0,Math.min(He.length-1,Ct.c+n));wt({r,c:i}),document.querySelector(\`[data-cell="\${r}:\${He[i]?.name}"]\`)?.scrollIntoView({block:\`nearest\`,inline:\`nearest\`})};if(e.key===\`ArrowUp\`)return t(-1,0);if(e.key===\`ArrowDown\`)return t(1,0);if(e.key===\`ArrowLeft\`)return t(0,-1);if(e.key===\`ArrowRight\`)return t(0,1);let n=s[Ct.r],r=He[Ct.c];if(n&&r&&e.key===\`Enter\`){e.preventDefault();let t=document.querySelector(\`[data-cell="\${Ct.r}:\${r.name}"]\`);t&&yt(n,r,t);return}if(n&&r&&(e.key===\`Delete\`||e.key===\`Backspace\`)&&!r.isPrimaryKey&&!Ge(r.name)&&r.nullable&&n[r.name]!==null){e.preventDefault(),xt(n,r,\`\`,0);return}if(e.key===\`Escape\`){wt(null);return}}e.key===\`Escape\`&&A(new Set),e.key===\`Delete\`&&k.size>0&&ie(!0)}};return window.addEventListener(\`keydown\`,e),()=>window.removeEventListener(\`keydown\`,e)},[k,M,te,F,de,Ct,s,He,ze]);let Tt=(0,_.useRef)(null);if((0,_.useEffect)(()=>{let e=e=>{let t=Tt.current;t&&O(n=>({...n,[t.col]:Math.max(72,t.startW+(e.clientX-t.startX))}))},t=()=>Tt.current=null;return window.addEventListener(\`mousemove\`,e),window.addEventListener(\`mouseup\`,t),()=>{window.removeEventListener(\`mousemove\`,e),window.removeEventListener(\`mouseup\`,t)}},[]),a)return(0,z.jsx)(Jp,{});let Et=Math.max(1,Math.ceil(l/h)),Dt=56+He.reduce((e,t)=>e+We(t),0)+40;return(0,z.jsxs)(\`div\`,{className:\`flex h-full\`,children:[(0,z.jsx)(Ty,{tables:t,schema:e,managed:Re,active:r,onSelect:i,onTablesChanged:et,onOpenPolicies:Ne,refreshKey:Pe}),(0,z.jsx)(\`div\`,{className:\`flex min-w-0 flex-1 flex-col\`,children:L?(0,z.jsxs)(z.Fragment,{children:[we===\`definition\`?(0,z.jsx)(ny,{table:L.name,schema:e,refreshKey:L}):(0,z.jsxs)(z.Fragment,{children:[k.size>0?(0,z.jsxs)(\`div\`,{className:\`flex h-11.5 shrink-0 items-center gap-3 border-b border-border bg-brand/10 px-3\`,children:[(0,z.jsx)($t,{checked:ct,indeterminate:!ct&&ft,onChange:e=>A(e?new Set(st):new Set)}),(0,z.jsxs)(\`span\`,{className:\`text-[13px] text-foreground\`,children:[(0,z.jsx)(\`span\`,{className:\`font-semibold text-brand\`,children:k.size}),\` row\`,k.size===1?\`\`:\`s\`,\` selected\`]}),(0,z.jsx)(\`div\`,{className:\`mx-1 h-4 w-px bg-muted\`}),(0,z.jsx)(er,{variant:\`outline\`,size:\`xs\`,label:\`rows as JSON\`,value:()=>JSON.stringify(pt,null,2),children:\`Copy JSON\`}),(0,z.jsx)(er,{variant:\`outline\`,size:\`xs\`,label:\`rows as CSV\`,value:()=>h_(He.map(e=>e.name),pt),children:\`Copy CSV\`}),(0,z.jsxs)(V,{variant:\`dangerSolid\`,size:\`xs\`,onClick:()=>ie(!0),children:[(0,z.jsx)(At,{size:12}),\` Delete \`,k.size]}),(0,z.jsxs)(\`span\`,{className:\`ml-1 hidden items-center gap-1 text-[11px] text-muted-foreground/80 lg:flex\`,children:[(0,z.jsx)(uf,{children:\`Del\`}),\` delete · \`,(0,z.jsx)(uf,{children:\`Esc\`}),\` clear\`]}),(0,z.jsx)(\`button\`,{className:\`ml-auto p-1 text-muted-foreground/80 hover:text-foreground\`,onClick:()=>A(new Set),children:(0,z.jsx)(Lt,{size:15})})]}):(0,z.jsxs)(\`div\`,{className:\`flex h-11.5 shrink-0 items-center gap-2 border-b border-border px-3\`,children:[(0,z.jsx)(dy,{columns:L.columns,filters:b,onChange:x}),(0,z.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-1.5\`,children:[!Re&&(L.isView?(0,z.jsx)(Fg,{view:L.name,schema:e,refreshKey:Pe,onChanged:Ie},L.name):(0,z.jsx)(Pg,{table:L.name,schema:e,refreshKey:Pe,onChanged:Ie},L.name)),(0,z.jsx)(av,{value:Oe,onChange:(e,t)=>{T(t),je(e),A(new Set)}}),(0,z.jsxs)(pf,{open:xe,onOpenChange:Ce,align:\`end\`,className:\`w-60 p-1.5\`,trigger:(0,z.jsx)(V,{variant:\`outline\`,size:\`iconXs\`,title:\`View options\`,onClick:()=>Ce(e=>!e),children:(0,z.jsx)(De,{size:13})}),children:[(0,z.jsxs)(\`p\`,{className:\`px-2 pb-1 pt-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/80\`,children:[\`Columns\`,S.size>0?\` — \${S.size} hidden\`:\`\`]}),(0,z.jsx)(\`div\`,{className:\`max-h-56 overflow-auto\`,children:L.columns.map(e=>(0,z.jsxs)(\`label\`,{className:\`flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-[13px] text-foreground hover:bg-accent\`,children:[(0,z.jsx)($t,{checked:!S.has(e.name),onChange:t=>C(n=>{let r=new Set(n);return t?r.delete(e.name):r.add(e.name),r})}),(0,z.jsx)(\`span\`,{className:\`truncate font-mono\`,children:e.name}),(0,z.jsx)(\`span\`,{className:\`ml-auto text-[11px] text-muted-foreground/60\`,children:e.type})]},e.name))}),S.size>0&&(0,z.jsx)(\`button\`,{className:\`w-full rounded px-2 py-1.5 text-left text-xs text-brand hover:bg-accent\`,onClick:()=>C(new Set),children:\`Show all columns\`}),(0,z.jsx)(\`div\`,{className:\`my-1 h-px bg-accent\`}),(0,z.jsx)(\`p\`,{className:\`px-2 pb-1 pt-1 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/80\`,children:\`Export page\`}),[\`csv\`,\`json\`].map(e=>(0,z.jsxs)(\`button\`,{className:\`flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-[13px] text-foreground hover:bg-accent\`,onClick:()=>{_t(e),Ce(!1)},children:[(0,z.jsx)(Ee,{size:13,className:\`text-muted-foreground/80\`}),\` Export as \`,e.toUpperCase()]},e))]}),(0,z.jsx)(V,{variant:\`ghost\`,size:\`iconXs\`,title:\`Refresh\`,onClick:()=>void rt(),children:(0,z.jsx)(gt,{size:13,className:d?\`animate-spin\`:\`\`})}),!L.isView&&!Re&&(0,z.jsxs)(V,{size:\`xs\`,onClick:()=>P(!0),children:[(0,z.jsx)(mt,{size:13}),\` Insert\`]})]})]}),!ze&&(Re?(0,z.jsxs)(\`div\`,{className:\`flex shrink-0 items-center gap-2 border-b border-border bg-accent/40 px-3 py-1.5 text-xs text-muted-foreground\`,children:[(0,z.jsx)(Ze,{size:13,className:\`shrink-0\`}),(0,z.jsxs)(\`span\`,{children:[\`The \`,(0,z.jsx)(\`span\`,{className:\`font-mono text-foreground/80\`,children:e}),\` schema is managed by tinbase — read-only here; change it through SQL. It isn't exposed to anon/authenticated through the Data API, so access is controlled by grants rather than RLS.\`]})]}):L?.isView?(0,z.jsxs)(\`div\`,{className:\`flex shrink-0 items-center gap-2 border-b border-border bg-accent/40 px-3 py-1.5 text-xs text-muted-foreground\`,children:[(0,z.jsx)(Ae,{size:13,className:\`shrink-0\`}),(0,z.jsx)(\`span\`,{children:\`This is a view — computed from other tables, so it's read-only. Edit the underlying tables instead.\`})]}):(0,z.jsxs)(\`div\`,{className:\`flex shrink-0 items-center gap-2 border-b border-warning/30 bg-warning/10 px-3 py-1.5 text-xs text-warning\`,children:[(0,z.jsx)(jt,{size:13,className:\`shrink-0\`}),(0,z.jsx)(\`span\`,{children:\`This table has no primary key, so rows can't be uniquely addressed — selection and editing are off. Inserting still works; add a primary key (SQL editor) to unlock everything.\`})]})),(0,z.jsxs)(\`div\`,{className:\`min-h-0 flex-1 overflow-auto transition-opacity \`+(d?\`opacity-60\`:\`\`),children:[(0,z.jsxs)(\`table\`,{className:\`border-collapse text-[13px]\`,style:{width:Math.max(Dt,0),tableLayout:\`fixed\`},children:[(0,z.jsxs)(\`colgroup\`,{children:[(0,z.jsx)(\`col\`,{style:{width:56}}),He.map(e=>(0,z.jsx)(\`col\`,{style:{width:We(e)}},e.name)),(0,z.jsx)(\`col\`,{style:{width:40}})]}),(0,z.jsx)(\`thead\`,{children:(0,z.jsxs)(\`tr\`,{children:[(0,z.jsx)(\`th\`,{className:\`sticky left-0 top-0 z-30 border-b border-r border-border bg-card px-0\`,children:(0,z.jsx)(\`div\`,{className:\`flex h-8.5 items-center gap-1.5 pl-3\`,children:(0,z.jsx)($t,{checked:ct,indeterminate:!ct&&ft,disabled:!ze,title:ze?void 0:\`Table has no primary key\`,onChange:e=>A(e?new Set(st):new Set)})})}),He.map(e=>{let t=v.findIndex(t=>t.column===e.name),n=t>=0?v[t]:null,r=qe(e.name),i=Ge(e.name);return(0,z.jsxs)(\`th\`,{className:\`group/th relative border-b border-r border-border bg-card p-0 text-left font-normal\`,style:r===null?{position:\`sticky\`,top:0,zIndex:20}:{position:\`sticky\`,left:r,top:0,zIndex:25},children:[(0,z.jsxs)(\`div\`,{className:\`flex h-8.5 items-center gap-1.5 pl-3 pr-1\`,children:[e.isPrimaryKey&&(0,z.jsx)(Ke,{size:11,className:\`shrink-0 text-warning\`}),i&&(0,z.jsx)(\`span\`,{title:\`foreign key → \${i.target}.\${i.targetColumns.join(\`,\`)}\`,children:(0,z.jsx)(Ye,{size:11,className:\`shrink-0 text-info\`})}),(0,z.jsx)(\`button\`,{className:\`min-w-0 truncate font-mono font-medium text-foreground hover:text-primary-foreground\`,title:\`\${e.name} — click to sort\${i?\` · fk → \${i.target}\`:\`\`}\`,onClick:t=>vt(e.name,t.shiftKey),children:e.name}),(0,z.jsx)(\`span\`,{className:\`shrink-0 text-[11px] text-muted-foreground/60\`,children:e.type}),n&&(0,z.jsxs)(\`span\`,{className:\`flex shrink-0 items-center text-brand\`,children:[n.dir===\`asc\`?(0,z.jsx)(fe,{size:11}):(0,z.jsx)(le,{size:11}),v.length>1&&(0,z.jsx)(\`span\`,{className:\`text-[10px]\`,children:t+1})]}),(0,z.jsxs)(Zd,{children:[(0,z.jsx)(Qd,{asChild:!0,children:(0,z.jsx)(\`button\`,{className:\`ml-auto shrink-0 rounded p-0.5 text-muted-foreground/60 opacity-0 hover:bg-muted hover:text-foreground focus:opacity-100 group-hover/th:opacity-100 data-[state=open]:opacity-100\`,children:(0,z.jsx)(me,{size:13})})}),(0,z.jsxs)(tf,{children:[(0,z.jsxs)(nf,{onSelect:()=>y([{column:e.name,dir:\`asc\`}]),children:[(0,z.jsx)(fe,{size:13}),\` Sort ascending\`]}),(0,z.jsxs)(nf,{onSelect:()=>y([{column:e.name,dir:\`desc\`}]),children:[(0,z.jsx)(le,{size:13}),\` Sort descending\`]}),(0,z.jsxs)(nf,{onSelect:()=>y(t=>t.filter(t=>t.column!==e.name)),disabled:!n,children:[(0,z.jsx)(ce,{size:13}),\` Clear sort\`]}),(0,z.jsx)(of,{}),(0,z.jsxs)(nf,{onSelect:()=>void Qn(e.name,\`"\${e.name}"\`),children:[(0,z.jsx)(Se,{size:13}),\` Copy name\`]}),(0,z.jsxs)(nf,{onSelect:()=>E(t=>{let n=new Set(t);return n.has(e.name)?n.delete(e.name):n.add(e.name),n}),children:[w.has(e.name)?(0,z.jsx)(dt,{size:13}):(0,z.jsx)(ut,{size:13}),w.has(e.name)?\`Unfreeze column\`:\`Freeze column\`]}),(0,z.jsxs)(nf,{onSelect:()=>C(t=>new Set(t).add(e.name)),children:[(0,z.jsx)(ke,{size:13}),\` Hide column\`]}),(0,z.jsx)(of,{}),(0,z.jsxs)(nf,{onSelect:()=>ne(e.name),children:[(0,z.jsx)(lt,{size:13}),\` Rename column\`]}),(0,z.jsxs)(nf,{danger:!0,onSelect:()=>oe(e.name),children:[(0,z.jsx)(At,{size:13}),\` Delete column\`]})]})]})]}),(0,z.jsx)(\`div\`,{className:\`absolute -right-0.5 top-0 z-10 h-full w-1.25 cursor-col-resize hover:bg-brand/50\`,onMouseDown:t=>{t.preventDefault(),Tt.current={col:e.name,startX:t.clientX,startW:We(e)}}})]},e.name)}),(0,z.jsx)(\`th\`,{className:\`sticky top-0 z-20 border-b border-border bg-card p-0\`,children:(0,z.jsx)(\`button\`,{title:\`Add column\`,onClick:()=>se(!0),className:\`flex h-8.5 w-10 items-center justify-center text-muted-foreground/60 transition-colors hover:text-foreground\`,children:(0,z.jsx)(mt,{size:13})})})]})}),(0,z.jsx)(\`tbody\`,{children:s.map((e,t)=>{let n=ze?it(e):String(t),i=ze&&k.has(n),a=i?\`bg-selected\`:\`bg-background group-hover:bg-popover\`;return(0,z.jsxs)(\`tr\`,{className:\`group\`,children:[(0,z.jsx)(\`td\`,{className:\`sticky left-0 z-10 border-b border-r border-border/70 px-0 \`+a,children:(0,z.jsxs)(\`div\`,{className:\`flex h-8.5 items-center gap-1.5 pl-3\`,children:[(0,z.jsx)($t,{checked:i,disabled:!ze,onChange:(e,n)=>ot(t,e,n.shiftKey)}),(0,z.jsx)(\`button\`,{title:ze?\`Edit row\`:\`View row\`,className:\`rounded p-0.5 text-muted-foreground/60 opacity-0 hover:bg-muted hover:text-foreground group-hover:opacity-100\`,onClick:()=>ee(e),children:(0,z.jsx)(tt,{size:11})})]})}),He.map((r,i)=>{let o=qe(r.name),s=ze&&de?.key===n&&de.col===r.name,c=Ct?.r===t&&Ct.c===i,l=Ge(r.name),u=e[r.name]!==null&&e[r.name]!==void 0;return(0,z.jsxs)(\`td\`,{"data-cell":\`\${t}:\${r.name}\`,className:\`relative h-8.5 truncate border-b border-r border-border/70 px-3 font-mono text-foreground/80 \`+(r.isPrimaryKey?\`cursor-default \`:\`cursor-cell \`)+(c?\`ring-1 ring-inset ring-brand \`:\`\`)+a,style:o===null?void 0:{position:\`sticky\`,left:o,zIndex:5},title:s?void 0:Xv(e[r.name]),onClick:()=>ze&&wt({r:t,c:i}),onDoubleClick:t=>!s&&yt(e,r,t.currentTarget),children:[(0,z.jsx)(Zv,{value:e[r.name]}),l&&u&&(0,z.jsx)(\`button\`,{title:\`View referencing record\`,className:\`absolute right-1 top-1/2 flex size-5 -translate-y-1/2 items-center justify-center rounded border border-input bg-accent text-muted-foreground opacity-0 transition-opacity hover:border-foreground hover:text-foreground group-hover:opacity-100\`,onClick:t=>{t.stopPropagation();let n=t.currentTarget.closest(\`td\`).getBoundingClientRect();ve({fk:l,value:e[r.name],rect:{top:n.top,left:n.left,width:n.width,height:n.height}})},onDoubleClick:e=>e.stopPropagation(),children:(0,z.jsx)(ue,{size:11})}),s&&(0,z.jsx)($v,{col:r,value:e[r.name],anchor:de.rect,enumValues:Be[r.type],onCancel:()=>pe(null),onCommit:(t,n)=>void xt(e,r,t,n)})]},r.name)}),(0,z.jsx)(\`td\`,{className:\`border-b border-border/70 \`+a})]},\`\${r}:\${t}\`)})})]}),s.length===0&&!d&&(0,z.jsx)(\`div\`,{className:\`flex flex-col items-center gap-3 py-20 text-[13px] text-muted-foreground/80\`,children:b.length>0?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Le,{size:20,className:\`text-muted-foreground/40\`}),\`No rows match the current filters.\`,(0,z.jsx)(V,{variant:\`outline\`,size:\`xs\`,onClick:()=>x([]),children:\`Clear filters\`})]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Xe,{size:20,className:\`text-muted-foreground/40\`}),L.isView?\`This view returns no rows.\`:\`This table is empty.\`,!L.isView&&!Re&&(0,z.jsxs)(V,{size:\`xs\`,onClick:()=>P(!0),children:[(0,z.jsx)(mt,{size:13}),\` Insert your first row\`]})]})})]})]}),(0,z.jsxs)(\`div\`,{className:\`flex shrink-0 items-center gap-3 border-t border-border bg-card px-3 py-1.5 text-xs text-muted-foreground/80\`,children:[we===\`data\`&&(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-1\`,children:[(0,z.jsx)(V,{variant:\`ghost\`,size:\`iconXs\`,disabled:p===0,onClick:()=>m(e=>e-1),children:(0,z.jsx)(he,{size:13})}),(0,z.jsx)(\`span\`,{children:\`Page\`}),(0,z.jsx)(\`input\`,{type:\`number\`,min:1,max:Et,defaultValue:p+1,onKeyDown:e=>{if(e.key!==\`Enter\`)return;let t=parseInt(e.target.value,10);Number.isNaN(t)||m(Math.min(Math.max(t-1,0),Et-1))},onBlur:e=>{let t=parseInt(e.target.value,10);Number.isNaN(t)||m(Math.min(Math.max(t-1,0),Et-1))},className:\`h-6 w-12 rounded border border-input bg-field px-1.5 text-center text-xs text-foreground focus:border-brand focus:outline-none [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none\`},p),(0,z.jsxs)(\`span\`,{children:[\`of \`,Et]}),(0,z.jsx)(V,{variant:\`ghost\`,size:\`iconXs\`,disabled:p+1>=Et,onClick:()=>m(e=>e+1),children:(0,z.jsx)(ge,{size:13})})]}),we===\`data\`&&(0,z.jsx)(\`div\`,{className:\`w-27.5 shrink-0\`,children:(0,z.jsx)(Wp,{value:String(h),onValueChange:e=>g(parseInt(e,10)),options:[25,50,100,500].map(e=>({value:String(e),label:\`\${e} rows\`}))})}),(0,z.jsx)(\`span\`,{className:\`ml-auto\`,children:we===\`data\`&&(0,z.jsxs)(z.Fragment,{children:[l.toLocaleString(),\` record\`,l===1?\`\`:\`s\`,k.size>0&&(0,z.jsxs)(z.Fragment,{children:[\` · \`,(0,z.jsxs)(\`span\`,{className:\`text-brand\`,children:[k.size,\` selected\`]})]})]})}),(0,z.jsx)(\`div\`,{className:\`flex overflow-hidden rounded-md border border-input\`,children:[\`data\`,\`definition\`].map(e=>(0,z.jsx)(\`button\`,{onClick:()=>Te(e),className:\`px-2.5 py-1 text-[11px] font-medium capitalize transition-colors \`+(we===e?\`bg-muted text-foreground\`:\`text-muted-foreground/80 hover:text-foreground\`),children:e},e))})]})]}):(0,z.jsx)(cf,{children:\`Select a table.\`})}),M&&L&&(0,z.jsx)(Sy,{table:L,tables:t,initial:M,readOnly:!ze,onClose:()=>ee(null),onSave:async t=>{await N.updateRow(r,at(M),t,e),H.success(\`Row updated\`),ee(null),await rt()},onDelete:async()=>{await N.deleteRow(r,at(M),e),H.success(\`Row deleted\`),ee(null),await rt(),await et()}}),te&&L&&(0,z.jsx)(Sy,{table:L,tables:t,initial:{},isNew:!0,onClose:()=>P(!1),onSave:async t=>{await N.insertRow(r,t,e),H.success(\`Row inserted\`),P(!1),await rt(),await et()}}),Me&&(0,z.jsx)(Ig,{table:Me,schema:e,onClose:()=>Ne(null),onChanged:Ie}),_e&&(0,z.jsx)(sy,{fk:_e.fk,value:_e.value,anchor:_e.rect,tables:t,onClose:()=>ve(null),onOpenTable:e=>{ve(null),i(e)}}),ye&&(0,z.jsx)(cy,{fk:ye.fk,tables:t,currentKey:ye.row[ye.col],onClose:()=>be(null),onPick:e=>{bt(ye.row,e),be(null)}}),F&&r&&(0,z.jsx)(fy,{table:r,schema:e,column:F,onClose:()=>ne(null),onDone:async()=>{ne(null),await et()}}),I&&r&&(0,z.jsx)(vy,{table:r,schema:e,onClose:()=>se(!1),onDone:async()=>{await et()}}),re&&L&&(0,z.jsx)(q,{open:!0,danger:!0,title:\`Delete \${k.size} selected row\${k.size===1?\`\`:\`s\`}?\`,description:\`Rows will be permanently deleted from "\${L.name}". This cannot be undone.\`,confirmLabel:\`Delete \${k.size} row\${k.size===1?\`\`:\`s\`}\`,onConfirm:()=>void ht(),onClose:()=>ie(!1)}),ae&&r&&(0,z.jsx)(q,{open:!0,danger:!0,title:\`Drop column "\${ae}"?\`,description:\`The column and all data in it will be permanently removed from "\${r}".\`,confirmLabel:\`Drop column\`,onConfirm:()=>void St(ae),onClose:()=>oe(null)})]})}function Dy(){let[e,t]=(0,_.useState)(!!x()),{tab:n}=Yt();return(0,_.useEffect)(()=>{x()&&N.ping().catch(e=>{e instanceof A&&(e.status===401||e.status===403)&&(C(),t(!1))})},[]),e?(0,z.jsxs)(\`div\`,{className:\`flex h-full flex-col\`,children:[(0,z.jsx)(Zn,{}),(0,z.jsx)(ch,{}),(0,z.jsx)(ah,{}),(0,z.jsx)(fh,{onLogout:()=>{C(),t(!1)}}),(0,z.jsxs)(\`div\`,{className:\`flex min-h-0 flex-1\`,children:[(0,z.jsx)(vh,{tab:n,onTab:e=>R(e)}),(0,z.jsxs)(\`main\`,{className:\`min-w-0 flex-1 overflow-hidden\`,children:[n===\`home\`&&(0,z.jsx)(u_,{}),n===\`table\`&&(0,z.jsx)(Ey,{}),n===\`sql\`&&(0,z.jsx)(Dv,{}),n===\`database\`&&(0,z.jsx)(e_,{}),n===\`auth\`&&(0,z.jsx)(Hh,{}),n===\`storage\`&&(0,z.jsx)(zv,{}),n===\`functions\`&&(0,z.jsx)(r_,{}),n===\`realtime\`&&(0,z.jsx)(F_,{}),n===\`automations\`&&(0,z.jsx)(ug,{}),n===\`logs\`&&(0,z.jsx)(S_,{}),n===\`settings\`&&(0,z.jsx)(rv,{})]})]})]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(mh,{onOk:()=>t(!0)}),(0,z.jsx)(Zn,{})]})}(0,v.createRoot)(document.getElementById(\`root\`)).render((0,z.jsx)(_.StrictMode,{children:(0,z.jsx)(Dy,{})}));</script>
|
|
1596
|
+
order by t.typname, e.enumsortorder\`).then(e=>{if(!e.ok||!e.rows)return;let t={};for(let n of e.rows)(t[n.name]??=[]).push(n.label);Ve(t)}).catch(()=>{})},[e]);let He=(0,_.useMemo)(()=>L?L.columns.filter(e=>!S.has(e.name)):[],[L,S]),Ue=(0,_.useMemo)(()=>He.filter(e=>w.has(e.name)),[He,w]),We=(0,_.useCallback)(e=>D[e.name]??qv(e),[D]),Ge=(0,_.useCallback)(e=>L?.foreignKeys.find(t=>t.columns.includes(e)),[L]),qe=(0,_.useCallback)(e=>{if(!w.has(e))return null;let t=56;for(let n of Ue){if(n.name===e)return t;t+=We(n)}return t},[w,Ue,We]),Je=Yt(),Qe=Je.tab===\`table\`?Je.section:null,$e=(0,_.useRef)(Qe);$e.current=Qe;let et=(0,_.useCallback)(async()=>{try{let t=await N.tables(e);n(t),i(e=>{if(e&&t.some(t=>t.name===e))return e;let n=$e.current;return n&&t.some(e=>e.name===n)?n:t[0]?.name??null})}catch(e){H.error(e.message)}},[e]);(0,_.useEffect)(()=>{i(null),n([]),o(!0),et().finally(()=>o(!1))},[et]),(0,_.useEffect)(()=>{Qe&&Qe!==r&&t.some(e=>e.name===Qe)&&i(Qe)},[Qe,t]),(0,_.useEffect)(()=>{!r||Je.tab!==\`table\`||Je.section===r||Qe&&t.some(e=>e.name===Qe)||R(\`table\`,r,{replace:!0})},[r,t]);let nt=(0,_.useRef)(0),rt=(0,_.useCallback)(async()=>{if(!r||!L)return;let t=++nt.current;f(!0);try{let n=v.length>0?v.map(e=>\`\${e.column}.\${e.dir}\`).join(\`,\`):L.primaryKey[0]?\`\${L.primaryKey[0]}.asc\`:void 0,{rows:i,total:a}=await N.rows(r,{limit:h,offset:p*h,order:n,schema:e,filters:Kv(L.columns,b)});if(t!==nt.current)return;c(i),u(a)}catch(e){t===nt.current&&H.error(e.message)}finally{t===nt.current&&f(!1)}},[r,L,p,h,v,b,Oe,Pe,e]);(0,_.useEffect)(()=>()=>T(null),[]),(0,_.useEffect)(()=>{rt()},[rt]),(0,_.useEffect)(()=>{c([]),u(0),m(0),y([]),x([]),A(new Set),C(new Set),E(new Set),O({}),pe(null),ve(null),be(null),ee(null),j.current=null},[r,e]),(0,_.useEffect)(()=>{m(0),A(new Set)},[b,h]),(0,_.useEffect)(()=>{if(!L)return;let e=new Set(L.columns.map(e=>e.name));y(t=>t.some(t=>!e.has(t.column))?t.filter(t=>e.has(t.column)):t),x(t=>t.some(t=>t.column!==\`*\`&&!e.has(t.column))?t.filter(t=>t.column===\`*\`||e.has(t.column)):t),C(t=>[...t].some(t=>!e.has(t))?new Set([...t].filter(t=>e.has(t))):t),E(t=>[...t].some(t=>!e.has(t))?new Set([...t].filter(t=>e.has(t))):t)},[L]);let it=(0,_.useCallback)(e=>JSON.stringify(L.primaryKey.map(t=>e[t])),[L]),at=(0,_.useCallback)(e=>{let t={};for(let n of L.primaryKey)t[n]=e[n];return t},[L]);function ot(e,t,n){A(r=>{let i=new Set(r),a=e=>{let n=it(s[e]);t?i.add(n):i.delete(n)};if(n&&j.current!==null){let[t,n]=[Math.min(j.current,e),Math.max(j.current,e)];for(let e=t;e<=n;e++)a(e)}else a(e);return i}),j.current=e}let st=(0,_.useMemo)(()=>ze?s.map(e=>it(e)):[],[s,it,ze]),ct=st.length>0&&st.every(e=>k.has(e)),ft=st.some(e=>k.has(e)),pt=(0,_.useMemo)(()=>ze?s.filter(e=>k.has(it(e))):[],[s,k,it,ze]),ht=(0,_.useCallback)(async()=>{if(!(!L||k.size===0))try{let t=[...k].map(e=>JSON.parse(e));if(L.primaryKey.length===1)await N.deleteRows(L.name,L.primaryKey[0],t.map(e=>e[0]),e);else for(let n of t){let t={};L.primaryKey.forEach((e,r)=>t[e]=n[r]),await N.deleteRow(L.name,t,e)}H.success(\`Deleted \${k.size} row(s)\`),A(new Set),await rt(),await et()}catch(e){H.error(e.message)}},[L,k,rt,et]);function _t(e){let t=He.map(e=>e.name);e===\`json\`?__(\`\${r}-page\${p+1}.json\`,\`application/json\`,JSON.stringify(s,null,2)):__(\`\${r}-page\${p+1}.csv\`,\`text/csv\`,g_(t,s))}function vt(e,t){y(n=>{let r=n.find(t=>t.column===e),i=r?r.dir===\`asc\`?{column:e,dir:\`desc\`}:null:{column:e,dir:\`asc\`};if(!t)return i?[i]:[];let a=n.filter(t=>t.column!==e);return i?[...a,i]:a})}function yt(e,t,n){if(!ze)return;if(t.isPrimaryKey)return H(\`Primary key columns are locked — use the SQL editor to change keys\`);let r=Ge(t.name);if(r)return be({row:e,fk:r,col:t.name});let i=n.getBoundingClientRect();pe({key:it(e),col:t.name,rect:{top:i.top,left:i.left,width:i.width,height:i.height}})}async function bt(t,n){try{let i=await N.updateRow(r,at(t),n,e),a=Array.isArray(i)?i[0]:null;c(e=>e.map(e=>e===t?a??{...e,...n}:e)),H.success(\`Row updated\`)}catch(e){H.error(e.message)}}async function xt(t,n,i,a){let o=t[n.name],s=o==null?\`\`:typeof o==\`object\`?JSON.stringify(o):String(o),l=t;if(i!==s){let a=i===\`__null\`||i===\`\`&&n.nullable?null:Xv(i,n.type);try{let i=await N.updateRow(r,at(t),{[n.name]:a},e);l=(Array.isArray(i)?i[0]:null)??{...t,[n.name]:a},c(e=>e.map(e=>e===t?l:e)),H.success(\`Row updated\`)}catch(e){H.error(e.message),pe(null);return}}if(a!==0&&de){let e=He.findIndex(e=>e.name===n.name),t=a,r=He[e+t],i=de.rect.left,o=n;for(;r&&(r.isPrimaryKey||Ge(r.name));)i+=a===1?We(o):-We(r),o=r,t+=a,r=He[e+t];if(r)return i+=a===1?We(o):-We(r),pe({key:it(l),col:r.name,rect:{...de.rect,left:i,width:We(r)}})}pe(null)}async function St(t){if(!r)return;let n=await N.sql(\`alter table \${Yh(e,r)} drop column "\${t}"\`);if(!n.ok)return H.error(n.error??\`Failed to drop column\`);H.success(\`Dropped column \${t}\`),await et()}let[Ct,wt]=(0,_.useState)(null);(0,_.useEffect)(()=>wt(null),[r,p,s.length,He.length]),(0,_.useEffect)(()=>{let e=e=>{let t=e.target;if(!(M||te||F||de||t.closest(\`input, textarea, select, [role="dialog"]\`))){if(Ct&&ze){let t=(t,n)=>{e.preventDefault();let r=Math.max(0,Math.min(s.length-1,Ct.r+t)),i=Math.max(0,Math.min(He.length-1,Ct.c+n));wt({r,c:i}),document.querySelector(\`[data-cell="\${r}:\${He[i]?.name}"]\`)?.scrollIntoView({block:\`nearest\`,inline:\`nearest\`})};if(e.key===\`ArrowUp\`)return t(-1,0);if(e.key===\`ArrowDown\`)return t(1,0);if(e.key===\`ArrowLeft\`)return t(0,-1);if(e.key===\`ArrowRight\`)return t(0,1);let n=s[Ct.r],r=He[Ct.c];if(n&&r&&e.key===\`Enter\`){e.preventDefault();let t=document.querySelector(\`[data-cell="\${Ct.r}:\${r.name}"]\`);t&&yt(n,r,t);return}if(n&&r&&(e.key===\`Delete\`||e.key===\`Backspace\`)&&!r.isPrimaryKey&&!Ge(r.name)&&r.nullable&&n[r.name]!==null){e.preventDefault(),xt(n,r,\`\`,0);return}if(e.key===\`Escape\`){wt(null);return}}e.key===\`Escape\`&&A(new Set),e.key===\`Delete\`&&k.size>0&&ie(!0)}};return window.addEventListener(\`keydown\`,e),()=>window.removeEventListener(\`keydown\`,e)},[k,M,te,F,de,Ct,s,He,ze]);let Tt=(0,_.useRef)(null);if((0,_.useEffect)(()=>{let e=e=>{let t=Tt.current;t&&O(n=>({...n,[t.col]:Math.max(72,t.startW+(e.clientX-t.startX))}))},t=()=>Tt.current=null;return window.addEventListener(\`mousemove\`,e),window.addEventListener(\`mouseup\`,t),()=>{window.removeEventListener(\`mousemove\`,e),window.removeEventListener(\`mouseup\`,t)}},[]),a)return(0,z.jsx)(Jp,{});let Et=Math.max(1,Math.ceil(l/h)),Dt=56+He.reduce((e,t)=>e+We(t),0)+40;return(0,z.jsxs)(\`div\`,{className:\`flex h-full\`,children:[(0,z.jsx)(Ey,{tables:t,schema:e,managed:Re,active:r,onSelect:i,onTablesChanged:et,onOpenPolicies:Ne,refreshKey:Pe}),(0,z.jsx)(\`div\`,{className:\`flex min-w-0 flex-1 flex-col\`,children:L?(0,z.jsxs)(z.Fragment,{children:[we===\`definition\`?(0,z.jsx)(ry,{table:L.name,schema:e,refreshKey:L}):(0,z.jsxs)(z.Fragment,{children:[k.size>0?(0,z.jsxs)(\`div\`,{className:\`flex h-11.5 shrink-0 items-center gap-3 border-b border-border bg-brand/10 px-3\`,children:[(0,z.jsx)($t,{checked:ct,indeterminate:!ct&&ft,onChange:e=>A(e?new Set(st):new Set)}),(0,z.jsxs)(\`span\`,{className:\`text-[13px] text-foreground\`,children:[(0,z.jsx)(\`span\`,{className:\`font-semibold text-brand\`,children:k.size}),\` row\`,k.size===1?\`\`:\`s\`,\` selected\`]}),(0,z.jsx)(\`div\`,{className:\`mx-1 h-4 w-px bg-muted\`}),(0,z.jsx)(er,{variant:\`outline\`,size:\`xs\`,label:\`rows as JSON\`,value:()=>JSON.stringify(pt,null,2),children:\`Copy JSON\`}),(0,z.jsx)(er,{variant:\`outline\`,size:\`xs\`,label:\`rows as CSV\`,value:()=>g_(He.map(e=>e.name),pt),children:\`Copy CSV\`}),(0,z.jsxs)(V,{variant:\`dangerSolid\`,size:\`xs\`,onClick:()=>ie(!0),children:[(0,z.jsx)(At,{size:12}),\` Delete \`,k.size]}),(0,z.jsxs)(\`span\`,{className:\`ml-1 hidden items-center gap-1 text-[11px] text-muted-foreground/80 lg:flex\`,children:[(0,z.jsx)(uf,{children:\`Del\`}),\` delete · \`,(0,z.jsx)(uf,{children:\`Esc\`}),\` clear\`]}),(0,z.jsx)(\`button\`,{className:\`ml-auto p-1 text-muted-foreground/80 hover:text-foreground\`,onClick:()=>A(new Set),children:(0,z.jsx)(Lt,{size:15})})]}):(0,z.jsxs)(\`div\`,{className:\`flex h-11.5 shrink-0 items-center gap-2 border-b border-border px-3\`,children:[(0,z.jsx)(fy,{columns:L.columns,filters:b,onChange:x}),(0,z.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-1.5\`,children:[!Re&&(L.isView?(0,z.jsx)(Ig,{view:L.name,schema:e,refreshKey:Pe,onChanged:Ie},L.name):(0,z.jsx)(Fg,{table:L.name,schema:e,refreshKey:Pe,onChanged:Ie},L.name)),(0,z.jsx)(ov,{value:Oe,onChange:(e,t)=>{T(t),je(e),A(new Set)}}),(0,z.jsxs)(pf,{open:xe,onOpenChange:Ce,align:\`end\`,className:\`w-60 p-1.5\`,trigger:(0,z.jsx)(V,{variant:\`outline\`,size:\`iconXs\`,title:\`View options\`,onClick:()=>Ce(e=>!e),children:(0,z.jsx)(De,{size:13})}),children:[(0,z.jsxs)(\`p\`,{className:\`px-2 pb-1 pt-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/80\`,children:[\`Columns\`,S.size>0?\` — \${S.size} hidden\`:\`\`]}),(0,z.jsx)(\`div\`,{className:\`max-h-56 overflow-auto\`,children:L.columns.map(e=>(0,z.jsxs)(\`label\`,{className:\`flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-[13px] text-foreground hover:bg-accent\`,children:[(0,z.jsx)($t,{checked:!S.has(e.name),onChange:t=>C(n=>{let r=new Set(n);return t?r.delete(e.name):r.add(e.name),r})}),(0,z.jsx)(\`span\`,{className:\`truncate font-mono\`,children:e.name}),(0,z.jsx)(\`span\`,{className:\`ml-auto text-[11px] text-muted-foreground/60\`,children:e.type})]},e.name))}),S.size>0&&(0,z.jsx)(\`button\`,{className:\`w-full rounded px-2 py-1.5 text-left text-xs text-brand hover:bg-accent\`,onClick:()=>C(new Set),children:\`Show all columns\`}),(0,z.jsx)(\`div\`,{className:\`my-1 h-px bg-accent\`}),(0,z.jsx)(\`p\`,{className:\`px-2 pb-1 pt-1 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/80\`,children:\`Export page\`}),[\`csv\`,\`json\`].map(e=>(0,z.jsxs)(\`button\`,{className:\`flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-[13px] text-foreground hover:bg-accent\`,onClick:()=>{_t(e),Ce(!1)},children:[(0,z.jsx)(Ee,{size:13,className:\`text-muted-foreground/80\`}),\` Export as \`,e.toUpperCase()]},e))]}),(0,z.jsx)(V,{variant:\`ghost\`,size:\`iconXs\`,title:\`Refresh\`,onClick:()=>void rt(),children:(0,z.jsx)(gt,{size:13,className:d?\`animate-spin\`:\`\`})}),!L.isView&&!Re&&(0,z.jsxs)(V,{size:\`xs\`,onClick:()=>P(!0),children:[(0,z.jsx)(mt,{size:13}),\` Insert\`]})]})]}),!ze&&(Re?(0,z.jsxs)(\`div\`,{className:\`flex shrink-0 items-center gap-2 border-b border-border bg-accent/40 px-3 py-1.5 text-xs text-muted-foreground\`,children:[(0,z.jsx)(Ze,{size:13,className:\`shrink-0\`}),(0,z.jsxs)(\`span\`,{children:[\`The \`,(0,z.jsx)(\`span\`,{className:\`font-mono text-foreground/80\`,children:e}),\` schema is managed by tinbase — read-only here; change it through SQL. It isn't exposed to anon/authenticated through the Data API, so access is controlled by grants rather than RLS.\`]})]}):L?.isView?(0,z.jsxs)(\`div\`,{className:\`flex shrink-0 items-center gap-2 border-b border-border bg-accent/40 px-3 py-1.5 text-xs text-muted-foreground\`,children:[(0,z.jsx)(Ae,{size:13,className:\`shrink-0\`}),(0,z.jsx)(\`span\`,{children:\`This is a view — computed from other tables, so it's read-only. Edit the underlying tables instead.\`})]}):(0,z.jsxs)(\`div\`,{className:\`flex shrink-0 items-center gap-2 border-b border-warning/30 bg-warning/10 px-3 py-1.5 text-xs text-warning\`,children:[(0,z.jsx)(jt,{size:13,className:\`shrink-0\`}),(0,z.jsx)(\`span\`,{children:\`This table has no primary key, so rows can't be uniquely addressed — selection and editing are off. Inserting still works; add a primary key (SQL editor) to unlock everything.\`})]})),(0,z.jsxs)(\`div\`,{className:\`min-h-0 flex-1 overflow-auto transition-opacity \`+(d?\`opacity-60\`:\`\`),children:[(0,z.jsxs)(\`table\`,{className:\`border-collapse text-[13px]\`,style:{width:Math.max(Dt,0),tableLayout:\`fixed\`},children:[(0,z.jsxs)(\`colgroup\`,{children:[(0,z.jsx)(\`col\`,{style:{width:56}}),He.map(e=>(0,z.jsx)(\`col\`,{style:{width:We(e)}},e.name)),(0,z.jsx)(\`col\`,{style:{width:40}})]}),(0,z.jsx)(\`thead\`,{children:(0,z.jsxs)(\`tr\`,{children:[(0,z.jsx)(\`th\`,{className:\`sticky left-0 top-0 z-30 border-b border-r border-border bg-card px-0\`,children:(0,z.jsx)(\`div\`,{className:\`flex h-8.5 items-center gap-1.5 pl-3\`,children:(0,z.jsx)($t,{checked:ct,indeterminate:!ct&&ft,disabled:!ze,title:ze?void 0:\`Table has no primary key\`,onChange:e=>A(e?new Set(st):new Set)})})}),He.map(e=>{let t=v.findIndex(t=>t.column===e.name),n=t>=0?v[t]:null,r=qe(e.name),i=Ge(e.name);return(0,z.jsxs)(\`th\`,{className:\`group/th relative border-b border-r border-border bg-card p-0 text-left font-normal\`,style:r===null?{position:\`sticky\`,top:0,zIndex:20}:{position:\`sticky\`,left:r,top:0,zIndex:25},children:[(0,z.jsxs)(\`div\`,{className:\`flex h-8.5 items-center gap-1.5 pl-3 pr-1\`,children:[e.isPrimaryKey&&(0,z.jsx)(Ke,{size:11,className:\`shrink-0 text-warning\`}),i&&(0,z.jsx)(\`span\`,{title:\`foreign key → \${i.target}.\${i.targetColumns.join(\`,\`)}\`,children:(0,z.jsx)(Ye,{size:11,className:\`shrink-0 text-info\`})}),(0,z.jsx)(\`button\`,{className:\`min-w-0 truncate font-mono font-medium text-foreground hover:text-primary-foreground\`,title:\`\${e.name} — click to sort\${i?\` · fk → \${i.target}\`:\`\`}\`,onClick:t=>vt(e.name,t.shiftKey),children:e.name}),(0,z.jsx)(\`span\`,{className:\`shrink-0 text-[11px] text-muted-foreground/60\`,children:e.type}),n&&(0,z.jsxs)(\`span\`,{className:\`flex shrink-0 items-center text-brand\`,children:[n.dir===\`asc\`?(0,z.jsx)(fe,{size:11}):(0,z.jsx)(le,{size:11}),v.length>1&&(0,z.jsx)(\`span\`,{className:\`text-[10px]\`,children:t+1})]}),(0,z.jsxs)(Qd,{children:[(0,z.jsx)($d,{asChild:!0,children:(0,z.jsx)(\`button\`,{className:\`ml-auto shrink-0 rounded p-0.5 text-muted-foreground/60 opacity-0 hover:bg-muted hover:text-foreground focus:opacity-100 group-hover/th:opacity-100 data-[state=open]:opacity-100\`,children:(0,z.jsx)(me,{size:13})})}),(0,z.jsxs)(nf,{children:[(0,z.jsxs)(rf,{onSelect:()=>y([{column:e.name,dir:\`asc\`}]),children:[(0,z.jsx)(fe,{size:13}),\` Sort ascending\`]}),(0,z.jsxs)(rf,{onSelect:()=>y([{column:e.name,dir:\`desc\`}]),children:[(0,z.jsx)(le,{size:13}),\` Sort descending\`]}),(0,z.jsxs)(rf,{onSelect:()=>y(t=>t.filter(t=>t.column!==e.name)),disabled:!n,children:[(0,z.jsx)(ce,{size:13}),\` Clear sort\`]}),(0,z.jsx)(sf,{}),(0,z.jsxs)(rf,{onSelect:()=>void Qn(e.name,\`"\${e.name}"\`),children:[(0,z.jsx)(Se,{size:13}),\` Copy name\`]}),(0,z.jsxs)(rf,{onSelect:()=>E(t=>{let n=new Set(t);return n.has(e.name)?n.delete(e.name):n.add(e.name),n}),children:[w.has(e.name)?(0,z.jsx)(dt,{size:13}):(0,z.jsx)(ut,{size:13}),w.has(e.name)?\`Unfreeze column\`:\`Freeze column\`]}),(0,z.jsxs)(rf,{onSelect:()=>C(t=>new Set(t).add(e.name)),children:[(0,z.jsx)(ke,{size:13}),\` Hide column\`]}),(0,z.jsx)(sf,{}),(0,z.jsxs)(rf,{onSelect:()=>ne(e.name),children:[(0,z.jsx)(lt,{size:13}),\` Rename column\`]}),(0,z.jsxs)(rf,{danger:!0,onSelect:()=>oe(e.name),children:[(0,z.jsx)(At,{size:13}),\` Delete column\`]})]})]})]}),(0,z.jsx)(\`div\`,{className:\`absolute -right-0.5 top-0 z-10 h-full w-1.25 cursor-col-resize hover:bg-brand/50\`,onMouseDown:t=>{t.preventDefault(),Tt.current={col:e.name,startX:t.clientX,startW:We(e)}}})]},e.name)}),(0,z.jsx)(\`th\`,{className:\`sticky top-0 z-20 border-b border-border bg-card p-0\`,children:(0,z.jsx)(\`button\`,{title:\`Add column\`,onClick:()=>se(!0),className:\`flex h-8.5 w-10 items-center justify-center text-muted-foreground/60 transition-colors hover:text-foreground\`,children:(0,z.jsx)(mt,{size:13})})})]})}),(0,z.jsx)(\`tbody\`,{children:s.map((e,t)=>{let n=ze?it(e):String(t),i=ze&&k.has(n),a=i?\`bg-selected\`:\`bg-background group-hover:bg-popover\`;return(0,z.jsxs)(\`tr\`,{className:\`group\`,children:[(0,z.jsx)(\`td\`,{className:\`sticky left-0 z-10 border-b border-r border-border/70 px-0 \`+a,children:(0,z.jsxs)(\`div\`,{className:\`flex h-8.5 items-center gap-1.5 pl-3\`,children:[(0,z.jsx)($t,{checked:i,disabled:!ze,onChange:(e,n)=>ot(t,e,n.shiftKey)}),(0,z.jsx)(\`button\`,{title:ze?\`Edit row\`:\`View row\`,className:\`rounded p-0.5 text-muted-foreground/60 opacity-0 hover:bg-muted hover:text-foreground group-hover:opacity-100\`,onClick:()=>ee(e),children:(0,z.jsx)(tt,{size:11})})]})}),He.map((r,i)=>{let o=qe(r.name),s=ze&&de?.key===n&&de.col===r.name,c=Ct?.r===t&&Ct.c===i,l=Ge(r.name),u=e[r.name]!==null&&e[r.name]!==void 0;return(0,z.jsxs)(\`td\`,{"data-cell":\`\${t}:\${r.name}\`,className:\`relative h-8.5 truncate border-b border-r border-border/70 px-3 font-mono text-foreground/80 \`+(r.isPrimaryKey?\`cursor-default \`:\`cursor-cell \`)+(c?\`ring-1 ring-inset ring-brand \`:\`\`)+a,style:o===null?void 0:{position:\`sticky\`,left:o,zIndex:5},title:s?void 0:Zv(e[r.name]),onClick:()=>ze&&wt({r:t,c:i}),onDoubleClick:t=>!s&&yt(e,r,t.currentTarget),children:[(0,z.jsx)(Qv,{value:e[r.name]}),l&&u&&(0,z.jsx)(\`button\`,{title:\`View referencing record\`,className:\`absolute right-1 top-1/2 flex size-5 -translate-y-1/2 items-center justify-center rounded border border-input bg-accent text-muted-foreground opacity-0 transition-opacity hover:border-foreground hover:text-foreground group-hover:opacity-100\`,onClick:t=>{t.stopPropagation();let n=t.currentTarget.closest(\`td\`).getBoundingClientRect();ve({fk:l,value:e[r.name],rect:{top:n.top,left:n.left,width:n.width,height:n.height}})},onDoubleClick:e=>e.stopPropagation(),children:(0,z.jsx)(ue,{size:11})}),s&&(0,z.jsx)(ey,{col:r,value:e[r.name],anchor:de.rect,enumValues:Be[r.type],onCancel:()=>pe(null),onCommit:(t,n)=>void xt(e,r,t,n)})]},r.name)}),(0,z.jsx)(\`td\`,{className:\`border-b border-border/70 \`+a})]},\`\${r}:\${t}\`)})})]}),s.length===0&&!d&&(0,z.jsx)(\`div\`,{className:\`flex flex-col items-center gap-3 py-20 text-[13px] text-muted-foreground/80\`,children:b.length>0?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Le,{size:20,className:\`text-muted-foreground/40\`}),\`No rows match the current filters.\`,(0,z.jsx)(V,{variant:\`outline\`,size:\`xs\`,onClick:()=>x([]),children:\`Clear filters\`})]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Xe,{size:20,className:\`text-muted-foreground/40\`}),L.isView?\`This view returns no rows.\`:\`This table is empty.\`,!L.isView&&!Re&&(0,z.jsxs)(V,{size:\`xs\`,onClick:()=>P(!0),children:[(0,z.jsx)(mt,{size:13}),\` Insert your first row\`]})]})})]})]}),(0,z.jsxs)(\`div\`,{className:\`flex shrink-0 items-center gap-3 border-t border-border bg-card px-3 py-1.5 text-xs text-muted-foreground/80\`,children:[we===\`data\`&&(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-1\`,children:[(0,z.jsx)(V,{variant:\`ghost\`,size:\`iconXs\`,disabled:p===0,onClick:()=>m(e=>e-1),children:(0,z.jsx)(he,{size:13})}),(0,z.jsx)(\`span\`,{children:\`Page\`}),(0,z.jsx)(\`input\`,{type:\`number\`,min:1,max:Et,defaultValue:p+1,onKeyDown:e=>{if(e.key!==\`Enter\`)return;let t=parseInt(e.target.value,10);Number.isNaN(t)||m(Math.min(Math.max(t-1,0),Et-1))},onBlur:e=>{let t=parseInt(e.target.value,10);Number.isNaN(t)||m(Math.min(Math.max(t-1,0),Et-1))},className:\`h-6 w-12 rounded border border-input bg-field px-1.5 text-center text-xs text-foreground focus:border-brand focus:outline-none [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none\`},p),(0,z.jsxs)(\`span\`,{children:[\`of \`,Et]}),(0,z.jsx)(V,{variant:\`ghost\`,size:\`iconXs\`,disabled:p+1>=Et,onClick:()=>m(e=>e+1),children:(0,z.jsx)(ge,{size:13})})]}),we===\`data\`&&(0,z.jsx)(\`div\`,{className:\`w-27.5 shrink-0\`,children:(0,z.jsx)(Wp,{value:String(h),onValueChange:e=>g(parseInt(e,10)),options:[25,50,100,500].map(e=>({value:String(e),label:\`\${e} rows\`}))})}),(0,z.jsx)(\`span\`,{className:\`ml-auto\`,children:we===\`data\`&&(0,z.jsxs)(z.Fragment,{children:[l.toLocaleString(),\` record\`,l===1?\`\`:\`s\`,k.size>0&&(0,z.jsxs)(z.Fragment,{children:[\` · \`,(0,z.jsxs)(\`span\`,{className:\`text-brand\`,children:[k.size,\` selected\`]})]})]})}),(0,z.jsx)(\`div\`,{className:\`flex overflow-hidden rounded-md border border-input\`,children:[\`data\`,\`definition\`].map(e=>(0,z.jsx)(\`button\`,{onClick:()=>Te(e),className:\`px-2.5 py-1 text-[11px] font-medium capitalize transition-colors \`+(we===e?\`bg-muted text-foreground\`:\`text-muted-foreground/80 hover:text-foreground\`),children:e},e))})]})]}):(0,z.jsx)(lf,{children:\`Select a table.\`})}),M&&L&&(0,z.jsx)(Cy,{table:L,tables:t,initial:M,readOnly:!ze,onClose:()=>ee(null),onSave:async t=>{await N.updateRow(r,at(M),t,e),H.success(\`Row updated\`),ee(null),await rt()},onDelete:async()=>{await N.deleteRow(r,at(M),e),H.success(\`Row deleted\`),ee(null),await rt(),await et()}}),te&&L&&(0,z.jsx)(Cy,{table:L,tables:t,initial:{},isNew:!0,onClose:()=>P(!1),onSave:async t=>{await N.insertRow(r,t,e),H.success(\`Row inserted\`),P(!1),await rt(),await et()}}),Me&&(0,z.jsx)(Lg,{table:Me,schema:e,onClose:()=>Ne(null),onChanged:Ie}),_e&&(0,z.jsx)(cy,{fk:_e.fk,value:_e.value,anchor:_e.rect,tables:t,onClose:()=>ve(null),onOpenTable:e=>{ve(null),i(e)}}),ye&&(0,z.jsx)(ly,{fk:ye.fk,tables:t,currentKey:ye.row[ye.col],onClose:()=>be(null),onPick:e=>{bt(ye.row,e),be(null)}}),F&&r&&(0,z.jsx)(py,{table:r,schema:e,column:F,onClose:()=>ne(null),onDone:async()=>{ne(null),await et()}}),I&&r&&(0,z.jsx)(yy,{table:r,schema:e,onClose:()=>se(!1),onDone:async()=>{await et()}}),re&&L&&(0,z.jsx)(q,{open:!0,danger:!0,title:\`Delete \${k.size} selected row\${k.size===1?\`\`:\`s\`}?\`,description:\`Rows will be permanently deleted from "\${L.name}". This cannot be undone.\`,confirmLabel:\`Delete \${k.size} row\${k.size===1?\`\`:\`s\`}\`,onConfirm:()=>void ht(),onClose:()=>ie(!1)}),ae&&r&&(0,z.jsx)(q,{open:!0,danger:!0,title:\`Drop column "\${ae}"?\`,description:\`The column and all data in it will be permanently removed from "\${r}".\`,confirmLabel:\`Drop column\`,onConfirm:()=>void St(ae),onClose:()=>oe(null)})]})}function Oy(){let[e,t]=(0,_.useState)(!!x()),{tab:n}=Yt();return(0,_.useEffect)(()=>{x()&&N.ping().catch(e=>{e instanceof A&&(e.status===401||e.status===403)&&(C(),t(!1))})},[]),e?(0,z.jsxs)(\`div\`,{className:\`flex h-full flex-col\`,children:[(0,z.jsx)(Zn,{}),(0,z.jsx)(ch,{}),(0,z.jsx)(ah,{}),(0,z.jsx)(fh,{onLogout:()=>{C(),t(!1)}}),(0,z.jsxs)(\`div\`,{className:\`flex min-h-0 flex-1\`,children:[(0,z.jsx)(vh,{tab:n,onTab:e=>R(e)}),(0,z.jsxs)(\`main\`,{className:\`min-w-0 flex-1 overflow-hidden\`,children:[n===\`home\`&&(0,z.jsx)(d_,{}),n===\`table\`&&(0,z.jsx)(Dy,{}),n===\`sql\`&&(0,z.jsx)(Ov,{}),n===\`database\`&&(0,z.jsx)(t_,{}),n===\`auth\`&&(0,z.jsx)(Uh,{}),n===\`storage\`&&(0,z.jsx)(Bv,{}),n===\`functions\`&&(0,z.jsx)(i_,{}),n===\`realtime\`&&(0,z.jsx)(I_,{}),n===\`automations\`&&(0,z.jsx)(dg,{}),n===\`logs\`&&(0,z.jsx)(C_,{}),n===\`settings\`&&(0,z.jsx)(iv,{})]})]})]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(mh,{onOk:()=>t(!0)}),(0,z.jsx)(Zn,{})]})}(0,v.createRoot)(document.getElementById(\`root\`)).render((0,z.jsx)(_.StrictMode,{children:(0,z.jsx)(Oy,{})}));</script>
|
|
1597
1597
|
<style rel="stylesheet" crossorigin>/*! tailwindcss v4.3.2 | MIT License | https://tailwindcss.com */
|
|
1598
1598
|
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial}}}@layer theme{:root,:host{--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-md:28rem;--container-2xl:42rem;--container-3xl:48rem;--container-4xl:56rem;--container-7xl:80rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-3xl:1.875rem;--text-3xl--line-height:calc(2.25 / 1.875);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--tracking-wide:.025em;--tracking-wider:.05em;--leading-snug:1.375;--leading-relaxed:1.625;--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:ui-sans-serif, system-ui, -apple-system, sans-serif;--default-mono-font-family:ui-monospace, "SF Mono", Menlo, monospace;--color-muted-foreground:var(--muted-foreground);--color-border:var(--border)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border)}html,body,#root{height:100%}body{background:var(--background);color:var(--foreground);-webkit-font-smoothing:antialiased;margin:0;font-size:13px}button:not(:disabled),[role=button]:not(:disabled){cursor:pointer}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:0}.inset-x-0{inset-inline:0}.inset-y-0{inset-block:0}.-top-0\\.5{top:calc(var(--spacing) * -.5)}.top-0{top:0}.top-0\\.5{top:calc(var(--spacing) * .5)}.top-1\\.5{top:calc(var(--spacing) * 1.5)}.top-1\\/2{top:50%}.top-2{top:calc(var(--spacing) * 2)}.top-24{top:calc(var(--spacing) * 24)}.top-full{top:100%}.-right-0\\.5{right:calc(var(--spacing) * -.5)}.right-0{right:0}.right-1{right:var(--spacing)}.right-1\\.5{right:calc(var(--spacing) * 1.5)}.right-2{right:calc(var(--spacing) * 2)}.right-2\\.5{right:calc(var(--spacing) * 2.5)}.right-3{right:calc(var(--spacing) * 3)}.-bottom-0\\.5{bottom:calc(var(--spacing) * -.5)}.bottom-0{bottom:0}.-left-0\\.5{left:calc(var(--spacing) * -.5)}.left-0{left:0}.left-0\\.5{left:calc(var(--spacing) * .5)}.left-1\\/2{left:50%}.left-2{left:calc(var(--spacing) * 2)}.left-2\\.5{left:calc(var(--spacing) * 2.5)}.left-4{left:calc(var(--spacing) * 4)}.left-\\[22\\%\\]{left:22%}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.z-80{z-index:80}.z-90{z-index:90}.z-\\[60\\]{z-index:60}.z-\\[70\\]{z-index:70}.z-\\[80\\]{z-index:80}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.m-4{margin:calc(var(--spacing) * 4)}.-mx-1{margin-inline:calc(var(--spacing) * -1)}.-mx-4{margin-inline:calc(var(--spacing) * -4)}.mx-0\\.5{margin-inline:calc(var(--spacing) * .5)}.mx-1{margin-inline:var(--spacing)}.mx-1\\.5{margin-inline:calc(var(--spacing) * 1.5)}.mx-3{margin-inline:calc(var(--spacing) * 3)}.mx-auto{margin-inline:auto}.my-1{margin-block:var(--spacing)}.my-px{margin-block:1px}.mt-0\\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-1\\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-1\\.5\\!{margin-top:calc(var(--spacing) * 1.5)!important}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-2\\.5{margin-top:calc(var(--spacing) * 2.5)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-5{margin-top:calc(var(--spacing) * 5)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mt-7{margin-top:calc(var(--spacing) * 7)}.mt-8{margin-top:calc(var(--spacing) * 8)}.mt-auto{margin-top:auto}.mt-px{margin-top:1px}.mr-1{margin-right:var(--spacing)}.mr-2{margin-right:calc(var(--spacing) * 2)}.-mb-4{margin-bottom:calc(var(--spacing) * -4)}.-mb-px{margin-bottom:-1px}.mb-0\\.5{margin-bottom:calc(var(--spacing) * .5)}.mb-1{margin-bottom:var(--spacing)}.mb-1\\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-px{margin-bottom:1px}.ml-1{margin-left:var(--spacing)}.ml-1\\.5{margin-left:calc(var(--spacing) * 1.5)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-auto{margin-left:auto}.\\!table{display:table!important}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.size-1\\.5{width:calc(var(--spacing) * 1.5);height:calc(var(--spacing) * 1.5)}.size-2{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.size-2\\.5{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.size-3\\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-5{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-7{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-11{width:calc(var(--spacing) * 11);height:calc(var(--spacing) * 11)}.h-1{height:var(--spacing)}.h-1\\.5{height:calc(var(--spacing) * 1.5)}.h-1\\/2{height:50%}.h-4{height:calc(var(--spacing) * 4)}.h-4\\.5{height:calc(var(--spacing) * 4.5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-8\\.5{height:calc(var(--spacing) * 8.5)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-11{height:calc(var(--spacing) * 11)}.h-11\\.5{height:calc(var(--spacing) * 11.5)}.h-12{height:calc(var(--spacing) * 12)}.h-14{height:calc(var(--spacing) * 14)}.h-32{height:calc(var(--spacing) * 32)}.h-40{height:calc(var(--spacing) * 40)}.h-44{height:calc(var(--spacing) * 44)}.h-52{height:calc(var(--spacing) * 52)}.h-56{height:calc(var(--spacing) * 56)}.h-\\[18px\\]{height:18px}.h-full{height:100%}.h-px{height:1px}.max-h-56{max-height:calc(var(--spacing) * 56)}.max-h-64{max-height:calc(var(--spacing) * 64)}.max-h-80{max-height:calc(var(--spacing) * 80)}.max-h-96{max-height:calc(var(--spacing) * 96)}.max-h-\\[85vh\\]{max-height:85vh}.max-h-\\[340px\\]{max-height:340px}.min-h-0{min-height:0}.min-h-\\[30px\\]{min-height:30px}.w-1{width:var(--spacing)}.w-1\\.25{width:calc(var(--spacing) * 1.25)}.w-1\\/3{width:33.3333%}.w-1\\/4{width:25%}.w-2\\/3{width:66.6667%}.w-3\\/4{width:75%}.w-8{width:calc(var(--spacing) * 8)}.w-10{width:calc(var(--spacing) * 10)}.w-12{width:calc(var(--spacing) * 12)}.w-16{width:calc(var(--spacing) * 16)}.w-20{width:calc(var(--spacing) * 20)}.w-24{width:calc(var(--spacing) * 24)}.w-26{width:calc(var(--spacing) * 26)}.w-27\\.5{width:calc(var(--spacing) * 27.5)}.w-28{width:calc(var(--spacing) * 28)}.w-32{width:calc(var(--spacing) * 32)}.w-36{width:calc(var(--spacing) * 36)}.w-40{width:calc(var(--spacing) * 40)}.w-44{width:calc(var(--spacing) * 44)}.w-48{width:calc(var(--spacing) * 48)}.w-56{width:calc(var(--spacing) * 56)}.w-60{width:calc(var(--spacing) * 60)}.w-64{width:calc(var(--spacing) * 64)}.w-72{width:calc(var(--spacing) * 72)}.w-85{width:calc(var(--spacing) * 85)}.w-105{width:calc(var(--spacing) * 105)}.w-110{width:calc(var(--spacing) * 110)}.w-120{width:calc(var(--spacing) * 120)}.w-135{width:calc(var(--spacing) * 135)}.w-140{width:calc(var(--spacing) * 140)}.w-160{width:calc(var(--spacing) * 160)}.w-235{width:calc(var(--spacing) * 235)}.w-\\[22\\%\\]{width:22%}.w-\\[42\\%\\]{width:42%}.w-\\[300px\\]{width:300px}.w-\\[360px\\]{width:360px}.w-\\[400px\\]{width:400px}.w-\\[480px\\]{width:480px}.w-\\[500px\\]{width:500px}.w-\\[560px\\]{width:560px}.w-\\[620px\\]{width:620px}.w-\\[640px\\]{width:640px}.w-\\[980px\\]{width:980px}.w-full{width:100%}.w-px{width:1px}.max-w-0{max-width:0}.max-w-2xl{max-width:var(--container-2xl)}.max-w-3xl{max-width:var(--container-3xl)}.max-w-4xl{max-width:var(--container-4xl)}.max-w-7xl{max-width:var(--container-7xl)}.max-w-40{max-width:calc(var(--spacing) * 40)}.max-w-70{max-width:calc(var(--spacing) * 70)}.max-w-90{max-width:calc(var(--spacing) * 90)}.max-w-120{max-width:calc(var(--spacing) * 120)}.max-w-\\[92vw\\]{max-width:92vw}.max-w-\\[200px\\]{max-width:200px}.max-w-\\[220px\\]{max-width:220px}.max-w-\\[260px\\]{max-width:260px}.max-w-\\[300px\\]{max-width:300px}.max-w-md{max-width:var(--container-md)}.max-w-xs{max-width:var(--container-xs)}.min-w-\\(--radix-select-trigger-width\\){min-width:var(--radix-select-trigger-width)}.min-w-0{min-width:0}.min-w-4{min-width:calc(var(--spacing) * 4)}.min-w-\\[18px\\]{min-width:18px}.min-w-\\[140px\\]{min-width:140px}.min-w-\\[180px\\]{min-width:180px}.flex-1{flex:1}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.-translate-x-1\\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-x-2{--tw-translate-x:calc(var(--spacing) * -2);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-0{--tw-translate-x:0;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-0\\.5{--tw-translate-x:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-4{--tw-translate-x:calc(var(--spacing) * 4);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-\\[fade-in_\\.1s_ease-out\\]{animation:.1s ease-out fade-in}.animate-\\[fade-in_\\.15s_ease-out\\]{animation:.15s ease-out fade-in}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-cell{cursor:cell}.cursor-col-resize{cursor:col-resize}.cursor-default{cursor:default}.cursor-grab{cursor:grab}.cursor-move{cursor:move}.cursor-pointer{cursor:pointer}.cursor-row-resize{cursor:row-resize}.cursor-text{cursor:text}.resize{resize:both}.resize-none{resize:none}.\\[scrollbar-width\\:none\\]{scrollbar-width:none}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.list-none{list-style-type:none}.\\[appearance\\:textfield\\]{appearance:textfield}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-\\[minmax\\(0\\,1fr\\)_minmax\\(0\\,1\\.6fr\\)_auto\\]{grid-template-columns:minmax(0,1fr) minmax(0,1.6fr) auto}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-3\\.5{gap:calc(var(--spacing) * 3.5)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-px{gap:1px}:where(.space-y-0\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-12>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 12) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 12) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-10{column-gap:calc(var(--spacing) * 10)}.gap-y-6{row-gap:calc(var(--spacing) * 6)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-border>:not(:last-child)),:where(.divide-border\\/70>:not(:last-child)){border-color:var(--border)}@supports (color:color-mix(in lab, red, red)){:where(.divide-border\\/70>:not(:last-child)){border-color:color-mix(in oklab, var(--border) 70%, transparent)}}.self-stretch{align-self:stretch}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-\\[4px\\]{border-radius:4px}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-t-md{border-top-left-radius:calc(var(--radius) - 2px);border-top-right-radius:calc(var(--radius) - 2px)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-x{border-inline-style:var(--tw-border-style);border-inline-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-dotted{--tw-border-style:dotted;border-style:dotted}.border-border,.border-border\\/40{border-color:var(--border)}@supports (color:color-mix(in lab, red, red)){.border-border\\/40{border-color:color-mix(in oklab, var(--border) 40%, transparent)}}.border-border\\/60{border-color:var(--border)}@supports (color:color-mix(in lab, red, red)){.border-border\\/60{border-color:color-mix(in oklab, var(--border) 60%, transparent)}}.border-border\\/70{border-color:var(--border)}@supports (color:color-mix(in lab, red, red)){.border-border\\/70{border-color:color-mix(in oklab, var(--border) 70%, transparent)}}.border-brand,.border-brand\\/40{border-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.border-brand\\/40{border-color:color-mix(in oklab, var(--brand) 40%, transparent)}}.border-brand\\/50{border-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.border-brand\\/50{border-color:color-mix(in oklab, var(--brand) 50%, transparent)}}.border-destructive\\/30{border-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.border-destructive\\/30{border-color:color-mix(in oklab, var(--destructive) 30%, transparent)}}.border-destructive\\/40{border-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.border-destructive\\/40{border-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.border-foreground{border-color:var(--foreground)}.border-input{border-color:var(--input)}.border-muted-foreground,.border-muted-foreground\\/30{border-color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.border-muted-foreground\\/30{border-color:color-mix(in oklab, var(--muted-foreground) 30%, transparent)}}.border-transparent{border-color:#0000}.border-warning\\/30{border-color:var(--warning)}@supports (color:color-mix(in lab, red, red)){.border-warning\\/30{border-color:color-mix(in oklab, var(--warning) 30%, transparent)}}.border-warning\\/50{border-color:var(--warning)}@supports (color:color-mix(in lab, red, red)){.border-warning\\/50{border-color:color-mix(in oklab, var(--warning) 50%, transparent)}}.border-t-brand{border-top-color:var(--brand)}.bg-accent,.bg-accent\\/40{background-color:var(--accent)}@supports (color:color-mix(in lab, red, red)){.bg-accent\\/40{background-color:color-mix(in oklab, var(--accent) 40%, transparent)}}.bg-accent\\/50{background-color:var(--accent)}@supports (color:color-mix(in lab, red, red)){.bg-accent\\/50{background-color:color-mix(in oklab, var(--accent) 50%, transparent)}}.bg-accent\\/60{background-color:var(--accent)}@supports (color:color-mix(in lab, red, red)){.bg-accent\\/60{background-color:color-mix(in oklab, var(--accent) 60%, transparent)}}.bg-accent\\/80{background-color:var(--accent)}@supports (color:color-mix(in lab, red, red)){.bg-accent\\/80{background-color:color-mix(in oklab, var(--accent) 80%, transparent)}}.bg-background,.bg-background\\/80{background-color:var(--background)}@supports (color:color-mix(in lab, red, red)){.bg-background\\/80{background-color:color-mix(in oklab, var(--background) 80%, transparent)}}.bg-black\\/50{background-color:#00000080}@supports (color:color-mix(in lab, red, red)){.bg-black\\/50{background-color:color-mix(in oklab, var(--color-black) 50%, transparent)}}.bg-black\\/60{background-color:#0009}@supports (color:color-mix(in lab, red, red)){.bg-black\\/60{background-color:color-mix(in oklab, var(--color-black) 60%, transparent)}}.bg-brand,.bg-brand\\/5{background-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.bg-brand\\/5{background-color:color-mix(in oklab, var(--brand) 5%, transparent)}}.bg-brand\\/10{background-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.bg-brand\\/10{background-color:color-mix(in oklab, var(--brand) 10%, transparent)}}.bg-brand\\/15{background-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.bg-brand\\/15{background-color:color-mix(in oklab, var(--brand) 15%, transparent)}}.bg-brand\\/40{background-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.bg-brand\\/40{background-color:color-mix(in oklab, var(--brand) 40%, transparent)}}.bg-card{background-color:var(--card)}.bg-code{background-color:var(--code)}.bg-destructive,.bg-destructive\\/5{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.bg-destructive\\/5{background-color:color-mix(in oklab, var(--destructive) 5%, transparent)}}.bg-destructive\\/10{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.bg-destructive\\/10{background-color:color-mix(in oklab, var(--destructive) 10%, transparent)}}.bg-destructive\\/15{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.bg-destructive\\/15{background-color:color-mix(in oklab, var(--destructive) 15%, transparent)}}.bg-destructive\\/70{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.bg-destructive\\/70{background-color:color-mix(in oklab, var(--destructive) 70%, transparent)}}.bg-field{background-color:var(--field)}.bg-foreground{background-color:var(--foreground)}.bg-info\\/15{background-color:var(--info)}@supports (color:color-mix(in lab, red, red)){.bg-info\\/15{background-color:color-mix(in oklab, var(--info) 15%, transparent)}}.bg-muted{background-color:var(--muted)}.bg-muted-foreground\\/25{background-color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.bg-muted-foreground\\/25{background-color:color-mix(in oklab, var(--muted-foreground) 25%, transparent)}}.bg-muted-foreground\\/40{background-color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.bg-muted-foreground\\/40{background-color:color-mix(in oklab, var(--muted-foreground) 40%, transparent)}}.bg-muted-foreground\\/60{background-color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.bg-muted-foreground\\/60{background-color:color-mix(in oklab, var(--muted-foreground) 60%, transparent)}}.bg-popover,.bg-popover\\/95{background-color:var(--popover)}@supports (color:color-mix(in lab, red, red)){.bg-popover\\/95{background-color:color-mix(in oklab, var(--popover) 95%, transparent)}}.bg-primary{background-color:var(--primary)}.bg-selected{background-color:var(--selected)}.bg-sidebar{background-color:var(--sidebar)}.bg-transparent{background-color:#0000}.bg-warning,.bg-warning\\/10{background-color:var(--warning)}@supports (color:color-mix(in lab, red, red)){.bg-warning\\/10{background-color:color-mix(in oklab, var(--warning) 10%, transparent)}}.bg-warning\\/15{background-color:var(--warning)}@supports (color:color-mix(in lab, red, red)){.bg-warning\\/15{background-color:color-mix(in oklab, var(--warning) 15%, transparent)}}.bg-white{background-color:var(--color-white)}.fill-brand{fill:var(--brand)}.fill-muted-foreground\\/60{fill:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.fill-muted-foreground\\/60{fill:color-mix(in oklab, var(--muted-foreground) 60%, transparent)}}.object-contain{object-fit:contain}.p-0{padding:0}.p-0\\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:var(--spacing)}.p-1\\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-2\\.5{padding:calc(var(--spacing) * 2.5)}.p-3{padding:calc(var(--spacing) * 3)}.p-3\\.5{padding:calc(var(--spacing) * 3.5)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.p-px{padding:1px}.px-0{padding-inline:0}.px-0\\.5{padding-inline:calc(var(--spacing) * .5)}.px-1{padding-inline:var(--spacing)}.px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-8{padding-inline:calc(var(--spacing) * 8)}.px-10{padding-inline:calc(var(--spacing) * 10)}.px-11{padding-inline:calc(var(--spacing) * 11)}.px-16{padding-inline:calc(var(--spacing) * 16)}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-3\\.5{padding-block:calc(var(--spacing) * 3.5)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-5{padding-block:calc(var(--spacing) * 5)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-10{padding-block:calc(var(--spacing) * 10)}.py-12{padding-block:calc(var(--spacing) * 12)}.py-16{padding-block:calc(var(--spacing) * 16)}.py-20{padding-block:calc(var(--spacing) * 20)}.py-px{padding-block:1px}.pt-0\\.5{padding-top:calc(var(--spacing) * .5)}.pt-1{padding-top:var(--spacing)}.pt-1\\.5{padding-top:calc(var(--spacing) * 1.5)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-2\\.5{padding-top:calc(var(--spacing) * 2.5)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-5{padding-top:calc(var(--spacing) * 5)}.pt-6{padding-top:calc(var(--spacing) * 6)}.pt-px{padding-top:1px}.pr-0\\.5{padding-right:calc(var(--spacing) * .5)}.pr-1{padding-right:var(--spacing)}.pr-1\\.5{padding-right:calc(var(--spacing) * 1.5)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pr-3{padding-right:calc(var(--spacing) * 3)}.pr-8{padding-right:calc(var(--spacing) * 8)}.pr-9{padding-right:calc(var(--spacing) * 9)}.pr-10{padding-right:calc(var(--spacing) * 10)}.pb-0{padding-bottom:0}.pb-0\\.5{padding-bottom:calc(var(--spacing) * .5)}.pb-1{padding-bottom:var(--spacing)}.pb-1\\.5{padding-bottom:calc(var(--spacing) * 1.5)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pl-1{padding-left:var(--spacing)}.pl-1\\.5{padding-left:calc(var(--spacing) * 1.5)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-7{padding-left:calc(var(--spacing) * 7)}.pl-8{padding-left:calc(var(--spacing) * 8)}.pl-10{padding-left:calc(var(--spacing) * 10)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:ui-monospace,SF Mono,Menlo,monospace}.font-sans{font-family:ui-sans-serif,system-ui,-apple-system,sans-serif}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[8px\\]{font-size:8px}.text-\\[9px\\]{font-size:9px}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[12\\.5px\\]{font-size:12.5px}.text-\\[12px\\]{font-size:12px}.text-\\[13px\\]{font-size:13px}.text-\\[14px\\]{font-size:14px}.text-\\[15px\\]{font-size:15px}.leading-6{--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6)}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.break-words,.wrap-break-word{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.whitespace-pre{white-space:pre}.whitespace-pre-wrap{white-space:pre-wrap}.text-background{color:var(--background)}.text-brand{color:var(--brand)}.text-destructive,.text-destructive\\/70{color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.text-destructive\\/70{color:color-mix(in oklab, var(--destructive) 70%, transparent)}}.text-destructive\\/80{color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.text-destructive\\/80{color:color-mix(in oklab, var(--destructive) 80%, transparent)}}.text-foreground,.text-foreground\\/70{color:var(--foreground)}@supports (color:color-mix(in lab, red, red)){.text-foreground\\/70{color:color-mix(in oklab, var(--foreground) 70%, transparent)}}.text-foreground\\/80{color:var(--foreground)}@supports (color:color-mix(in lab, red, red)){.text-foreground\\/80{color:color-mix(in oklab, var(--foreground) 80%, transparent)}}.text-foreground\\/85{color:var(--foreground)}@supports (color:color-mix(in lab, red, red)){.text-foreground\\/85{color:color-mix(in oklab, var(--foreground) 85%, transparent)}}.text-foreground\\/90{color:var(--foreground)}@supports (color:color-mix(in lab, red, red)){.text-foreground\\/90{color:color-mix(in oklab, var(--foreground) 90%, transparent)}}.text-info{color:var(--info)}.text-muted-foreground,.text-muted-foreground\\/40{color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.text-muted-foreground\\/40{color:color-mix(in oklab, var(--muted-foreground) 40%, transparent)}}.text-muted-foreground\\/50{color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.text-muted-foreground\\/50{color:color-mix(in oklab, var(--muted-foreground) 50%, transparent)}}.text-muted-foreground\\/60{color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.text-muted-foreground\\/60{color:color-mix(in oklab, var(--muted-foreground) 60%, transparent)}}.text-muted-foreground\\/70{color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.text-muted-foreground\\/70{color:color-mix(in oklab, var(--muted-foreground) 70%, transparent)}}.text-muted-foreground\\/80{color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.text-muted-foreground\\/80{color:color-mix(in oklab, var(--muted-foreground) 80%, transparent)}}.text-primary-foreground{color:var(--primary-foreground)}.text-warning,.text-warning\\/90{color:var(--warning)}@supports (color:color-mix(in lab, red, red)){.text-warning\\/90{color:color-mix(in oklab, var(--warning) 90%, transparent)}}.capitalize{text-transform:capitalize}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.underline{text-decoration-line:underline}.decoration-muted-foreground\\/40{-webkit-text-decoration-color:var(--muted-foreground);-webkit-text-decoration-color:var(--muted-foreground);-webkit-text-decoration-color:var(--muted-foreground);text-decoration-color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.decoration-muted-foreground\\/40{-webkit-text-decoration-color:color-mix(in oklab, var(--muted-foreground) 40%, transparent);-webkit-text-decoration-color:color-mix(in oklab, var(--muted-foreground) 40%, transparent);-webkit-text-decoration-color:color-mix(in oklab, var(--muted-foreground) 40%, transparent);text-decoration-color:color-mix(in oklab, var(--muted-foreground) 40%, transparent)}}.decoration-dotted{text-decoration-style:dotted}.underline-offset-2{text-underline-offset:2px}.opacity-0{opacity:0}.opacity-40{opacity:.4}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-100{opacity:1}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_16px_48px_rgba\\(0\\,0\\,0\\,0\\.6\\)\\]{--tw-shadow:0 16px 48px var(--tw-shadow-color,#0009);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[12px_0_32px_rgba\\(0\\,0\\,0\\,0\\.45\\)\\]{--tw-shadow:12px 0 32px var(--tw-shadow-color,#00000073);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-brand,.ring-brand\\/40{--tw-ring-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.ring-brand\\/40{--tw-ring-color:color-mix(in oklab, var(--brand) 40%, transparent)}}.ring-card{--tw-ring-color:var(--card)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-\\[2px\\]{--tw-backdrop-blur:blur(2px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition-\\[opacity\\,transform\\]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[width\\,box-shadow\\]{transition-property:width,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[width\\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-shadow{transition-property:box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.ease-\\[cubic-bezier\\(0\\.16\\,1\\,0\\.3\\,1\\)\\]{--tw-ease:cubic-bezier(.16,1,.3,1);transition-timing-function:cubic-bezier(.16,1,.3,1)}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.ring-inset{--tw-ring-inset:inset}@media (hover:hover){.group-hover\\:block:is(:where(.group):hover *){display:block}.group-hover\\:hidden:is(:where(.group):hover *){display:none}.group-hover\\:bg-popover:is(:where(.group):hover *){background-color:var(--popover)}.group-hover\\:text-foreground:is(:where(.group):hover *){color:var(--foreground)}.group-hover\\:opacity-100:is(:where(.group):hover *),.group-hover\\/th\\:opacity-100:is(:where(.group\\/th):hover *){opacity:1}}.selection\\:bg-brand\\/40 ::selection{background-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.selection\\:bg-brand\\/40 ::selection{background-color:color-mix(in oklab, var(--brand) 40%, transparent)}}.selection\\:bg-brand\\/40::selection{background-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.selection\\:bg-brand\\/40::selection{background-color:color-mix(in oklab, var(--brand) 40%, transparent)}}.placeholder\\:text-muted-foreground\\/60::placeholder{color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.placeholder\\:text-muted-foreground\\/60::placeholder{color:color-mix(in oklab, var(--muted-foreground) 60%, transparent)}}.first\\:pt-0:first-child{padding-top:0}.first\\:pt-2:first-child{padding-top:calc(var(--spacing) * 2)}.last\\:border-0:last-child{border-style:var(--tw-border-style);border-width:0}.last\\:border-r-0:last-child{border-right-style:var(--tw-border-style);border-right-width:0}.last\\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.focus-within\\:border-brand:focus-within{border-color:var(--brand)}.focus-within\\:border-input:focus-within{border-color:var(--input)}@media (hover:hover){.hover\\:border-border:hover{border-color:var(--border)}.hover\\:border-foreground:hover{border-color:var(--foreground)}.hover\\:border-muted-foreground:hover,.hover\\:border-muted-foreground\\/60:hover{border-color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.hover\\:border-muted-foreground\\/60:hover{border-color:color-mix(in oklab, var(--muted-foreground) 60%, transparent)}}.hover\\:border-warning:hover{border-color:var(--warning)}.hover\\:bg-accent:hover,.hover\\:bg-accent\\/30:hover{background-color:var(--accent)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-accent\\/30:hover{background-color:color-mix(in oklab, var(--accent) 30%, transparent)}}.hover\\:bg-accent\\/40:hover{background-color:var(--accent)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-accent\\/40:hover{background-color:color-mix(in oklab, var(--accent) 40%, transparent)}}.hover\\:bg-accent\\/50:hover{background-color:var(--accent)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-accent\\/50:hover{background-color:color-mix(in oklab, var(--accent) 50%, transparent)}}.hover\\:bg-accent\\/60:hover{background-color:var(--accent)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-accent\\/60:hover{background-color:color-mix(in oklab, var(--accent) 60%, transparent)}}.hover\\:bg-brand\\/40:hover{background-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-brand\\/40:hover{background-color:color-mix(in oklab, var(--brand) 40%, transparent)}}.hover\\:bg-brand\\/50:hover{background-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-brand\\/50:hover{background-color:color-mix(in oklab, var(--brand) 50%, transparent)}}.hover\\:bg-destructive\\/10:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-destructive\\/10:hover{background-color:color-mix(in oklab, var(--destructive) 10%, transparent)}}.hover\\:bg-destructive\\/90:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-destructive\\/90:hover{background-color:color-mix(in oklab, var(--destructive) 90%, transparent)}}.hover\\:bg-muted:hover{background-color:var(--muted)}.hover\\:bg-primary\\/90:hover{background-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-primary\\/90:hover{background-color:color-mix(in oklab, var(--primary) 90%, transparent)}}.hover\\:bg-warning\\/15:hover{background-color:var(--warning)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-warning\\/15:hover{background-color:color-mix(in oklab, var(--warning) 15%, transparent)}}.hover\\:text-brand:hover{color:var(--brand)}.hover\\:text-destructive:hover{color:var(--destructive)}.hover\\:text-foreground:hover,.hover\\:text-foreground\\/80:hover{color:var(--foreground)}@supports (color:color-mix(in lab, red, red)){.hover\\:text-foreground\\/80:hover{color:color-mix(in oklab, var(--foreground) 80%, transparent)}}.hover\\:text-muted-foreground:hover{color:var(--muted-foreground)}.hover\\:text-primary-foreground:hover{color:var(--primary-foreground)}.hover\\:underline:hover{text-decoration-line:underline}}.focus\\:border-brand:focus{border-color:var(--brand)}.focus\\:border-muted-foreground:focus{border-color:var(--muted-foreground)}.focus\\:bg-accent:focus{background-color:var(--accent)}.focus\\:opacity-100:focus{opacity:1}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\\:opacity-100:focus-visible{opacity:1}.focus-visible\\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.active\\:cursor-grabbing:active{cursor:grabbing}.active\\:bg-brand\\/60:active{background-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.active\\:bg-brand\\/60:active{background-color:color-mix(in oklab, var(--brand) 60%, transparent)}}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:opacity-50:disabled{opacity:.5}.data-disabled\\:pointer-events-none[data-disabled]{pointer-events:none}.data-disabled\\:opacity-40[data-disabled]{opacity:.4}.data-highlighted\\:bg-accent[data-highlighted]{background-color:var(--accent)}.data-placeholder\\:text-muted-foreground\\/60[data-placeholder]{color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.data-placeholder\\:text-muted-foreground\\/60[data-placeholder]{color:color-mix(in oklab, var(--muted-foreground) 60%, transparent)}}.data-\\[highlighted\\]\\:bg-accent[data-highlighted]{background-color:var(--accent)}.data-\\[highlighted\\]\\:bg-destructive\\/10[data-highlighted]{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.data-\\[highlighted\\]\\:bg-destructive\\/10[data-highlighted]{background-color:color-mix(in oklab, var(--destructive) 10%, transparent)}}.data-\\[state\\=closed\\]\\:animate-\\[fade-out_\\.2s_ease-in\\][data-state=closed]{animation:.2s ease-in fade-out}.data-\\[state\\=closed\\]\\:animate-\\[sheet-out_\\.2s_ease-in\\][data-state=closed]{animation:.2s ease-in sheet-out}.data-\\[state\\=open\\]\\:block[data-state=open]{display:block}.data-\\[state\\=open\\]\\:animate-\\[fade-in_\\.15s_ease-out\\][data-state=open]{animation:.15s ease-out fade-in}.data-\\[state\\=open\\]\\:animate-\\[sheet-in_\\.25s_cubic-bezier\\(0\\.16\\,1\\,0\\.3\\,1\\)\\][data-state=open]{animation:.25s cubic-bezier(.16,1,.3,1) sheet-in}.data-\\[state\\=open\\]\\:bg-accent[data-state=open]{background-color:var(--accent)}.data-\\[state\\=open\\]\\:bg-muted[data-state=open]{background-color:var(--muted)}.data-\\[state\\=open\\]\\:text-foreground[data-state=open]{color:var(--foreground)}.data-\\[state\\=open\\]\\:opacity-100[data-state=open]{opacity:1}@media (width>=40rem){.sm\\:flex{display:flex}.sm\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\\:flex-row{flex-direction:row}.sm\\:items-start{align-items:flex-start}.sm\\:gap-10{gap:calc(var(--spacing) * 10)}}@media (width>=64rem){.lg\\:flex{display:flex}.lg\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}.\\[\\&\\:\\:-webkit-inner-spin-button\\]\\:appearance-none::-webkit-inner-spin-button{appearance:none}.\\[\\&\\:\\:-webkit-scrollbar\\]\\:hidden::-webkit-scrollbar{display:none}}:root{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;--background:#fafafa;--foreground:#171717;--card:#fff;--card-foreground:#171717;--popover:#fff;--popover-foreground:#171717;--sidebar:#f4f4f5;--sidebar-foreground:#52525b;--primary:#059669;--primary-foreground:#fff;--brand:#059669;--secondary:#f4f4f5;--muted:#e4e4e7;--muted-foreground:#52525b;--accent:#e8e8ea;--accent-foreground:#171717;--destructive:#dc2626;--destructive-foreground:#fff;--warning:#b45309;--info:#2563eb;--border:#e4e4e7;--input:#d4d4d8;--field:#fff;--code:#f4f4f5;--selected:#d7f0e4;--ring:#059669;--radius:.5rem}.dark{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--background:#1c1c1c;--foreground:#ededed;--card:#191919;--card-foreground:#ededed;--popover:#232323;--popover-foreground:#d4d4d4;--sidebar:#171717;--sidebar-foreground:#a3a3a3;--primary:#059669;--primary-foreground:#fff;--brand:#3ecf8e;--secondary:#171717;--muted:#404040;--muted-foreground:#a3a3a3;--accent:#262626;--accent-foreground:#ededed;--destructive:#ef4444;--destructive-foreground:#fff;--warning:#fbbf24;--info:#60a5fa;--border:#262626;--input:#404040;--field:#171717;--code:#141414;--selected:#12271c;--ring:#3ecf8e}@keyframes sheet-in{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes sheet-out{0%{transform:translate(0)}to{transform:translate(100%)}}@keyframes fade-in{0%{opacity:0}to{opacity:1}}@keyframes fade-out{0%{opacity:1}to{opacity:0}}.ace_editor{background:0 0!important;line-height:1.6!important}.ace_editor .ace_gutter{color:var(--muted-foreground);background:0 0!important}@supports (color:color-mix(in lab, red, red)){.ace_editor .ace_gutter{color:color-mix(in oklab, var(--muted-foreground) 70%, transparent)}}.ace_editor .ace_gutter-active-line{background:var(--accent)!important}@supports (color:color-mix(in lab, red, red)){.ace_editor .ace_gutter-active-line{background:color-mix(in oklab, var(--accent) 60%, transparent)!important}}.ace_editor .ace_active-line{background:var(--accent)!important}@supports (color:color-mix(in lab, red, red)){.ace_editor .ace_active-line{background:color-mix(in oklab, var(--accent) 50%, transparent)!important}}.ace_editor .ace_selection{background:var(--brand)!important}@supports (color:color-mix(in lab, red, red)){.ace_editor .ace_selection{background:color-mix(in oklab, var(--brand) 22%, transparent)!important}}.ace_editor .ace_cursor{color:var(--foreground)}.ace_placeholder{color:var(--muted-foreground)!important}@supports (color:color-mix(in lab, red, red)){.ace_placeholder{color:color-mix(in oklab, var(--muted-foreground) 60%, transparent)!important}}.ace_placeholder{padding:0!important;font-family:inherit!important}::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-thumb{background:var(--muted);border:2px solid var(--background);border-radius:6px}::-webkit-scrollbar-thumb:hover{background:var(--muted-foreground)}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}
|
|
1599
1599
|
/*$vite$:1*/</style>
|