tinbase 0.20.0 → 0.21.1

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/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 P(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 ee(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 F=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)},I={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(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=I,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:ee}},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,F)}catch(e){F(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 P(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?P(e.type)||\`Memo\`:t;case O:t=e._payload,e=e._init;try{return P(e(t))}catch{}}return null}var ee=Array.isArray,F=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te={pending:!1,data:null,method:null,action:null},ne=[],re=-1;function ie(e){return{current:e}}function ae(e){0>re||(e.current=ne[re],ne[re]=null,re--)}function L(e,t){re++,ne[re]=e.current,e.current=t}var oe=ie(null),se=ie(null),ce=ie(null),le=ie(null);function ue(e,t){switch(L(ce,t),L(se,e),L(oe,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}}ae(oe),L(oe,e)}function de(){ae(oe),ae(se),ae(ce)}function fe(e){e.memoizedState!==null&&L(le,e);var t=oe.current,n=qd(t,e.type);t!==n&&(L(se,e),L(oe,n))}function pe(e){se.current===e&&(ae(oe),ae(se)),le.current===e&&(ae(le),tp._currentValue=te)}var me,he;function ge(e){if(me===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\\n( *(at )?)/);me=t&&t[1]||\`\`,he=-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)?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(\`
23
23
  at\`)?\` (<anonymous>)\`:-1<e.stack.indexOf(\`@\`)?\`@unknown:0:0\`:\`\`}return\`
24
- \`+me+e+he}var _e=!1;function ve(e,t){if(!e||_e)return\`\`;_e=!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(\`
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
- \`+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{_e=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:\`\`)?ge(n):\`\`}function ye(e,t){switch(e.tag){case 26:case 27:case 5:return ge(e.type);case 16:return ge(\`Lazy\`);case 13:return e.child!==t&&t!==null?ge(\`Suspense Fallback\`):ge(\`Suspense\`);case 19:return ge(\`SuspenseList\`);case 0:case 15:return ve(e.type,!1);case 11:return ve(e.type.render,!1);case 1:return ve(e.type,!0);case 31:return ge(\`Activity\`);default:return\`\`}}function be(e){try{var t=\`\`,n=null;do t+=ye(e,n),n=e,e=e.return;while(e);return t}catch(e){return\`
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 xe=Object.prototype.hasOwnProperty,Se=t.unstable_scheduleCallback,Ce=t.unstable_cancelCallback,we=t.unstable_shouldYield,Te=t.unstable_requestPaint,Ee=t.unstable_now,De=t.unstable_getCurrentPriorityLevel,Oe=t.unstable_ImmediatePriority,ke=t.unstable_UserBlockingPriority,Ae=t.unstable_NormalPriority,je=t.unstable_LowPriority,Me=t.unstable_IdlePriority,Ne=t.log,Pe=t.unstable_setDisableYieldValue,Fe=null,Ie=null;function R(e){if(typeof Ne==\`function\`&&Pe(e),Ie&&typeof Ie.setStrictMode==\`function\`)try{Ie.setStrictMode(Fe,e)}catch{}}var Le=Math.clz32?Math.clz32:Be,Re=Math.log,ze=Math.LN2;function Be(e){return e>>>=0,e===0?32:31-(Re(e)/ze|0)|0}var Ve=256,He=262144,Ue=4194304;function We(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 Ge(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=We(n))):i=We(o):i=We(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=We(n))):i=We(o)):i=We(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 Ke(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function qe(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 Je(){var e=Ue;return Ue<<=1,!(Ue&62914560)&&(Ue=4194304),e}function Ye(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Xe(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ze(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-Le(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&&Qe(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Qe(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Le(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function $e(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Le(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function et(e,t){var n=t&-t;return n=n&42?1:tt(n),(n&(e.suspendedLanes|t))===0?n:0}function tt(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 nt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function rt(){var e=I.p;return e===0?(e=window.event,e===void 0?32:_p(e.type)):e}function it(e,t){var n=I.p;try{return I.p=e,t()}finally{I.p=n}}var at=Math.random().toString(36).slice(2),ot=\`__reactFiber$\`+at,st=\`__reactProps$\`+at,ct=\`__reactContainer$\`+at,lt=\`__reactEvents$\`+at,ut=\`__reactListeners$\`+at,dt=\`__reactHandles$\`+at,ft=\`__reactResources$\`+at,pt=\`__reactMarker$\`+at;function mt(e){delete e[ot],delete e[st],delete e[lt],delete e[ut],delete e[dt]}function ht(e){var t=e[ot];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ct]||n[ot]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=mf(e);e!==null;){if(n=e[ot])return n;e=mf(e)}return t}e=n,n=e.parentNode}return null}function gt(e){if(e=e[ot]||e[ct]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function _t(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function vt(e){var t=e[ft];return t||=e[ft]={hoistableStyles:new Map,hoistableScripts:new Map},t}function yt(e){e[pt]=!0}var bt=new Set,xt={};function St(e,t){Ct(e,t),Ct(e+\`Capture\`,t)}function Ct(e,t){for(xt[e]=t,e=0;e<t.length;e++)bt.add(t[e])}var wt=RegExp(\`^[:A-Z_a-z\\\\u00C0-\\\\u00D6\\\\u00D8-\\\\u00F6\\\\u00F8-\\\\u02FF\\\\u0370-\\\\u037D\\\\u037F-\\\\u1FFF\\\\u200C-\\\\u200D\\\\u2070-\\\\u218F\\\\u2C00-\\\\u2FEF\\\\u3001-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFFD][:A-Z_a-z\\\\u00C0-\\\\u00D6\\\\u00D8-\\\\u00F6\\\\u00F8-\\\\u02FF\\\\u0370-\\\\u037D\\\\u037F-\\\\u1FFF\\\\u200C-\\\\u200D\\\\u2070-\\\\u218F\\\\u2C00-\\\\u2FEF\\\\u3001-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFFD\\\\-.0-9\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040]*$\`),Tt={},Et={};function Dt(e){return xe.call(Et,e)?!0:xe.call(Tt,e)?!1:wt.test(e)?Et[e]=!0:(Tt[e]=!0,!1)}function Ot(e,t,n){if(Dt(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 kt(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 At(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 jt(e){switch(typeof e){case\`bigint\`:case\`boolean\`:case\`number\`:case\`string\`:case\`undefined\`:return e;case\`object\`:return e;default:return\`\`}}function Mt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===\`input\`&&(t===\`checkbox\`||t===\`radio\`)}function Nt(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 Pt(e){if(!e._valueTracker){var t=Mt(e)?\`checked\`:\`value\`;e._valueTracker=Nt(e,t,\`\`+e[t])}}function Ft(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=\`\`;return e&&(r=Mt(e)?e.checked?\`true\`:\`false\`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function It(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 Lt=/[\\n"\\\\]/g;function Rt(e){return e.replace(Lt,function(e){return\`\\\\\`+e.charCodeAt(0).toString(16)+\` \`})}function zt(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=\`\`+jt(t)):e.value!==\`\`+jt(t)&&(e.value=\`\`+jt(t)),t==null?n==null?r!=null&&e.removeAttribute(\`value\`):Vt(e,o,jt(n)):Vt(e,o,jt(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=\`\`+jt(s):e.removeAttribute(\`name\`)}function Bt(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)){Pt(e);return}n=n==null?\`\`:\`\`+jt(n),t=t==null?n:\`\`+jt(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),Pt(e)}function Vt(e,t,n){t===\`number\`&&It(e.ownerDocument)===e||e.defaultValue===\`\`+n||(e.defaultValue=\`\`+n)}function Ht(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=\`\`+jt(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 Ut(e,t,n){if(t!=null&&(t=\`\`+jt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?\`\`:\`\`+jt(n)}function Wt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ee(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=\`\`,t=n}n=jt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==\`\`&&r!==null&&(e.value=r),Pt(e)}function Gt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Kt=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 z(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||Kt.has(t)?t===\`float\`?e.cssFloat=n:e[t]=(\`\`+n).trim():e[t]=n+\`px\`}function qt(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&&z(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&z(e,o,t[o])}function Jt(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 Yt=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\`]]),Xt=/^[\\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 B(e){return Xt.test(\`\`+e)?\`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')\`:e}function V(){}var H=null;function Zt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Qt=null,$t=null;function en(e){var t=gt(e);if(t&&(e=t.stateNode)){var n=e[st]||null;a:switch(e=t.stateNode,t.type){case\`input\`:if(zt(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="\`+Rt(\`\`+t)+\`"][type="radio"]\`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[st]||null;if(!a)throw Error(i(90));zt(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&&Ft(r)}break a;case\`textarea\`:Ut(e,n.value,n.defaultValue);break a;case\`select\`:t=n.value,t!=null&&Ht(e,!!n.multiple,t,!1)}}}var tn=!1;function nn(e,t,n){if(tn)return e(t,n);tn=!0;try{return e(t)}finally{if(tn=!1,(Qt!==null||$t!==null)&&(Cu(),Qt&&(t=Qt,e=$t,$t=Qt=null,en(t),e)))for(t=0;t<e.length;t++)en(e[t])}}function rn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[st]||null;if(r===null)return null;n=r[t];a:switch(t){case\`onClick\`:case\`onClickCapture\`:case\`onDoubleClick\`:case\`onDoubleClickCapture\`:case\`onMouseDown\`:case\`onMouseDownCapture\`:case\`onMouseMove\`:case\`onMouseMoveCapture\`:case\`onMouseUp\`:case\`onMouseUpCapture\`:case\`onMouseEnter\`:(r=!r.disabled)||(e=e.type,r=!(e===\`button\`||e===\`input\`||e===\`select\`||e===\`textarea\`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=\`function\`)throw Error(i(231,t,typeof n));return n}var an=!(typeof window>\`u\`||window.document===void 0||window.document.createElement===void 0),on=!1;if(an)try{var sn={};Object.defineProperty(sn,"passive",{get:function(){on=!0}}),window.addEventListener(\`test\`,sn,sn),window.removeEventListener(\`test\`,sn,sn)}catch{on=!1}var cn=null,ln=null,un=null;function dn(){if(un)return un;var e,t=ln,n=t.length,r,i=\`value\`in cn?cn.value:cn.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 un=i.slice(e,1<r?1-r:void 0)}function fn(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 pn(){return!0}function mn(){return!1}function hn(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)?pn:mn,this.isPropagationStopped=mn,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=pn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=\`unknown\`&&(e.cancelBubble=!0),this.isPropagationStopped=pn)},persist:function(){},isPersistent:pn}),t}var gn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},_n=hn(gn),vn=h({},gn,{view:0,detail:0}),yn=hn(vn),bn,xn,Sn,Cn=h({},vn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Pn,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!==Sn&&(Sn&&e.type===\`mousemove\`?(bn=e.screenX-Sn.screenX,xn=e.screenY-Sn.screenY):xn=bn=0,Sn=e),bn)},movementY:function(e){return\`movementY\`in e?e.movementY:xn}}),wn=hn(Cn),Tn=hn(h({},Cn,{dataTransfer:0})),En=hn(h({},vn,{relatedTarget:0})),Dn=hn(h({},gn,{animationName:0,elapsedTime:0,pseudoElement:0})),On=hn(h({},gn,{clipboardData:function(e){return\`clipboardData\`in e?e.clipboardData:window.clipboardData}})),kn=hn(h({},gn,{data:0})),An={Esc:\`Escape\`,Spacebar:\` \`,Left:\`ArrowLeft\`,Up:\`ArrowUp\`,Right:\`ArrowRight\`,Down:\`ArrowDown\`,Del:\`Delete\`,Win:\`OS\`,Menu:\`ContextMenu\`,Apps:\`ContextMenu\`,Scroll:\`ScrollLock\`,MozPrintableKey:\`Unidentified\`},jn={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\`},Mn={Alt:\`altKey\`,Control:\`ctrlKey\`,Meta:\`metaKey\`,Shift:\`shiftKey\`};function Nn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Mn[e])?!!t[e]:!1}function Pn(){return Nn}var Fn=hn(h({},vn,{key:function(e){if(e.key){var t=An[e.key]||e.key;if(t!==\`Unidentified\`)return t}return e.type===\`keypress\`?(e=fn(e),e===13?\`Enter\`:String.fromCharCode(e)):e.type===\`keydown\`||e.type===\`keyup\`?jn[e.keyCode]||\`Unidentified\`:\`\`},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Pn,charCode:function(e){return e.type===\`keypress\`?fn(e):0},keyCode:function(e){return e.type===\`keydown\`||e.type===\`keyup\`?e.keyCode:0},which:function(e){return e.type===\`keypress\`?fn(e):e.type===\`keydown\`||e.type===\`keyup\`?e.keyCode:0}})),In=hn(h({},Cn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Ln=hn(h({},vn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Pn})),Rn=hn(h({},gn,{propertyName:0,elapsedTime:0,pseudoElement:0})),zn=hn(h({},Cn,{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})),Bn=hn(h({},gn,{newState:0,oldState:0})),Vn=[9,13,27,32],Hn=an&&\`CompositionEvent\`in window,Un=null;an&&\`documentMode\`in document&&(Un=document.documentMode);var Wn=an&&\`TextEvent\`in window&&!Un,Gn=an&&(!Hn||Un&&8<Un&&11>=Un),Kn=\` \`,qn=!1;function Jn(e,t){switch(e){case\`keyup\`:return Vn.indexOf(t.keyCode)!==-1;case\`keydown\`:return t.keyCode!==229;case\`keypress\`:case\`mousedown\`:case\`focusout\`:return!0;default:return!1}}function U(e){return e=e.detail,typeof e==\`object\`&&\`data\`in e?e.data:null}var Yn=!1;function Xn(e,t){switch(e){case\`compositionend\`:return U(t);case\`keypress\`:return t.which===32?(qn=!0,Kn):null;case\`textInput\`:return e=t.data,e===Kn&&qn?null:e;default:return null}}function Zn(e,t){if(Yn)return e===\`compositionend\`||!Hn&&Jn(e,t)?(e=dn(),un=ln=cn=null,Yn=!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 Gn&&t.locale!==\`ko\`?null:t.data;default:return null}}var Qn={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 $n(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===\`input\`?!!Qn[e.type]:t===\`textarea\`}function er(e,t,n,r){Qt?$t?$t.push(r):$t=[r]:Qt=r,t=Ad(t,\`onChange\`),0<t.length&&(n=new _n(\`onChange\`,\`change\`,null,n,r),e.push({event:n,listeners:t}))}var tr=null,nr=null;function W(e){Cd(e,0)}function rr(e){if(Ft(_t(e)))return e}function ir(e,t){if(e===\`change\`)return t}var ar=!1;if(an){var or;if(an){var sr=\`oninput\`in document;if(!sr){var cr=document.createElement(\`div\`);cr.setAttribute(\`oninput\`,\`return;\`),sr=typeof cr.oninput==\`function\`}or=sr}else or=!1;ar=or&&(!document.documentMode||9<document.documentMode)}function lr(){tr&&(tr.detachEvent(\`onpropertychange\`,ur),nr=tr=null)}function ur(e){if(e.propertyName===\`value\`&&rr(nr)){var t=[];er(t,nr,e,Zt(e)),nn(W,t)}}function dr(e,t,n){e===\`focusin\`?(lr(),tr=t,nr=n,tr.attachEvent(\`onpropertychange\`,ur)):e===\`focusout\`&&lr()}function fr(e){if(e===\`selectionchange\`||e===\`keyup\`||e===\`keydown\`)return rr(nr)}function pr(e,t){if(e===\`click\`)return rr(t)}function mr(e,t){if(e===\`input\`||e===\`change\`)return rr(t)}function hr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var gr=typeof Object.is==\`function\`?Object.is:hr;function _r(e,t){if(gr(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(!xe.call(t,i)||!gr(e[i],t[i]))return!1}return!0}function vr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function yr(e,t){var n=vr(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=vr(n)}}function br(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?br(e,t.parentNode):\`contains\`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function xr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=It(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=It(e.document)}return t}function Sr(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 Cr=an&&\`documentMode\`in document&&11>=document.documentMode,wr=null,Tr=null,Er=null,Dr=!1;function Or(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Dr||wr==null||wr!==It(r)||(r=wr,\`selectionStart\`in r&&Sr(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}),Er&&_r(Er,r)||(Er=r,r=Ad(Tr,\`onSelect\`),0<r.length&&(t=new _n(\`onSelect\`,\`select\`,null,t,n),e.push({event:t,listeners:r}),t.target=wr)))}function kr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[\`Webkit\`+e]=\`webkit\`+t,n[\`Moz\`+e]=\`moz\`+t,n}var Ar={animationend:kr(\`Animation\`,\`AnimationEnd\`),animationiteration:kr(\`Animation\`,\`AnimationIteration\`),animationstart:kr(\`Animation\`,\`AnimationStart\`),transitionrun:kr(\`Transition\`,\`TransitionRun\`),transitionstart:kr(\`Transition\`,\`TransitionStart\`),transitioncancel:kr(\`Transition\`,\`TransitionCancel\`),transitionend:kr(\`Transition\`,\`TransitionEnd\`)},jr={},G={};an&&(G=document.createElement(\`div\`).style,\`AnimationEvent\`in window||(delete Ar.animationend.animation,delete Ar.animationiteration.animation,delete Ar.animationstart.animation),\`TransitionEvent\`in window||delete Ar.transitionend.transition);function Mr(e){if(jr[e])return jr[e];if(!Ar[e])return e;var t=Ar[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in G)return jr[e]=t[n];return e}var Nr=Mr(\`animationend\`),Pr=Mr(\`animationiteration\`),Fr=Mr(\`animationstart\`),Ir=Mr(\`transitionrun\`),Lr=Mr(\`transitionstart\`),Rr=Mr(\`transitioncancel\`),zr=Mr(\`transitionend\`),Br=new Map,Vr=\`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(\` \`);Vr.push(\`scrollEnd\`);function Hr(e,t){Br.set(e,t),St(t,[e])}var Ur=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)},Wr=[],Gr=0,Kr=0;function qr(){for(var e=Gr,t=Kr=Gr=0;t<e;){var n=Wr[t];Wr[t++]=null;var r=Wr[t];Wr[t++]=null;var i=Wr[t];Wr[t++]=null;var a=Wr[t];if(Wr[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&&Zr(n,i,a)}}function Jr(e,t,n,r){Wr[Gr++]=e,Wr[Gr++]=t,Wr[Gr++]=n,Wr[Gr++]=r,Kr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Yr(e,t,n,r){return Jr(e,t,n,r),Qr(e)}function Xr(e,t){return Jr(e,null,null,t),Qr(e)}function Zr(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-Le(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Qr(e){if(50<mu)throw mu=0,hu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var $r={};function ei(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 ti(e,t,n,r){return new ei(e,t,n,r)}function ni(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ri(e,t){var n=e.alternate;return n===null?(n=ti(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 ii(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 ai(e,t,n,r,a,o){var s=0;if(r=e,typeof e==\`function\`)ni(e)&&(s=1);else if(typeof e==\`string\`)s=Kf(e,n,oe.current)?26:e===\`html\`||e===\`head\`||e===\`body\`?27:5;else a:switch(e){case k:return e=ti(31,n,t,a),e.elementType=k,e.lanes=o,e;case y:return oi(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=ti(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=ti(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=ti(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=ti(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function oi(e,t,n,r){return e=ti(7,e,r,t),e.lanes=n,e}function si(e,t,n){return e=ti(6,e,null,t),e.lanes=n,e}function ci(e){var t=ti(18,null,null,0);return t.stateNode=e,t}function li(e,t,n){return t=ti(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var ui=new WeakMap;function di(e,t){if(typeof e==\`object\`&&e){var n=ui.get(e);return n===void 0?(t={value:e,source:t,stack:be(t)},ui.set(e,t),t):n}return{value:e,source:t,stack:be(t)}}var fi=[],pi=0,mi=null,hi=0,gi=[],_i=0,vi=null,yi=1,bi=\`\`;function xi(e,t){fi[pi++]=hi,fi[pi++]=mi,mi=e,hi=t}function Si(e,t,n){gi[_i++]=yi,gi[_i++]=bi,gi[_i++]=vi,vi=e;var r=yi;e=bi;var i=32-Le(r)-1;r&=~(1<<i),n+=1;var a=32-Le(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,yi=1<<32-Le(t)+i|n<<i|r,bi=a+e}else yi=1<<a|n<<i|r,bi=e}function Ci(e){e.return!==null&&(xi(e,1),Si(e,1,0))}function wi(e){for(;e===mi;)mi=fi[--pi],fi[pi]=null,hi=fi[--pi],fi[pi]=null;for(;e===vi;)vi=gi[--_i],gi[_i]=null,bi=gi[--_i],gi[_i]=null,yi=gi[--_i],gi[_i]=null}function Ti(e,t){gi[_i++]=yi,gi[_i++]=bi,gi[_i++]=vi,yi=t.id,bi=t.overflow,vi=e}var Ei=null,Di=null,Oi=!1,ki=null,Ai=!1,ji=Error(i(519));function Mi(e){throw Ri(di(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[ot]=e,t[st]=r,n){case\`dialog\`:J(\`cancel\`,t),J(\`close\`,t);break;case\`iframe\`:case\`object\`:case\`embed\`:J(\`load\`,t);break;case\`video\`:case\`audio\`:for(n=0;n<xd.length;n++)J(xd[n],t);break;case\`source\`:J(\`error\`,t);break;case\`img\`:case\`image\`:case\`link\`:J(\`error\`,t),J(\`load\`,t);break;case\`details\`:J(\`toggle\`,t);break;case\`input\`:J(\`invalid\`,t),Bt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case\`select\`:J(\`invalid\`,t);break;case\`textarea\`:J(\`invalid\`,t),Wt(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&&(J(\`beforetoggle\`,t),J(\`toggle\`,t)),r.onScroll!=null&&J(\`scroll\`,t),r.onScrollEnd!=null&&J(\`scrollend\`,t),r.onClick!=null&&(t.onclick=V),t=!0):t=!1,t||Mi(e,!0)}function Pi(e){for(Ei=e.return;Ei;)switch(Ei.tag){case 5:case 31:case 13:Ai=!1;return;case 27:case 3:Ai=!0;return;default:Ei=Ei.return}}function Fi(e){if(e!==Ei)return!1;if(!Oi)return Pi(e),Oi=!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&&Di&&Mi(e),Pi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Di=pf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Di=pf(e)}else t===27?(t=Di,nf(e.type)?(e=ff,ff=null,Di=e):Di=t):Di=Ei?df(e.stateNode.nextSibling):null;return!0}function Ii(){Di=Ei=null,Oi=!1}function Li(){var e=ki;return e!==null&&(eu===null?eu=e:eu.push.apply(eu,e),ki=null),e}function Ri(e){ki===null?ki=[e]:ki.push(e)}var zi=ie(null),Bi=null,Vi=null;function Hi(e,t,n){L(zi,t._currentValue),t._currentValue=n}function Ui(e){e._currentValue=zi.current,ae(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;gr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===le.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(!gr(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=hd(),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=F.S;F.S=function(e,t){ru=Ee(),typeof t==\`object\`&&t&&typeof t.then==\`function\`&&ca(e,t),da!==null&&da(e,t)};var fa=ie(null);function pa(){var e=fa.current;return e===null?zl.pooledCache:e}function ma(e,t){t===null?L(fa,fa.current):L(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(V,V),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(V,V);else{if(e=zl,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=ri(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=si(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=ai(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=li(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=oi(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=si(\`\`+t,e.mode,n),t.return=e,t;if(typeof t==\`object\`&&t){switch(t.$$typeof){case _:return n=ai(t.type,t.key,t.props,null,e.mode,n),ka(n,t),n.return=e,n;case v:return t=li(t,e.mode,n),t.return=e,t;case O:return t=Sa(t),f(e,t,n)}if(ee(t)||M(t))return t=oi(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(ee(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(ee(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),Oi&&xi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return Oi&&xi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(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)}),Oi&&xi(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),Oi&&xi(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Oi&&xi(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(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)}),Oi&&xi(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=oi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=ai(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=li(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=Sa(o),b(e,r,o,c)}if(ee(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=si(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=ti(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,Rl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Qr(e),Zr(e,null,n),t}return Jr(e,r,t,n),Qr(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,$e(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?(Bl&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),Jl|=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=ie(null),qa=ie(0);function Ja(e,t){e=Kl,L(qa,e),L(Ka,t),Kl=e|t.baseLanes}function Ya(){L(qa,Kl),L(Ka,Ka.current)}function Xa(){Kl=qa.current,ae(Ka),ae(qa)}var Za=ie(null),Qa=null;function $a(e){var t=e.alternate;L(io,io.current&1),L(Za,e),Qa===null&&(t===null||Ka.current!==null||t.memoizedState!==null)&&(Qa=e)}function eo(e){L(io,io.current),L(Za,e),Qa===null&&(Qa=e)}function to(e){e.tag===22?(L(io,io.current),L(Za,e),Qa===null&&(Qa=e)):no(e)}function no(){L(io,io.current),L(Za,Za.current)}function ro(e){ae(Za),Qa===e&&(Qa=null),ae(io)}var io=ie(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)||X(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 _o(){throw Error(i(321))}function vo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!gr(e[n],t[n]))return!1;return!0}function yo(e,t,n,r,i,a){return oo=a,K=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,F.H=e===null||e.memoizedState===null?Is:Ls,fo=!1,a=n(r,i),fo=!1,uo&&(a=xo(t,n,r,i)),bo(e),a}function bo(e){F.H=Fs;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||ec||(e=e.dependencies,e!==null&&qi(e)&&(ec=!0))}function xo(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)}F.H=Rs,o=t(n,r)}while(uo);return o}function So(){var e=F.H,t=e.useState()[0];return t=typeof t.then==\`function\`?ko(t):t,e=e.useState()[0],(so===null?null:so.memoizedState)!==e&&(K.flags|=1024),t}function Co(){var e=po!==0;return po=0,e}function wo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function To(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 Eo(){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 Do(){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 Oo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ko(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,F.H=t===null||t.memoizedState===null?Is:Ls),e}function Ao(e){if(typeof e==\`object\`&&e){if(typeof e.then==\`function\`)return ko(e);if(e.$$typeof===C)return Yi(e)}throw Error(i(438,String(e)))}function jo(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=Oo(),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 Mo(e,t){return typeof t==\`function\`?t(e):t}function No(e){return Po(Do(),so,e)}function Po(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:(Bl&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,Jl|=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,Jl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!gr(o,e.memoizedState)&&(ec=!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 Fo(e){var t=Do(),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);gr(o,t.memoizedState)||(ec=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Io(e,t,n){var r=K,a=Do(),o=Oi;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!gr((so||a).memoizedState,n);if(s&&(a.memoizedState=n,ec=!0),a=a.queue,ss(zo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||co!==null&&co.memoizedState.tag&1){if(r.flags|=2048,ns(9,{destroy:void 0},Ro.bind(null,r,a,n,t),null),zl===null)throw Error(i(349));o||oo&127||Lo(r,t,n)}return n}function Lo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=K.updateQueue,t===null?(t=Oo(),K.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ro(e,t,n,r){t.value=n,t.getSnapshot=r,Bo(t)&&Vo(e)}function zo(e,t,n){return n(function(){Bo(t)&&Vo(e)})}function Bo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!gr(e,n)}catch{return!0}}function Vo(e){var t=Xr(e,2);t!==null&&vu(t,e,2)}function Ho(e){var t=Eo();if(typeof e==\`function\`){var n=e;if(e=n(),fo){R(!0);try{n()}finally{R(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mo,lastRenderedState:e},t}function Uo(e,t,n,r){return e.baseState=n,Po(e,so,typeof r==\`function\`?r:Mo)}function Wo(e,t,n,r,a){if(Ms(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)}};F.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Go(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Go(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=F.T,o={};F.T=o;try{var s=n(i,r),c=F.S;c!==null&&c(o,s),Ko(e,t,s)}catch(n){Jo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),F.T=a}}else try{a=n(i,r),Ko(e,t,a)}catch(n){Jo(e,t,n)}}function Ko(e,t,n){typeof n==\`object\`&&n&&typeof n.then==\`function\`?n.then(function(n){qo(e,t,n)},function(n){return Jo(e,t,n)}):qo(e,t,n)}function qo(e,t,n){t.status=\`fulfilled\`,t.value=n,Yo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Go(e,n)))}function Jo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=\`rejected\`,t.reason=n,Yo(t),t=t.next;while(t!==r)}e.action=null}function Yo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Xo(e,t){return t}function Zo(e,t){if(Oi){var n=zl.formState;if(n!==null){a:{var r=K;if(Oi){if(Di){b:{for(var i=Di,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){Di=df(i.nextSibling),r=i.data===\`F!\`;break a}}Mi(r)}r=!1}r&&(t=n[0])}}return n=Eo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xo,lastRenderedState:t},n.queue=r,n=ks.bind(null,K,r),r.dispatch=n,r=Ho(!1),a=js.bind(null,K,!1,r.queue),r=Eo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Wo.bind(null,K,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Qo(e){return $o(Do(),so,e)}function $o(e,t,n){if(t=Po(e,t,Xo)[0],e=No(Mo)[0],typeof t==\`object\`&&t&&typeof t.then==\`function\`)try{var r=ko(t)}catch(e){throw e===ga?va:e}else r=t;t=Do();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(K.flags|=2048,ns(9,{destroy:void 0},es.bind(null,i,n),null)),[r,a,e]}function es(e,t){e.action=t}function ts(e){var t=Do(),n=so;if(n!==null)return $o(t,n,e);Do(),t=t.memoizedState,n=Do();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ns(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=K.updateQueue,t===null&&(t=Oo(),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 rs(){return Do().memoizedState}function is(e,t,n,r){var i=Eo();K.flags|=e,i.memoizedState=ns(1|t,{destroy:void 0},n,r===void 0?null:r)}function as(e,t,n,r){var i=Do();r=r===void 0?null:r;var a=i.memoizedState.inst;so!==null&&r!==null&&vo(r,so.memoizedState.deps)?i.memoizedState=ns(t,a,n,r):(K.flags|=e,i.memoizedState=ns(1|t,a,n,r))}function os(e,t){is(8390656,8,e,t)}function ss(e,t){as(2048,8,e,t)}function cs(e){K.flags|=4;var t=K.updateQueue;if(t===null)t=Oo(),K.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ls(e){var t=Do().memoizedState;return cs({ref:t,nextImpl:e}),function(){if(Rl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function us(e,t){return as(4,2,e,t)}function ds(e,t){return as(4,4,e,t)}function fs(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 ps(e,t,n){n=n==null?null:n.concat([e]),as(4,4,fs.bind(null,t,e),n)}function ms(){}function hs(e,t){var n=Do();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&vo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function gs(e,t){var n=Do();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&vo(t,r[1]))return r[0];if(r=e(),fo){R(!0);try{e()}finally{R(!1)}}return n.memoizedState=[r,t],r}function _s(e,t,n){return n===void 0||oo&1073741824&&!(Bl&261930)?e.memoizedState=t:(e.memoizedState=n,e=_u(),K.lanes|=e,Jl|=e,n)}function vs(e,t,n,r){return gr(n,t)?n:Ka.current===null?!(oo&42)||oo&1073741824&&!(Bl&261930)?(ec=!0,e.memoizedState=n):(e=_u(),K.lanes|=e,Jl|=e,t):(e=_s(e,n,r),gr(e,t)||(ec=!0),e)}function ys(e,t,n,r,i){var a=I.p;I.p=a!==0&&8>a?a:8;var o=F.T,s={};F.T=s,js(e,!1,t,n);try{var c=i(),l=F.S;l!==null&&l(s,c),typeof c==\`object\`&&c&&typeof c.then==\`function\`?As(e,t,ua(c,r),gu(e)):As(e,t,r,gu(e))}catch(n){As(e,t,{then:function(){},status:\`rejected\`,reason:n},gu())}finally{I.p=a,o!==null&&s.types!==null&&(o.types=s.types),F.T=o}}function bs(){}function xs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Ss(e).queue;ys(e,a,t,te,n===null?bs:function(){return Cs(e),n(r)})}function Ss(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:te,baseState:te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mo,lastRenderedState:te},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Cs(e){var t=Ss(e);t.next===null&&(t=e.alternate.memoizedState),As(e,t.next.queue,{},gu())}function ws(){return Yi(tp)}function Ts(){return Do().memoizedState}function Es(){return Do().memoizedState}function Ds(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=gu();e=La(n);var r=Ra(t,e,n);r!==null&&(vu(r,t,n),za(r,t,n)),t={cache:na()},e.payload=t;return}t=t.return}}function Os(e,t,n){var r=gu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ms(e)?Ns(t,n):(n=Yr(e,t,n,r),n!==null&&(vu(n,e,r),Ps(n,t,r)))}function ks(e,t,n){As(e,t,n,gu())}function As(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ms(e))Ns(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,gr(s,o))return Jr(e,t,i,0),zl===null&&qr(),!1}catch{}if(n=Yr(e,t,i,r),n!==null)return vu(n,e,r),Ps(n,t,r),!0}return!1}function js(e,t,n,r){if(r={lane:2,revertLane:hd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ms(e)){if(t)throw Error(i(479))}else t=Yr(e,n,r,2),t!==null&&vu(t,e,2)}function Ms(e){var t=e.alternate;return e===K||t!==null&&t===K}function Ns(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 Ps(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,$e(e,n)}}var Fs={readContext:Yi,use:Ao,useCallback:_o,useContext:_o,useEffect:_o,useImperativeHandle:_o,useLayoutEffect:_o,useInsertionEffect:_o,useMemo:_o,useReducer:_o,useRef:_o,useState:_o,useDebugValue:_o,useDeferredValue:_o,useTransition:_o,useSyncExternalStore:_o,useId:_o,useHostTransitionStatus:_o,useFormState:_o,useActionState:_o,useOptimistic:_o,useMemoCache:_o,useCacheRefresh:_o};Fs.useEffectEvent=_o;var Is={readContext:Yi,use:Ao,useCallback:function(e,t){return Eo().memoizedState=[e,t===void 0?null:t],e},useContext:Yi,useEffect:os,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),is(4194308,4,fs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return is(4194308,4,e,t)},useInsertionEffect:function(e,t){is(4,2,e,t)},useMemo:function(e,t){var n=Eo();t=t===void 0?null:t;var r=e();if(fo){R(!0);try{e()}finally{R(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Eo();if(n!==void 0){var i=n(t);if(fo){R(!0);try{n(t)}finally{R(!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=Os.bind(null,K,e),[r.memoizedState,e]},useRef:function(e){var t=Eo();return e={current:e},t.memoizedState=e},useState:function(e){e=Ho(e);var t=e.queue,n=ks.bind(null,K,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ms,useDeferredValue:function(e,t){return _s(Eo(),e,t)},useTransition:function(){var e=Ho(!1);return e=ys.bind(null,K,e.queue,!0,!1),Eo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=K,a=Eo();if(Oi){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),zl===null)throw Error(i(349));Bl&127||Lo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,os(zo.bind(null,r,o,e),[e]),r.flags|=2048,ns(9,{destroy:void 0},Ro.bind(null,r,o,n,t),null),n},useId:function(){var e=Eo(),t=zl.identifierPrefix;if(Oi){var n=bi,r=yi;n=(r&~(1<<32-Le(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:ws,useFormState:Zo,useActionState:Zo,useOptimistic:function(e){var t=Eo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=js.bind(null,K,!0,n),n.dispatch=t,[e,t]},useMemoCache:jo,useCacheRefresh:function(){return Eo().memoizedState=Ds.bind(null,K)},useEffectEvent:function(e){var t=Eo(),n={impl:e};return t.memoizedState=n,function(){if(Rl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Ls={readContext:Yi,use:Ao,useCallback:hs,useContext:Yi,useEffect:ss,useImperativeHandle:ps,useInsertionEffect:us,useLayoutEffect:ds,useMemo:gs,useReducer:No,useRef:rs,useState:function(){return No(Mo)},useDebugValue:ms,useDeferredValue:function(e,t){return vs(Do(),so.memoizedState,e,t)},useTransition:function(){var e=No(Mo)[0],t=Do().memoizedState;return[typeof e==\`boolean\`?e:ko(e),t]},useSyncExternalStore:Io,useId:Ts,useHostTransitionStatus:ws,useFormState:Qo,useActionState:Qo,useOptimistic:function(e,t){return Uo(Do(),so,e,t)},useMemoCache:jo,useCacheRefresh:Es};Ls.useEffectEvent=ls;var Rs={readContext:Yi,use:Ao,useCallback:hs,useContext:Yi,useEffect:ss,useImperativeHandle:ps,useInsertionEffect:us,useLayoutEffect:ds,useMemo:gs,useReducer:Fo,useRef:rs,useState:function(){return Fo(Mo)},useDebugValue:ms,useDeferredValue:function(e,t){var n=Do();return so===null?_s(n,e,t):vs(n,so.memoizedState,e,t)},useTransition:function(){var e=Fo(Mo)[0],t=Do().memoizedState;return[typeof e==\`boolean\`?e:ko(e),t]},useSyncExternalStore:Io,useId:Ts,useHostTransitionStatus:ws,useFormState:ts,useActionState:ts,useOptimistic:function(e,t){var n=Do();return so===null?(n.baseState=e,[e,n.queue.dispatch]):Uo(n,so,e,t)},useMemoCache:jo,useCacheRefresh:Es};Rs.useEffectEvent=ls;function zs(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 Bs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=gu(),i=La(r);i.payload=t,n!=null&&(i.callback=n),t=Ra(e,i,r),t!==null&&(vu(t,e,r),za(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=gu(),i=La(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ra(e,i,r),t!==null&&(vu(t,e,r),za(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=gu(),r=La(n);r.tag=2,t!=null&&(r.callback=t),t=Ra(e,r,n),t!==null&&(vu(t,e,n),za(t,e,n))}};function Vs(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?!_r(n,r)||!_r(i,a):!0}function Hs(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&&Bs.enqueueReplaceState(t,t.state,null)}function Us(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 Ws(e){Ur(e)}function Gs(e){console.error(e)}function Ks(e){Ur(e)}function qs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Js(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 Ys(e,t,n){return n=La(n),n.tag=3,n.payload={element:null},n.callback=function(){qs(e,t)},n}function Xs(e){return e=La(e),e.tag=3,e}function Zs(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(){Js(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==\`function\`&&(e.callback=function(){Js(t,n,r),typeof i!=\`function\`&&(ou===null?ou=new Set([this]):ou.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?\`\`:e})})}function Qs(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?Au():n.alternate===null&&ql===0&&(ql=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),Yu(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)),Yu(e,r,a)),!1}throw Error(i(435,n.tag))}return Yu(e,r,a),Au(),!1}if(Oi)return t=Za.current,t===null?(r!==ji&&(t=Error(i(423),{cause:r}),Ri(di(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=di(r,n),a=Ys(e.stateNode,r,a),Ba(e,a),ql!==4&&(ql=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==ji&&(e=Error(i(422),{cause:r}),Ri(di(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=di(o,n),$l===null?$l=[o]:$l.push(o),ql!==4&&(ql=2),t===null)return!0;r=di(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Ys(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\`&&(ou===null||!ou.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Xs(a),Zs(a,e,n,r),Ba(n,a),!1}n=n.return}while(n!==null);return!1}var $s=Error(i(461)),ec=!1;function tc(e,t,n,r){t.child=e===null?Na(t,null,n,r):Ma(t,e.child,n,r)}function nc(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=yo(e,t,n,o,a,i),s=Co(),e!==null&&!ec?(wo(e,t,i),Ec(e,t,i)):(Oi&&s&&Ci(t),t.flags|=1,tc(e,t,r,i),t.child)}function rc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==\`function\`&&!ni(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,ic(e,t,a,r,i)):(e=ai(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Dc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?_r:n,n(o,r)&&e.ref===t.ref)return Ec(e,t,i)}return t.flags|=1,e=ri(a,r),e.ref=t.ref,e.return=t,t.child=e}function ic(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(_r(a,r)&&e.ref===t.ref)if(ec=!1,t.pendingProps=r=a,Dc(e,i))e.flags&131072&&(ec=!0);else return t.lanes=e.lanes,Ec(e,t,i)}return fc(e,t,n,r,i)}function ac(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 sc(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,sc(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 tc(e,t,i,n),t.child}function oc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function sc(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 cc(e,t){return t=xc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function lc(e,t,n){return Ma(t,e.child,null,n),e=cc(t,t.pendingProps),e.flags|=2,ro(t),t.memoizedState=null,e}function uc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(Oi){if(r.mode===\`hidden\`)return e=cc(t,r),t.lanes=536870912,oc(null,e);if(eo(t),(e=Di)?(e=Y(e,Ai),e=e!==null&&e.data===\`&\`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:vi===null?null:{id:yi,overflow:bi},retryLane:536870912,hydrationErrors:null},n=ci(e),n.return=t,t.child=n,Ei=t,Di=null)):e=null,e===null)throw Mi(t);return t.lanes=536870912,null}return cc(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=lc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(ec||Ki(e,t,n,!1),a=(n&e.childLanes)!==0,ec||a){if(r=zl,r!==null&&(s=et(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Xr(e,s),vu(r,e,s),$s;Au(),t=lc(e,t,n)}else e=o.treeContext,Di=df(s.nextSibling),Ei=t,Oi=!0,ki=null,Ai=!1,e!==null&&Ti(t,e),t=cc(t,r),t.flags|=4096;return t}return e=ri(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function dc(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 fc(e,t,n,r,i){return Ji(t),n=yo(e,t,n,r,void 0,i),r=Co(),e!==null&&!ec?(wo(e,t,i),Ec(e,t,i)):(Oi&&r&&Ci(t),t.flags|=1,tc(e,t,n,i),t.child)}function pc(e,t,n,r,i,a){return Ji(t),t.updateQueue=null,n=xo(t,r,n,i),bo(e),r=Co(),e!==null&&!ec?(wo(e,t,a),Ec(e,t,a)):(Oi&&r&&Ci(t),t.flags|=1,tc(e,t,n,a),t.child)}function mc(e,t,n,r,i){if(Ji(t),t.stateNode===null){var a=$r,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=Bs,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):$r,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==\`function\`&&(zs(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&&Bs.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=Us(n,s);a.props=c;var l=a.context,u=n.contextType;o=$r,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)&&Hs(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\`&&(zs(t,n,d,r),l=t.memoizedState),(c=Pa||Vs(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=Us(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=$r,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)&&Hs(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\`&&(zs(t,n,s,r),p=t.memoizedState),(u=Pa||Vs(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,dc(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)):tc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Ec(e,t,i),e}function hc(e,t,n,r){return Ii(),t.flags|=256,tc(e,t,n,r),t.child}var gc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function _c(e){return{baseLanes:e,cachePool:ha()}}function vc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Zl),e}function yc(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(Oi){if(a?$a(t):no(t),(e=Di)?(e=Y(e,Ai),e=e!==null&&e.data!==\`&\`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:vi===null?null:{id:yi,overflow:bi},retryLane:536870912,hydrationErrors:null},n=ci(e),n.return=t,t.child=n,Ei=t,Di=null)):e=null,e===null)throw Mi(t);return X(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(no(t),a=t.mode,c=xc({mode:\`hidden\`,children:c},a),r=oi(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=_c(n),r.childLanes=vc(e,s,n),t.memoizedState=gc,oc(null,r)):($a(t),bc(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=Sc(e,t,n)):t.memoizedState===null?(no(t),c=r.fallback,a=t.mode,r=xc({mode:\`visible\`,children:r.children},a),c=oi(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=_c(n),r.childLanes=vc(e,s,n),t.memoizedState=gc,t=oc(null,r)):(no(t),t.child=e.child,t.flags|=128,t=null);else if($a(t),X(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=Sc(e,t,n)}else if(ec||Ki(e,t,n,!1),s=(n&e.childLanes)!==0,ec||s){if(s=zl,s!==null&&(r=et(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Xr(e,r),vu(s,e,r),$s;lf(c)||Au(),t=Sc(e,t,n)}else lf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Di=df(c.nextSibling),Ei=t,Oi=!0,ki=null,Ai=!1,e!==null&&Ti(t,e),t=bc(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=ri(l,{mode:\`hidden\`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=oi(c,a,n,null),c.flags|=2):c=ri(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,oc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=_c(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=vc(e,s,n),t.memoizedState=gc,oc(e.child,r)):($a(t),n=e.child,e=n.sibling,n=ri(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 bc(e,t){return t=xc({mode:\`visible\`,children:t},e.mode),t.return=e,e.child=t}function xc(e,t){return e=ti(22,e,null,t),e.lanes=0,e}function Sc(e,t,n){return Ma(t,e.child,null,n),e=bc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Cc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Wi(e.return,t,n)}function wc(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 Tc(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,L(io,o),tc(e,t,r,n),r=Oi?hi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Cc(e,n,t);else if(e.tag===19)Cc(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),wc(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}wc(t,!0,n,null,a,r);break;case\`together\`:wc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Ec(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Jl|=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=ri(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ri(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Dc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&qi(e))):!0}function Oc(e,t,n){switch(t.tag){case 3:ue(t,t.stateNode.containerInfo),Hi(t,ta,e.memoizedState.cache),Ii();break;case 27:case 5:fe(t);break;case 4:ue(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=Ec(e,t,n),e===null?null:e.sibling):yc(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 Tc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),L(io,io.current),r)break;return null;case 22:return t.lanes=0,ac(e,t,n,t.pendingProps);case 24:Hi(t,ta,e.memoizedState.cache)}return Ec(e,t,n)}function kc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)ec=!0;else{if(!Dc(e,n)&&!(t.flags&128))return ec=!1,Oc(e,t,n);ec=!!(e.flags&131072)}else ec=!1,Oi&&t.flags&1048576&&Si(t,hi,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\`)ni(e)?(r=Us(e,r),t.tag=1,t=mc(null,t,e,r,n)):(t.tag=0,t=fc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=nc(null,t,e,r,n);break a}else if(a===D){t.tag=14,t=rc(null,t,e,r,n);break a}}throw t=P(e)||e,Error(i(306,t,\`\`))}}return t;case 0:return fc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Us(r,t.pendingProps),mc(e,t,r,a,n);case 3:a:{if(ue(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=hc(e,t,r,n);break a}else if(r!==a){a=di(Error(i(424)),t),Ri(a),t=hc(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(Di=df(e.firstChild),Ei=t,Oi=!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=Ec(e,t,n);break a}tc(e,t,r,n)}t=t.child}return t;case 26:return dc(e,t),e===null?(n=Mf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Oi||(n=t.type,e=t.pendingProps,r=Gd(ce.current).createElement(n),r[ot]=t,r[st]=e,zd(r,n,e),yt(r),t.stateNode=r):t.memoizedState=Mf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return fe(t),e===null&&Oi&&(r=t.stateNode=hf(t.type,t.pendingProps,ce.current),Ei=t,Ai=!0,a=Di,nf(t.type)?(ff=a,Di=df(r.firstChild)):Di=a),tc(e,t,t.pendingProps.children,n),dc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Oi&&((a=r=Di)&&(r=sf(r,t.type,t.pendingProps,Ai),r===null?a=!1:(t.stateNode=r,Ei=t,Di=df(r.firstChild),Ai=!1,a=!0)),a||Mi(t)),fe(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=yo(e,t,So,null,null,n),tp._currentValue=a),dc(e,t),tc(e,t,r,n),t.child;case 6:return e===null&&Oi&&((e=n=Di)&&(n=cf(n,t.pendingProps,Ai),n===null?e=!1:(t.stateNode=n,Ei=t,Di=null,e=!0)),e||Mi(t)),null;case 13:return yc(e,t,n);case 4:return ue(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ma(t,null,r,n):tc(e,t,r,n),t.child;case 11:return nc(e,t,t.type,t.pendingProps,n);case 7:return tc(e,t,t.pendingProps,n),t.child;case 8:return tc(e,t,t.pendingProps.children,n),t.child;case 12:return tc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Hi(t,t.type,r.value),tc(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,tc(e,t,r,n),t.child;case 14:return rc(e,t,t.type,t.pendingProps,n);case 15:return ic(e,t,t.type,t.pendingProps,n);case 19:return Tc(e,t,n);case 31:return uc(e,t,n);case 22:return ac(e,t,n,t.pendingProps);case 24:return Ji(t),r=Yi(ta),e===null?(a=pa(),a===null&&(a=zl,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))),tc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Ac(e){e.flags|=4}function jc(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(Du())e.flags|=8192;else throw Ca=ya,_a}else e.flags&=-16777217}function Mc(e,t){if(t.type!==\`stylesheet\`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!qf(t))if(Du())e.flags|=8192;else throw Ca=ya,_a}function Nc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Je(),e.lanes|=t,Ql|=t)}function Pc(e,t){if(!Oi)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 Fc(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 Ic(e,t,n){var r=t.pendingProps;switch(wi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Fc(t),null;case 1:return Fc(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),de(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Fi(t)?Ac(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Li())),Fc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Ac(t),o===null?(Fc(t),jc(t,a,null,r,n)):(Fc(t),Mc(t,o))):o?o===e.memoizedState?(Fc(t),t.flags&=-16777217):(Ac(t),Fc(t),Mc(t,o)):(e=e.memoizedProps,e!==r&&Ac(t),Fc(t),jc(t,a,e,r,n)),null;case 27:if(pe(t),n=ce.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ac(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Fc(t),null}e=oe.current,Fi(t)?Ni(t,e):(e=hf(a,r,n),t.stateNode=e,Ac(t))}return Fc(t),null;case 5:if(pe(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ac(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Fc(t),null}if(o=oe.current,Fi(t))Ni(t,o);else{var s=Gd(ce.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[ot]=t,o[st]=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&&Ac(t)}}return Fc(t),jc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Ac(t);else{if(typeof r!=\`string\`&&t.stateNode===null)throw Error(i(166));if(e=ce.current,Fi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ei,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[ot]=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[ot]=t,t.stateNode=e}return Fc(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[ot]=t}else Ii(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Fc(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 Fc(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[ot]=t}else Ii(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Fc(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),Nc(t,t.updateQueue),Fc(t),null);case 4:return de(),e===null&&Ed(t.stateNode.containerInfo),Fc(t),null;case 10:return Ui(t.type),Fc(t),null;case 19:if(ae(io),r=t.memoizedState,r===null)return Fc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Pc(r,!1);else{if(ql!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=ao(e),o!==null){for(t.flags|=128,Pc(r,!1),e=o.updateQueue,t.updateQueue=e,Nc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ii(n,e),n=n.sibling;return L(io,io.current&1|2),Oi&&xi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ee()>iu&&(t.flags|=128,a=!0,Pc(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,Nc(t,e),Pc(r,!0),r.tail===null&&r.tailMode===\`hidden\`&&!o.alternate&&!Oi)return Fc(t),null}else 2*Ee()-r.renderingStartTime>iu&&n!==536870912&&(t.flags|=128,a=!0,Pc(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?(Fc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ee(),e.sibling=null,n=io.current,L(io,a?n&1|2:n&1),Oi&&xi(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)&&(Fc(t),t.subtreeFlags&6&&(t.flags|=8192)):Fc(t),n=t.updateQueue,n!==null&&Nc(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&&ae(fa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ui(ta),Fc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Lc(e,t){switch(wi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ui(ta),de(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return pe(t),null;case 31:if(t.memoizedState!==null){if(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 ae(io),null;case 4:return de(),null;case 10:return Ui(t.type),null;case 22:case 23:return ro(t),Xa(),e!==null&&ae(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 Rc(e,t){switch(wi(t),t.tag){case 3:Ui(ta),de();break;case 26:case 27:case 5:pe(t);break;case 4:de();break;case 31:t.memoizedState!==null&&ro(t);break;case 13:ro(t);break;case 19:ae(io);break;case 10:Ui(t.type);break;case 22:case 23:ro(t),Xa(),e!==null&&ae(fa);break;case 24:Ui(ta)}}function zc(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){Ju(t,t.return,e)}}function Bc(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){Ju(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Ju(t,t.return,e)}}function Vc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ga(t,n)}catch(t){Ju(e,e.return,t)}}}function Hc(e,t,n){n.props=Us(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Ju(e,t,n)}}function Uc(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){Ju(e,t,n)}}function Wc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==\`function\`)try{r()}catch(n){Ju(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){Ju(e,t,n)}else n.current=null}function Gc(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){Ju(e,e.return,t)}}function Kc(e,t,n){try{var r=e.stateNode;Bd(r,e.type,n,t),r[st]=t}catch(t){Ju(e,e.return,t)}}function qc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&nf(e.type)||e.tag===4}function Jc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||qc(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 Yc(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=V));else if(r!==4&&(r===27&&nf(e.type)&&(n=e.stateNode,t=null),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,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(Xc(e,t,n),e=e.sibling;e!==null;)Xc(e,t,n),e=e.sibling}function Zc(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[ot]=e,t[st]=n}catch(t){Ju(e,e.return,t)}}var Qc=!1,$c=!1,el=!1,tl=typeof WeakSet==\`function\`?WeakSet:Set,nl=null;function rl(e,t){if(e=e.containerInfo,Ud=up,e=xr(e),Sr(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,nl=t;nl!==null;)if(t=nl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,nl=e;else for(;nl!==null;){switch(t=nl,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=Us(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Ju(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,nl=e;break}nl=t.return}}function il(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:yl(e,n),r&4&&zc(5,n);break;case 1:if(yl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Ju(n,n.return,e)}else{var i=Us(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Ju(n,n.return,e)}}r&64&&Vc(n),r&512&&Uc(n,n.return);break;case 3:if(yl(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){Ju(n,n.return,e)}}break;case 27:t===null&&r&4&&Zc(n);case 26:case 5:yl(e,n),t===null&&r&4&&Gc(n),r&512&&Uc(n,n.return);break;case 12:yl(e,n);break;case 31:yl(e,n),r&4&&ul(e,n);break;case 13:yl(e,n),r&4&&dl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Qu.bind(null,n),uf(e,n))));break;case 22:if(r=n.memoizedState!==null||Qc,!r){t=t!==null&&t.memoizedState!==null||$c,i=Qc;var a=$c;Qc=r,($c=t)&&!a?xl(e,n,(n.subtreeFlags&8772)!=0):yl(e,n),Qc=i,$c=a}break;case 30:break;default:yl(e,n)}}function al(e){var t=e.alternate;t!==null&&(e.alternate=null,al(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&mt(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 ol=null,sl=!1;function cl(e,t,n){for(n=n.child;n!==null;)ll(e,t,n),n=n.sibling}function ll(e,t,n){if(Ie&&typeof Ie.onCommitFiberUnmount==\`function\`)try{Ie.onCommitFiberUnmount(Fe,n)}catch{}switch(n.tag){case 26:$c||Wc(n,t),cl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:$c||Wc(n,t);var r=ol,i=sl;nf(n.type)&&(ol=n.stateNode,sl=!1),cl(e,t,n),gf(n.stateNode),ol=r,sl=i;break;case 5:$c||Wc(n,t);case 6:if(r=ol,i=sl,ol=null,cl(e,t,n),ol=r,sl=i,ol!==null)if(sl)try{(ol.nodeType===9?ol.body:ol.nodeName===\`HTML\`?ol.ownerDocument.body:ol).removeChild(n.stateNode)}catch(e){Ju(n,t,e)}else try{ol.removeChild(n.stateNode)}catch(e){Ju(n,t,e)}break;case 18:ol!==null&&(sl?(e=ol,rf(e.nodeType===9?e.body:e.nodeName===\`HTML\`?e.ownerDocument.body:e,n.stateNode),Ip(e)):rf(ol,n.stateNode));break;case 4:r=ol,i=sl,ol=n.stateNode.containerInfo,sl=!0,cl(e,t,n),ol=r,sl=i;break;case 0:case 11:case 14:case 15:Bc(2,n,t),$c||Bc(4,n,t),cl(e,t,n);break;case 1:$c||(Wc(n,t),r=n.stateNode,typeof r.componentWillUnmount==\`function\`&&Hc(n,t,r)),cl(e,t,n);break;case 21:cl(e,t,n);break;case 22:$c=(r=$c)||n.memoizedState!==null,cl(e,t,n),$c=r;break;default:cl(e,t,n)}}function ul(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ip(e)}catch(e){Ju(t,t.return,e)}}}function dl(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){Ju(t,t.return,e)}}function fl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new tl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new tl),t;default:throw Error(i(435,e.tag))}}function pl(e,t){var n=fl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=$u.bind(null,e,t);t.then(r,r)}})}function ml(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)){ol=c.stateNode,sl=!1;break a}break;case 5:ol=c.stateNode,sl=!1;break a;case 3:case 4:ol=c.stateNode.containerInfo,sl=!0;break a}c=c.return}if(ol===null)throw Error(i(160));ll(o,s,a),ol=null,sl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)gl(t,e),t=t.sibling}var hl=null;function gl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ml(t,e),_l(e),r&4&&(Bc(3,e,e.return),zc(3,e),Bc(5,e,e.return));break;case 1:ml(t,e),_l(e),r&512&&($c||n===null||Wc(n,n.return)),r&64&&Qc&&(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=hl;if(ml(t,e),_l(e),r&512&&($c||n===null||Wc(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[pt]||o[ot]||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[ot]=e,yt(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[ot]=e,yt(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&&Kc(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:ml(t,e),_l(e),r&512&&($c||n===null||Wc(n,n.return)),n!==null&&r&4&&Kc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(ml(t,e),_l(e),r&512&&($c||n===null||Wc(n,n.return)),e.flags&32){a=e.stateNode;try{Gt(a,\`\`)}catch(t){Ju(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Kc(e,a,n===null?a:n.memoizedProps)),r&1024&&(el=!0);break;case 6:if(ml(t,e),_l(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Ju(e,e.return,t)}}break;case 3:if(Uf=null,a=hl,hl=yf(t.containerInfo),ml(t,e),hl=a,_l(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Ip(t.containerInfo)}catch(t){Ju(e,e.return,t)}el&&(el=!1,vl(e));break;case 4:r=hl,hl=yf(e.stateNode.containerInfo),ml(t,e),_l(e),hl=r;break;case 12:ml(t,e),_l(e);break;case 31:ml(t,e),_l(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,pl(e,r)));break;case 13:ml(t,e),_l(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(nu=Ee()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,pl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Qc,d=$c;if(Qc=u||a,$c=d||l,ml(t,e),$c=d,Qc=u,_l(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||Qc||$c||bl(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){Ju(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?\`\`:l.memoizedProps}catch(e){Ju(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){Ju(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,pl(e,n))));break;case 19:ml(t,e),_l(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,pl(e,r)));break;case 30:break;case 21:break;default:ml(t,e),_l(e)}}function _l(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(qc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Xc(e,Jc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Gt(o,\`\`),n.flags&=-33),Xc(e,Jc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Yc(e,Jc(e),s);break;default:throw Error(i(161))}}catch(t){Ju(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function vl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;vl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function yl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)il(e,t.alternate,t),t=t.sibling}function bl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Bc(4,t,t.return),bl(t);break;case 1:Wc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==\`function\`&&Hc(t,t.return,n),bl(t);break;case 27:gf(t.stateNode);case 26:case 5:Wc(t,t.return),bl(t);break;case 22:t.memoizedState===null&&bl(t);break;case 30:bl(t);break;default:bl(t)}e=e.sibling}}function xl(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:xl(i,a,n),zc(4,a);break;case 1:if(xl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==\`function\`)try{i.componentDidMount()}catch(e){Ju(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){Ju(r,r.return,e)}}n&&o&64&&Vc(a),Uc(a,a.return);break;case 27:Zc(a);case 26:case 5:xl(i,a,n),n&&r===null&&o&4&&Gc(a),Uc(a,a.return);break;case 12:xl(i,a,n);break;case 31:xl(i,a,n),n&&o&4&&ul(i,a);break;case 13:xl(i,a,n),n&&o&4&&dl(i,a);break;case 22:a.memoizedState===null&&xl(i,a,n),Uc(a,a.return);break;case 30:break;default:xl(i,a,n)}t=t.sibling}}function Sl(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 Cl(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 wl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Tl(e,t,n,r),t=t.sibling}function Tl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:wl(e,t,n,r),i&2048&&zc(9,t);break;case 1:wl(e,t,n,r);break;case 3:wl(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){wl(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){Ju(t,t.return,e)}}else wl(e,t,n,r);break;case 31:wl(e,t,n,r);break;case 13:wl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?wl(e,t,n,r):(a._visibility|=2,El(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?wl(e,t,n,r):Dl(e,t),i&2048&&Sl(o,t);break;case 24:wl(e,t,n,r),i&2048&&Cl(t.alternate,t);break;default:wl(e,t,n,r)}}function El(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:El(a,o,s,c,i),zc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,El(a,o,s,c,i)):u._visibility&2?El(a,o,s,c,i):Dl(a,o),i&&l&2048&&Sl(o.alternate,o);break;case 24:El(a,o,s,c,i),i&&l&2048&&Cl(o.alternate,o);break;default:El(a,o,s,c,i)}t=t.sibling}}function Dl(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:Dl(n,r),i&2048&&Sl(r.alternate,r);break;case 24:Dl(n,r),i&2048&&Cl(r.alternate,r);break;default:Dl(n,r)}t=t.sibling}}var Ol=8192;function kl(e,t,n){if(e.subtreeFlags&Ol)for(e=e.child;e!==null;)Al(e,t,n),e=e.sibling}function Al(e,t,n){switch(e.tag){case 26:kl(e,t,n),e.flags&Ol&&e.memoizedState!==null&&Jf(n,hl,e.memoizedState,e.memoizedProps);break;case 5:kl(e,t,n);break;case 3:case 4:var r=hl;hl=yf(e.stateNode.containerInfo),kl(e,t,n),hl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Ol,Ol=16777216,kl(e,t,n),Ol=r):kl(e,t,n));break;default:kl(e,t,n)}}function jl(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 Ml(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];nl=r,Fl(r,e)}jl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Nl(e),e=e.sibling}function Nl(e){switch(e.tag){case 0:case 11:case 15:Ml(e),e.flags&2048&&Bc(9,e,e.return);break;case 3:Ml(e);break;case 12:Ml(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Pl(e)):Ml(e);break;default:Ml(e)}}function Pl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];nl=r,Fl(r,e)}jl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Bc(8,t,t.return),Pl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Pl(t));break;default:Pl(t)}e=e.sibling}}function Fl(e,t){for(;nl!==null;){var n=nl;switch(n.tag){case 0:case 11:case 15:Bc(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,nl=r;else a:for(n=e;nl!==null;){r=nl;var i=r.sibling,a=r.return;if(al(r),r===n){nl=null;break a}if(i!==null){i.return=a,nl=i;break a}nl=a}}}var Il={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}},Ll=typeof WeakMap==\`function\`?WeakMap:Map,Rl=0,zl=null,q=null,Bl=0,Vl=0,Hl=null,Ul=!1,Wl=!1,Gl=!1,Kl=0,ql=0,Jl=0,Yl=0,Xl=0,Zl=0,Ql=0,$l=null,eu=null,tu=!1,nu=0,ru=0,iu=1/0,au=null,ou=null,su=0,cu=null,lu=null,uu=0,du=0,fu=null,pu=null,mu=0,hu=null;function gu(){return Rl&2&&Bl!==0?Bl&-Bl:F.T===null?rt():hd()}function _u(){if(Zl===0)if(!(Bl&536870912)||Oi){var e=He;He<<=1,!(He&3932160)&&(He=262144),Zl=e}else Zl=536870912;return e=Za.current,e!==null&&(e.flags|=32),Zl}function vu(e,t,n){(e===zl&&(Vl===2||Vl===9)||e.cancelPendingCommit!==null)&&(Tu(e,0),Su(e,Bl,Zl,!1)),Xe(e,n),(!(Rl&2)||e!==zl)&&(e===zl&&(!(Rl&2)&&(Yl|=n),ql===4&&Su(e,Bl,Zl,!1)),sd(e))}function yu(e,t,n){if(Rl&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Ke(e,t),a=r?Nu(e,t):ju(e,t,!0),o=r;do{if(a===0){Wl&&!r&&Su(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!xu(n)){a=ju(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=$l;var l=c.current.memoizedState.isDehydrated;if(l&&(Tu(c,s).flags|=256),s=ju(c,s,!1),s!==2){if(Gl&&!l){c.errorRecoveryDisabledLanes|=o,Yl|=o,a=4;break a}o=eu,eu=a,o!==null&&(eu===null?eu=o:eu.push.apply(eu,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Tu(e,0),Su(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:Su(r,t,Zl,!Ul);break a;case 2:eu=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=nu+300-Ee(),10<a)){if(Su(r,t,Zl,!Ul),Ge(r,0,!0)!==0)break a;uu=t,r.timeoutHandle=Zd(bu.bind(null,r,n,eu,au,tu,t,Zl,Yl,Ql,Ul,o,\`Throttled\`,-0,0),a);break a}bu(r,n,eu,au,tu,t,Zl,Yl,Ql,Ul,o,null,-0,0)}}break}while(1);sd(e)}function bu(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:V},Al(t,a,d);var m=(a&62914560)===a?nu-Ee():(a&4194048)===a?ru-Ee():0;if(m=Xf(d,m),m!==null){uu=a,e.cancelPendingCommit=m(Bu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),Su(e,a,o,!l);return}}Bu(e,t,a,n,r,i,o,s,c)}function xu(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(!gr(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 Su(e,t,n,r){t&=~Xl,t&=~Yl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Le(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Qe(e,n,t)}function Cu(){return Rl&6?!0:(cd(0,!1),!1)}function wu(){if(q!==null){if(Vl===0)var e=q.return;else e=q,Vi=Bi=null,To(e),Ea=null,Da=0,e=q;for(;e!==null;)Rc(e.alternate,e),e=e.return;q=null}}function Tu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Qd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),uu=0,wu(),zl=e,q=n=ri(e.current,null),Bl=t,Vl=0,Hl=null,Ul=!1,Wl=Ke(e,t),Gl=!1,Ql=Zl=Xl=Yl=Jl=ql=0,eu=$l=null,tu=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Le(r),a=1<<i;t|=e[i],r&=~a}return Kl=t,qr(),n}function Eu(e,t){K=null,F.H=Fs,t===ga||t===va?(t=wa(),Vl=3):t===_a?(t=wa(),Vl=4):Vl=t===$s?8:typeof t==\`object\`&&t&&typeof t.then==\`function\`?6:1,Hl=t,q===null&&(ql=1,qs(e,di(t,e.current)))}function Du(){var e=Za.current;return e===null?!0:(Bl&4194048)===Bl?Qa===null:(Bl&62914560)===Bl||Bl&536870912?e===Qa:!1}function Ou(){var e=F.H;return F.H=Fs,e===null?Fs:e}function ku(){var e=F.A;return F.A=Il,e}function Au(){ql=4,Ul||(Bl&4194048)!==Bl&&Za.current!==null||(Wl=!0),!(Jl&134217727)&&!(Yl&134217727)||zl===null||Su(zl,Bl,Zl,!1)}function ju(e,t,n){var r=Rl;Rl|=2;var i=Ou(),a=ku();(zl!==e||Bl!==t)&&(au=null,Tu(e,t)),t=!1;var o=ql;a:do try{if(Vl!==0&&q!==null){var s=q,c=Hl;switch(Vl){case 8:wu(),o=6;break a;case 3:case 2:case 9:case 6:Za.current===null&&(t=!0);var l=Vl;if(Vl=0,Hl=null,Lu(e,s,c,l),n&&Wl){o=0;break a}break;default:l=Vl,Vl=0,Hl=null,Lu(e,s,c,l)}}Mu(),o=ql;break}catch(t){Eu(e,t)}while(1);return t&&e.shellSuspendCounter++,Vi=Bi=null,Rl=r,F.H=i,F.A=a,q===null&&(zl=null,Bl=0,qr()),o}function Mu(){for(;q!==null;)Fu(q)}function Nu(e,t){var n=Rl;Rl|=2;var r=Ou(),a=ku();zl!==e||Bl!==t?(au=null,iu=Ee()+500,Tu(e,t)):Wl=Ke(e,t);a:do try{if(Vl!==0&&q!==null){t=q;var o=Hl;b:switch(Vl){case 1:Vl=0,Hl=null,Lu(e,t,o,1);break;case 2:case 9:if(ba(o)){Vl=0,Hl=null,Iu(t);break}t=function(){Vl!==2&&Vl!==9||zl!==e||(Vl=7),sd(e)},o.then(t,t);break a;case 3:Vl=7;break a;case 4:Vl=5;break a;case 7:ba(o)?(Vl=0,Hl=null,Iu(t)):(Vl=0,Hl=null,Lu(e,t,o,7));break;case 5:var s=null;switch(q.tag){case 26:s=q.memoizedState;case 5:case 27:var c=q;if(s?qf(s):c.stateNode.complete){Vl=0,Hl=null;var l=c.sibling;if(l!==null)q=l;else{var u=c.return;u===null?q=null:(q=u,Ru(u))}break b}}Vl=0,Hl=null,Lu(e,t,o,5);break;case 6:Vl=0,Hl=null,Lu(e,t,o,6);break;case 8:wu(),ql=6;break a;default:throw Error(i(462))}}Pu();break}catch(t){Eu(e,t)}while(1);return Vi=Bi=null,F.H=r,F.A=a,Rl=n,q===null?(zl=null,Bl=0,qr(),ql):0}function Pu(){for(;q!==null&&!we();)Fu(q)}function Fu(e){var t=kc(e.alternate,e,Kl);e.memoizedProps=e.pendingProps,t===null?Ru(e):q=t}function Iu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=pc(n,t,t.pendingProps,t.type,void 0,Bl);break;case 11:t=pc(n,t,t.pendingProps,t.type.render,t.ref,Bl);break;case 5:To(t);default:Rc(n,t),t=q=ii(t,Kl),t=kc(n,t,Kl)}e.memoizedProps=e.pendingProps,t===null?Ru(e):q=t}function Lu(e,t,n,r){Vi=Bi=null,To(t),Ea=null,Da=0;var i=t.return;try{if(Qs(e,i,t,n,Bl)){ql=1,qs(e,di(n,e.current)),q=null;return}}catch(t){if(i!==null)throw q=i,t;ql=1,qs(e,di(n,e.current)),q=null;return}t.flags&32768?(Oi||r===1?e=!0:Wl||Bl&536870912?e=!1:(Ul=e=!0,(r===2||r===9||r===3||r===6)&&(r=Za.current,r!==null&&r.tag===13&&(r.flags|=16384))),zu(t,e)):Ru(t)}function Ru(e){var t=e;do{if(t.flags&32768){zu(t,Ul);return}e=t.return;var n=Ic(t.alternate,t,Kl);if(n!==null){q=n;return}if(t=t.sibling,t!==null){q=t;return}q=t=e}while(t!==null);ql===0&&(ql=5)}function zu(e,t){do{var n=Lc(e.alternate,e);if(n!==null){n.flags&=32767,q=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){q=e;return}q=e=n}while(e!==null);ql=6,q=null}function Bu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Gu();while(su!==0);if(Rl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Kr,Ze(e,n,o,s,c,l),e===zl&&(q=zl=null,Bl=0),lu=t,cu=e,uu=n,du=o,fu=a,pu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,ed(Ae,function(){return Ku(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=F.T,F.T=null,a=I.p,I.p=2,s=Rl,Rl|=4;try{rl(e,t,n)}finally{Rl=s,I.p=a,F.T=r}}su=1,Vu(),Hu(),Uu()}}function Vu(){if(su===1){su=0;var e=cu,t=lu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=F.T,F.T=null;var r=I.p;I.p=2;var i=Rl;Rl|=4;try{gl(t,e);var a=Wd,o=xr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&br(s.ownerDocument.documentElement,s)){if(c!==null&&Sr(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 _=yr(s,h),v=yr(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{Rl=i,I.p=r,F.T=n}}e.current=t,su=2}}function Hu(){if(su===2){su=0;var e=cu,t=lu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=F.T,F.T=null;var r=I.p;I.p=2;var i=Rl;Rl|=4;try{il(e,t.alternate,t)}finally{Rl=i,I.p=r,F.T=n}}su=3}}function Uu(){if(su===4||su===3){su=0,Te();var e=cu,t=lu,n=uu,r=pu;t.subtreeFlags&10256||t.flags&10256?su=5:(su=0,lu=cu=null,Wu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(ou=null),nt(n),t=t.stateNode,Ie&&typeof Ie.onCommitFiberRoot==\`function\`)try{Ie.onCommitFiberRoot(Fe,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=F.T,i=I.p,I.p=2,F.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{F.T=t,I.p=i}}uu&3&&Gu(),sd(e),i=e.pendingLanes,n&261930&&i&42?e===hu?mu++:(mu=0,hu=e):mu=0,cd(0,!1)}}function Wu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ra(t)))}function Gu(){return Vu(),Hu(),Uu(),Ku()}function Ku(){if(su!==5)return!1;var e=cu,t=du;du=0;var n=nt(uu),r=F.T,a=I.p;try{I.p=32>n?32:n,F.T=null,n=fu,fu=null;var o=cu,s=uu;if(su=0,lu=cu=null,uu=0,Rl&6)throw Error(i(331));var c=Rl;if(Rl|=4,Nl(o.current),Tl(o,o.current,s,n),Rl=c,cd(0,!1),Ie&&typeof Ie.onPostCommitFiberRoot==\`function\`)try{Ie.onPostCommitFiberRoot(Fe,o)}catch{}return!0}finally{I.p=a,F.T=r,Wu(e,t)}}function qu(e,t,n){t=di(n,t),t=Ys(e.stateNode,t,2),e=Ra(e,t,2),e!==null&&(Xe(e,2),sd(e))}function Ju(e,t,n){if(e.tag===3)qu(e,e,n);else for(;t!==null;){if(t.tag===3){qu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==\`function\`||typeof r.componentDidCatch==\`function\`&&(ou===null||!ou.has(r))){e=di(n,e),n=Xs(2),r=Ra(t,n,2),r!==null&&(Zs(n,r,t,e),Xe(r,2),sd(r));break}}t=t.return}}function Yu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ll;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)||(Gl=!0,i.add(n),e=Xu.bind(null,e,t,n),t.then(e,e))}function Xu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,zl===e&&(Bl&n)===n&&(ql===4||ql===3&&(Bl&62914560)===Bl&&300>Ee()-nu?!(Rl&2)&&Tu(e,0):Xl|=n,Ql===Bl&&(Ql=0)),sd(e)}function Zu(e,t){t===0&&(t=Je()),e=Xr(e,t),e!==null&&(Xe(e,t),sd(e))}function Qu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Zu(e,n)}function $u(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),Zu(e,n)}function ed(e,t){return Se(e,t)}var td=null,nd=null,rd=!1,id=!1,ad=!1,od=0;function sd(e){e!==nd&&e.next===null&&(nd===null?td=nd=e:nd=nd.next=e),id=!0,rd||(rd=!0,md())}function cd(e,t){if(!ad&&id){ad=!0;do for(var n=!1,r=td;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-Le(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,pd(r,a))}else a=Bl,a=Ge(r,r===zl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ke(r,a)||(n=!0,pd(r,a));r=r.next}while(n);ad=!1}}function ld(){ud()}function ud(){id=rd=!1;var e=0;od!==0&&Xd()&&(e=od);for(var t=Ee(),n=null,r=td;r!==null;){var i=r.next,a=dd(r,t);a===0?(r.next=null,n===null?td=i:n.next=i,i===null&&(nd=n)):(n=r,(e!==0||a&3)&&(id=!0)),r=i}su!==0&&su!==5||cd(e,!1),od!==0&&(od=0)}function dd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Le(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=qe(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=zl,n=Bl,n=Ge(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Vl===2||Vl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ce(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ke(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ce(r),nt(n)){case 2:case 8:n=ke;break;case 32:n=Ae;break;case 268435456:n=Me;break;default:n=Ae}return r=fd.bind(null,e),n=Se(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ce(r),e.callbackPriority=2,e.callbackNode=null,2}function fd(e,t){if(su!==0&&su!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Gu()&&e.callbackNode!==n)return null;var r=Bl;return r=Ge(e,e===zl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(yu(e,r,t),dd(e,Ee()),e.callbackNode!=null&&e.callbackNode===n?fd.bind(null,e):null)}function pd(e,t){if(Gu())return null;yu(e,t,!0)}function md(){ef(function(){Rl&6?Se(Oe,ld):ud()})}function hd(){if(od===0){var e=oa;e===0&&(e=Ve,Ve<<=1,!(Ve&261888)&&(Ve=256)),od=e}return od}function gd(e){return e==null||typeof e==\`symbol\`||typeof e==\`boolean\`?null:typeof e==\`function\`?e:B(\`\`+e)}function _d(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 vd(e,t,n,r,i){if(t===\`submit\`&&n&&n.stateNode===i){var a=gd((i[st]||null).action),o=r.submitter;o&&(t=(t=o[st]||null)?gd(t.formAction):o.getAttribute(\`formAction\`),t!==null&&(a=t,o=null));var s=new _n(\`action\`,\`action\`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(od!==0){var e=o?_d(i,o):new FormData(i);xs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==\`function\`&&(s.preventDefault(),e=o?_d(i,o):new FormData(i),xs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var yd=0;yd<Vr.length;yd++){var bd=Vr[yd];Hr(bd.toLowerCase(),\`on\`+(bd[0].toUpperCase()+bd.slice(1)))}Hr(Nr,\`onAnimationEnd\`),Hr(Pr,\`onAnimationIteration\`),Hr(Fr,\`onAnimationStart\`),Hr(\`dblclick\`,\`onDoubleClick\`),Hr(\`focusin\`,\`onFocus\`),Hr(\`focusout\`,\`onBlur\`),Hr(Ir,\`onTransitionRun\`),Hr(Lr,\`onTransitionStart\`),Hr(Rr,\`onTransitionCancel\`),Hr(zr,\`onTransitionEnd\`),Ct(\`onMouseEnter\`,[\`mouseout\`,\`mouseover\`]),Ct(\`onMouseLeave\`,[\`mouseout\`,\`mouseover\`]),Ct(\`onPointerEnter\`,[\`pointerout\`,\`pointerover\`]),Ct(\`onPointerLeave\`,[\`pointerout\`,\`pointerover\`]),St(\`onChange\`,\`change click focusin focusout input keydown keyup selectionchange\`.split(\` \`)),St(\`onSelect\`,\`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange\`.split(\` \`)),St(\`onBeforeInput\`,[\`compositionend\`,\`keypress\`,\`textInput\`,\`paste\`]),St(\`onCompositionEnd\`,\`compositionend focusout keydown keypress keyup mousedown\`.split(\` \`)),St(\`onCompositionStart\`,\`compositionstart focusout keydown keypress keyup mousedown\`.split(\` \`)),St(\`onCompositionUpdate\`,\`compositionupdate focusout keydown keypress keyup mousedown\`.split(\` \`));var xd=\`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(\` \`),Sd=new Set(\`beforetoggle cancel close invalid load scroll scrollend toggle\`.split(\` \`).concat(xd));function Cd(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){Ur(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){Ur(e)}i.currentTarget=null,a=c}}}}function J(e,t){var n=t[lt];n===void 0&&(n=t[lt]=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,bt.forEach(function(t){t!==\`selectionchange\`&&(Sd.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,!on||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=ht(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}nn(function(){var r=a,i=Zt(n),s=[];a:{var c=Br.get(e);if(c!==void 0){var l=_n,u=e;switch(e){case\`keypress\`:if(fn(n)===0)break a;case\`keydown\`:case\`keyup\`:l=Fn;break;case\`focusin\`:u=\`focus\`,l=En;break;case\`focusout\`:u=\`blur\`,l=En;break;case\`beforeblur\`:case\`afterblur\`:l=En;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=wn;break;case\`drag\`:case\`dragend\`:case\`dragenter\`:case\`dragexit\`:case\`dragleave\`:case\`dragover\`:case\`dragstart\`:case\`drop\`:l=Tn;break;case\`touchcancel\`:case\`touchend\`:case\`touchmove\`:case\`touchstart\`:l=Ln;break;case Nr:case Pr:case Fr:l=Dn;break;case zr:l=Rn;break;case\`scroll\`:case\`scrollend\`:l=yn;break;case\`wheel\`:l=zn;break;case\`copy\`:case\`cut\`:case\`paste\`:l=On;break;case\`gotpointercapture\`:case\`lostpointercapture\`:case\`pointercancel\`:case\`pointerdown\`:case\`pointermove\`:case\`pointerout\`:case\`pointerover\`:case\`pointerup\`:l=In;break;case\`toggle\`:case\`beforetoggle\`:l=Bn}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=rn(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!==H&&(u=n.relatedTarget||n.fromElement)&&(ht(u)||u[ct]))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?ht(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=wn,g=\`onMouseLeave\`,p=\`onMouseEnter\`,m=\`mouse\`,(e===\`pointerout\`||e===\`pointerover\`)&&(d=In,g=\`onPointerLeave\`,p=\`onPointerEnter\`,m=\`pointer\`),f=l==null?c:_t(l),h=u==null?c:_t(u),c=new d(g,m+\`leave\`,l,n,i),c.target=f,c.relatedTarget=h,g=null,ht(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?_t(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===\`select\`||l===\`input\`&&c.type===\`file\`)var v=ir;else if($n(c))if(ar)v=mr;else{v=fr;var y=dr}else l=c.nodeName,!l||l.toLowerCase()!==\`input\`||c.type!==\`checkbox\`&&c.type!==\`radio\`?r&&Jt(r.elementType)&&(v=ir):v=pr;if(v&&=v(e,r)){er(s,v,n,i);break a}y&&y(e,c,r),e===\`focusout\`&&r&&c.type===\`number\`&&r.memoizedProps.value!=null&&Vt(c,\`number\`,c.value)}switch(y=r?_t(r):window,e){case\`focusin\`:($n(y)||y.contentEditable===\`true\`)&&(wr=y,Tr=r,Er=null);break;case\`focusout\`:Er=Tr=wr=null;break;case\`mousedown\`:Dr=!0;break;case\`contextmenu\`:case\`mouseup\`:case\`dragend\`:Dr=!1,Or(s,n,i);break;case\`selectionchange\`:if(Cr)break;case\`keydown\`:case\`keyup\`:Or(s,n,i)}var b;if(Hn)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 Yn?Jn(e,n)&&(x=\`onCompositionEnd\`):e===\`keydown\`&&n.keyCode===229&&(x=\`onCompositionStart\`);x&&(Gn&&n.locale!==\`ko\`&&(Yn||x!==\`onCompositionStart\`?x===\`onCompositionEnd\`&&Yn&&(b=dn()):(cn=i,ln=\`value\`in cn?cn.value:cn.textContent,Yn=!0)),y=Ad(r,x),0<y.length&&(x=new kn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=U(n),b!==null&&(x.data=b)))),(b=Wn?Xn(e,n):Zn(e,n))&&(x=Ad(r,\`onBeforeInput\`),0<x.length&&(y=new kn(\`onBeforeInput\`,\`beforeinput\`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),vd(s,e,r,n,i)}Cd(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=rn(e,n),i!=null&&r.unshift(kd(e,i,a)),i=rn(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=rn(n,a),l!=null&&o.unshift(kd(n,l,c))):i||(l=rn(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===\`\`||Gt(e,r):(typeof r==\`number\`||typeof r==\`bigint\`)&&t!==\`body\`&&Gt(e,\`\`+r);break;case\`className\`:kt(e,\`class\`,r);break;case\`tabIndex\`:kt(e,\`tabindex\`,r);break;case\`dir\`:case\`role\`:case\`viewBox\`:case\`width\`:case\`height\`:kt(e,n,r);break;case\`style\`:qt(e,r,o);break;case\`data\`:if(t!==\`object\`){kt(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=B(\`\`+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=B(\`\`+r),e.setAttribute(n,r);break;case\`onClick\`:r!=null&&(e.onclick=V);break;case\`onScroll\`:r!=null&&J(\`scroll\`,e);break;case\`onScrollEnd\`:r!=null&&J(\`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=B(\`\`+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\`:J(\`beforetoggle\`,e),J(\`toggle\`,e),Ot(e,\`popover\`,r);break;case\`xlinkActuate\`:At(e,\`http://www.w3.org/1999/xlink\`,\`xlink:actuate\`,r);break;case\`xlinkArcrole\`:At(e,\`http://www.w3.org/1999/xlink\`,\`xlink:arcrole\`,r);break;case\`xlinkRole\`:At(e,\`http://www.w3.org/1999/xlink\`,\`xlink:role\`,r);break;case\`xlinkShow\`:At(e,\`http://www.w3.org/1999/xlink\`,\`xlink:show\`,r);break;case\`xlinkTitle\`:At(e,\`http://www.w3.org/1999/xlink\`,\`xlink:title\`,r);break;case\`xlinkType\`:At(e,\`http://www.w3.org/1999/xlink\`,\`xlink:type\`,r);break;case\`xmlBase\`:At(e,\`http://www.w3.org/XML/1998/namespace\`,\`xml:base\`,r);break;case\`xmlLang\`:At(e,\`http://www.w3.org/XML/1998/namespace\`,\`xml:lang\`,r);break;case\`xmlSpace\`:At(e,\`http://www.w3.org/XML/1998/namespace\`,\`xml:space\`,r);break;case\`is\`:Ot(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=Yt.get(n)||n,Ot(e,n,r))}}function Rd(e,t,n,r,a,o){switch(n){case\`style\`:qt(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\`?Gt(e,r):(typeof r==\`number\`||typeof r==\`bigint\`)&&Gt(e,\`\`+r);break;case\`onScroll\`:r!=null&&J(\`scroll\`,e);break;case\`onScrollEnd\`:r!=null&&J(\`scrollend\`,e);break;case\`onClick\`:r!=null&&(e.onclick=V);break;case\`suppressContentEditableWarning\`:case\`suppressHydrationWarning\`:case\`innerHTML\`:case\`ref\`:break;case\`innerText\`:case\`textContent\`:break;default:if(!xt.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[st]||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,\`\`):Ot(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\`:J(\`error\`,e),J(\`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\`:J(\`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)}}Bt(e,o,c,l,u,s,a,!1);return;case\`select\`:for(a in J(\`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&&Ht(e,!!r,n,!0):Ht(e,!!r,t,!1);return;case\`textarea\`:for(s in J(\`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)}Wt(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\`:J(\`beforetoggle\`,e),J(\`toggle\`,e),J(\`cancel\`,e),J(\`close\`,e);break;case\`iframe\`:case\`object\`:J(\`load\`,e);break;case\`video\`:case\`audio\`:for(r=0;r<xd.length;r++)J(xd[r],e);break;case\`image\`:J(\`error\`,e),J(\`load\`,e);break;case\`details\`:J(\`toggle\`,e);break;case\`embed\`:case\`source\`:case\`link\`:J(\`error\`,e),J(\`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(Jt(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)}}zt(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?Ht(e,!!n,n?[]:\`\`,!1):Ht(e,!!n,t,!0)):Ht(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)}Ut(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(Jt(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[pt]||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),mt(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[pt])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 Y(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 X(e){return e.data===\`$!\`||e.data===\`$?\`&&e.ownerDocument.readyState!==\`loading\`}function uf(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]);mt(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=I.d;I.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=Cu();return e||t}function Sf(e){var t=gt(e);t!==null&&t.tag===5&&t.type===\`form\`?Cs(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=Rt(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),yt(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="\`+Rt(t)+\`"]\`;t===\`image\`&&n&&n.imageSrcSet?(i+=\`[imagesrcset="\`+Rt(n.imageSrcSet)+\`"]\`,typeof n.imageSizes==\`string\`&&(i+=\`[imagesizes="\`+Rt(n.imageSizes)+\`"]\`)):i+=\`[href="\`+Rt(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),yt(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="\`+Rt(r)+\`"][href="\`+Rt(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),yt(r),n.head.appendChild(r)}}}function kf(e,t,n){bf.S(e,t,n);var r=Cf;if(r&&e){var i=vt(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\`);yt(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=vt(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\`),yt(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=vt(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\`),yt(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=ce.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=vt(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=vt(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=vt(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="\`+Rt(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),yt(t),e.head.appendChild(t))}function Lf(e){return\`[src="\`+Rt(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~="\`+Rt(n.href)+\`"]\`);if(r)return t.instance=r,yt(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\`),yt(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,yt(o),o;r=Ff(n),(a=_f.get(a))&&Vf(r,a),o=(e.ownerDocument||e).createElement(\`link\`),yt(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,yt(a),a):(r=n,(a=_f.get(o))&&(r=h({},n),Hf(r,a)),e=e.ownerDocument||e,a=e.createElement(\`script\`),yt(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[pt]||a[ot]||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,yt(a);return}a=t.ownerDocument||t,r=Ff(r),(i=_f.get(i))&&Vf(r,i),a=a.createElement(\`link\`),yt(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:te,_currentValue2:te,_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=Ye(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ye(0),this.hiddenUpdates=Ye(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=ti(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=$r,e):$r}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&&(vu(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=Xr(e,67108864);t!==null&&vu(t,e,67108864),sp(e,67108864)}}function lp(e){if(e.tag===13||e.tag===31){var t=gu();t=tt(t);var n=Xr(e,t);n!==null&&vu(n,e,t),sp(e,t)}}var up=!0;function dp(e,t,n,r){var i=F.T;F.T=null;var a=I.p;try{I.p=2,pp(e,t,n,r)}finally{I.p=a,F.T=i}}function fp(e,t,n,r){var i=F.T;F.T=null;var a=I.p;try{I.p=8,pp(e,t,n,r)}finally{I.p=a,F.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=gt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=We(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Le(o);s.entanglements[1]|=c,o&=~c}sd(a),!(Rl&6)&&(iu=Ee()+500,cd(0,!1))}}break;case 31:case 13:s=Xr(a,2),s!==null&&vu(s,a,2),Cu(),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=Zt(e),gp(e)}var hp=null;function gp(e){if(hp=null,e=ht(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(De()){case Oe:return 2;case ke:return 8;case Ae:case je:return 32;case Me: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=gt(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=ht(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,it(e.priority,function(){lp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,it(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);H=r,n.target.dispatchEvent(r),H=null}else return t=gt(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=gt(n);a!==null&&(e.splice(t,3),t-=3,xs(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[st]||null;if(typeof a==\`function\`)o||Fp(n);else if(o){var s=null;if(a&&a.hasAttribute(\`formAction\`)){if(i=a,o=a[st]||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,gu(),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),Cu(),t[ct]=null}};function zp(e){this._internalRoot=e}zp.prototype.unstable_scheduleHydration=function(e){if(e){var t=rt();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\`));I.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:F,reconcilerVersion:\`19.2.7\`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<\`u\`){var Hp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Hp.isDisabled&&Hp.supportsFiber)try{Fe=Hp.inject(Vp),Ie=Hp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=\`\`,o=Ws,s=Gs,c=Ks;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[ct]=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()})},P=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==\`\`&&n.indexOf(e)===t).join(\` \`).trim(),ee=e=>e.replace(/([a-z0-9])([A-Z])/g,\`$1-$2\`).toLowerCase(),F=e=>e.replace(/^([A-Z])|[\\s-_]+(\\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),I=e=>{let t=F(e);return t.charAt(0).toUpperCase()+t.slice(1)},te={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\`},ne=e=>{for(let t in e)if(t.startsWith(\`aria-\`)||t===\`role\`||t===\`title\`)return!0;return!1},re=(0,_.createContext)({}),ie=()=>(0,_.useContext)(re),ae=(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=\`\`}=ie()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,_.createElement)(\`svg\`,{ref:c,...te,width:t??l??te.width,height:t??l??te.height,stroke:e??f,strokeWidth:m,className:P(\`lucide\`,p,i),...!a&&!ne(s)&&{"aria-hidden":\`true\`},...s},[...o.map(([e,t])=>(0,_.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),L=(e,t)=>{let n=(0,_.forwardRef)(({className:n,...r},i)=>(0,_.createElement)(ae,{ref:i,iconNode:t,className:P(\`lucide-\${ee(I(e))}\`,\`lucide-\${e}\`,n),...r}));return n.displayName=I(e),n},oe=L(\`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\`}]]),se=L(\`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\`}]]),ce=L(\`arrow-down\`,[[\`path\`,{d:\`M12 5v14\`,key:\`s699le\`}],[\`path\`,{d:\`m19 12-7 7-7-7\`,key:\`1idqje\`}]]),le=L(\`arrow-right\`,[[\`path\`,{d:\`M5 12h14\`,key:\`1ays0h\`}],[\`path\`,{d:\`m12 5 7 7-7 7\`,key:\`xquz4c\`}]]),ue=L(\`arrow-up-right\`,[[\`path\`,{d:\`M7 7h10v10\`,key:\`1tivn9\`}],[\`path\`,{d:\`M7 17 17 7\`,key:\`1vkiza\`}]]),de=L(\`arrow-up\`,[[\`path\`,{d:\`m5 12 7-7 7 7\`,key:\`hav0vg\`}],[\`path\`,{d:\`M12 19V5\`,key:\`x0mq9r\`}]]),fe=L(\`check\`,[[\`path\`,{d:\`M20 6 9 17l-5-5\`,key:\`1gmf2c\`}]]),pe=L(\`chevron-down\`,[[\`path\`,{d:\`m6 9 6 6 6-6\`,key:\`qrunsl\`}]]),me=L(\`chevron-left\`,[[\`path\`,{d:\`m15 18-6-6 6-6\`,key:\`1wnfg3\`}]]),he=L(\`chevron-right\`,[[\`path\`,{d:\`m9 18 6-6-6-6\`,key:\`mthhwq\`}]]),ge=L(\`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\`}]]),_e=L(\`circle-check\`,[[\`circle\`,{cx:\`12\`,cy:\`12\`,r:\`10\`,key:\`1mglay\`}],[\`path\`,{d:\`m9 12 2 2 4-4\`,key:\`dzmm74\`}]]),ve=L(\`circle-dot\`,[[\`circle\`,{cx:\`12\`,cy:\`12\`,r:\`10\`,key:\`1mglay\`}],[\`circle\`,{cx:\`12\`,cy:\`12\`,r:\`1\`,key:\`41hilf\`}]]),ye=L(\`circle\`,[[\`circle\`,{cx:\`12\`,cy:\`12\`,r:\`10\`,key:\`1mglay\`}]]),be=L(\`clock\`,[[\`circle\`,{cx:\`12\`,cy:\`12\`,r:\`10\`,key:\`1mglay\`}],[\`path\`,{d:\`M12 6v6l4 2\`,key:\`mmk7yg\`}]]),xe=L(\`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\`}]]),Se=L(\`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\`}]]),Ce=L(\`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\`}]]),we=L(\`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\`}]]),Te=L(\`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\`}]]),Ee=L(\`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\`}]]),De=L(\`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\`}]]),Oe=L(\`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\`}]]),ke=L(\`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\`}]]),Ae=L(\`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\`}]]),je=L(\`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\`}]]),Me=L(\`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\`}]]),Ne=L(\`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\`}]]),Pe=L(\`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\`}]]),Fe=L(\`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\`}]]),Ie=L(\`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\`}]]),R=L(\`gauge\`,[[\`path\`,{d:\`m12 14 4-4\`,key:\`9kzdfg\`}],[\`path\`,{d:\`M3.34 19a10 10 0 1 1 17.32 0\`,key:\`19p75a\`}]]),Le=L(\`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\`}]]),Re=L(\`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\`}]]),ze=L(\`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\`}]]),Be=L(\`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\`}]]),Ve=L(\`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\`}]]),He=L(\`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\`}]]),Ue=L(\`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\`}]]),We=L(\`info\`,[[\`circle\`,{cx:\`12\`,cy:\`12\`,r:\`10\`,key:\`1mglay\`}],[\`path\`,{d:\`M12 16v-4\`,key:\`1dtifu\`}],[\`path\`,{d:\`M12 8h.01\`,key:\`e9boi3\`}]]),Ge=L(\`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\`}]]),Ke=L(\`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\`}]]),qe=L(\`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\`}]]),Je=L(\`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\`}]]),Ye=L(\`list-filter\`,[[\`path\`,{d:\`M2 5h20\`,key:\`1fs1ex\`}],[\`path\`,{d:\`M6 12h12\`,key:\`8npq4p\`}],[\`path\`,{d:\`M9 19h6\`,key:\`456am0\`}]]),Xe=L(\`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\`}]]),Ze=L(\`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\`}]]),Qe=L(\`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\`}]]),$e=L(\`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\`}]]),et=L(\`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\`}]]),tt=L(\`minus\`,[[\`path\`,{d:\`M5 12h14\`,key:\`1ays0h\`}]]),nt=L(\`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\`}]]),rt=L(\`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\`}]]),it=L(\`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\`}]]),at=L(\`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\`}]]),ot=L(\`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\`}]]),st=L(\`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\`}]]),ct=L(\`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\`}]]),lt=L(\`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\`}]]),ut=L(\`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\`}]]),dt=L(\`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\`}]]),ft=L(\`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\`}]]),pt=L(\`plus\`,[[\`path\`,{d:\`M5 12h14\`,key:\`1ays0h\`}],[\`path\`,{d:\`M12 5v14\`,key:\`s699le\`}]]),mt=L(\`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\`}]]),ht=L(\`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\`}]]),gt=L(\`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\`}]]),_t=L(\`search\`,[[\`path\`,{d:\`m21 21-4.34-4.34\`,key:\`14j7rj\`}],[\`circle\`,{cx:\`11\`,cy:\`11\`,r:\`8\`,key:\`4ej97u\`}]]),vt=L(\`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\`}]]),yt=L(\`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\`}]]),bt=L(\`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\`}]]),xt=L(\`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\`}]]),St=L(\`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\`}]]),Ct=L(\`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\`}]]),wt=L(\`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\`}]]),Tt=L(\`square\`,[[\`rect\`,{width:\`18\`,height:\`18\`,x:\`3\`,y:\`3\`,rx:\`2\`,key:\`afitv7\`}]]),Et=L(\`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\`}]]),Dt=L(\`terminal\`,[[\`path\`,{d:\`M12 19h8\`,key:\`baeox8\`}],[\`path\`,{d:\`m4 17 6-6-6-6\`,key:\`1yngyt\`}]]),Ot=L(\`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\`}]]),kt=L(\`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\`}]]),At=L(\`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\`}]]),jt=L(\`user-round\`,[[\`circle\`,{cx:\`12\`,cy:\`8\`,r:\`5\`,key:\`1hypcn\`}],[\`path\`,{d:\`M20 21a8 8 0 0 0-16 0\`,key:\`rfgkzh\`}]]),Mt=L(\`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\`}]]),Nt=L(\`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\`}]]),Pt=L(\`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\`}]]),Ft=L(\`x\`,[[\`path\`,{d:\`M18 6 6 18\`,key:\`1bl5f8\`}],[\`path\`,{d:\`m6 6 12 12\`,key:\`d8bk6v\`}]]),It=L(\`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 Lt(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 Rt=[{title:null,items:[{id:\`home\`,label:\`Project overview\`,icon:He}]},{title:\`Database\`,items:[{id:\`table\`,label:\`Table Editor\`,icon:Et},{id:\`sql\`,label:\`SQL Editor\`,icon:Dt},{id:\`database\`,label:\`Database\`,icon:Le}]},{title:\`Manage\`,items:[{id:\`auth\`,label:\`Authentication\`,icon:Ge},{id:\`storage\`,label:\`Storage\`,icon:ze},{id:\`functions\`,label:\`Edge Functions\`,icon:It},{id:\`realtime\`,label:\`Realtime\`,icon:mt}]},{title:\`Automations\`,items:[{id:\`automations\`,label:\`Automations\`,icon:Pt}]},{title:\`Observe\`,items:[{id:\`logs\`,label:\`Logs\`,icon:gt}]},{title:\`Project\`,items:[{id:\`settings\`,label:\`Project Settings\`,icon:yt}]}];function zt(){try{return new URL(document.URL).pathname}catch{return window.location.pathname}}var Bt=zt().startsWith(\`/_\`)?\`/_\`:\`\`,Vt=new Set(Rt.flatMap(e=>e.items.map(e=>e.id)));function Ht(){let e=zt().slice(Bt.length).split(\`/\`).filter(Boolean);return{tab:Vt.has(e[0])?e[0]:\`home\`,section:e[1]?decodeURIComponent(e[1]):null}}function Ut(e,t){return e===\`home\`?\`\${Bt}/\`:t?\`\${Bt}/\${e}/\${encodeURIComponent(t)}\`:\`\${Bt}/\${e}\`}var Wt=Ht(),Gt=new Set;function Kt(){let e=Ht();(e.tab!==Wt.tab||e.section!==Wt.section)&&(Wt=e,Gt.forEach(e=>e()))}window.addEventListener(\`popstate\`,Kt);function z(e,t=null,n={}){let r=Ut(e,t);zt()!==r&&(n.replace?window.history.replaceState(null,\`\`,r):window.history.pushState(null,\`\`,r)),Kt()}function qt(){return(0,_.useSyncExternalStore)(e=>(Gt.add(e),()=>Gt.delete(e)),()=>Wt)}function Jt(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=Jt(e[t]))&&(r&&(r+=\` \`),r+=n)}else for(n in e)e[n]&&(r&&(r+=\` \`),r+=n);return r}function Yt(){for(var e,t,n=0,r=\`\`,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Jt(e))&&(r&&(r+=\` \`),r+=t);return r}var Xt=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})),B=o(((e,t)=>{t.exports=Xt()}))();function V({variant:e=\`neutral\`,className:t,children:n}){return(0,B.jsx)(\`span\`,{className:Yt(\`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 H({variant:e=\`default\`,size:t=\`sm\`,className:n,...r}){return(0,B.jsx)(\`button\`,{className:Yt(\`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 Zt({checked:e,indeterminate:t,onChange:n,disabled:r,title:i,className:a}){return(0,B.jsx)(\`button\`,{type:\`button\`,role:\`checkbox\`,"aria-checked":t?\`mixed\`:e,disabled:r,title:i,onClick:t=>{t.stopPropagation(),n?.(!e,t)},className:Yt(\`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,B.jsx)(tt,{size:11,strokeWidth:3}):e?(0,B.jsx)(fe,{size:11,strokeWidth:3}):null})}var Qt=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,\`&#38;\`).replace(/"/g,\`&#34;\`).replace(/'/g,\`&#39;\`).replace(/</g,\`&#60;\`)},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)&&(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,\`&#38;\`).replace(/"/g,\`&#34;\`).replace(/'/g,\`&#39;\`).replace(/</g,\`&#60;\`)},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;
@@ -198,7 +198,7 @@ Error generating stack: \`+e.message+\`
198
198
  \`+r,n+=1,t+=1);r.length>f&&(t<f&&n<f?r=r.slice(0,f):(r=\`
199
199
  \`,t==n?t=n=0:(t=0,n=1)));var p=r+\`
200
200
 
201
- \`;p!=this.lastValue&&(this.text.value=this.lastValue=p,this.lastSelectionStart=this.lastSelectionEnd=p.length)}if(this.afterContextMenu&&(this.lastSelectionStart=this.text.selectionStart,this.lastSelectionEnd=this.text.selectionEnd),this.lastSelectionEnd!=n||this.lastSelectionStart!=t||this.text.selectionEnd!=this.lastSelectionEnd)try{this.text.setSelectionRange(t,n),this.lastSelectionStart=t,this.lastSelectionEnd=n}catch{}this.inComposition=!1}},e.prototype.setHost=function(e){this.host=e},e.prototype.setNumberOfExtraLines=function(e){if(this.rowStart=2**53-1,this.rowEnd=-(2**53-1),e<0){this.numberOfExtraLines=0;return}this.numberOfExtraLines=e},e.prototype.setAriaLabel=function(){var e=\`\`;if(this.host.$textInputAriaLabel&&(e+=\`\${this.host.$textInputAriaLabel}, \`),this.host.session){var t=this.host.session.selection.cursor.row;e+=i(\`text-input.aria-label\`,\`Cursor at row $0\`,[t+1])}this.text.setAttribute(\`aria-label\`,e)},e.prototype.setAriaOptions=function(e){e.activeDescendant?(this.text.setAttribute(\`aria-haspopup\`,\`true\`),this.text.setAttribute(\`aria-autocomplete\`,e.inline?\`both\`:\`list\`),this.text.setAttribute(\`aria-activedescendant\`,e.activeDescendant)):(this.text.setAttribute(\`aria-haspopup\`,\`false\`),this.text.setAttribute(\`aria-autocomplete\`,\`both\`),this.text.removeAttribute(\`aria-activedescendant\`)),e.role&&this.text.setAttribute(\`role\`,e.role),e.setLabel&&(this.text.setAttribute(\`aria-roledescription\`,i(\`text-input.aria-roledescription\`,\`editor\`)),this.setAriaLabel())},e.prototype.focus=function(){var e=this;if(this.setAriaOptions({setLabel:this.host.renderer.enableKeyboardAccessibility}),this.tempStyle||d||this.$focusScroll==\`browser\`)return this.text.focus({preventScroll:!0});var t=this.text.style.top;this.text.style.position=\`fixed\`,this.text.style.top=\`0px\`;try{var n=this.text.getBoundingClientRect().top!=0}catch{return}var r=[];if(n)for(var i=this.text.parentElement;i&&i.nodeType==1;)r.push(i),i.setAttribute(\`ace_nocontext\`,\`true\`),i=!i.parentElement&&i.getRootNode?i.getRootNode().host:i.parentElement;this.text.focus({preventScroll:!0}),n&&r.forEach(function(e){e.removeAttribute(\`ace_nocontext\`)}),setTimeout(function(){e.text.style.position=\`\`,e.text.style.top==\`0px\`&&(e.text.style.top=t)},0)},e.prototype.blur=function(){this.text.blur()},e.prototype.isFocused=function(){return this.$isFocused},e.prototype.setInputHandler=function(e){this.inputHandler=e},e.prototype.getInputHandler=function(){return this.inputHandler},e.prototype.getElement=function(){return this.text},e.prototype.setCommandMode=function(e){this.commandMode=e,this.text.readOnly=!1},e.prototype.setReadOnly=function(e){this.commandMode||(this.text.readOnly=e)},e.prototype.setCopyWithEmptySelection=function(e){},e.prototype.onContextMenu=function(e){this.afterContextMenu=!0,this.resetSelection(),this.host._emit(\`nativecontextmenu\`,{target:this.host,domEvent:e}),this.moveToMouse(e,!0)},e.prototype.moveToMouse=function(e,t){var n=this;this.tempStyle||=this.text.style.cssText,this.text.style.cssText=(t?\`z-index:100000;\`:\`\`)+(a.isIE?\`opacity:0.1;\`:\`\`)+\`text-indent: -\`+(this.lastSelectionStart+this.lastSelectionEnd)*this.host.renderer.characterWidth*.5+\`px;\`;var i=this.host.container.getBoundingClientRect(),s=o.computedStyle(this.host.container),c=i.top+(parseInt(s.borderTopWidth)||0),l=i.left+(parseInt(s.borderLeftWidth)||0),u=i.bottom-c-this.text.clientHeight-2,d=function(e){o.translate(n.text,e.clientX-l-2,Math.min(e.clientY-c-2,u))};d(e),e.type==\`mousedown\`&&(this.host.renderer.$isMousePressed=!0,clearTimeout(this.closeTimeout),a.isWin&&r.capture(this.host.container,d,this.onContextMenuClose.bind(this)))},e.prototype.destroy=function(){this.text.parentElement&&this.text.parentElement.removeChild(this.text)},e}(),t.$setUserAgentForTests=function(e,t){_=e,h=t}}),ace.define(\`ace/mouse/default_handlers\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/useragent\`],function(e,t,n){var r=e("../lib/useragent"),i=0,a=550,o=function(){function e(e){e.$clickSelection=null;var t=e.editor;t.setDefaultHandler(\`mousedown\`,this.onMouseDown.bind(e)),t.setDefaultHandler(\`dblclick\`,this.onDoubleClick.bind(e)),t.setDefaultHandler(\`tripleclick\`,this.onTripleClick.bind(e)),t.setDefaultHandler(\`quadclick\`,this.onQuadClick.bind(e)),t.setDefaultHandler(\`mousewheel\`,this.onMouseWheel.bind(e)),[\`select\`,\`startSelect\`,\`selectEnd\`,\`selectAllEnd\`,\`selectByWordsEnd\`,\`selectByLinesEnd\`,\`dragWait\`,\`dragWaitEnd\`,\`focusWait\`].forEach(function(t){e[t]=this[t]},this),e.selectByLines=this.extendSelectionBy.bind(e,\`getLineRange\`),e.selectByWords=this.extendSelectionBy.bind(e,\`getWordRange\`)}return e.prototype.onMouseDown=function(e){var t=e.inSelection(),n=e.getDocumentPosition();this.mousedownEvent=e;var i=this.editor,a=e.getButton();if(a!==0){(i.getSelectionRange().isEmpty()||a==1)&&i.selection.moveToPosition(n),a==2&&(i.textInput.onContextMenu(e.domEvent),r.isMozilla||e.preventDefault());return}if(this.mousedownEvent.time=Date.now(),t&&!i.isFocused()&&(i.focus(),this.$focusTimeout&&!this.$clickSelection&&!i.inMultiSelectMode)){this.setState(\`focusWait\`),this.captureMouse(e);return}return this.captureMouse(e),this.startSelect(n,e.domEvent._clicks>1),e.preventDefault()},e.prototype.startSelect=function(e,t){e||=this.editor.renderer.screenToTextCoordinates(this.x,this.y);var n=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?n.selection.selectToPosition(e):t||n.selection.moveToPosition(e),t||this.select(),n.setStyle(\`ace_selecting\`),this.setState(\`select\`))},e.prototype.select=function(){var e,t=this.editor,n=t.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var r=this.$clickSelection.comparePoint(n);if(r==-1)e=this.$clickSelection.end;else if(r==1)e=this.$clickSelection.start;else{var i=c(this.$clickSelection,n,t.session);n=i.cursor,e=i.anchor}t.selection.setSelectionAnchor(e.row,e.column)}t.selection.selectToPosition(n),t.renderer.scrollCursorIntoView()},e.prototype.extendSelectionBy=function(e){var t,n=this.editor,r=n.renderer.screenToTextCoordinates(this.x,this.y),i=n.selection[e](r.row,r.column);if(this.$clickSelection){var a=this.$clickSelection.comparePoint(i.start),o=this.$clickSelection.comparePoint(i.end);if(a==-1&&o<=0)t=this.$clickSelection.end,(i.end.row!=r.row||i.end.column!=r.column)&&(r=i.start);else if(o==1&&a>=0)t=this.$clickSelection.start,(i.start.row!=r.row||i.start.column!=r.column)&&(r=i.end);else if(a==-1&&o==1)r=i.end,t=i.start;else{var s=c(this.$clickSelection,r,n.session);r=s.cursor,t=s.anchor}n.selection.setSelectionAnchor(t.row,t.column)}n.selection.selectToPosition(r),n.renderer.scrollCursorIntoView()},e.prototype.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle(\`ace_selecting\`)},e.prototype.focusWait=function(){(s(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>i||Date.now()-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},e.prototype.onDoubleClick=function(e){var t=e.getDocumentPosition(),n=this.editor,r=n.session.getBracketRange(t);r?(r.isEmpty()&&(r.start.column--,r.end.column++),this.setState(\`select\`)):(r=n.selection.getWordRange(t.row,t.column),this.setState(\`selectByWords\`)),this.$clickSelection=r,this.select()},e.prototype.onTripleClick=function(e){var t=e.getDocumentPosition(),n=this.editor;this.setState(\`selectByLines\`);var r=n.getSelectionRange();r.isMultiLine()&&r.contains(t.row,t.column)?(this.$clickSelection=n.selection.getLineRange(r.start.row),this.$clickSelection.end=n.selection.getLineRange(r.end.row).end):this.$clickSelection=n.selection.getLineRange(t.row),this.select()},e.prototype.onQuadClick=function(e){var t=this.editor;t.selectAll(),this.$clickSelection=t.getSelectionRange(),this.setState(\`selectAll\`)},e.prototype.onMouseWheel=function(e){if(!e.getAccelKey()){e.getShiftKey()&&e.wheelY&&!e.wheelX&&(e.wheelX=e.wheelY,e.wheelY=0);var t=this.editor;this.$lastScroll||={t:0,vx:0,vy:0,allowed:0};var n=this.$lastScroll,r=e.domEvent.timeStamp,i=r-n.t,o=i?e.wheelX/i:n.vx,s=i?e.wheelY/i:n.vy;i<a&&(o=(o+n.vx)/2,s=(s+n.vy)/2);var c=Math.abs(o/s),l=!1;if(c>=1&&t.renderer.isScrollableBy(e.wheelX*e.speed,0)&&(l=!0),c<=1&&t.renderer.isScrollableBy(0,e.wheelY*e.speed)&&(l=!0),l?n.allowed=r:r-n.allowed<a&&(Math.abs(o)<=1.5*Math.abs(n.vx)&&Math.abs(s)<=1.5*Math.abs(n.vy)?(l=!0,n.allowed=r):n.allowed=0),n.t=r,n.vx=o,n.vy=s,l)return t.renderer.scrollBy(e.wheelX*e.speed,e.wheelY*e.speed),e.stop()}},e}();o.prototype.selectEnd=o.prototype.selectByLinesEnd,o.prototype.selectAllEnd=o.prototype.selectByLinesEnd,o.prototype.selectByWordsEnd=o.prototype.selectByLinesEnd,t.DefaultHandlers=o;function s(e,t,n,r){return Math.sqrt((n-e)**2+(r-t)**2)}function c(e,t,n){if(e.start.row==e.end.row)var r=2*t.column-e.start.column-e.end.column;else if(e.start.row==e.end.row-1&&!e.start.column&&!e.end.column)var r=3*t.column-2*n.getLine(e.start.row).length;else var r=2*t.row-e.start.row-e.end.row;return r<0?{cursor:e.start,anchor:e.end}:{cursor:e.end,anchor:e.start}}}),ace.define(\`ace/mouse/mouse_event\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/event\`,\`ace/lib/useragent\`],function(e,t,n){var r=e("../lib/event"),i=e("../lib/useragent");t.MouseEvent=function(){function e(e,t){this.speed,this.wheelX,this.wheelY,this.domEvent=e,this.editor=t,this.x=this.clientX=e.clientX,this.y=this.clientY=e.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1}return e.prototype.stopPropagation=function(){r.stopPropagation(this.domEvent),this.propagationStopped=!0},e.prototype.preventDefault=function(){r.preventDefault(this.domEvent),this.defaultPrevented=!0},e.prototype.stop=function(){this.stopPropagation(),this.preventDefault()},e.prototype.getDocumentPosition=function(){return this.$pos||=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY),this.$pos},e.prototype.getGutterRow=function(){var e=this.getDocumentPosition().row;return this.editor.session.documentToScreenRow(e,0)-this.editor.session.documentToScreenRow(this.editor.renderer.$gutterLayer.$lines.get(0).row,0)},e.prototype.inSelection=function(){if(this.$inSelection!==null)return this.$inSelection;var e=this.editor.getSelectionRange();if(e.isEmpty())this.$inSelection=!1;else{var t=this.getDocumentPosition();this.$inSelection=e.contains(t.row,t.column)}return this.$inSelection},e.prototype.getButton=function(){return r.getButton(this.domEvent)},e.prototype.getShiftKey=function(){return this.domEvent.shiftKey},e.prototype.getAccelKey=function(){return i.isMac?this.domEvent.metaKey:this.domEvent.ctrlKey},e}()}),ace.define(\`ace/lib/scroll\`,[\`require\`,\`exports\`,\`module\`],function(e,t,n){t.preventParentScroll=function(e){e.stopPropagation();var t=e.currentTarget;t.scrollHeight>t.clientHeight||e.preventDefault()}}),ace.define(\`ace/tooltip\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/dom\`,\`ace/lib/event\`,\`ace/range\`,\`ace/lib/scroll\`],function(e,t,n){var r=this&&this.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=\`function\`&&n!==null)throw TypeError(\`Class extends value \`+String(n)+\` is not a constructor or null\`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),i=this&&this.__values||function(e){var t=typeof Symbol==\`function\`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==\`number\`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?\`Object is not iterable.\`:\`Symbol.iterator is not defined.\`)},a=e("./lib/dom");e("./lib/event");var o=e("./range").Range,s=e("./lib/scroll").preventParentScroll,c=\`ace_tooltip\`,l=function(){function e(e){this.isOpen=!1,this.$element=null,this.$parentNode=e}return e.prototype.$init=function(){return this.$element=a.createElement(\`div\`),this.$element.className=c,this.$element.style.display=\`none\`,this.$parentNode.appendChild(this.$element),this.$element},e.prototype.getElement=function(){return this.$element||this.$init()},e.prototype.setText=function(e){this.getElement().textContent=e},e.prototype.setHtml=function(e){this.getElement().innerHTML=e},e.prototype.setPosition=function(e,t){this.getElement().style.left=e+\`px\`,this.getElement().style.top=t+\`px\`},e.prototype.setClassName=function(e){a.addCssClass(this.getElement(),e)},e.prototype.setTheme=function(e){this.theme&&(this.theme.isDark&&a.removeCssClass(this.getElement(),\`ace_dark\`),this.theme.cssClass&&a.removeCssClass(this.getElement(),this.theme.cssClass)),e.isDark&&a.addCssClass(this.getElement(),\`ace_dark\`),e.cssClass&&a.addCssClass(this.getElement(),e.cssClass),this.theme={isDark:e.isDark,cssClass:e.cssClass}},e.prototype.show=function(e,t,n){e!=null&&this.setText(e),t!=null&&n!=null&&this.setPosition(t,n),this.isOpen||=(this.getElement().style.display=\`block\`,!0)},e.prototype.hide=function(e){this.isOpen&&=(this.getElement().style.display=\`none\`,this.getElement().className=c,!1)},e.prototype.getHeight=function(){return this.getElement().offsetHeight},e.prototype.getWidth=function(){return this.getElement().offsetWidth},e.prototype.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)},e}(),u=new(function(){function e(){this.popups=[]}return e.prototype.addPopup=function(e){this.popups.push(e),this.updatePopups()},e.prototype.removePopup=function(e){var t=this.popups.indexOf(e);t!==-1&&(this.popups.splice(t,1),this.updatePopups())},e.prototype.updatePopups=function(){var e,t,n,r;this.popups.sort(function(e,t){return t.priority-e.priority});var a=[];try{for(var o=i(this.popups),s=o.next();!s.done;s=o.next()){var c=s.value,l=!0;try{for(var u=(n=void 0,i(a)),d=u.next();!d.done;d=u.next()){var f=d.value;if(this.doPopupsOverlap(f,c)){l=!1;break}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}l?a.push(c):c.hide()}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}},e.prototype.doPopupsOverlap=function(e,t){var n=e.getElement().getBoundingClientRect(),r=t.getElement().getBoundingClientRect();return n.left<r.right&&n.right>r.left&&n.top<r.bottom&&n.bottom>r.top},e}());t.popupManager=u,t.Tooltip=l,t.HoverTooltip=function(e){r(t,e);function t(t){t===void 0&&(t=document.body);var n=e.call(this,t)||this;n.timeout=void 0,n.lastT=0,n.idleTime=350,n.lastEvent=void 0,n.onMouseOut=n.onMouseOut.bind(n),n.onMouseMove=n.onMouseMove.bind(n),n.waitForHover=n.waitForHover.bind(n),n.hide=n.hide.bind(n);var r=n.getElement();return r.style.whiteSpace=\`pre-wrap\`,r.style.pointerEvents=\`auto\`,r.addEventListener(\`mouseout\`,n.onMouseOut),r.tabIndex=-1,r.addEventListener(\`blur\`,function(){r.contains(document.activeElement)||this.hide()}.bind(n)),r.addEventListener(\`wheel\`,s),n}return t.prototype.addToEditor=function(e){e.on(\`mousemove\`,this.onMouseMove),e.on(\`mousedown\`,this.hide);var t=e.renderer.getMouseEventTarget();t&&typeof t.removeEventListener==\`function\`&&t.addEventListener(\`mouseout\`,this.onMouseOut,!0)},t.prototype.removeFromEditor=function(e){e.off(\`mousemove\`,this.onMouseMove),e.off(\`mousedown\`,this.hide);var t=e.renderer.getMouseEventTarget();t&&typeof t.removeEventListener==\`function\`&&t.removeEventListener(\`mouseout\`,this.onMouseOut,!0),this.timeout&&=(clearTimeout(this.timeout),null)},t.prototype.onMouseMove=function(e,t){this.lastEvent=e,this.lastT=Date.now();var n=t.$mouseHandler.isMousePressed;if(this.isOpen){var r=this.lastEvent&&this.lastEvent.getDocumentPosition();(!this.range||!this.range.contains(r.row,r.column)||n||this.isOutsideOfText(this.lastEvent))&&this.hide()}this.timeout||n||(this.lastEvent=e,this.timeout=setTimeout(this.waitForHover,this.idleTime))},t.prototype.waitForHover=function(){this.timeout&&clearTimeout(this.timeout);var e=Date.now()-this.lastT;if(this.idleTime-e>10){this.timeout=setTimeout(this.waitForHover,this.idleTime-e);return}this.timeout=null,this.lastEvent&&!this.isOutsideOfText(this.lastEvent)&&this.$gatherData(this.lastEvent,this.lastEvent.editor)},t.prototype.isOutsideOfText=function(e){var t=e.editor,n=e.getDocumentPosition(),r=t.session.getLine(n.row);if(n.column==r.length){var i=t.renderer.pixelToScreenCoordinates(e.clientX,e.clientY),a=t.session.documentToScreenPosition(n.row,n.column);if(a.column!=i.column||a.row!=i.row)return!0}return!1},t.prototype.setDataProvider=function(e){this.$gatherData=e},t.prototype.showForRange=function(e,t,n,r){if(!(r&&r!=this.lastEvent)&&!(this.isOpen&&document.activeElement==this.getElement())){var i=e.renderer;this.isOpen||(u.addPopup(this),this.$registerCloseEvents(),this.setTheme(i.theme)),this.isOpen=!0,this.range=o.fromPoints(t.start,t.end);var s=i.textToScreenCoordinates(t.start.row,t.start.column),c=i.scroller.getBoundingClientRect();s.pageX<c.left&&(s.pageX=c.left);var l=this.getElement();l.innerHTML=\`\`,l.appendChild(n),l.style.maxHeight=\`\`,l.style.display=\`block\`,this.$setPosition(e,s,!0,t),a.$fixPositionBug(l)}},t.prototype.$setPosition=function(e,t,n,r){var i=10;n&&this.addMarker(r,e.session);var a=e.renderer,o=this.getElement(),s=o.offsetHeight,c=o.offsetWidth,l=t.pageY,u=t.pageX,d=window.innerHeight-l-a.lineHeight,f=this.$shouldPlaceAbove(s,l,d-i);o.style.maxHeight=(f?l:d)-i+\`px\`,o.style.top=f?\`\`:l+a.lineHeight+\`px\`,o.style.bottom=f?window.innerHeight-l+\`px\`:\`\`,o.style.left=Math.min(u,window.innerWidth-c-i)+\`px\`},t.prototype.$shouldPlaceAbove=function(e,t,n){return!(t-e<0&&t<n)},t.prototype.addMarker=function(e,t){this.marker&&this.$markerSession.removeMarker(this.marker),this.$markerSession=t,this.marker=t&&t.addMarker(e,\`ace_highlight-marker\`,\`text\`)},t.prototype.hide=function(e){e&&this.$fromKeyboard&&e.type==\`keydown\`&&e.code==\`Escape\`||!e&&document.activeElement==this.getElement()||e&&e.target&&(e.type!=\`keydown\`||e.ctrlKey||e.metaKey)&&this.$element.contains(e.target)||(this.lastEvent=null,this.timeout&&clearTimeout(this.timeout),this.timeout=null,this.addMarker(null),this.isOpen&&(this.$fromKeyboard=!1,this.$removeCloseEvents(),this.getElement().style.display=\`none\`,this.isOpen=!1,u.removePopup(this)))},t.prototype.$registerCloseEvents=function(){window.addEventListener(\`keydown\`,this.hide,!0),window.addEventListener(\`wheel\`,this.hide,!0),window.addEventListener(\`mousedown\`,this.hide,!0)},t.prototype.$removeCloseEvents=function(){window.removeEventListener(\`keydown\`,this.hide,!0),window.removeEventListener(\`wheel\`,this.hide,!0),window.removeEventListener(\`mousedown\`,this.hide,!0)},t.prototype.onMouseOut=function(e){this.timeout&&=(clearTimeout(this.timeout),null),this.lastEvent=null,this.isOpen&&(!e.relatedTarget||this.getElement().contains(e.relatedTarget)||e&&e.currentTarget.contains(e.relatedTarget)||e.relatedTarget.classList.contains(\`ace_content\`)||this.hide())},t}(l)}),ace.define(\`ace/mouse/default_gutter_handler\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/dom\`,\`ace/mouse/mouse_event\`,\`ace/tooltip\`,\`ace/config\`,\`ace/range\`],function(e,t,n){var r=this&&this.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=\`function\`&&n!==null)throw TypeError(\`Class extends value \`+String(n)+\` is not a constructor or null\`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),i=this&&this.__values||function(e){var t=typeof Symbol==\`function\`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==\`number\`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?\`Object is not iterable.\`:\`Symbol.iterator is not defined.\`)},a=e("../lib/dom"),o=e("./mouse_event").MouseEvent,s=e("../tooltip").HoverTooltip,c=e("../config").nls,l=e("../range").Range;function u(e){var t=e.editor,n=t.renderer.$gutterLayer;e.$tooltip=new d(t),e.$tooltip.addToEditor(t),e.$tooltip.setDataProvider(function(t,n){var r=t.getDocumentPosition().row;e.$tooltip.showTooltip(r)}),e.editor.setDefaultHandler(\`guttermousedown\`,function(r){if(!(!t.isFocused()||r.getButton()!=0)&&n.getRegion(r)!=\`foldWidgets\`){var i=r.getDocumentPosition().row,a=t.session.selection;if(r.getShiftKey())a.selectTo(i,0);else{if(r.domEvent.detail==2)return t.selectAll(),r.preventDefault();e.$clickSelection=t.selection.getLineRange(i)}return e.setState(\`selectByLines\`),e.captureMouse(r),r.preventDefault()}})}t.GutterHandler=u;var d=function(e){r(t,e);function t(n){var r=e.call(this,n.container)||this;r.id=\`gt\`+ ++t.$uid,r.editor=n,r.visibleTooltipRow;var i=r.getElement();return i.setAttribute(\`role\`,\`tooltip\`),i.setAttribute(\`id\`,r.id),i.style.pointerEvents=\`auto\`,r.idleTime=50,r.onDomMouseMove=r.onDomMouseMove.bind(r),r.onDomMouseOut=r.onDomMouseOut.bind(r),r.setClassName(\`ace_gutter-tooltip\`),r}return t.prototype.onDomMouseMove=function(e){var t=new o(e,this.editor);this.onMouseMove(t,this.editor)},t.prototype.onDomMouseOut=function(e){var t=new o(e,this.editor);this.onMouseOut(t)},t.prototype.addToEditor=function(t){var n=t.renderer.$gutter;n.addEventListener(\`mousemove\`,this.onDomMouseMove),n.addEventListener(\`mouseout\`,this.onDomMouseOut),e.prototype.addToEditor.call(this,t)},t.prototype.removeFromEditor=function(t){var n=t.renderer.$gutter;n.removeEventListener(\`mousemove\`,this.onDomMouseMove),n.removeEventListener(\`mouseout\`,this.onDomMouseOut),e.prototype.removeFromEditor.call(this,t)},t.prototype.destroy=function(){this.editor&&this.removeFromEditor(this.editor),e.prototype.destroy.call(this)},Object.defineProperty(t,"annotationLabels",{get:function(){return{error:{singular:c(\`gutter-tooltip.aria-label.error.singular\`,\`error\`),plural:c(\`gutter-tooltip.aria-label.error.plural\`,\`errors\`)},security:{singular:c(\`gutter-tooltip.aria-label.security.singular\`,\`security finding\`),plural:c(\`gutter-tooltip.aria-label.security.plural\`,\`security findings\`)},warning:{singular:c(\`gutter-tooltip.aria-label.warning.singular\`,\`warning\`),plural:c(\`gutter-tooltip.aria-label.warning.plural\`,\`warnings\`)},info:{singular:c(\`gutter-tooltip.aria-label.info.singular\`,\`information message\`),plural:c(\`gutter-tooltip.aria-label.info.plural\`,\`information messages\`)},hint:{singular:c(\`gutter-tooltip.aria-label.hint.singular\`,\`suggestion\`),plural:c(\`gutter-tooltip.aria-label.hint.plural\`,\`suggestions\`)}}},enumerable:!1,configurable:!0}),t.prototype.showTooltip=function(e){var n,r=this.editor.renderer.$gutterLayer,i=r.$annotations[e],o=i?{displayText:Array.from(i.displayText),type:Array.from(i.type)}:{displayText:[],type:[]},s=r.session.getFoldLine(e);if(s&&r.$showFoldedAnnotations){for(var c={error:[],security:[],warning:[],info:[],hint:[]},u={error:1,security:2,warning:3,info:4,hint:5},d,f=e+1;f<=s.end.row;f++)if(r.$annotations[f])for(var p=0;p<r.$annotations[f].text.length;p++){var m=r.$annotations[f].type[p];c[m].push(r.$annotations[f].text[p]),(!d||u[m]<u[d])&&(d=m)}if([\`error\`,\`security\`,\`warning\`].includes(d)){var h=\`\${t.annotationsToSummaryString(c)} in folded code.\`;o.displayText.push(h),o.type.push(d+\`_fold\`)}}if(o.displayText.length===0)return this.hide();for(var g={error:[],security:[],warning:[],info:[],hint:[]},_=r.$useSvgGutterIcons?\`ace_icon_svg\`:\`ace_icon\`,f=0;f<o.displayText.length;f++){var v=a.createElement(\`span\`),y=a.createElement(\`span\`);(n=y.classList).add.apply(n,[\`ace_\${o.type[f]}\`,_]),y.setAttribute(\`aria-label\`,\`\${t.annotationLabels[o.type[f].replace(\`_fold\`,\`\`)].singular}\`),y.setAttribute(\`role\`,\`img\`),y.appendChild(a.createTextNode(\` \`)),v.appendChild(y),v.appendChild(a.createTextNode(o.displayText[f])),v.appendChild(a.createElement(\`br\`)),g[o.type[f].replace(\`_fold\`,\`\`)].push(v)}var b=a.createElement(\`span\`);g.error.forEach(function(e){return b.appendChild(e)}),g.security.forEach(function(e){return b.appendChild(e)}),g.warning.forEach(function(e){return b.appendChild(e)}),g.info.forEach(function(e){return b.appendChild(e)}),g.hint.forEach(function(e){return b.appendChild(e)}),b.setAttribute(\`aria-live\`,\`polite\`);var x=this.$findLinkedAnnotationNode(e);x&&x.setAttribute(\`aria-describedby\`,this.id);var S=l.fromPoints({row:e,column:0},{row:e,column:0});this.showForRange(this.editor,S,b),this.visibleTooltipRow=e,this.editor._signal(\`showGutterTooltip\`,this)},t.prototype.$setPosition=function(t,n,r,i){var a=this.$findCellByRow(i.start.row);if(a){var o=a&&a.element,s=o&&o.querySelector(\`.ace_gutter_annotation\`);if(s){var c=s.getBoundingClientRect();if(c){var l={pageX:c.right,pageY:c.top};return e.prototype.$setPosition.call(this,t,l,!1,i)}}}},t.prototype.$shouldPlaceAbove=function(e,t,n){return n<e},t.prototype.$findLinkedAnnotationNode=function(e){var t=this.$findCellByRow(e);if(t){var n=t.element;if(n.childNodes.length>2)return n.childNodes[2]}},t.prototype.$findCellByRow=function(e){return this.editor.renderer.$gutterLayer.$lines.cells.find(function(t){return t.row===e})},t.prototype.hide=function(t){if(this.isOpen){if(this.$element.removeAttribute(\`aria-live\`),this.visibleTooltipRow!=null){var n=this.$findLinkedAnnotationNode(this.visibleTooltipRow);n&&n.removeAttribute(\`aria-describedby\`)}this.visibleTooltipRow=void 0,this.editor._signal(\`hideGutterTooltip\`,this),e.prototype.hide.call(this,t)}},t.annotationsToSummaryString=function(e){var n,r,a=[],o=[\`error\`,\`security\`,\`warning\`,\`info\`,\`hint\`];try{for(var s=i(o),c=s.next();!c.done;c=s.next()){var l=c.value;if(e[l].length){var u=e[l].length===1?t.annotationLabels[l].singular:t.annotationLabels[l].plural;a.push(\`\${e[l].length} \${u}\`)}}}catch(e){n={error:e}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return a.join(\`, \`)},t.prototype.isOutsideOfText=function(e){var t=e.editor.renderer.$gutter.getBoundingClientRect();return!(e.clientX>=t.left&&e.clientX<=t.right&&e.clientY>=t.top&&e.clientY<=t.bottom)},t}(s);d.$uid=0,t.GutterTooltip=d}),ace.define(\`ace/mouse/dragdrop_handler\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/dom\`,\`ace/lib/event\`,\`ace/lib/useragent\`],function(e,t,n){var r=e("../lib/dom"),i=e("../lib/event"),a=e("../lib/useragent"),o=200,s=200,c=5;function l(e){var t=e.editor,n=r.createElement(\`div\`);n.style.cssText=\`top:-100px;position:absolute;z-index:2147483647;opacity:0.5\`,n.textContent=\`\\xA0\`,[\`dragWait\`,\`dragWaitEnd\`,\`startDrag\`,\`dragReadyEnd\`,\`onMouseDrag\`].forEach(function(t){e[t]=this[t]},this),t.on(\`mousedown\`,this.onMouseDown.bind(e));var l=t.container,d,f,p,m,h,g,_=0,v,y,b,x,S;this.onDragStart=function(e){if(this.cancelDrag||!l.draggable){var r=this;return setTimeout(function(){r.startSelect(),r.captureMouse(e)},0),e.preventDefault()}h=t.getSelectionRange();var i=e.dataTransfer;i.effectAllowed=t.getReadOnly()?\`copy\`:\`copyMove\`,t.container.appendChild(n),i.setDragImage&&i.setDragImage(n,0,0),setTimeout(function(){t.container.removeChild(n)}),i.clearData(),i.setData(\`Text\`,t.session.getTextRange()),y=!0,this.setState(\`drag\`)},this.onDragEnd=function(e){if(l.draggable=!1,y=!1,this.setState(null),!t.getReadOnly()){var n=e.dataTransfer.dropEffect;!v&&n==\`move\`&&t.session.remove(t.getSelectionRange()),t.$resetCursorStyle()}this.editor.unsetStyle(\`ace_dragging\`),this.editor.renderer.setCursorStyle(\`\`)},this.onDragEnter=function(e){if(!(t.getReadOnly()||!A(e.dataTransfer)))return f=e.clientX,p=e.clientY,d||E(),_++,e.dataTransfer.dropEffect=v=j(e),i.preventDefault(e)},this.onDragOver=function(e){if(!(t.getReadOnly()||!A(e.dataTransfer)))return f=e.clientX,p=e.clientY,d||(E(),_++),O!==null&&(O=null),e.dataTransfer.dropEffect=v=j(e),i.preventDefault(e)},this.onDragLeave=function(e){if(_--,_<=0&&d)return D(),v=null,i.preventDefault(e)},this.onDrop=function(e){if(g){var n=e.dataTransfer;if(y)switch(v){case\`move\`:h=h.contains(g.row,g.column)?{start:g,end:g}:t.moveText(h,g);break;case\`copy\`:h=t.moveText(h,g,!0);break}else{var r=n.getData(\`Text\`);h={start:g,end:t.session.insert(g,r)},t.focus(),v=null}return D(),i.preventDefault(e)}},i.addListener(l,\`dragstart\`,this.onDragStart.bind(e),t),i.addListener(l,\`dragend\`,this.onDragEnd.bind(e),t),i.addListener(l,\`dragenter\`,this.onDragEnter.bind(e),t),i.addListener(l,\`dragover\`,this.onDragOver.bind(e),t),i.addListener(l,\`dragleave\`,this.onDragLeave.bind(e),t),i.addListener(l,\`drop\`,this.onDrop.bind(e),t);function C(e,n){var r=Date.now(),i=!n||e.row!=n.row,a=!n||e.column!=n.column;!x||i||a?(t.moveCursorToPosition(e),x=r,S={x:f,y:p}):u(S.x,S.y,f,p)>c?x=null:r-x>=s&&(t.renderer.scrollCursorIntoView(),x=null)}function w(e,n){var r=Date.now(),i=t.renderer.layerConfig.lineHeight,a=t.renderer.layerConfig.characterWidth,s=t.renderer.scroller.getBoundingClientRect(),c={x:{left:f-s.left,right:s.right-f},y:{top:p-s.top,bottom:s.bottom-p}},l=Math.min(c.x.left,c.x.right),u=Math.min(c.y.top,c.y.bottom),d={row:e.row,column:e.column};l/a<=2&&(d.column+=c.x.left<c.x.right?-3:2),u/i<=1&&(d.row+=c.y.top<c.y.bottom?-1:1);var m=e.row!=d.row,h=e.column!=d.column,g=!n||e.row!=n.row;m||h&&!g?b?r-b>=o&&t.renderer.scrollCursorIntoView(d):b=r:b=null}function T(){var e=g;g=t.renderer.screenToTextCoordinates(f,p),C(g,e),w(g,e)}function E(){h=t.selection.toOrientedRange(),d=t.session.addMarker(h,\`ace_selection\`,t.getSelectionStyle()),t.clearSelection(),t.isFocused()&&t.renderer.$cursorLayer.setBlinking(!1),clearInterval(m),T(),m=setInterval(T,20),_=0,i.addListener(document,\`mousemove\`,k)}function D(){clearInterval(m),t.session.removeMarker(d),d=null,t.selection.fromOrientedRange(h),t.isFocused()&&!y&&t.$resetCursorStyle(),h=null,g=null,_=0,b=null,x=null,i.removeListener(document,\`mousemove\`,k)}var O=null;function k(){O??=setTimeout(function(){O!=null&&d&&D()},20)}function A(e){var t=e.types;return!t||Array.prototype.some.call(t,function(e){return e==\`text/plain\`||e==\`Text\`})}function j(e){var t=[\`copy\`,\`copymove\`,\`all\`,\`uninitialized\`],n=[\`move\`,\`copymove\`,\`linkmove\`,\`all\`,\`uninitialized\`],r=a.isMac?e.altKey:e.ctrlKey,i=\`uninitialized\`;try{i=e.dataTransfer.effectAllowed.toLowerCase()}catch{}var o=\`none\`;return r&&t.indexOf(i)>=0?o=\`copy\`:n.indexOf(i)>=0?o=\`move\`:t.indexOf(i)>=0&&(o=\`copy\`),o}}(function(){this.dragWait=function(){Date.now()-this.mousedownEvent.time>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){var e=this.editor.container;e.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(e){this.editor.$resetCursorStyle(),this.editor.unsetStyle(\`ace_dragging\`),this.editor.renderer.setCursorStyle(\`\`),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var e=this.editor,t=e.container;t.draggable=!0,e.renderer.$cursorLayer.setBlinking(!1),e.setStyle(\`ace_dragging\`);var n=a.isWin?\`default\`:\`move\`;e.renderer.setCursorStyle(n),this.setState(\`dragReady\`)},this.onMouseDrag=function(e){var t=this.editor.container;if(a.isIE&&this.state==\`dragReady\`){var n=u(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);n>3&&t.dragDrop()}if(this.state===\`dragWait\`){var n=u(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);n>0&&(t.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))}},this.onMouseDown=function(e){if(this.$dragEnabled){this.mousedownEvent=e;var t=this.editor,n=e.inSelection(),r=e.getButton();if((e.domEvent.detail||1)===1&&r===0&&n){if(e.editor.inMultiSelectMode&&(e.getAccelKey()||e.getShiftKey()))return;this.mousedownEvent.time=Date.now();var i=e.domEvent.target||e.domEvent.srcElement;if(\`unselectable\`in i&&(i.unselectable=\`on\`),t.getDragDelay()){if(a.isWebKit){this.cancelDrag=!0;var o=t.container;o.draggable=!0}this.setState(\`dragWait\`)}else this.startDrag();this.captureMouse(e,this.onMouseDrag.bind(this)),e.defaultPrevented=!0}}}}).call(l.prototype);function u(e,t,n,r){return Math.sqrt((n-e)**2+(r-t)**2)}t.DragdropHandler=l}),ace.define(\`ace/mouse/touch_handler\`,[\`require\`,\`exports\`,\`module\`,\`ace/mouse/mouse_event\`,\`ace/lib/event\`,\`ace/lib/dom\`],function(e,t,n){var r=e("./mouse_event").MouseEvent,i=e("../lib/event"),a=e("../lib/dom");t.addTouchListeners=function(e,t){var n=\`scroll\`,o,s,c,l,u,d,f=0,p,m=0,h=0,g=0,_,v;function y(){var e=window.navigator&&window.navigator.clipboard,r=!1,i=function(){var n=t.getCopyText(),i=t.session.getUndoManager().hasUndo();v.replaceChild(a.buildDom(r?[\`span\`,!n&&o(\`selectall\`)&&[\`span\`,{class:\`ace_mobile-button\`,action:\`selectall\`},\`Select All\`],n&&o(\`copy\`)&&[\`span\`,{class:\`ace_mobile-button\`,action:\`copy\`},\`Copy\`],n&&o(\`cut\`)&&[\`span\`,{class:\`ace_mobile-button\`,action:\`cut\`},\`Cut\`],e&&o(\`paste\`)&&[\`span\`,{class:\`ace_mobile-button\`,action:\`paste\`},\`Paste\`],i&&o(\`undo\`)&&[\`span\`,{class:\`ace_mobile-button\`,action:\`undo\`},\`Undo\`],o(\`find\`)&&[\`span\`,{class:\`ace_mobile-button\`,action:\`find\`},\`Find\`],o(\`openCommandPalette\`)&&[\`span\`,{class:\`ace_mobile-button\`,action:\`openCommandPalette\`},\`Palette\`]]:[\`span\`]),v.firstChild)},o=function(e){return t.commands.canExecute(e,t)},s=function(n){var a=n.target.getAttribute(\`action\`);if(a==\`more\`||!r)return r=!r,i();a==\`paste\`?e.readText().then(function(e){t.execCommand(a,e)}):a&&((a==\`cut\`||a==\`copy\`)&&(e?e.writeText(t.getCopyText()):document.execCommand(\`copy\`)),t.execCommand(a)),v.firstChild.style.display=\`none\`,r=!1,a!=\`openCommandPalette\`&&t.focus()};v=a.buildDom([\`div\`,{class:\`ace_mobile-menu\`,onclick:s},[\`span\`],[\`span\`,{class:\`ace_mobile-button\`,action:\`more\`},\`...\`]],t.container),v.addEventListener(\`touchstart\`,function(e){n=\`menu\`,e.stopPropagation(),e.preventDefault(),t.textInput.focus()}),v.addEventListener(\`touchend\`,function(e){e.stopPropagation(),e.preventDefault(),s(e)})}function b(){if(!t.getOption(\`enableMobileMenu\`)){v&&x();return}v||y();var e=t.selection.cursor,n=t.renderer.textToScreenCoordinates(e.row,e.column),r=t.renderer.textToScreenCoordinates(0,0).pageX,i=t.renderer.scrollLeft,a=t.container.getBoundingClientRect();v.style.top=n.pageY-a.top-3+\`px\`,n.pageX-a.left<a.width-70?(v.style.left=\`\`,v.style.right=\`10px\`):(v.style.right=\`\`,v.style.left=r+i-a.left+\`px\`),v.style.display=\`\`,v.firstChild.style.display=\`none\`,t.on(\`input\`,x)}function x(e){v&&(v.style.display=\`none\`),t.off(\`input\`,x)}function S(){u=null,clearTimeout(u);var e=t.selection.getRange(),r=e.contains(p.row,p.column);(e.isEmpty()||!r)&&(t.selection.moveToPosition(p),t.selection.selectWord()),n=\`wait\`,b()}function C(){u=null,clearTimeout(u),t.selection.moveToPosition(p);var e=m>=2?t.selection.getLineRange(p.row):t.session.getBracketRange(p);e&&!e.isEmpty()?t.selection.setRange(e):t.selection.selectWord(),n=\`wait\`}i.addListener(e,\`contextmenu\`,function(e){_&&t.textInput.getElement().focus()},t),i.addListener(e,\`touchstart\`,function(e){var i=e.touches;if(u||i.length>1){clearTimeout(u),u=null,c=-1,n=\`zoom\`;return}_=t.$mouseHandler.isMousePressed=!0;var a=t.renderer.layerConfig.lineHeight,d=t.renderer.layerConfig.lineHeight,v=e.timeStamp;l=v;var y=i[0],b=y.clientX,x=y.clientY;if(Math.abs(o-b)+Math.abs(s-x)>a&&(c=-1),o=e.clientX=b,s=e.clientY=x,h=g=0,p=new r(e,t).getDocumentPosition(),v-c<500&&i.length==1&&!f)m++,e.preventDefault(),e.button=0,C();else{m=0;var w=t.selection.cursor,T=t.selection.isEmpty()?w:t.selection.anchor,E=t.renderer.$cursorLayer.getPixelPosition(w,!0),D=t.renderer.$cursorLayer.getPixelPosition(T,!0),O=t.renderer.scroller.getBoundingClientRect(),k=t.renderer.layerConfig.offset,A=t.renderer.scrollLeft,j=function(e,t){return e/=d,t=t/a-.75,e*e+t*t};if(e.clientX<O.left){n=\`zoom\`;return}var M=j(e.clientX-O.left-E.left+A,e.clientY-O.top-E.top+k),N=j(e.clientX-O.left-D.left+A,e.clientY-O.top-D.top+k);M<3.5&&N<3.5&&(n=M>N?\`cursor\`:\`anchor\`),n=N<3.5?\`anchor\`:M<3.5?\`cursor\`:\`scroll\`,u=setTimeout(S,450)}c=v},t),i.addListener(e,\`touchend\`,function(e){_=t.$mouseHandler.isMousePressed=!1,d&&clearInterval(d),n==\`zoom\`?(n=\`\`,f=0):u?(t.selection.moveToPosition(p),f=0,b()):n==\`scroll\`?(w(),x()):b(),clearTimeout(u),u=null},t),i.addListener(e,\`touchmove\`,function(e){u&&=(clearTimeout(u),null);var i=e.touches;if(!(i.length>1||n==\`zoom\`)){var a=i[0],c=o-a.clientX,d=s-a.clientY;if(n==\`wait\`)if(c*c+d*d>4)n=\`cursor\`;else return e.preventDefault();o=a.clientX,s=a.clientY,e.clientX=a.clientX,e.clientY=a.clientY;var f=e.timeStamp,p=f-l;if(l=f,n==\`scroll\`){var m=new r(e,t);m.speed=1,m.wheelX=c,m.wheelY=d,10*Math.abs(c)<Math.abs(d)&&(c=0),10*Math.abs(d)<Math.abs(c)&&(d=0),p!=0&&(h=c/p,g=d/p),t._emit(\`mousewheel\`,m),m.propagationStopped||(h=g=0)}else{var _=new r(e,t).getDocumentPosition();n==\`cursor\`?t.selection.moveCursorToPosition(_):n==\`anchor\`&&t.selection.setSelectionAnchor(_.row,_.column),t.renderer.scrollCursorIntoView(_),e.preventDefault()}}},t);function w(){f+=60,d=setInterval(function(){f--<=0&&(clearInterval(d),d=null),Math.abs(h)<.01&&(h=0),Math.abs(g)<.01&&(g=0),f<20&&(h=.9*h),f<20&&(g=.9*g);var e=t.session.getScrollTop();t.renderer.scrollBy(10*h,10*g),e==t.session.getScrollTop()&&(f=0)},10)}}}),ace.define(\`ace/mouse/mouse_handler\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/event\`,\`ace/lib/useragent\`,\`ace/mouse/default_handlers\`,\`ace/mouse/default_gutter_handler\`,\`ace/mouse/mouse_event\`,\`ace/mouse/dragdrop_handler\`,\`ace/mouse/touch_handler\`,\`ace/config\`],function(e,t,n){var r=e("../lib/event"),i=e("../lib/useragent"),a=e("./default_handlers").DefaultHandlers,o=e("./default_gutter_handler").GutterHandler,s=e("./mouse_event").MouseEvent,c=e("./dragdrop_handler").DragdropHandler,l=e("./touch_handler").addTouchListeners,u=e("../config"),d=function(){function e(e){this.$dragDelay,this.$dragEnabled,this.$mouseMoved,this.mouseEvent,this.$focusTimeout;var t=this;this.editor=e,new a(this),new o(this),new c(this);var n=function(t){(!document.hasFocus||!document.hasFocus()||!e.isFocused()&&document.activeElement==(e.textInput&&e.textInput.getElement()))&&window.focus(),e.focus(),setTimeout(function(){e.isFocused()||e.focus()})},s=e.renderer.getMouseEventTarget();r.addListener(s,\`click\`,this.onMouseEvent.bind(this,\`click\`),e),r.addListener(s,\`mousemove\`,this.onMouseMove.bind(this,\`mousemove\`),e),r.addMultiMouseDownListener([s,e.renderer.scrollBarV&&e.renderer.scrollBarV.inner,e.renderer.scrollBarH&&e.renderer.scrollBarH.inner,e.textInput&&e.textInput.getElement()].filter(Boolean),[400,300,250],this,\`onMouseEvent\`,e),r.addMouseWheelListener(e.container,this.onMouseWheel.bind(this,\`mousewheel\`),e),l(e.container,e);var u=e.renderer.$gutter;r.addListener(u,\`mousedown\`,this.onMouseEvent.bind(this,\`guttermousedown\`),e),r.addListener(u,\`click\`,this.onMouseEvent.bind(this,\`gutterclick\`),e),r.addListener(u,\`dblclick\`,this.onMouseEvent.bind(this,\`gutterdblclick\`),e),r.addListener(u,\`mousemove\`,this.onMouseEvent.bind(this,\`guttermousemove\`),e),r.addListener(s,\`mousedown\`,n,e),r.addListener(u,\`mousedown\`,n,e),i.isIE&&e.renderer.scrollBarV&&(r.addListener(e.renderer.scrollBarV.element,\`mousedown\`,n,e),r.addListener(e.renderer.scrollBarH.element,\`mousedown\`,n,e)),e.on(\`mousemove\`,function(n){if(!(t.state||t.$dragDelay||!t.$dragEnabled)){var r=e.renderer.screenToTextCoordinates(n.x,n.y),i=e.session.selection.getRange(),a=e.renderer;!i.isEmpty()&&i.insideStart(r.row,r.column)?a.setCursorStyle(\`default\`):a.setCursorStyle(\`\`)}},e)}return e.prototype.onMouseEvent=function(e,t){this.editor.session&&this.editor._emit(e,new s(t,this.editor))},e.prototype.onMouseMove=function(e,t){var n=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;!n||!n.length||this.editor._emit(e,new s(t,this.editor))},e.prototype.onMouseWheel=function(e,t){var n=new s(t,this.editor);n.speed=this.$scrollSpeed*2,n.wheelX=t.wheelX,n.wheelY=t.wheelY,this.editor._emit(e,n)},e.prototype.setState=function(e){this.state=e},e.prototype.captureMouse=function(e,t){this.x=e.x,this.y=e.y,this.isMousePressed=!0;var n=this.editor,a=this.editor.renderer;a.$isMousePressed=!0;var o=this,c=!0,l=function(e){if(e){if(i.isWebKit&&!e.which&&o.releaseMouse)return o.releaseMouse();o.x=e.clientX,o.y=e.clientY,t&&t(e),o.mouseEvent=new s(e,o.editor),o.$mouseMoved=!0}},u=function(e){n.off(\`beforeEndOperation\`,p),c=!1,n.session&&d(),o[o.state+\`End\`]&&o[o.state+\`End\`](e),o.state=\`\`,o.isMousePressed=a.$isMousePressed=!1,a.$keepTextAreaAtCursor&&a.$moveTextAreaToCursor(),o.$onCaptureMouseMove=o.releaseMouse=null,e&&o.onMouseEvent(\`mouseup\`,e),n.endOperation()},d=function(){o[o.state]&&o[o.state](),o.$mouseMoved=!1},f=function(){c&&(d(),r.nextFrame(f))};if(i.isOldIE&&e.domEvent.type==\`dblclick\`)return setTimeout(function(){u(e)});var p=function(e){o.releaseMouse&&n.curOp.command.name&&n.curOp.selectionChanged&&(o[o.state+\`End\`]&&o[o.state+\`End\`](),o.state=\`\`,o.releaseMouse())};n.on(\`beforeEndOperation\`,p),n.startOperation({command:{name:\`mouse\`}}),o.$onCaptureMouseMove=l,o.releaseMouse=r.capture(this.editor.container,l,u),f()},e.prototype.cancelContextMenu=function(){var e=function(t){t&&t.domEvent&&t.domEvent.type!=\`contextmenu\`||(this.editor.off(\`nativecontextmenu\`,e),t&&t.domEvent&&r.stopEvent(t.domEvent))}.bind(this);setTimeout(e,10),this.editor.on(\`nativecontextmenu\`,e)},e.prototype.destroy=function(){this.releaseMouse&&this.releaseMouse(),this.$tooltip&&this.$tooltip.destroy()},e}();d.prototype.releaseMouse=null,u.defineOptions(d.prototype,\`mouseHandler\`,{scrollSpeed:{initialValue:2},dragDelay:{initialValue:i.isMac?150:0},dragEnabled:{initialValue:!0},focusTimeout:{initialValue:0}}),t.MouseHandler=d}),ace.define(\`ace/mouse/fold_handler\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/dom\`],function(e,t,n){var r=e("../lib/dom");t.FoldHandler=function(){function e(e){e.on(\`click\`,function(t){var n=t.getDocumentPosition(),i=e.session,a=i.getFoldAt(n.row,n.column,1);a&&(t.getAccelKey()?i.removeFold(a):i.expandFold(a),t.stop());var o=t.domEvent&&t.domEvent.target;o&&r.hasCssClass(o,\`ace_inline_button\`)&&r.hasCssClass(o,\`ace_toggle_wrap\`)&&(i.setOption(\`wrap\`,!i.getUseWrapMode()),e.renderer.scrollCursorIntoView())}),e.on(\`gutterclick\`,function(t){if(e.renderer.$gutterLayer.getRegion(t)==\`foldWidgets\`){var n=t.getDocumentPosition().row,r=e.session;r.foldWidgets&&r.foldWidgets[n]&&e.session.onFoldWidgetClick(n,t),e.isFocused()||e.focus(),t.stop()}}),e.on(\`gutterdblclick\`,function(t){if(e.renderer.$gutterLayer.getRegion(t)==\`foldWidgets\`){var n=t.getDocumentPosition().row,r=e.session,i=r.getParentFoldRangeData(n,!0),a=i.range||i.firstRange;if(a){n=a.start.row;var o=r.getFoldAt(n,r.getLine(n).length,1);o?r.removeFold(o):(r.addFold(\`...\`,a),e.renderer.scrollCursorIntoView({row:a.start.row,column:0}))}t.stop()}})}return e}()}),ace.define(\`ace/keyboard/keybinding\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/keys\`,\`ace/lib/event\`],function(e,t,n){var r=e("../lib/keys"),i=e("../lib/event");t.KeyBinding=function(){function e(e){this.$editor=e,this.$data={editor:e},this.$handlers=[],this.setDefaultHandler(e.commands)}return e.prototype.setDefaultHandler=function(e){this.removeKeyboardHandler(this.$defaultHandler),this.$defaultHandler=e,this.addKeyboardHandler(e,0)},e.prototype.setKeyboardHandler=function(e){var t=this.$handlers;if(t[t.length-1]!=e){for(;t[t.length-1]&&t[t.length-1]!=this.$defaultHandler;)this.removeKeyboardHandler(t[t.length-1]);this.addKeyboardHandler(e,1)}},e.prototype.addKeyboardHandler=function(e,t){if(e){typeof e==\`function\`&&!e.handleKeyboard&&(e.handleKeyboard=e);var n=this.$handlers.indexOf(e);n!=-1&&this.$handlers.splice(n,1),t==null?this.$handlers.push(e):this.$handlers.splice(t,0,e),n==-1&&e.attach&&e.attach(this.$editor)}},e.prototype.removeKeyboardHandler=function(e){var t=this.$handlers.indexOf(e);return t==-1?!1:(this.$handlers.splice(t,1),e.detach&&e.detach(this.$editor),!0)},e.prototype.getKeyboardHandler=function(){return this.$handlers[this.$handlers.length-1]},e.prototype.getStatusText=function(){var e=this.$data,t=e.editor;return this.$handlers.map(function(n){return n.getStatusText&&n.getStatusText(t,e)||\`\`}).filter(Boolean).join(\` \`)},e.prototype.$callKeyboardHandlers=function(e,t,n,r){for(var a,o=!1,s=this.$editor.commands,c=this.$handlers.length;c--&&(a=this.$handlers[c].handleKeyboard(this.$data,e,t,n,r),!(!(!a||!a.command)&&(o=a.command==\`null\`?!0:s.exec(a.command,this.$editor,a.args,r),o&&r&&e!=-1&&a.passEvent!=1&&a.command.passEvent!=1&&i.stopEvent(r),o))););return!o&&e==-1&&(a={command:\`insertstring\`},o=s.exec(\`insertstring\`,this.$editor,t)),o&&this.$editor._signal&&this.$editor._signal(\`keyboardActivity\`,a),o},e.prototype.onCommandKey=function(e,t,n){var i=r.keyCodeToString(n);return this.$callKeyboardHandlers(t,i,n,e)},e.prototype.onTextInput=function(e){return this.$callKeyboardHandlers(-1,e)},e}()}),ace.define(\`ace/lib/bidiutil\`,[\`require\`,\`exports\`,\`module\`],function(e,t,n){var r=0,i=0,a=!1,o=!1,s=!1,c=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],l=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],u=0,d=1,f=0,p=1,m=2,h=3,g=4,_=5,v=6,y=7,b=8,x=9,S=10,C=11,w=12,T=13,E=14,D=15,O=16,k=17,A=18,j=[A,A,A,A,A,A,A,A,A,v,_,v,b,_,A,A,A,A,A,A,A,A,A,A,A,A,A,A,_,_,_,v,b,g,g,C,C,C,g,g,g,g,g,S,x,S,x,x,m,m,m,m,m,m,m,m,m,m,x,g,g,g,g,g,g,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,g,g,g,g,g,g,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,g,g,g,g,A,A,A,A,A,A,_,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,x,g,C,C,C,C,g,g,g,g,f,g,g,A,g,g,C,C,m,m,g,f,g,g,g,m,f,g,g,g,g,g],M=[b,b,b,b,b,b,b,b,b,b,b,A,A,A,f,p,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,b,_,T,E,D,O,k,x,C,C,C,C,C,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,x,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,b];function N(e,t,n,u){var d=r?l:c,f=null,p=null,m=null,h=0,g=null,y=null,x=-1,S=null,C=null,w=[];if(!u)for(S=0,u=[];S<n;S++)u[S]=F(e[S]);for(i=r,a=!1,o=!1,s=!1,C=0;C<n;C++){if(f=h,w[C]=p=ee(e,u,w,C),h=d[f][p],g=h&240,h&=15,t[C]=m=d[h][5],g>0)if(g==16){for(S=x;S<C;S++)t[S]=1;x=-1}else x=-1;if(y=d[h][6],y)x==-1&&(x=C);else if(x>-1){for(S=x;S<C;S++)t[S]=m;x=-1}u[C]==_&&(t[C]=0),i|=m}if(s){for(S=0;S<n;S++)if(u[S]==v){t[S]=r;for(var T=S-1;T>=0&&u[T]==b;T--)t[T]=r}}}function P(e,t,n){if(!(i<e)){if(e==1&&r==d&&!o){n.reverse();return}for(var a=n.length,s=0,c,l,u,f;s<a;){if(t[s]>=e){for(c=s+1;c<a&&t[c]>=e;)c++;for(l=s,u=c-1;l<u;l++,u--)f=n[l],n[l]=n[u],n[u]=f;s=c}s++}}}function ee(e,t,n,i){var c=t[i],l,u,d,j;switch(c){case f:case p:a=!1;case g:case h:return c;case m:return a?h:m;case y:return a=!0,p;case b:return g;case x:return i<1||i+1>=t.length||(l=n[i-1])!=m&&l!=h||(u=t[i+1])!=m&&u!=h?g:(a&&(u=h),u==l?u:g);case S:return l=i>0?n[i-1]:_,l==m&&i+1<t.length&&t[i+1]==m?m:g;case C:if(i>0&&n[i-1]==m)return m;if(a)return g;for(j=i+1,d=t.length;j<d&&t[j]==C;)j++;return j<d&&t[j]==m?m:g;case w:for(d=t.length,j=i+1;j<d&&t[j]==w;)j++;if(j<d){var M=e[i],N=M>=1425&&M<=2303||M==64286;if(l=t[j],N&&(l==p||l==y))return p}return i<1||(l=t[i-1])==_?g:n[i-1];case _:return a=!1,o=!0,r;case v:return s=!0,g;case T:case E:case O:case k:case D:a=!1;case A:return g}}function F(e){var t=e.charCodeAt(0),n=t>>8;return n==0?t>191?f:j[t]:n==5?/[\\u0591-\\u05f4]/.test(e)?p:f:n==6?/[\\u0610-\\u061a\\u064b-\\u065f\\u06d6-\\u06e4\\u06e7-\\u06ed]/.test(e)?w:/[\\u0660-\\u0669\\u066b-\\u066c]/.test(e)?h:t==1642?C:/[\\u06f0-\\u06f9]/.test(e)?m:y:n==32&&t<=8287?M[t&255]:n==254&&t>=65136?y:g}t.L=f,t.R=p,t.EN=m,t.ON_R=3,t.AN=4,t.R_H=5,t.B=6,t.RLE=7,t.DOT=\`·\`,t.doBidiReorder=function(e,n,i){if(e.length<2)return{};var a=e.split(\`\`),o=Array(a.length),s=Array(a.length),c=[];r=i?d:u,N(a,c,a.length,n);for(var l=0;l<o.length;o[l]=l,l++);P(2,c,o),P(1,c,o);for(var l=0;l<o.length-1;l++)n[l]===h?c[l]=t.AN:c[l]===p&&(n[l]>y&&n[l]<T||n[l]===g||n[l]===A)?c[l]=t.ON_R:l>0&&a[l-1]===\`ل\`&&/\\u0622|\\u0623|\\u0625|\\u0627/.test(a[l])&&(c[l-1]=c[l]=t.R_H,l++);a[a.length-1]===t.DOT&&(c[a.length-1]=t.B),a[0]===\`‫\`&&(c[0]=t.RLE);for(var l=0;l<o.length;l++)s[l]=c[o[l]];return{logicalFromVisual:o,bidiLevels:s}},t.hasBidiCharacters=function(e,t){for(var n=!1,r=0;r<e.length;r++)t[r]=F(e.charAt(r)),!n&&(t[r]==p||t[r]==y||t[r]==h)&&(n=!0);return n},t.getVisualFromLogicalIdx=function(e,t){for(var n=0;n<t.logicalFromVisual.length;n++)if(t.logicalFromVisual[n]==e)return n;return 0}}),ace.define(\`ace/bidihandler\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/bidiutil\`,\`ace/lib/lang\`],function(e,t,n){var r=e("./lib/bidiutil"),i=e("./lib/lang"),a=/[\\u0590-\\u05f4\\u0600-\\u06ff\\u0700-\\u08ac\\u202B]/;t.BidiHandler=function(){function e(e){this.session=e,this.bidiMap={},this.currentRow=null,this.bidiUtil=r,this.charWidths=[],this.EOL=\`¬\`,this.showInvisibles=!0,this.isRtlDir=!1,this.$isRtl=!1,this.line=\`\`,this.wrapIndent=0,this.EOF=\`¶\`,this.RLE=\`‫\`,this.contentWidth=0,this.fontMetrics=null,this.rtlLineOffset=0,this.wrapOffset=0,this.isMoveLeftOperation=!1,this.seenBidi=a.test(e.getValue())}return e.prototype.isBidiRow=function(e,t,n){return this.seenBidi?(e!==this.currentRow&&(this.currentRow=e,this.updateRowLine(t,n),this.updateBidiMap()),this.bidiMap.bidiLevels):!1},e.prototype.onChange=function(e){this.seenBidi?this.currentRow=null:e.action==\`insert\`&&a.test(e.lines.join(\`
201
+ \`;p!=this.lastValue&&(this.text.value=this.lastValue=p,this.lastSelectionStart=this.lastSelectionEnd=p.length)}if(this.afterContextMenu&&(this.lastSelectionStart=this.text.selectionStart,this.lastSelectionEnd=this.text.selectionEnd),this.lastSelectionEnd!=n||this.lastSelectionStart!=t||this.text.selectionEnd!=this.lastSelectionEnd)try{this.text.setSelectionRange(t,n),this.lastSelectionStart=t,this.lastSelectionEnd=n}catch{}this.inComposition=!1}},e.prototype.setHost=function(e){this.host=e},e.prototype.setNumberOfExtraLines=function(e){if(this.rowStart=2**53-1,this.rowEnd=-(2**53-1),e<0){this.numberOfExtraLines=0;return}this.numberOfExtraLines=e},e.prototype.setAriaLabel=function(){var e=\`\`;if(this.host.$textInputAriaLabel&&(e+=\`\${this.host.$textInputAriaLabel}, \`),this.host.session){var t=this.host.session.selection.cursor.row;e+=i(\`text-input.aria-label\`,\`Cursor at row $0\`,[t+1])}this.text.setAttribute(\`aria-label\`,e)},e.prototype.setAriaOptions=function(e){e.activeDescendant?(this.text.setAttribute(\`aria-haspopup\`,\`true\`),this.text.setAttribute(\`aria-autocomplete\`,e.inline?\`both\`:\`list\`),this.text.setAttribute(\`aria-activedescendant\`,e.activeDescendant)):(this.text.setAttribute(\`aria-haspopup\`,\`false\`),this.text.setAttribute(\`aria-autocomplete\`,\`both\`),this.text.removeAttribute(\`aria-activedescendant\`)),e.role&&this.text.setAttribute(\`role\`,e.role),e.setLabel&&(this.text.setAttribute(\`aria-roledescription\`,i(\`text-input.aria-roledescription\`,\`editor\`)),this.setAriaLabel())},e.prototype.focus=function(){var e=this;if(this.setAriaOptions({setLabel:this.host.renderer.enableKeyboardAccessibility}),this.tempStyle||d||this.$focusScroll==\`browser\`)return this.text.focus({preventScroll:!0});var t=this.text.style.top;this.text.style.position=\`fixed\`,this.text.style.top=\`0px\`;try{var n=this.text.getBoundingClientRect().top!=0}catch{return}var r=[];if(n)for(var i=this.text.parentElement;i&&i.nodeType==1;)r.push(i),i.setAttribute(\`ace_nocontext\`,\`true\`),i=!i.parentElement&&i.getRootNode?i.getRootNode().host:i.parentElement;this.text.focus({preventScroll:!0}),n&&r.forEach(function(e){e.removeAttribute(\`ace_nocontext\`)}),setTimeout(function(){e.text.style.position=\`\`,e.text.style.top==\`0px\`&&(e.text.style.top=t)},0)},e.prototype.blur=function(){this.text.blur()},e.prototype.isFocused=function(){return this.$isFocused},e.prototype.setInputHandler=function(e){this.inputHandler=e},e.prototype.getInputHandler=function(){return this.inputHandler},e.prototype.getElement=function(){return this.text},e.prototype.setCommandMode=function(e){this.commandMode=e,this.text.readOnly=!1},e.prototype.setReadOnly=function(e){this.commandMode||(this.text.readOnly=e)},e.prototype.setCopyWithEmptySelection=function(e){},e.prototype.onContextMenu=function(e){this.afterContextMenu=!0,this.resetSelection(),this.host._emit(\`nativecontextmenu\`,{target:this.host,domEvent:e}),this.moveToMouse(e,!0)},e.prototype.moveToMouse=function(e,t){var n=this;this.tempStyle||=this.text.style.cssText,this.text.style.cssText=(t?\`z-index:100000;\`:\`\`)+(a.isIE?\`opacity:0.1;\`:\`\`)+\`text-indent: -\`+(this.lastSelectionStart+this.lastSelectionEnd)*this.host.renderer.characterWidth*.5+\`px;\`;var i=this.host.container.getBoundingClientRect(),s=o.computedStyle(this.host.container),c=i.top+(parseInt(s.borderTopWidth)||0),l=i.left+(parseInt(s.borderLeftWidth)||0),u=i.bottom-c-this.text.clientHeight-2,d=function(e){o.translate(n.text,e.clientX-l-2,Math.min(e.clientY-c-2,u))};d(e),e.type==\`mousedown\`&&(this.host.renderer.$isMousePressed=!0,clearTimeout(this.closeTimeout),a.isWin&&r.capture(this.host.container,d,this.onContextMenuClose.bind(this)))},e.prototype.destroy=function(){this.text.parentElement&&this.text.parentElement.removeChild(this.text)},e}(),t.$setUserAgentForTests=function(e,t){_=e,h=t}}),ace.define(\`ace/mouse/default_handlers\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/useragent\`],function(e,t,n){var r=e("../lib/useragent"),i=0,a=550,o=function(){function e(e){e.$clickSelection=null;var t=e.editor;t.setDefaultHandler(\`mousedown\`,this.onMouseDown.bind(e)),t.setDefaultHandler(\`dblclick\`,this.onDoubleClick.bind(e)),t.setDefaultHandler(\`tripleclick\`,this.onTripleClick.bind(e)),t.setDefaultHandler(\`quadclick\`,this.onQuadClick.bind(e)),t.setDefaultHandler(\`mousewheel\`,this.onMouseWheel.bind(e)),[\`select\`,\`startSelect\`,\`selectEnd\`,\`selectAllEnd\`,\`selectByWordsEnd\`,\`selectByLinesEnd\`,\`dragWait\`,\`dragWaitEnd\`,\`focusWait\`].forEach(function(t){e[t]=this[t]},this),e.selectByLines=this.extendSelectionBy.bind(e,\`getLineRange\`),e.selectByWords=this.extendSelectionBy.bind(e,\`getWordRange\`)}return e.prototype.onMouseDown=function(e){var t=e.inSelection(),n=e.getDocumentPosition();this.mousedownEvent=e;var i=this.editor,a=e.getButton();if(a!==0){(i.getSelectionRange().isEmpty()||a==1)&&i.selection.moveToPosition(n),a==2&&(i.textInput.onContextMenu(e.domEvent),r.isMozilla||e.preventDefault());return}if(this.mousedownEvent.time=Date.now(),t&&!i.isFocused()&&(i.focus(),this.$focusTimeout&&!this.$clickSelection&&!i.inMultiSelectMode)){this.setState(\`focusWait\`),this.captureMouse(e);return}return this.captureMouse(e),this.startSelect(n,e.domEvent._clicks>1),e.preventDefault()},e.prototype.startSelect=function(e,t){e||=this.editor.renderer.screenToTextCoordinates(this.x,this.y);var n=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?n.selection.selectToPosition(e):t||n.selection.moveToPosition(e),t||this.select(),n.setStyle(\`ace_selecting\`),this.setState(\`select\`))},e.prototype.select=function(){var e,t=this.editor,n=t.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var r=this.$clickSelection.comparePoint(n);if(r==-1)e=this.$clickSelection.end;else if(r==1)e=this.$clickSelection.start;else{var i=c(this.$clickSelection,n,t.session);n=i.cursor,e=i.anchor}t.selection.setSelectionAnchor(e.row,e.column)}t.selection.selectToPosition(n),t.renderer.scrollCursorIntoView()},e.prototype.extendSelectionBy=function(e){var t,n=this.editor,r=n.renderer.screenToTextCoordinates(this.x,this.y),i=n.selection[e](r.row,r.column);if(this.$clickSelection){var a=this.$clickSelection.comparePoint(i.start),o=this.$clickSelection.comparePoint(i.end);if(a==-1&&o<=0)t=this.$clickSelection.end,(i.end.row!=r.row||i.end.column!=r.column)&&(r=i.start);else if(o==1&&a>=0)t=this.$clickSelection.start,(i.start.row!=r.row||i.start.column!=r.column)&&(r=i.end);else if(a==-1&&o==1)r=i.end,t=i.start;else{var s=c(this.$clickSelection,r,n.session);r=s.cursor,t=s.anchor}n.selection.setSelectionAnchor(t.row,t.column)}n.selection.selectToPosition(r),n.renderer.scrollCursorIntoView()},e.prototype.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle(\`ace_selecting\`)},e.prototype.focusWait=function(){(s(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>i||Date.now()-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},e.prototype.onDoubleClick=function(e){var t=e.getDocumentPosition(),n=this.editor,r=n.session.getBracketRange(t);r?(r.isEmpty()&&(r.start.column--,r.end.column++),this.setState(\`select\`)):(r=n.selection.getWordRange(t.row,t.column),this.setState(\`selectByWords\`)),this.$clickSelection=r,this.select()},e.prototype.onTripleClick=function(e){var t=e.getDocumentPosition(),n=this.editor;this.setState(\`selectByLines\`);var r=n.getSelectionRange();r.isMultiLine()&&r.contains(t.row,t.column)?(this.$clickSelection=n.selection.getLineRange(r.start.row),this.$clickSelection.end=n.selection.getLineRange(r.end.row).end):this.$clickSelection=n.selection.getLineRange(t.row),this.select()},e.prototype.onQuadClick=function(e){var t=this.editor;t.selectAll(),this.$clickSelection=t.getSelectionRange(),this.setState(\`selectAll\`)},e.prototype.onMouseWheel=function(e){if(!e.getAccelKey()){e.getShiftKey()&&e.wheelY&&!e.wheelX&&(e.wheelX=e.wheelY,e.wheelY=0);var t=this.editor;this.$lastScroll||={t:0,vx:0,vy:0,allowed:0};var n=this.$lastScroll,r=e.domEvent.timeStamp,i=r-n.t,o=i?e.wheelX/i:n.vx,s=i?e.wheelY/i:n.vy;i<a&&(o=(o+n.vx)/2,s=(s+n.vy)/2);var c=Math.abs(o/s),l=!1;if(c>=1&&t.renderer.isScrollableBy(e.wheelX*e.speed,0)&&(l=!0),c<=1&&t.renderer.isScrollableBy(0,e.wheelY*e.speed)&&(l=!0),l?n.allowed=r:r-n.allowed<a&&(Math.abs(o)<=1.5*Math.abs(n.vx)&&Math.abs(s)<=1.5*Math.abs(n.vy)?(l=!0,n.allowed=r):n.allowed=0),n.t=r,n.vx=o,n.vy=s,l)return t.renderer.scrollBy(e.wheelX*e.speed,e.wheelY*e.speed),e.stop()}},e}();o.prototype.selectEnd=o.prototype.selectByLinesEnd,o.prototype.selectAllEnd=o.prototype.selectByLinesEnd,o.prototype.selectByWordsEnd=o.prototype.selectByLinesEnd,t.DefaultHandlers=o;function s(e,t,n,r){return Math.sqrt((n-e)**2+(r-t)**2)}function c(e,t,n){if(e.start.row==e.end.row)var r=2*t.column-e.start.column-e.end.column;else if(e.start.row==e.end.row-1&&!e.start.column&&!e.end.column)var r=3*t.column-2*n.getLine(e.start.row).length;else var r=2*t.row-e.start.row-e.end.row;return r<0?{cursor:e.start,anchor:e.end}:{cursor:e.end,anchor:e.start}}}),ace.define(\`ace/mouse/mouse_event\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/event\`,\`ace/lib/useragent\`],function(e,t,n){var r=e("../lib/event"),i=e("../lib/useragent");t.MouseEvent=function(){function e(e,t){this.speed,this.wheelX,this.wheelY,this.domEvent=e,this.editor=t,this.x=this.clientX=e.clientX,this.y=this.clientY=e.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1}return e.prototype.stopPropagation=function(){r.stopPropagation(this.domEvent),this.propagationStopped=!0},e.prototype.preventDefault=function(){r.preventDefault(this.domEvent),this.defaultPrevented=!0},e.prototype.stop=function(){this.stopPropagation(),this.preventDefault()},e.prototype.getDocumentPosition=function(){return this.$pos||=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY),this.$pos},e.prototype.getGutterRow=function(){var e=this.getDocumentPosition().row;return this.editor.session.documentToScreenRow(e,0)-this.editor.session.documentToScreenRow(this.editor.renderer.$gutterLayer.$lines.get(0).row,0)},e.prototype.inSelection=function(){if(this.$inSelection!==null)return this.$inSelection;var e=this.editor.getSelectionRange();if(e.isEmpty())this.$inSelection=!1;else{var t=this.getDocumentPosition();this.$inSelection=e.contains(t.row,t.column)}return this.$inSelection},e.prototype.getButton=function(){return r.getButton(this.domEvent)},e.prototype.getShiftKey=function(){return this.domEvent.shiftKey},e.prototype.getAccelKey=function(){return i.isMac?this.domEvent.metaKey:this.domEvent.ctrlKey},e}()}),ace.define(\`ace/lib/scroll\`,[\`require\`,\`exports\`,\`module\`],function(e,t,n){t.preventParentScroll=function(e){e.stopPropagation();var t=e.currentTarget;t.scrollHeight>t.clientHeight||e.preventDefault()}}),ace.define(\`ace/tooltip\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/dom\`,\`ace/lib/event\`,\`ace/range\`,\`ace/lib/scroll\`],function(e,t,n){var r=this&&this.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=\`function\`&&n!==null)throw TypeError(\`Class extends value \`+String(n)+\` is not a constructor or null\`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),i=this&&this.__values||function(e){var t=typeof Symbol==\`function\`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==\`number\`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?\`Object is not iterable.\`:\`Symbol.iterator is not defined.\`)},a=e("./lib/dom");e("./lib/event");var o=e("./range").Range,s=e("./lib/scroll").preventParentScroll,c=\`ace_tooltip\`,l=function(){function e(e){this.isOpen=!1,this.$element=null,this.$parentNode=e}return e.prototype.$init=function(){return this.$element=a.createElement(\`div\`),this.$element.className=c,this.$element.style.display=\`none\`,this.$parentNode.appendChild(this.$element),this.$element},e.prototype.getElement=function(){return this.$element||this.$init()},e.prototype.setText=function(e){this.getElement().textContent=e},e.prototype.setHtml=function(e){this.getElement().innerHTML=e},e.prototype.setPosition=function(e,t){this.getElement().style.left=e+\`px\`,this.getElement().style.top=t+\`px\`},e.prototype.setClassName=function(e){a.addCssClass(this.getElement(),e)},e.prototype.setTheme=function(e){this.theme&&(this.theme.isDark&&a.removeCssClass(this.getElement(),\`ace_dark\`),this.theme.cssClass&&a.removeCssClass(this.getElement(),this.theme.cssClass)),e.isDark&&a.addCssClass(this.getElement(),\`ace_dark\`),e.cssClass&&a.addCssClass(this.getElement(),e.cssClass),this.theme={isDark:e.isDark,cssClass:e.cssClass}},e.prototype.show=function(e,t,n){e!=null&&this.setText(e),t!=null&&n!=null&&this.setPosition(t,n),this.isOpen||=(this.getElement().style.display=\`block\`,!0)},e.prototype.hide=function(e){this.isOpen&&=(this.getElement().style.display=\`none\`,this.getElement().className=c,!1)},e.prototype.getHeight=function(){return this.getElement().offsetHeight},e.prototype.getWidth=function(){return this.getElement().offsetWidth},e.prototype.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)},e}(),u=new(function(){function e(){this.popups=[]}return e.prototype.addPopup=function(e){this.popups.push(e),this.updatePopups()},e.prototype.removePopup=function(e){var t=this.popups.indexOf(e);t!==-1&&(this.popups.splice(t,1),this.updatePopups())},e.prototype.updatePopups=function(){var e,t,n,r;this.popups.sort(function(e,t){return t.priority-e.priority});var a=[];try{for(var o=i(this.popups),s=o.next();!s.done;s=o.next()){var c=s.value,l=!0;try{for(var u=(n=void 0,i(a)),d=u.next();!d.done;d=u.next()){var f=d.value;if(this.doPopupsOverlap(f,c)){l=!1;break}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}l?a.push(c):c.hide()}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}},e.prototype.doPopupsOverlap=function(e,t){var n=e.getElement().getBoundingClientRect(),r=t.getElement().getBoundingClientRect();return n.left<r.right&&n.right>r.left&&n.top<r.bottom&&n.bottom>r.top},e}());t.popupManager=u,t.Tooltip=l,t.HoverTooltip=function(e){r(t,e);function t(t){t===void 0&&(t=document.body);var n=e.call(this,t)||this;n.timeout=void 0,n.lastT=0,n.idleTime=350,n.lastEvent=void 0,n.onMouseOut=n.onMouseOut.bind(n),n.onMouseMove=n.onMouseMove.bind(n),n.waitForHover=n.waitForHover.bind(n),n.hide=n.hide.bind(n);var r=n.getElement();return r.style.whiteSpace=\`pre-wrap\`,r.style.pointerEvents=\`auto\`,r.addEventListener(\`mouseout\`,n.onMouseOut),r.tabIndex=-1,r.addEventListener(\`blur\`,function(){r.contains(document.activeElement)||this.hide()}.bind(n)),r.addEventListener(\`wheel\`,s),n}return t.prototype.addToEditor=function(e){e.on(\`mousemove\`,this.onMouseMove),e.on(\`mousedown\`,this.hide);var t=e.renderer.getMouseEventTarget();t&&typeof t.removeEventListener==\`function\`&&t.addEventListener(\`mouseout\`,this.onMouseOut,!0)},t.prototype.removeFromEditor=function(e){e.off(\`mousemove\`,this.onMouseMove),e.off(\`mousedown\`,this.hide);var t=e.renderer.getMouseEventTarget();t&&typeof t.removeEventListener==\`function\`&&t.removeEventListener(\`mouseout\`,this.onMouseOut,!0),this.timeout&&=(clearTimeout(this.timeout),null)},t.prototype.onMouseMove=function(e,t){this.lastEvent=e,this.lastT=Date.now();var n=t.$mouseHandler.isMousePressed;if(this.isOpen){var r=this.lastEvent&&this.lastEvent.getDocumentPosition();(!this.range||!this.range.contains(r.row,r.column)||n||this.isOutsideOfText(this.lastEvent))&&this.hide()}this.timeout||n||(this.lastEvent=e,this.timeout=setTimeout(this.waitForHover,this.idleTime))},t.prototype.waitForHover=function(){this.timeout&&clearTimeout(this.timeout);var e=Date.now()-this.lastT;if(this.idleTime-e>10){this.timeout=setTimeout(this.waitForHover,this.idleTime-e);return}this.timeout=null,this.lastEvent&&!this.isOutsideOfText(this.lastEvent)&&this.$gatherData(this.lastEvent,this.lastEvent.editor)},t.prototype.isOutsideOfText=function(e){var t=e.editor,n=e.getDocumentPosition(),r=t.session.getLine(n.row);if(n.column==r.length){var i=t.renderer.pixelToScreenCoordinates(e.clientX,e.clientY),a=t.session.documentToScreenPosition(n.row,n.column);if(a.column!=i.column||a.row!=i.row)return!0}return!1},t.prototype.setDataProvider=function(e){this.$gatherData=e},t.prototype.showForRange=function(e,t,n,r){if(!(r&&r!=this.lastEvent)&&!(this.isOpen&&document.activeElement==this.getElement())){var i=e.renderer;this.isOpen||(u.addPopup(this),this.$registerCloseEvents(),this.setTheme(i.theme)),this.isOpen=!0,this.range=o.fromPoints(t.start,t.end);var s=i.textToScreenCoordinates(t.start.row,t.start.column),c=i.scroller.getBoundingClientRect();s.pageX<c.left&&(s.pageX=c.left);var l=this.getElement();l.innerHTML=\`\`,l.appendChild(n),l.style.maxHeight=\`\`,l.style.display=\`block\`,this.$setPosition(e,s,!0,t),a.$fixPositionBug(l)}},t.prototype.$setPosition=function(e,t,n,r){var i=10;n&&this.addMarker(r,e.session);var a=e.renderer,o=this.getElement(),s=o.offsetHeight,c=o.offsetWidth,l=t.pageY,u=t.pageX,d=window.innerHeight-l-a.lineHeight,f=this.$shouldPlaceAbove(s,l,d-i);o.style.maxHeight=(f?l:d)-i+\`px\`,o.style.top=f?\`\`:l+a.lineHeight+\`px\`,o.style.bottom=f?window.innerHeight-l+\`px\`:\`\`,o.style.left=Math.min(u,window.innerWidth-c-i)+\`px\`},t.prototype.$shouldPlaceAbove=function(e,t,n){return!(t-e<0&&t<n)},t.prototype.addMarker=function(e,t){this.marker&&this.$markerSession.removeMarker(this.marker),this.$markerSession=t,this.marker=t&&t.addMarker(e,\`ace_highlight-marker\`,\`text\`)},t.prototype.hide=function(e){e&&this.$fromKeyboard&&e.type==\`keydown\`&&e.code==\`Escape\`||!e&&document.activeElement==this.getElement()||e&&e.target&&(e.type!=\`keydown\`||e.ctrlKey||e.metaKey)&&this.$element.contains(e.target)||(this.lastEvent=null,this.timeout&&clearTimeout(this.timeout),this.timeout=null,this.addMarker(null),this.isOpen&&(this.$fromKeyboard=!1,this.$removeCloseEvents(),this.getElement().style.display=\`none\`,this.isOpen=!1,u.removePopup(this)))},t.prototype.$registerCloseEvents=function(){window.addEventListener(\`keydown\`,this.hide,!0),window.addEventListener(\`wheel\`,this.hide,!0),window.addEventListener(\`mousedown\`,this.hide,!0)},t.prototype.$removeCloseEvents=function(){window.removeEventListener(\`keydown\`,this.hide,!0),window.removeEventListener(\`wheel\`,this.hide,!0),window.removeEventListener(\`mousedown\`,this.hide,!0)},t.prototype.onMouseOut=function(e){this.timeout&&=(clearTimeout(this.timeout),null),this.lastEvent=null,this.isOpen&&(!e.relatedTarget||this.getElement().contains(e.relatedTarget)||e&&e.currentTarget.contains(e.relatedTarget)||e.relatedTarget.classList.contains(\`ace_content\`)||this.hide())},t}(l)}),ace.define(\`ace/mouse/default_gutter_handler\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/dom\`,\`ace/mouse/mouse_event\`,\`ace/tooltip\`,\`ace/config\`,\`ace/range\`],function(e,t,n){var r=this&&this.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=\`function\`&&n!==null)throw TypeError(\`Class extends value \`+String(n)+\` is not a constructor or null\`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),i=this&&this.__values||function(e){var t=typeof Symbol==\`function\`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==\`number\`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?\`Object is not iterable.\`:\`Symbol.iterator is not defined.\`)},a=e("../lib/dom"),o=e("./mouse_event").MouseEvent,s=e("../tooltip").HoverTooltip,c=e("../config").nls,l=e("../range").Range;function u(e){var t=e.editor,n=t.renderer.$gutterLayer;e.$tooltip=new d(t),e.$tooltip.addToEditor(t),e.$tooltip.setDataProvider(function(t,n){var r=t.getDocumentPosition().row;e.$tooltip.showTooltip(r)}),e.editor.setDefaultHandler(\`guttermousedown\`,function(r){if(!(!t.isFocused()||r.getButton()!=0)&&n.getRegion(r)!=\`foldWidgets\`){var i=r.getDocumentPosition().row,a=t.session.selection;if(r.getShiftKey())a.selectTo(i,0);else{if(r.domEvent.detail==2)return t.selectAll(),r.preventDefault();e.$clickSelection=t.selection.getLineRange(i)}return e.setState(\`selectByLines\`),e.captureMouse(r),r.preventDefault()}})}t.GutterHandler=u;var d=function(e){r(t,e);function t(n){var r=e.call(this,n.container)||this;r.id=\`gt\`+ ++t.$uid,r.editor=n,r.visibleTooltipRow;var i=r.getElement();return i.setAttribute(\`role\`,\`tooltip\`),i.setAttribute(\`id\`,r.id),i.style.pointerEvents=\`auto\`,r.idleTime=50,r.onDomMouseMove=r.onDomMouseMove.bind(r),r.onDomMouseOut=r.onDomMouseOut.bind(r),r.setClassName(\`ace_gutter-tooltip\`),r}return t.prototype.onDomMouseMove=function(e){var t=new o(e,this.editor);this.onMouseMove(t,this.editor)},t.prototype.onDomMouseOut=function(e){var t=new o(e,this.editor);this.onMouseOut(t)},t.prototype.addToEditor=function(t){var n=t.renderer.$gutter;n.addEventListener(\`mousemove\`,this.onDomMouseMove),n.addEventListener(\`mouseout\`,this.onDomMouseOut),e.prototype.addToEditor.call(this,t)},t.prototype.removeFromEditor=function(t){var n=t.renderer.$gutter;n.removeEventListener(\`mousemove\`,this.onDomMouseMove),n.removeEventListener(\`mouseout\`,this.onDomMouseOut),e.prototype.removeFromEditor.call(this,t)},t.prototype.destroy=function(){this.editor&&this.removeFromEditor(this.editor),e.prototype.destroy.call(this)},Object.defineProperty(t,"annotationLabels",{get:function(){return{error:{singular:c(\`gutter-tooltip.aria-label.error.singular\`,\`error\`),plural:c(\`gutter-tooltip.aria-label.error.plural\`,\`errors\`)},security:{singular:c(\`gutter-tooltip.aria-label.security.singular\`,\`security finding\`),plural:c(\`gutter-tooltip.aria-label.security.plural\`,\`security findings\`)},warning:{singular:c(\`gutter-tooltip.aria-label.warning.singular\`,\`warning\`),plural:c(\`gutter-tooltip.aria-label.warning.plural\`,\`warnings\`)},info:{singular:c(\`gutter-tooltip.aria-label.info.singular\`,\`information message\`),plural:c(\`gutter-tooltip.aria-label.info.plural\`,\`information messages\`)},hint:{singular:c(\`gutter-tooltip.aria-label.hint.singular\`,\`suggestion\`),plural:c(\`gutter-tooltip.aria-label.hint.plural\`,\`suggestions\`)}}},enumerable:!1,configurable:!0}),t.prototype.showTooltip=function(e){var n,r=this.editor.renderer.$gutterLayer,i=r.$annotations[e],o=i?{displayText:Array.from(i.displayText),type:Array.from(i.type)}:{displayText:[],type:[]},s=r.session.getFoldLine(e);if(s&&r.$showFoldedAnnotations){for(var c={error:[],security:[],warning:[],info:[],hint:[]},u={error:1,security:2,warning:3,info:4,hint:5},d,f=e+1;f<=s.end.row;f++)if(r.$annotations[f])for(var p=0;p<r.$annotations[f].text.length;p++){var m=r.$annotations[f].type[p];c[m].push(r.$annotations[f].text[p]),(!d||u[m]<u[d])&&(d=m)}if([\`error\`,\`security\`,\`warning\`].includes(d)){var h=\`\${t.annotationsToSummaryString(c)} in folded code.\`;o.displayText.push(h),o.type.push(d+\`_fold\`)}}if(o.displayText.length===0)return this.hide();for(var g={error:[],security:[],warning:[],info:[],hint:[]},_=r.$useSvgGutterIcons?\`ace_icon_svg\`:\`ace_icon\`,f=0;f<o.displayText.length;f++){var v=a.createElement(\`span\`),y=a.createElement(\`span\`);(n=y.classList).add.apply(n,[\`ace_\${o.type[f]}\`,_]),y.setAttribute(\`aria-label\`,\`\${t.annotationLabels[o.type[f].replace(\`_fold\`,\`\`)].singular}\`),y.setAttribute(\`role\`,\`img\`),y.appendChild(a.createTextNode(\` \`)),v.appendChild(y),v.appendChild(a.createTextNode(o.displayText[f])),v.appendChild(a.createElement(\`br\`)),g[o.type[f].replace(\`_fold\`,\`\`)].push(v)}var b=a.createElement(\`span\`);g.error.forEach(function(e){return b.appendChild(e)}),g.security.forEach(function(e){return b.appendChild(e)}),g.warning.forEach(function(e){return b.appendChild(e)}),g.info.forEach(function(e){return b.appendChild(e)}),g.hint.forEach(function(e){return b.appendChild(e)}),b.setAttribute(\`aria-live\`,\`polite\`);var x=this.$findLinkedAnnotationNode(e);x&&x.setAttribute(\`aria-describedby\`,this.id);var S=l.fromPoints({row:e,column:0},{row:e,column:0});this.showForRange(this.editor,S,b),this.visibleTooltipRow=e,this.editor._signal(\`showGutterTooltip\`,this)},t.prototype.$setPosition=function(t,n,r,i){var a=this.$findCellByRow(i.start.row);if(a){var o=a&&a.element,s=o&&o.querySelector(\`.ace_gutter_annotation\`);if(s){var c=s.getBoundingClientRect();if(c){var l={pageX:c.right,pageY:c.top};return e.prototype.$setPosition.call(this,t,l,!1,i)}}}},t.prototype.$shouldPlaceAbove=function(e,t,n){return n<e},t.prototype.$findLinkedAnnotationNode=function(e){var t=this.$findCellByRow(e);if(t){var n=t.element;if(n.childNodes.length>2)return n.childNodes[2]}},t.prototype.$findCellByRow=function(e){return this.editor.renderer.$gutterLayer.$lines.cells.find(function(t){return t.row===e})},t.prototype.hide=function(t){if(this.isOpen){if(this.$element.removeAttribute(\`aria-live\`),this.visibleTooltipRow!=null){var n=this.$findLinkedAnnotationNode(this.visibleTooltipRow);n&&n.removeAttribute(\`aria-describedby\`)}this.visibleTooltipRow=void 0,this.editor._signal(\`hideGutterTooltip\`,this),e.prototype.hide.call(this,t)}},t.annotationsToSummaryString=function(e){var n,r,a=[],o=[\`error\`,\`security\`,\`warning\`,\`info\`,\`hint\`];try{for(var s=i(o),c=s.next();!c.done;c=s.next()){var l=c.value;if(e[l].length){var u=e[l].length===1?t.annotationLabels[l].singular:t.annotationLabels[l].plural;a.push(\`\${e[l].length} \${u}\`)}}}catch(e){n={error:e}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return a.join(\`, \`)},t.prototype.isOutsideOfText=function(e){var t=e.editor.renderer.$gutter.getBoundingClientRect();return!(e.clientX>=t.left&&e.clientX<=t.right&&e.clientY>=t.top&&e.clientY<=t.bottom)},t}(s);d.$uid=0,t.GutterTooltip=d}),ace.define(\`ace/mouse/dragdrop_handler\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/dom\`,\`ace/lib/event\`,\`ace/lib/useragent\`],function(e,t,n){var r=e("../lib/dom"),i=e("../lib/event"),a=e("../lib/useragent"),o=200,s=200,c=5;function l(e){var t=e.editor,n=r.createElement(\`div\`);n.style.cssText=\`top:-100px;position:absolute;z-index:2147483647;opacity:0.5\`,n.textContent=\`\\xA0\`,[\`dragWait\`,\`dragWaitEnd\`,\`startDrag\`,\`dragReadyEnd\`,\`onMouseDrag\`].forEach(function(t){e[t]=this[t]},this),t.on(\`mousedown\`,this.onMouseDown.bind(e));var l=t.container,d,f,p,m,h,g,_=0,v,y,b,x,S;this.onDragStart=function(e){if(this.cancelDrag||!l.draggable){var r=this;return setTimeout(function(){r.startSelect(),r.captureMouse(e)},0),e.preventDefault()}h=t.getSelectionRange();var i=e.dataTransfer;i.effectAllowed=t.getReadOnly()?\`copy\`:\`copyMove\`,t.container.appendChild(n),i.setDragImage&&i.setDragImage(n,0,0),setTimeout(function(){t.container.removeChild(n)}),i.clearData(),i.setData(\`Text\`,t.session.getTextRange()),y=!0,this.setState(\`drag\`)},this.onDragEnd=function(e){if(l.draggable=!1,y=!1,this.setState(null),!t.getReadOnly()){var n=e.dataTransfer.dropEffect;!v&&n==\`move\`&&t.session.remove(t.getSelectionRange()),t.$resetCursorStyle()}this.editor.unsetStyle(\`ace_dragging\`),this.editor.renderer.setCursorStyle(\`\`)},this.onDragEnter=function(e){if(!(t.getReadOnly()||!A(e.dataTransfer)))return f=e.clientX,p=e.clientY,d||E(),_++,e.dataTransfer.dropEffect=v=j(e),i.preventDefault(e)},this.onDragOver=function(e){if(!(t.getReadOnly()||!A(e.dataTransfer)))return f=e.clientX,p=e.clientY,d||(E(),_++),O!==null&&(O=null),e.dataTransfer.dropEffect=v=j(e),i.preventDefault(e)},this.onDragLeave=function(e){if(_--,_<=0&&d)return D(),v=null,i.preventDefault(e)},this.onDrop=function(e){if(g){var n=e.dataTransfer;if(y)switch(v){case\`move\`:h=h.contains(g.row,g.column)?{start:g,end:g}:t.moveText(h,g);break;case\`copy\`:h=t.moveText(h,g,!0);break}else{var r=n.getData(\`Text\`);h={start:g,end:t.session.insert(g,r)},t.focus(),v=null}return D(),i.preventDefault(e)}},i.addListener(l,\`dragstart\`,this.onDragStart.bind(e),t),i.addListener(l,\`dragend\`,this.onDragEnd.bind(e),t),i.addListener(l,\`dragenter\`,this.onDragEnter.bind(e),t),i.addListener(l,\`dragover\`,this.onDragOver.bind(e),t),i.addListener(l,\`dragleave\`,this.onDragLeave.bind(e),t),i.addListener(l,\`drop\`,this.onDrop.bind(e),t);function C(e,n){var r=Date.now(),i=!n||e.row!=n.row,a=!n||e.column!=n.column;!x||i||a?(t.moveCursorToPosition(e),x=r,S={x:f,y:p}):u(S.x,S.y,f,p)>c?x=null:r-x>=s&&(t.renderer.scrollCursorIntoView(),x=null)}function w(e,n){var r=Date.now(),i=t.renderer.layerConfig.lineHeight,a=t.renderer.layerConfig.characterWidth,s=t.renderer.scroller.getBoundingClientRect(),c={x:{left:f-s.left,right:s.right-f},y:{top:p-s.top,bottom:s.bottom-p}},l=Math.min(c.x.left,c.x.right),u=Math.min(c.y.top,c.y.bottom),d={row:e.row,column:e.column};l/a<=2&&(d.column+=c.x.left<c.x.right?-3:2),u/i<=1&&(d.row+=c.y.top<c.y.bottom?-1:1);var m=e.row!=d.row,h=e.column!=d.column,g=!n||e.row!=n.row;m||h&&!g?b?r-b>=o&&t.renderer.scrollCursorIntoView(d):b=r:b=null}function T(){var e=g;g=t.renderer.screenToTextCoordinates(f,p),C(g,e),w(g,e)}function E(){h=t.selection.toOrientedRange(),d=t.session.addMarker(h,\`ace_selection\`,t.getSelectionStyle()),t.clearSelection(),t.isFocused()&&t.renderer.$cursorLayer.setBlinking(!1),clearInterval(m),T(),m=setInterval(T,20),_=0,i.addListener(document,\`mousemove\`,k)}function D(){clearInterval(m),t.session.removeMarker(d),d=null,t.selection.fromOrientedRange(h),t.isFocused()&&!y&&t.$resetCursorStyle(),h=null,g=null,_=0,b=null,x=null,i.removeListener(document,\`mousemove\`,k)}var O=null;function k(){O??=setTimeout(function(){O!=null&&d&&D()},20)}function A(e){var t=e.types;return!t||Array.prototype.some.call(t,function(e){return e==\`text/plain\`||e==\`Text\`})}function j(e){var t=[\`copy\`,\`copymove\`,\`all\`,\`uninitialized\`],n=[\`move\`,\`copymove\`,\`linkmove\`,\`all\`,\`uninitialized\`],r=a.isMac?e.altKey:e.ctrlKey,i=\`uninitialized\`;try{i=e.dataTransfer.effectAllowed.toLowerCase()}catch{}var o=\`none\`;return r&&t.indexOf(i)>=0?o=\`copy\`:n.indexOf(i)>=0?o=\`move\`:t.indexOf(i)>=0&&(o=\`copy\`),o}}(function(){this.dragWait=function(){Date.now()-this.mousedownEvent.time>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){var e=this.editor.container;e.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(e){this.editor.$resetCursorStyle(),this.editor.unsetStyle(\`ace_dragging\`),this.editor.renderer.setCursorStyle(\`\`),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var e=this.editor,t=e.container;t.draggable=!0,e.renderer.$cursorLayer.setBlinking(!1),e.setStyle(\`ace_dragging\`);var n=a.isWin?\`default\`:\`move\`;e.renderer.setCursorStyle(n),this.setState(\`dragReady\`)},this.onMouseDrag=function(e){var t=this.editor.container;if(a.isIE&&this.state==\`dragReady\`){var n=u(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);n>3&&t.dragDrop()}if(this.state===\`dragWait\`){var n=u(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);n>0&&(t.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))}},this.onMouseDown=function(e){if(this.$dragEnabled){this.mousedownEvent=e;var t=this.editor,n=e.inSelection(),r=e.getButton();if((e.domEvent.detail||1)===1&&r===0&&n){if(e.editor.inMultiSelectMode&&(e.getAccelKey()||e.getShiftKey()))return;this.mousedownEvent.time=Date.now();var i=e.domEvent.target||e.domEvent.srcElement;if(\`unselectable\`in i&&(i.unselectable=\`on\`),t.getDragDelay()){if(a.isWebKit){this.cancelDrag=!0;var o=t.container;o.draggable=!0}this.setState(\`dragWait\`)}else this.startDrag();this.captureMouse(e,this.onMouseDrag.bind(this)),e.defaultPrevented=!0}}}}).call(l.prototype);function u(e,t,n,r){return Math.sqrt((n-e)**2+(r-t)**2)}t.DragdropHandler=l}),ace.define(\`ace/mouse/touch_handler\`,[\`require\`,\`exports\`,\`module\`,\`ace/mouse/mouse_event\`,\`ace/lib/event\`,\`ace/lib/dom\`],function(e,t,n){var r=e("./mouse_event").MouseEvent,i=e("../lib/event"),a=e("../lib/dom");t.addTouchListeners=function(e,t){var n=\`scroll\`,o,s,c,l,u,d,f=0,p,m=0,h=0,g=0,_,v;function y(){var e=window.navigator&&window.navigator.clipboard,r=!1,i=function(){var n=t.getCopyText(),i=t.session.getUndoManager().hasUndo();v.replaceChild(a.buildDom(r?[\`span\`,!n&&o(\`selectall\`)&&[\`span\`,{class:\`ace_mobile-button\`,action:\`selectall\`},\`Select All\`],n&&o(\`copy\`)&&[\`span\`,{class:\`ace_mobile-button\`,action:\`copy\`},\`Copy\`],n&&o(\`cut\`)&&[\`span\`,{class:\`ace_mobile-button\`,action:\`cut\`},\`Cut\`],e&&o(\`paste\`)&&[\`span\`,{class:\`ace_mobile-button\`,action:\`paste\`},\`Paste\`],i&&o(\`undo\`)&&[\`span\`,{class:\`ace_mobile-button\`,action:\`undo\`},\`Undo\`],o(\`find\`)&&[\`span\`,{class:\`ace_mobile-button\`,action:\`find\`},\`Find\`],o(\`openCommandPalette\`)&&[\`span\`,{class:\`ace_mobile-button\`,action:\`openCommandPalette\`},\`Palette\`]]:[\`span\`]),v.firstChild)},o=function(e){return t.commands.canExecute(e,t)},s=function(n){var a=n.target.getAttribute(\`action\`);if(a==\`more\`||!r)return r=!r,i();a==\`paste\`?e.readText().then(function(e){t.execCommand(a,e)}):a&&((a==\`cut\`||a==\`copy\`)&&(e?e.writeText(t.getCopyText()):document.execCommand(\`copy\`)),t.execCommand(a)),v.firstChild.style.display=\`none\`,r=!1,a!=\`openCommandPalette\`&&t.focus()};v=a.buildDom([\`div\`,{class:\`ace_mobile-menu\`,onclick:s},[\`span\`],[\`span\`,{class:\`ace_mobile-button\`,action:\`more\`},\`...\`]],t.container),v.addEventListener(\`touchstart\`,function(e){n=\`menu\`,e.stopPropagation(),e.preventDefault(),t.textInput.focus()}),v.addEventListener(\`touchend\`,function(e){e.stopPropagation(),e.preventDefault(),s(e)})}function b(){if(!t.getOption(\`enableMobileMenu\`)){v&&x();return}v||y();var e=t.selection.cursor,n=t.renderer.textToScreenCoordinates(e.row,e.column),r=t.renderer.textToScreenCoordinates(0,0).pageX,i=t.renderer.scrollLeft,a=t.container.getBoundingClientRect();v.style.top=n.pageY-a.top-3+\`px\`,n.pageX-a.left<a.width-70?(v.style.left=\`\`,v.style.right=\`10px\`):(v.style.right=\`\`,v.style.left=r+i-a.left+\`px\`),v.style.display=\`\`,v.firstChild.style.display=\`none\`,t.on(\`input\`,x)}function x(e){v&&(v.style.display=\`none\`),t.off(\`input\`,x)}function S(){u=null,clearTimeout(u);var e=t.selection.getRange(),r=e.contains(p.row,p.column);(e.isEmpty()||!r)&&(t.selection.moveToPosition(p),t.selection.selectWord()),n=\`wait\`,b()}function C(){u=null,clearTimeout(u),t.selection.moveToPosition(p);var e=m>=2?t.selection.getLineRange(p.row):t.session.getBracketRange(p);e&&!e.isEmpty()?t.selection.setRange(e):t.selection.selectWord(),n=\`wait\`}i.addListener(e,\`contextmenu\`,function(e){_&&t.textInput.getElement().focus()},t),i.addListener(e,\`touchstart\`,function(e){var i=e.touches;if(u||i.length>1){clearTimeout(u),u=null,c=-1,n=\`zoom\`;return}_=t.$mouseHandler.isMousePressed=!0;var a=t.renderer.layerConfig.lineHeight,d=t.renderer.layerConfig.lineHeight,v=e.timeStamp;l=v;var y=i[0],b=y.clientX,x=y.clientY;if(Math.abs(o-b)+Math.abs(s-x)>a&&(c=-1),o=e.clientX=b,s=e.clientY=x,h=g=0,p=new r(e,t).getDocumentPosition(),v-c<500&&i.length==1&&!f)m++,e.preventDefault(),e.button=0,C();else{m=0;var w=t.selection.cursor,T=t.selection.isEmpty()?w:t.selection.anchor,E=t.renderer.$cursorLayer.getPixelPosition(w,!0),D=t.renderer.$cursorLayer.getPixelPosition(T,!0),O=t.renderer.scroller.getBoundingClientRect(),k=t.renderer.layerConfig.offset,A=t.renderer.scrollLeft,j=function(e,t){return e/=d,t=t/a-.75,e*e+t*t};if(e.clientX<O.left){n=\`zoom\`;return}var M=j(e.clientX-O.left-E.left+A,e.clientY-O.top-E.top+k),N=j(e.clientX-O.left-D.left+A,e.clientY-O.top-D.top+k);M<3.5&&N<3.5&&(n=M>N?\`cursor\`:\`anchor\`),n=N<3.5?\`anchor\`:M<3.5?\`cursor\`:\`scroll\`,u=setTimeout(S,450)}c=v},t),i.addListener(e,\`touchend\`,function(e){_=t.$mouseHandler.isMousePressed=!1,d&&clearInterval(d),n==\`zoom\`?(n=\`\`,f=0):u?(t.selection.moveToPosition(p),f=0,b()):n==\`scroll\`?(w(),x()):b(),clearTimeout(u),u=null},t),i.addListener(e,\`touchmove\`,function(e){u&&=(clearTimeout(u),null);var i=e.touches;if(!(i.length>1||n==\`zoom\`)){var a=i[0],c=o-a.clientX,d=s-a.clientY;if(n==\`wait\`)if(c*c+d*d>4)n=\`cursor\`;else return e.preventDefault();o=a.clientX,s=a.clientY,e.clientX=a.clientX,e.clientY=a.clientY;var f=e.timeStamp,p=f-l;if(l=f,n==\`scroll\`){var m=new r(e,t);m.speed=1,m.wheelX=c,m.wheelY=d,10*Math.abs(c)<Math.abs(d)&&(c=0),10*Math.abs(d)<Math.abs(c)&&(d=0),p!=0&&(h=c/p,g=d/p),t._emit(\`mousewheel\`,m),m.propagationStopped||(h=g=0)}else{var _=new r(e,t).getDocumentPosition();n==\`cursor\`?t.selection.moveCursorToPosition(_):n==\`anchor\`&&t.selection.setSelectionAnchor(_.row,_.column),t.renderer.scrollCursorIntoView(_),e.preventDefault()}}},t);function w(){f+=60,d=setInterval(function(){f--<=0&&(clearInterval(d),d=null),Math.abs(h)<.01&&(h=0),Math.abs(g)<.01&&(g=0),f<20&&(h=.9*h),f<20&&(g=.9*g);var e=t.session.getScrollTop();t.renderer.scrollBy(10*h,10*g),e==t.session.getScrollTop()&&(f=0)},10)}}}),ace.define(\`ace/mouse/mouse_handler\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/event\`,\`ace/lib/useragent\`,\`ace/mouse/default_handlers\`,\`ace/mouse/default_gutter_handler\`,\`ace/mouse/mouse_event\`,\`ace/mouse/dragdrop_handler\`,\`ace/mouse/touch_handler\`,\`ace/config\`],function(e,t,n){var r=e("../lib/event"),i=e("../lib/useragent"),a=e("./default_handlers").DefaultHandlers,o=e("./default_gutter_handler").GutterHandler,s=e("./mouse_event").MouseEvent,c=e("./dragdrop_handler").DragdropHandler,l=e("./touch_handler").addTouchListeners,u=e("../config"),d=function(){function e(e){this.$dragDelay,this.$dragEnabled,this.$mouseMoved,this.mouseEvent,this.$focusTimeout;var t=this;this.editor=e,new a(this),new o(this),new c(this);var n=function(t){(!document.hasFocus||!document.hasFocus()||!e.isFocused()&&document.activeElement==(e.textInput&&e.textInput.getElement()))&&window.focus(),e.focus(),setTimeout(function(){e.isFocused()||e.focus()})},s=e.renderer.getMouseEventTarget();r.addListener(s,\`click\`,this.onMouseEvent.bind(this,\`click\`),e),r.addListener(s,\`mousemove\`,this.onMouseMove.bind(this,\`mousemove\`),e),r.addMultiMouseDownListener([s,e.renderer.scrollBarV&&e.renderer.scrollBarV.inner,e.renderer.scrollBarH&&e.renderer.scrollBarH.inner,e.textInput&&e.textInput.getElement()].filter(Boolean),[400,300,250],this,\`onMouseEvent\`,e),r.addMouseWheelListener(e.container,this.onMouseWheel.bind(this,\`mousewheel\`),e),l(e.container,e);var u=e.renderer.$gutter;r.addListener(u,\`mousedown\`,this.onMouseEvent.bind(this,\`guttermousedown\`),e),r.addListener(u,\`click\`,this.onMouseEvent.bind(this,\`gutterclick\`),e),r.addListener(u,\`dblclick\`,this.onMouseEvent.bind(this,\`gutterdblclick\`),e),r.addListener(u,\`mousemove\`,this.onMouseEvent.bind(this,\`guttermousemove\`),e),r.addListener(s,\`mousedown\`,n,e),r.addListener(u,\`mousedown\`,n,e),i.isIE&&e.renderer.scrollBarV&&(r.addListener(e.renderer.scrollBarV.element,\`mousedown\`,n,e),r.addListener(e.renderer.scrollBarH.element,\`mousedown\`,n,e)),e.on(\`mousemove\`,function(n){if(!(t.state||t.$dragDelay||!t.$dragEnabled)){var r=e.renderer.screenToTextCoordinates(n.x,n.y),i=e.session.selection.getRange(),a=e.renderer;!i.isEmpty()&&i.insideStart(r.row,r.column)?a.setCursorStyle(\`default\`):a.setCursorStyle(\`\`)}},e)}return e.prototype.onMouseEvent=function(e,t){this.editor.session&&this.editor._emit(e,new s(t,this.editor))},e.prototype.onMouseMove=function(e,t){var n=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;!n||!n.length||this.editor._emit(e,new s(t,this.editor))},e.prototype.onMouseWheel=function(e,t){var n=new s(t,this.editor);n.speed=this.$scrollSpeed*2,n.wheelX=t.wheelX,n.wheelY=t.wheelY,this.editor._emit(e,n)},e.prototype.setState=function(e){this.state=e},e.prototype.captureMouse=function(e,t){this.x=e.x,this.y=e.y,this.isMousePressed=!0;var n=this.editor,a=this.editor.renderer;a.$isMousePressed=!0;var o=this,c=!0,l=function(e){if(e){if(i.isWebKit&&!e.which&&o.releaseMouse)return o.releaseMouse();o.x=e.clientX,o.y=e.clientY,t&&t(e),o.mouseEvent=new s(e,o.editor),o.$mouseMoved=!0}},u=function(e){n.off(\`beforeEndOperation\`,p),c=!1,n.session&&d(),o[o.state+\`End\`]&&o[o.state+\`End\`](e),o.state=\`\`,o.isMousePressed=a.$isMousePressed=!1,a.$keepTextAreaAtCursor&&a.$moveTextAreaToCursor(),o.$onCaptureMouseMove=o.releaseMouse=null,e&&o.onMouseEvent(\`mouseup\`,e),n.endOperation()},d=function(){o[o.state]&&o[o.state](),o.$mouseMoved=!1},f=function(){c&&(d(),r.nextFrame(f))};if(i.isOldIE&&e.domEvent.type==\`dblclick\`)return setTimeout(function(){u(e)});var p=function(e){o.releaseMouse&&n.curOp.command.name&&n.curOp.selectionChanged&&(o[o.state+\`End\`]&&o[o.state+\`End\`](),o.state=\`\`,o.releaseMouse())};n.on(\`beforeEndOperation\`,p),n.startOperation({command:{name:\`mouse\`}}),o.$onCaptureMouseMove=l,o.releaseMouse=r.capture(this.editor.container,l,u),f()},e.prototype.cancelContextMenu=function(){var e=function(t){t&&t.domEvent&&t.domEvent.type!=\`contextmenu\`||(this.editor.off(\`nativecontextmenu\`,e),t&&t.domEvent&&r.stopEvent(t.domEvent))}.bind(this);setTimeout(e,10),this.editor.on(\`nativecontextmenu\`,e)},e.prototype.destroy=function(){this.releaseMouse&&this.releaseMouse(),this.$tooltip&&this.$tooltip.destroy()},e}();d.prototype.releaseMouse=null,u.defineOptions(d.prototype,\`mouseHandler\`,{scrollSpeed:{initialValue:2},dragDelay:{initialValue:i.isMac?150:0},dragEnabled:{initialValue:!0},focusTimeout:{initialValue:0}}),t.MouseHandler=d}),ace.define(\`ace/mouse/fold_handler\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/dom\`],function(e,t,n){var r=e("../lib/dom");t.FoldHandler=function(){function e(e){e.on(\`click\`,function(t){var n=t.getDocumentPosition(),i=e.session,a=i.getFoldAt(n.row,n.column,1);a&&(t.getAccelKey()?i.removeFold(a):i.expandFold(a),t.stop());var o=t.domEvent&&t.domEvent.target;o&&r.hasCssClass(o,\`ace_inline_button\`)&&r.hasCssClass(o,\`ace_toggle_wrap\`)&&(i.setOption(\`wrap\`,!i.getUseWrapMode()),e.renderer.scrollCursorIntoView())}),e.on(\`gutterclick\`,function(t){if(e.renderer.$gutterLayer.getRegion(t)==\`foldWidgets\`){var n=t.getDocumentPosition().row,r=e.session;r.foldWidgets&&r.foldWidgets[n]&&e.session.onFoldWidgetClick(n,t),e.isFocused()||e.focus(),t.stop()}}),e.on(\`gutterdblclick\`,function(t){if(e.renderer.$gutterLayer.getRegion(t)==\`foldWidgets\`){var n=t.getDocumentPosition().row,r=e.session,i=r.getParentFoldRangeData(n,!0),a=i.range||i.firstRange;if(a){n=a.start.row;var o=r.getFoldAt(n,r.getLine(n).length,1);o?r.removeFold(o):(r.addFold(\`...\`,a),e.renderer.scrollCursorIntoView({row:a.start.row,column:0}))}t.stop()}})}return e}()}),ace.define(\`ace/keyboard/keybinding\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/keys\`,\`ace/lib/event\`],function(e,t,n){var r=e("../lib/keys"),i=e("../lib/event");t.KeyBinding=function(){function e(e){this.$editor=e,this.$data={editor:e},this.$handlers=[],this.setDefaultHandler(e.commands)}return e.prototype.setDefaultHandler=function(e){this.removeKeyboardHandler(this.$defaultHandler),this.$defaultHandler=e,this.addKeyboardHandler(e,0)},e.prototype.setKeyboardHandler=function(e){var t=this.$handlers;if(t[t.length-1]!=e){for(;t[t.length-1]&&t[t.length-1]!=this.$defaultHandler;)this.removeKeyboardHandler(t[t.length-1]);this.addKeyboardHandler(e,1)}},e.prototype.addKeyboardHandler=function(e,t){if(e){typeof e==\`function\`&&!e.handleKeyboard&&(e.handleKeyboard=e);var n=this.$handlers.indexOf(e);n!=-1&&this.$handlers.splice(n,1),t==null?this.$handlers.push(e):this.$handlers.splice(t,0,e),n==-1&&e.attach&&e.attach(this.$editor)}},e.prototype.removeKeyboardHandler=function(e){var t=this.$handlers.indexOf(e);return t==-1?!1:(this.$handlers.splice(t,1),e.detach&&e.detach(this.$editor),!0)},e.prototype.getKeyboardHandler=function(){return this.$handlers[this.$handlers.length-1]},e.prototype.getStatusText=function(){var e=this.$data,t=e.editor;return this.$handlers.map(function(n){return n.getStatusText&&n.getStatusText(t,e)||\`\`}).filter(Boolean).join(\` \`)},e.prototype.$callKeyboardHandlers=function(e,t,n,r){for(var a,o=!1,s=this.$editor.commands,c=this.$handlers.length;c--&&(a=this.$handlers[c].handleKeyboard(this.$data,e,t,n,r),!(!(!a||!a.command)&&(o=a.command==\`null\`?!0:s.exec(a.command,this.$editor,a.args,r),o&&r&&e!=-1&&a.passEvent!=1&&a.command.passEvent!=1&&i.stopEvent(r),o))););return!o&&e==-1&&(a={command:\`insertstring\`},o=s.exec(\`insertstring\`,this.$editor,t)),o&&this.$editor._signal&&this.$editor._signal(\`keyboardActivity\`,a),o},e.prototype.onCommandKey=function(e,t,n){var i=r.keyCodeToString(n);return this.$callKeyboardHandlers(t,i,n,e)},e.prototype.onTextInput=function(e){return this.$callKeyboardHandlers(-1,e)},e}()}),ace.define(\`ace/lib/bidiutil\`,[\`require\`,\`exports\`,\`module\`],function(e,t,n){var r=0,i=0,a=!1,o=!1,s=!1,c=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],l=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],u=0,d=1,f=0,p=1,m=2,h=3,g=4,_=5,v=6,y=7,b=8,x=9,S=10,C=11,w=12,T=13,E=14,D=15,O=16,k=17,A=18,j=[A,A,A,A,A,A,A,A,A,v,_,v,b,_,A,A,A,A,A,A,A,A,A,A,A,A,A,A,_,_,_,v,b,g,g,C,C,C,g,g,g,g,g,S,x,S,x,x,m,m,m,m,m,m,m,m,m,m,x,g,g,g,g,g,g,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,g,g,g,g,g,g,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,g,g,g,g,A,A,A,A,A,A,_,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,x,g,C,C,C,C,g,g,g,g,f,g,g,A,g,g,C,C,m,m,g,f,g,g,g,m,f,g,g,g,g,g],M=[b,b,b,b,b,b,b,b,b,b,b,A,A,A,f,p,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,b,_,T,E,D,O,k,x,C,C,C,C,C,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,x,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,b];function N(e,t,n,u){var d=r?l:c,f=null,p=null,m=null,h=0,g=null,y=null,x=-1,S=null,C=null,w=[];if(!u)for(S=0,u=[];S<n;S++)u[S]=P(e[S]);for(i=r,a=!1,o=!1,s=!1,C=0;C<n;C++){if(f=h,w[C]=p=te(e,u,w,C),h=d[f][p],g=h&240,h&=15,t[C]=m=d[h][5],g>0)if(g==16){for(S=x;S<C;S++)t[S]=1;x=-1}else x=-1;if(y=d[h][6],y)x==-1&&(x=C);else if(x>-1){for(S=x;S<C;S++)t[S]=m;x=-1}u[C]==_&&(t[C]=0),i|=m}if(s){for(S=0;S<n;S++)if(u[S]==v){t[S]=r;for(var T=S-1;T>=0&&u[T]==b;T--)t[T]=r}}}function ee(e,t,n){if(!(i<e)){if(e==1&&r==d&&!o){n.reverse();return}for(var a=n.length,s=0,c,l,u,f;s<a;){if(t[s]>=e){for(c=s+1;c<a&&t[c]>=e;)c++;for(l=s,u=c-1;l<u;l++,u--)f=n[l],n[l]=n[u],n[u]=f;s=c}s++}}}function te(e,t,n,i){var c=t[i],l,u,d,j;switch(c){case f:case p:a=!1;case g:case h:return c;case m:return a?h:m;case y:return a=!0,p;case b:return g;case x:return i<1||i+1>=t.length||(l=n[i-1])!=m&&l!=h||(u=t[i+1])!=m&&u!=h?g:(a&&(u=h),u==l?u:g);case S:return l=i>0?n[i-1]:_,l==m&&i+1<t.length&&t[i+1]==m?m:g;case C:if(i>0&&n[i-1]==m)return m;if(a)return g;for(j=i+1,d=t.length;j<d&&t[j]==C;)j++;return j<d&&t[j]==m?m:g;case w:for(d=t.length,j=i+1;j<d&&t[j]==w;)j++;if(j<d){var M=e[i],N=M>=1425&&M<=2303||M==64286;if(l=t[j],N&&(l==p||l==y))return p}return i<1||(l=t[i-1])==_?g:n[i-1];case _:return a=!1,o=!0,r;case v:return s=!0,g;case T:case E:case O:case k:case D:a=!1;case A:return g}}function P(e){var t=e.charCodeAt(0),n=t>>8;return n==0?t>191?f:j[t]:n==5?/[\\u0591-\\u05f4]/.test(e)?p:f:n==6?/[\\u0610-\\u061a\\u064b-\\u065f\\u06d6-\\u06e4\\u06e7-\\u06ed]/.test(e)?w:/[\\u0660-\\u0669\\u066b-\\u066c]/.test(e)?h:t==1642?C:/[\\u06f0-\\u06f9]/.test(e)?m:y:n==32&&t<=8287?M[t&255]:n==254&&t>=65136?y:g}t.L=f,t.R=p,t.EN=m,t.ON_R=3,t.AN=4,t.R_H=5,t.B=6,t.RLE=7,t.DOT=\`·\`,t.doBidiReorder=function(e,n,i){if(e.length<2)return{};var a=e.split(\`\`),o=Array(a.length),s=Array(a.length),c=[];r=i?d:u,N(a,c,a.length,n);for(var l=0;l<o.length;o[l]=l,l++);ee(2,c,o),ee(1,c,o);for(var l=0;l<o.length-1;l++)n[l]===h?c[l]=t.AN:c[l]===p&&(n[l]>y&&n[l]<T||n[l]===g||n[l]===A)?c[l]=t.ON_R:l>0&&a[l-1]===\`ل\`&&/\\u0622|\\u0623|\\u0625|\\u0627/.test(a[l])&&(c[l-1]=c[l]=t.R_H,l++);a[a.length-1]===t.DOT&&(c[a.length-1]=t.B),a[0]===\`‫\`&&(c[0]=t.RLE);for(var l=0;l<o.length;l++)s[l]=c[o[l]];return{logicalFromVisual:o,bidiLevels:s}},t.hasBidiCharacters=function(e,t){for(var n=!1,r=0;r<e.length;r++)t[r]=P(e.charAt(r)),!n&&(t[r]==p||t[r]==y||t[r]==h)&&(n=!0);return n},t.getVisualFromLogicalIdx=function(e,t){for(var n=0;n<t.logicalFromVisual.length;n++)if(t.logicalFromVisual[n]==e)return n;return 0}}),ace.define(\`ace/bidihandler\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/bidiutil\`,\`ace/lib/lang\`],function(e,t,n){var r=e("./lib/bidiutil"),i=e("./lib/lang"),a=/[\\u0590-\\u05f4\\u0600-\\u06ff\\u0700-\\u08ac\\u202B]/;t.BidiHandler=function(){function e(e){this.session=e,this.bidiMap={},this.currentRow=null,this.bidiUtil=r,this.charWidths=[],this.EOL=\`¬\`,this.showInvisibles=!0,this.isRtlDir=!1,this.$isRtl=!1,this.line=\`\`,this.wrapIndent=0,this.EOF=\`¶\`,this.RLE=\`‫\`,this.contentWidth=0,this.fontMetrics=null,this.rtlLineOffset=0,this.wrapOffset=0,this.isMoveLeftOperation=!1,this.seenBidi=a.test(e.getValue())}return e.prototype.isBidiRow=function(e,t,n){return this.seenBidi?(e!==this.currentRow&&(this.currentRow=e,this.updateRowLine(t,n),this.updateBidiMap()),this.bidiMap.bidiLevels):!1},e.prototype.onChange=function(e){this.seenBidi?this.currentRow=null:e.action==\`insert\`&&a.test(e.lines.join(\`
202
202
  \`))&&(this.seenBidi=!0,this.currentRow=null)},e.prototype.getDocumentRow=function(){var e=0,t=this.session.$screenRowCache;if(t.length){var n=this.session.$getRowCacheIndex(t,this.currentRow);n>=0&&(e=this.session.$docRowCache[n])}return e},e.prototype.getSplitIndex=function(){var e=0,t=this.session.$screenRowCache;if(t.length)for(var n,r=this.session.$getRowCacheIndex(t,this.currentRow);this.currentRow-e>0&&(n=this.session.$getRowCacheIndex(t,this.currentRow-e-1),n===r);)r=n,e++;else e=this.currentRow;return e},e.prototype.updateRowLine=function(e,t){e===void 0&&(e=this.getDocumentRow());var n=e===this.session.getLength()-1?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(e),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var a=this.session.$wrapData[e];a&&(t===void 0&&(t=this.getSplitIndex()),t>0&&a.length?(this.wrapIndent=a.indent,this.wrapOffset=this.wrapIndent*this.charWidths[r.L],this.line=t<a.length?this.line.substring(a[t-1],a[t]):this.line.substring(a[a.length-1])):this.line=this.line.substring(0,a[t]),t==a.length&&(this.line+=this.showInvisibles?n:r.DOT))}else this.line+=this.showInvisibles?n:r.DOT;var o=this.session,s=0,c;this.line=this.line.replace(/\\t|[\\u1100-\\u2029, \\u202F-\\uFFE6]/g,function(e,t){return e===\` \`||o.isFullWidth(e.charCodeAt(0))?(c=e===\` \`?o.getScreenTabSize(t+s):2,s+=c-1,i.stringRepeat(r.DOT,c)):e}),this.isRtlDir&&(this.fontMetrics.$main.textContent=this.line.charAt(this.line.length-1)==r.DOT?this.line.substr(0,this.line.length-1):this.line,this.rtlLineOffset=this.contentWidth-this.fontMetrics.$main.getBoundingClientRect().width)},e.prototype.updateBidiMap=function(){var e=[];r.hasBidiCharacters(this.line,e)||this.isRtlDir?this.bidiMap=r.doBidiReorder(this.line,e,this.isRtlDir):this.bidiMap={}},e.prototype.markAsDirty=function(){this.currentRow=null},e.prototype.updateCharacterWidths=function(e){if(this.characterWidth!==e.$characterSize.width){this.fontMetrics=e;var t=this.characterWidth=e.$characterSize.width,n=e.$measureCharWidth(\`ה\`);this.charWidths[r.L]=this.charWidths[r.EN]=this.charWidths[r.ON_R]=t,this.charWidths[r.R]=this.charWidths[r.AN]=n,this.charWidths[r.R_H]=n*.45,this.charWidths[r.B]=this.charWidths[r.RLE]=0,this.currentRow=null}},e.prototype.setShowInvisibles=function(e){this.showInvisibles=e,this.currentRow=null},e.prototype.setEolChar=function(e){this.EOL=e},e.prototype.setContentWidth=function(e){this.contentWidth=e},e.prototype.isRtlLine=function(e){return this.$isRtl?!0:e==null?this.isRtlDir:this.session.getLine(e).charAt(0)==this.RLE},e.prototype.setRtlDirection=function(e,t){for(var n=e.getCursorPosition(),r=e.selection.getSelectionAnchor().row;r<=n.row;r++)!t&&e.session.getLine(r).charAt(0)===e.session.$bidiHandler.RLE?e.session.doc.removeInLine(r,0,1):t&&e.session.getLine(r).charAt(0)!==e.session.$bidiHandler.RLE&&e.session.doc.insert({column:0,row:r},e.session.$bidiHandler.RLE)},e.prototype.getPosLeft=function(e){e-=this.wrapIndent;var t=+(this.line.charAt(0)===this.RLE),n=e>t?this.session.getOverwrite()?e:e-1:t,i=r.getVisualFromLogicalIdx(n,this.bidiMap),a=this.bidiMap.bidiLevels,o=0;!this.session.getOverwrite()&&e<=t&&a[i]%2!=0&&i++;for(var s=0;s<i;s++)o+=this.charWidths[a[s]];return!this.session.getOverwrite()&&e>t&&a[i]%2==0&&(o+=this.charWidths[a[i]]),this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(o+=this.rtlLineOffset),o},e.prototype.getSelections=function(e,t){var n=this.bidiMap,r=n.bidiLevels,i,a=[],o=0,s=Math.min(e,t)-this.wrapIndent,c=Math.max(e,t)-this.wrapIndent,l=!1,u=!1,d=0;this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var f,p=0;p<r.length;p++)f=n.logicalFromVisual[p],i=r[p],l=f>=s&&f<c,l&&!u?d=o:!l&&u&&a.push({left:d,width:o-d}),o+=this.charWidths[i],u=l;if(l&&p===r.length&&a.push({left:d,width:o-d}),this.isRtlDir)for(var m=0;m<a.length;m++)a[m].left+=this.rtlLineOffset;return a},e.prototype.offsetToCol=function(e){this.isRtlDir&&(e-=this.rtlLineOffset);var t=0,e=Math.max(e,0),n=0,r=0,i=this.bidiMap.bidiLevels,a=this.charWidths[i[r]];for(this.wrapIndent&&(e-=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);e>n+a/2;){if(n+=a,r===i.length-1){a=0;break}a=this.charWidths[i[++r]]}return r>0&&i[r-1]%2!=0&&i[r]%2==0?(e<n&&r--,t=this.bidiMap.logicalFromVisual[r]):r>0&&i[r-1]%2==0&&i[r]%2!=0?t=1+(e>n?this.bidiMap.logicalFromVisual[r]:this.bidiMap.logicalFromVisual[r-1]):this.isRtlDir&&r===i.length-1&&a===0&&i[r-1]%2==0||!this.isRtlDir&&r===0&&i[r]%2!=0?t=1+this.bidiMap.logicalFromVisual[r]:(r>0&&i[r-1]%2!=0&&a!==0&&r--,t=this.bidiMap.logicalFromVisual[r]),t===0&&this.isRtlDir&&t++,t+this.wrapIndent},e}()}),ace.define(\`ace/selection\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/oop\`,\`ace/lib/lang\`,\`ace/lib/event_emitter\`,\`ace/range\`],function(e,t,n){var r=e("./lib/oop"),i=e("./lib/lang"),a=e("./lib/event_emitter").EventEmitter,o=e("./range").Range,s=function(){function e(e){this.session=e,this.doc=e.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var t=this;this.cursor.on(\`change\`,function(e){t.$cursorChanged=!0,t.$silent||t._emit(\`changeCursor\`),!t.$isEmpty&&!t.$silent&&t._emit(\`changeSelection\`),!t.$keepDesiredColumnOnChange&&e.old.column!=e.value.column&&(t.$desiredColumn=null)}),this.anchor.on(\`change\`,function(){t.$anchorChanged=!0,!t.$isEmpty&&!t.$silent&&t._emit(\`changeSelection\`)})}return e.prototype.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},e.prototype.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},e.prototype.getCursor=function(){return this.lead.getPosition()},e.prototype.setAnchor=function(e,t){this.$isEmpty=!1,this.anchor.setPosition(e,t)},e.prototype.getAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},e.prototype.getSelectionLead=function(){return this.lead.getPosition()},e.prototype.isBackwards=function(){var e=this.anchor,t=this.lead;return e.row>t.row||e.row==t.row&&e.column>t.column},e.prototype.getRange=function(){var e=this.anchor,t=this.lead;return this.$isEmpty?o.fromPoints(t,t):this.isBackwards()?o.fromPoints(t,e):o.fromPoints(e,t)},e.prototype.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit(\`changeSelection\`))},e.prototype.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},e.prototype.setRange=function(e,t){var n=t?e.end:e.start,r=t?e.start:e.end;this.$setSelection(n.row,n.column,r.row,r.column)},e.prototype.$setSelection=function(e,t,n,r){if(!this.$silent){var i=this.$isEmpty,a=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(e,t),this.cursor.setPosition(n,r),this.$isEmpty=!o.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit(\`changeCursor\`),(this.$cursorChanged||this.$anchorChanged||i!=this.$isEmpty||a)&&this._emit(\`changeSelection\`)}},e.prototype.$moveSelection=function(e){var t=this.lead;this.$isEmpty&&this.setSelectionAnchor(t.row,t.column),e.call(this)},e.prototype.selectTo=function(e,t){this.$moveSelection(function(){this.moveCursorTo(e,t)})},e.prototype.selectToPosition=function(e){this.$moveSelection(function(){this.moveCursorToPosition(e)})},e.prototype.moveTo=function(e,t){this.clearSelection(),this.moveCursorTo(e,t)},e.prototype.moveToPosition=function(e){this.clearSelection(),this.moveCursorToPosition(e)},e.prototype.selectUp=function(){this.$moveSelection(this.moveCursorUp)},e.prototype.selectDown=function(){this.$moveSelection(this.moveCursorDown)},e.prototype.selectRight=function(){this.$moveSelection(this.moveCursorRight)},e.prototype.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},e.prototype.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},e.prototype.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},e.prototype.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},e.prototype.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},e.prototype.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},e.prototype.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},e.prototype.getWordRange=function(e,t){if(t===void 0){var n=e||this.lead;e=n.row,t=n.column}return this.session.getWordRange(e,t)},e.prototype.selectWord=function(){this.setSelectionRange(this.getWordRange())},e.prototype.selectAWord=function(){var e=this.getCursor(),t=this.session.getAWordRange(e.row,e.column);this.setSelectionRange(t)},e.prototype.getLineRange=function(e,t){var n=typeof e==\`number\`?e:this.lead.row,r,i=this.session.getFoldLine(n);return i?(n=i.start.row,r=i.end.row):r=n,t===!0?new o(n,0,r,this.session.getLine(r).length):new o(n,0,r+1,0)},e.prototype.selectLine=function(){this.setSelectionRange(this.getLineRange())},e.prototype.moveCursorUp=function(){this.moveCursorBy(-1,0)},e.prototype.moveCursorDown=function(){this.moveCursorBy(1,0)},e.prototype.wouldMoveIntoSoftTab=function(e,t,n){var r=e.column,i=e.column+t;return n<0&&(r=e.column-t,i=e.column),this.session.isTabStop(e)&&this.doc.getLine(e.row).slice(r,i).split(\` \`).length-1==t},e.prototype.moveCursorLeft=function(){var e=this.lead.getPosition(),t;if(t=this.session.getFoldAt(e.row,e.column,-1))this.moveCursorTo(t.start.row,t.start.column);else if(e.column===0)e.row>0&&this.moveCursorTo(e.row-1,this.doc.getLine(e.row-1).length);else{var n=this.session.getTabSize();this.wouldMoveIntoSoftTab(e,n,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-n):this.moveCursorBy(0,-1)}},e.prototype.moveCursorRight=function(){var e=this.lead.getPosition(),t;if(t=this.session.getFoldAt(e.row,e.column,1))this.moveCursorTo(t.end.row,t.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row<this.doc.getLength()-1&&this.moveCursorTo(this.lead.row+1,0);else{var n=this.session.getTabSize(),e=this.lead;this.wouldMoveIntoSoftTab(e,n,1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,n):this.moveCursorBy(0,1)}},e.prototype.moveCursorLineStart=function(){var e=this.lead.row,t=this.lead.column,n=this.session.documentToScreenRow(e,t),r=this.session.screenToDocumentPosition(n,0),i=this.session.getDisplayLine(e,null,r.row,r.column).match(/^\\s*/);i[0].length!=t&&!this.session.$useEmacsStyleLineStart&&(r.column+=i[0].length),this.moveCursorToPosition(r)},e.prototype.moveCursorLineEnd=function(){var e=this.lead,t=this.session.getDocumentLastRowColumnPosition(e.row,e.column);if(this.lead.column==t.column){var n=this.session.getLine(t.row);if(t.column==n.length){var r=n.search(/\\s+$/);r>0&&(t.column=r)}}this.moveCursorTo(t.row,t.column)},e.prototype.moveCursorFileEnd=function(){var e=this.doc.getLength()-1,t=this.doc.getLine(e).length;this.moveCursorTo(e,t)},e.prototype.moveCursorFileStart=function(){this.moveCursorTo(0,0)},e.prototype.moveCursorLongWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),r=n.substring(t);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var i=this.session.getFoldAt(e,t,1);if(i){this.moveCursorTo(i.end.row,i.end.column);return}if(this.session.nonTokenRe.exec(r)&&(t+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,r=n.substring(t)),t>=n.length){this.moveCursorTo(e,n.length),this.moveCursorRight(),e<this.doc.getLength()-1&&this.moveCursorWordRight();return}this.session.tokenRe.exec(r)&&(t+=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(e,t)},e.prototype.moveCursorLongWordLeft=function(){var e=this.lead.row,t=this.lead.column,n;if(n=this.session.getFoldAt(e,t,-1)){this.moveCursorTo(n.start.row,n.start.column);return}var r=this.session.getFoldStringAt(e,t,-1);r??=this.doc.getLine(e).substring(0,t);var a=i.stringReverse(r);if(this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0,this.session.nonTokenRe.exec(a)&&(t-=this.session.nonTokenRe.lastIndex,a=a.slice(this.session.nonTokenRe.lastIndex),this.session.nonTokenRe.lastIndex=0),t<=0){this.moveCursorTo(e,0),this.moveCursorLeft(),e>0&&this.moveCursorWordLeft();return}this.session.tokenRe.exec(a)&&(t-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(e,t)},e.prototype.$shortWordEndIndex=function(e){var t=0,n,r=/\\s/,i=this.session.tokenRe;if(i.lastIndex=0,this.session.tokenRe.exec(e))t=this.session.tokenRe.lastIndex;else{for(;(n=e[t])&&r.test(n);)t++;if(t<1){for(i.lastIndex=0;(n=e[t])&&!i.test(n);)if(i.lastIndex=0,t++,r.test(n))if(t>2){t--;break}else{for(;(n=e[t])&&r.test(n);)t++;if(t>2)break}}}return i.lastIndex=0,t},e.prototype.moveCursorShortWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),r=n.substring(t),i=this.session.getFoldAt(e,t,1);if(i)return this.moveCursorTo(i.end.row,i.end.column);if(t==n.length){var a=this.doc.getLength();do e++,r=this.doc.getLine(e);while(e<a&&/^\\s*$/.test(r));/^\\s+/.test(r)||(r=\`\`),t=0}var o=this.$shortWordEndIndex(r);this.moveCursorTo(e,t+o)},e.prototype.moveCursorShortWordLeft=function(){var e=this.lead.row,t=this.lead.column,n;if(n=this.session.getFoldAt(e,t,-1))return this.moveCursorTo(n.start.row,n.start.column);var r=this.session.getLine(e).substring(0,t);if(t===0){do e--,r=this.doc.getLine(e);while(e>0&&/^\\s*$/.test(r));t=r.length,/\\s+$/.test(r)||(r=\`\`)}var a=i.stringReverse(r),o=this.$shortWordEndIndex(a);return this.moveCursorTo(e,t-o)},e.prototype.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},e.prototype.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},e.prototype.moveCursorBy=function(e,t){var n=this.session.documentToScreenPosition(this.lead.row,this.lead.column),r;if(t===0&&(e!==0&&(this.session.$bidiHandler.isBidiRow(n.row,this.lead.row)?(r=this.session.$bidiHandler.getPosLeft(n.column),n.column=Math.round(r/this.session.$bidiHandler.charWidths[0])):r=n.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?n.column=this.$desiredColumn:this.$desiredColumn=n.column),e!=0&&this.session.lineWidgets&&this.session.lineWidgets[this.lead.row]){var i=this.session.lineWidgets[this.lead.row];e<0?e-=i.rowsAbove||0:e>0&&(e+=i.rowCount-(i.rowsAbove||0))}var a=this.session.screenToDocumentPosition(n.row+e,n.column,r);e!==0&&t===0&&a.row===this.lead.row&&(a.column,this.lead.column),this.moveCursorTo(a.row,a.column+t,t===0)},e.prototype.moveCursorToPosition=function(e){this.moveCursorTo(e.row,e.column)},e.prototype.moveCursorTo=function(e,t,n){var r=this.session.getFoldAt(e,t,1);r&&(e=r.start.row,t=r.start.column),this.$keepDesiredColumnOnChange=!0;var i=this.session.getLine(e);/[\\uDC00-\\uDFFF]/.test(i.charAt(t))&&i.charAt(t-1)&&(this.lead.row==e&&this.lead.column==t+1?--t:t+=1),this.lead.setPosition(e,t),this.$keepDesiredColumnOnChange=!1,n||(this.$desiredColumn=null)},e.prototype.moveCursorToScreen=function(e,t,n){var r=this.session.screenToDocumentPosition(e,t);this.moveCursorTo(r.row,r.column,n)},e.prototype.detach=function(){this.lead.detach(),this.anchor.detach()},e.prototype.fromOrientedRange=function(e){this.setSelectionRange(e,e.cursor==e.start),this.$desiredColumn=e.desiredColumn||this.$desiredColumn},e.prototype.toOrientedRange=function(e){var t=this.getRange();return e?(e.start.column=t.start.column,e.start.row=t.start.row,e.end.column=t.end.column,e.end.row=t.end.row):e=t,e.cursor=this.isBackwards()?e.start:e.end,e.desiredColumn=this.$desiredColumn,e},e.prototype.getRangeOfMovements=function(e){var t=this.getCursor();try{e(this);var n=this.getCursor();return o.fromPoints(t,n)}catch{return o.fromPoints(t,t)}finally{this.moveCursorToPosition(t)}},e.prototype.toJSON=function(){if(this.rangeCount)var e=this.ranges.map(function(e){var t=e.clone();return t.isBackwards=e.cursor==e.start,t});else{var e=this.getRange();e.isBackwards=this.isBackwards()}return e},e.prototype.fromJSON=function(e){if(e.start==null)if(this.rangeList&&e.length>1){this.toSingleRange(e[0]);for(var t=e.length;t--;){var n=o.fromPoints(e[t].start,e[t].end);e[t].isBackwards&&(n.cursor=n.start),this.addRange(n,!0)}return}else e=e[0];this.rangeList&&this.toSingleRange(e),this.setSelectionRange(e,e.isBackwards)},e.prototype.isEqual=function(e){if((e.length||this.rangeCount)&&e.length!=this.rangeCount)return!1;if(!e.length||!this.ranges)return this.getRange().isEqual(e);for(var t=this.ranges.length;t--;)if(!this.ranges[t].isEqual(e[t]))return!1;return!0},e}();s.prototype.setSelectionAnchor=s.prototype.setAnchor,s.prototype.getSelectionAnchor=s.prototype.getAnchor,s.prototype.setSelectionRange=s.prototype.setRange,r.implement(s.prototype,a),t.Selection=s}),ace.define(\`ace/tokenizer\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/report_error\`],function(e,t,n){var r=e("./lib/report_error").reportError,i=2e3,a=function(){function e(e){for(var t in this.splitRegex,this.states=e,this.regExps={},this.matchMappings={},this.states){for(var n=this.states[t],r=[],i=0,a=this.matchMappings[t]={defaultToken:\`text\`},o=\`g\`,s=[],c=0;c<n.length;c++){var l=n[c];if(l.defaultToken&&(a.defaultToken=l.defaultToken),l.caseInsensitive&&o.indexOf(\`i\`)===-1&&(o+=\`i\`),l.unicode&&o.indexOf(\`u\`)===-1&&(o+=\`u\`),l.regex!=null){l.regex instanceof RegExp&&(l.regex=l.regex.toString().slice(1,-1));var u=l.regex,d=RegExp(\`(?:(\`+u+\`)|(.))\`).exec(\`a\`).length-2;Array.isArray(l.token)?l.token.length==1||d==1?l.token=l.token[0]:d-1==l.token.length?(l.tokenArray=l.token,l.token=null,l.onMatch=this.$arrayTokens):(this.reportError(\`number of classes and regexp groups doesn't match\`,{rule:l,groupCount:d-1}),l.token=l.token[0]):typeof l.token==\`function\`&&!l.onMatch&&(d>1?l.onMatch=this.$applyToken:l.onMatch=l.token),d>1&&(/\\\\\\d/.test(l.regex)?u=l.regex.replace(/\\\\([0-9]+)/g,function(e,t){return\`\\\\\`+(parseInt(t,10)+i+1)}):(d=1,u=this.removeCapturingGroups(l.regex)),!l.splitRegex&&typeof l.token!=\`string\`&&s.push(l)),a[i]=c,i+=d,r.push(u),l.onMatch||=null}}r.length||(a[0]=0,r.push(\`$\`)),s.forEach(function(e){e.splitRegex=this.createSplitterRegexp(e.regex,o)},this),this.regExps[t]=RegExp(\`(\`+r.join(\`)|(\`)+\`)|($)\`,o)}}return e.prototype.$setMaxTokenCount=function(e){i=e|0},e.prototype.$applyToken=function(e){var t=this.splitRegex.exec(e).slice(1),n=this.token.apply(this,t);if(typeof n==\`string\`)return[{type:n,value:e}];for(var r=[],i=0,a=n.length;i<a;i++)t[i]&&(r[r.length]={type:n[i],value:t[i]});return r},e.prototype.$arrayTokens=function(e){if(!e)return[];var t=this.splitRegex.exec(e);if(!t)return\`text\`;for(var n=[],r=this.tokenArray,i=0,a=r.length;i<a;i++)t[i+1]&&(n[n.length]={type:r[i],value:t[i+1]});return n},e.prototype.removeCapturingGroups=function(e){return e.replace(/\\\\.|\\[(?:\\\\.|[^\\\\\\]])*|\\(\\?[:=!<]|(\\()/g,function(e,t){return t?\`(?:\`:e})},e.prototype.createSplitterRegexp=function(e,t){if(e.indexOf(\`(?=\`)!=-1){var n=0,r=!1,i={};e.replace(/(\\\\.)|(\\((?:\\?[=!])?)|(\\))|([\\[\\]])/g,function(e,t,a,o,s,c){return r?r=s!=\`]\`:s?r=!0:o?(n==i.stack&&(i.end=c+1,i.stack=-1),n--):a&&(n++,a.length!=1&&(i.stack=n,i.start=c)),e}),i.end!=null&&/^\\)*$/.test(e.substr(i.end))&&(e=e.substring(0,i.start)+e.substr(i.end))}return e.charAt(0)!=\`^\`&&(e=\`^\`+e),e.charAt(e.length-1)!=\`$\`&&(e+=\`$\`),new RegExp(e,(t||\`\`).replace(\`g\`,\`\`))},e.prototype.getLineTokens=function(e,t){if(t&&typeof t!=\`string\`){var n=t.slice(0);t=n[0],t===\`#tmp\`&&(n.shift(),t=n.shift())}else var n=[];var r=t||\`start\`,a=this.states[r];a||=(r=\`start\`,this.states[r]);var o=this.matchMappings[r],s=this.regExps[r];s.lastIndex=0;for(var c,l=[],u=0,d=0,f={type:null,value:\`\`};c=s.exec(e);){var p=o.defaultToken,m=null,h=c[0],g=s.lastIndex;if(g-h.length>u){var _=e.substring(u,g-h.length);f.type==p?f.value+=_:(f.type&&l.push(f),f={type:p,value:_})}for(var v=0;v<c.length-2;v++)if(c[v+1]!==void 0){m=a[o[v]],p=m.onMatch?m.onMatch(h,r,n,e):m.token,m.next&&(r=typeof m.next==\`string\`?m.next:m.next(r,n),a=this.states[r],a||=(this.reportError(\`state doesn't exist\`,r),r=\`start\`,this.states[r]),o=this.matchMappings[r],u=g,s=this.regExps[r],s.lastIndex=g),m.consumeLineEnd&&(u=g);break}if(h){if(typeof p==\`string\`)(!m||m.merge!==!1)&&f.type===p?f.value+=h:(f.type&&l.push(f),f={type:p,value:h});else if(p){f.type&&l.push(f),f={type:null,value:\`\`};for(var v=0;v<p.length;v++)l.push(p[v])}}if(u==e.length)break;if(u=g,d++>i){for(d>2*e.length&&this.reportError(\`infinite loop with in ace tokenizer\`,{startState:t,line:e});u<e.length;)f.type&&l.push(f),f={value:e.substring(u,u+=500),type:\`overflow\`};r=\`start\`,n=[];break}}return f.type&&l.push(f),n.length>1&&n[0]!==r&&n.unshift(\`#tmp\`,r),{tokens:l,state:n.length?n:r}},e}();a.prototype.reportError=r,t.Tokenizer=a}),ace.define(\`ace/mode/text_highlight_rules\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/deep_copy\`],function(e,t,n){var r=e("../lib/deep_copy").deepCopy,i=function(){this.$rules={start:[{token:\`empty_line\`,regex:\`^$\`},{defaultToken:\`text\`}]}};(function(){this.addRules=function(e,t){if(!t){for(var n in e)this.$rules[n]=e[n];return}for(var n in e){for(var r=e[n],i=0;i<r.length;i++){var a=r[i];(a.next||a.onMatch)&&(typeof a.next==\`string\`&&a.next.indexOf(t)!==0&&(a.next=t+a.next),a.nextState&&a.nextState.indexOf(t)!==0&&(a.nextState=t+a.nextState))}this.$rules[t+n]=r}},this.getRules=function(){return this.$rules},this.embedRules=function(e,t,n,i,a){var o=typeof e==\`function\`?new e().getRules():e;if(i)for(var s=0;s<i.length;s++)i[s]=t+i[s];else for(var c in i=[],o)i.push(t+c);if(this.addRules(o,t),n)for(var l=Array.prototype[a?\`push\`:\`unshift\`],s=0;s<i.length;s++)l.apply(this.$rules[i[s]],r(n));this.$embeds||=[],this.$embeds.push(t)},this.getEmbeds=function(){return this.$embeds};var e=function(e,t){return(e!=\`start\`||t.length)&&t.unshift(this.nextState,e),this.nextState},t=function(e,t){return t.shift(),t.shift()||\`start\`};this.normalizeRules=function(){var n=0,r=this.$rules;function i(a){var o=r[a];o.processed=!0;for(var s=0;s<o.length;s++){var c=o[s],l=null;Array.isArray(c)&&(l=c,c={}),!c.regex&&c.start&&(c.regex=c.start,c.next||=[],c.next.push({defaultToken:c.token},{token:c.token+\`.end\`,regex:c.end||c.start,next:\`pop\`}),c.token+=\`.start\`,c.push=!0);var u=c.next||c.push;if(u&&Array.isArray(u)){var d=c.stateName;d||(d=c.token,typeof d!=\`string\`&&(d=d[0]||\`\`),r[d]&&(d+=n++)),r[d]=u,c.next=d,i(d)}else u==\`pop\`&&(c.next=t);if(c.push&&(c.nextState=c.next||c.push,c.next=e,delete c.push),c.rules)for(var f in c.rules)r[f]?r[f].push&&r[f].push.apply(r[f],c.rules[f]):r[f]=c.rules[f];var p=typeof c==\`string\`?c:c.include;if(p&&(p===\`$self\`&&(p=\`start\`),l=Array.isArray(p)?p.map(function(e){return r[e]}):r[p]),l){var m=[s,1].concat(l);c.noEscape&&(m=m.filter(function(e){return!e.next})),o.splice.apply(o,m),s--}c.keywordMap&&(c.token=this.createKeywordMapper(c.keywordMap,c.defaultToken||\`text\`,c.caseInsensitive),delete c.defaultToken)}}Object.keys(r).forEach(i,this)},this.createKeywordMapper=function(e,t,n,r){var i=Object.create(null);return this.$keywordList=[],Object.keys(e).forEach(function(t){for(var a=e[t].split(r||\`|\`),o=a.length;o--;){var s=a[o];this.$keywordList.push(s),n&&(s=s.toLowerCase()),i[s]=t}},this),e=null,n?function(e){return i[e.toLowerCase()]||t}:function(e){return i[e]||t}},this.getKeywords=function(){return this.$keywords}}).call(i.prototype),t.TextHighlightRules=i}),ace.define(\`ace/mode/behaviour\`,[\`require\`,\`exports\`,\`module\`],function(e,t,n){var r=function(){this.$behaviours={}};(function(){this.add=function(e,t,n){switch(void 0){case this.$behaviours:this.$behaviours={};case this.$behaviours[e]:this.$behaviours[e]={}}this.$behaviours[e][t]=n},this.addBehaviours=function(e){for(var t in e)for(var n in e[t])this.add(t,n,e[t][n])},this.remove=function(e){this.$behaviours&&this.$behaviours[e]&&delete this.$behaviours[e]},this.inherit=function(e,t){if(typeof e==\`function\`)var n=new e().getBehaviours(t);else var n=e.getBehaviours(t);this.addBehaviours(n)},this.getBehaviours=function(e){if(e){for(var t={},n=0;n<e.length;n++)this.$behaviours[e[n]]&&(t[e[n]]=this.$behaviours[e[n]]);return t}else return this.$behaviours}}).call(r.prototype),t.Behaviour=r}),ace.define(\`ace/token_iterator\`,[\`require\`,\`exports\`,\`module\`,\`ace/range\`],function(e,t,n){var r=e("./range").Range;t.TokenIterator=function(){function e(e,t,n){this.$session=e,this.$row=t,this.$rowTokens=e.getTokens(t);var r=e.getTokenAt(t,n);this.$tokenIndex=r?r.index:-1}return e.prototype.stepBackward=function(){for(--this.$tokenIndex;this.$tokenIndex<0;){if(--this.$row,this.$row<0)return this.$row=0,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=this.$rowTokens.length-1}return this.$rowTokens[this.$tokenIndex]},e.prototype.stepForward=function(){this.$tokenIndex+=1;for(var e;this.$tokenIndex>=this.$rowTokens.length;){if(this.$row+=1,e||=this.$session.getLength(),this.$row>=e)return this.$row=e-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},e.prototype.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},e.prototype.getCurrentTokenRow=function(){return this.$row},e.prototype.getCurrentTokenColumn=function(){var e=this.$rowTokens,t=this.$tokenIndex,n=e[t].start;if(n!==void 0)return n;for(n=0;t>0;)--t,n+=e[t].value.length;return n},e.prototype.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},e.prototype.getCurrentTokenRange=function(){var e=this.$rowTokens[this.$tokenIndex],t=this.getCurrentTokenColumn();return new r(this.$row,t,this.$row,t+e.value.length)},e}()}),ace.define(\`ace/mode/behaviour/cstyle\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/oop\`,\`ace/mode/behaviour\`,\`ace/token_iterator\`,\`ace/lib/lang\`],function(e,t,n){var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,a=e("../../token_iterator").TokenIterator,o=e("../../lib/lang"),s=[\`text\`,\`paren.rparen\`,\`rparen\`,\`paren\`,\`punctuation.operator\`],c=[\`text\`,\`paren.rparen\`,\`rparen\`,\`paren\`,\`punctuation.operator\`,\`comment\`],l,u={},d={'"':\`"\`,"'":\`'\`},f=function(e){var t=-1;if(e.multiSelect&&(t=e.selection.index,u.rangeCount!=e.multiSelect.rangeCount&&(u={rangeCount:e.multiSelect.rangeCount})),u[t])return l=u[t];l=u[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:\`\`,maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:\`\`,maybeInsertedLineEnd:\`\`}},p=function(e,t,n,r){var i=e.end.row-e.start.row;return{text:n+t+r,selection:[0,e.start.column+1,i,e.end.column+ +!i]}},m=function(e){e||={},this.add(\`braces\`,\`insertion\`,function(t,n,r,i,a){var s=r.getCursorPosition(),c=i.doc.getLine(s.row);if(a==\`{\`){f(r);var u=r.getSelectionRange(),d=i.doc.getTextRange(u),h=i.getTokenAt(s.row,s.column);if(d!==\`\`&&d!==\`{\`&&r.getWrapBehavioursEnabled())return p(u,d,\`{\`,\`}\`);if(h&&/(?:string)\\.quasi|\\.xml/.test(h.type))return[/tag\\-(?:open|name)/,/attribute\\-name/].some(function(e){return e.test(h.type)})||/(string)\\.quasi/.test(h.type)&&h.value[s.column-h.start-1]!==\`$\`?void 0:(m.recordAutoInsert(r,i,\`}\`),{text:\`{}\`,selection:[1,1]});if(m.isSaneInsertion(r,i))return/[\\]\\}\\)]/.test(c[s.column])||r.inMultiSelectMode||e.braces?(m.recordAutoInsert(r,i,\`}\`),{text:\`{}\`,selection:[1,1]}):(m.recordMaybeInsert(r,i,\`{\`),{text:\`{\`,selection:[1,1]})}else if(a==\`}\`){f(r);var g=c.substring(s.column,s.column+1);if(g==\`}\`&&i.$findOpeningBracket(\`}\`,{column:s.column+1,row:s.row})!==null&&m.isAutoInsertedClosing(s,c,a))return m.popAutoInsertedClosing(),{text:\`\`,selection:[1,1]}}else if(a==\`
203
203
  \`||a==\`\\r
204
204
  \`){f(r);var _=\`\`;m.isMaybeInsertedClosing(s,c)&&(_=o.stringRepeat(\`}\`,l.maybeInsertedBrackets),m.clearMaybeInsertedClosing());var g=c.substring(s.column,s.column+1);if(g===\`}\`){var v=i.findMatchingBracket({row:s.row,column:s.column+1},\`}\`);if(!v)return null;var y=this.$getIndent(i.getLine(v.row))}else if(_)var y=this.$getIndent(c);else{m.clearMaybeInsertedClosing();return}var b=y+i.getTabString();return{text:\`
@@ -1005,7 +1005,7 @@ Error generating stack: \`+e.message+\`
1005
1005
  border-left-color: transparent!important;
1006
1006
  top: -5px;
1007
1007
  }
1008
- \`,\`error_marker.css\`,!1)}),ace.define(\`ace/ace\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/dom\`,\`ace/range\`,\`ace/editor\`,\`ace/edit_session\`,\`ace/undomanager\`,\`ace/virtual_renderer\`,\`ace/worker/worker_client\`,\`ace/keyboard/hash_handler\`,\`ace/placeholder\`,\`ace/multi_select\`,\`ace/mode/folding/fold_mode\`,\`ace/theme/textmate\`,\`ace/ext/error_marker\`,\`ace/config\`,\`ace/loader_build\`],function(e,t,n){e("./loader_build")(t);var r=e("./lib/dom"),i=e("./range").Range,a=e("./editor").Editor,o=e("./edit_session").EditSession,s=e("./undomanager").UndoManager,c=e("./virtual_renderer").VirtualRenderer;e("./worker/worker_client"),e("./keyboard/hash_handler"),e("./placeholder"),e("./multi_select"),e("./mode/folding/fold_mode"),e("./theme/textmate"),e("./ext/error_marker"),t.config=e("./config"),t.edit=function(e,n){if(typeof e==\`string\`){var i=e;if(e=document.getElementById(i),!e)throw Error(\`ace.edit can't find div #\`+i)}if(e&&e.env&&e.env.editor instanceof a)return e.env.editor;var o=\`\`;if(e&&/input|textarea/i.test(e.tagName)){var s=e;o=s.value,e=r.createElement(\`pre\`),s.parentNode.replaceChild(e,s)}else e&&(o=e.textContent,e.innerHTML=\`\`);var l=t.createEditSession(o),u=new a(new c(e),l,n),d={document:l,editor:u,onResize:u.resize.bind(u,null)};return s&&(d.textarea=s),u.on(\`destroy\`,function(){d.editor.container.env=null}),u.container.env=u.env=d,u},t.createEditSession=function(e,t){var n=new o(e,t);return n.setUndoManager(new s),n},t.Range=i,t.Editor=a,t.EditSession=o,t.UndoManager=s,t.VirtualRenderer=c,t.version=t.config.version}),(function(){ace.require([\`ace/ace\`],function(n){n&&(n.config.init(!0),n.define=ace.define);var r=(function(){return this})();for(var i in!r&&typeof window<\`u\`&&(r=window),!r&&typeof self<\`u\`&&(r=self),r.ace||=n,n)n.hasOwnProperty(i)&&(r.ace[i]=n[i]);r.ace.default=r.ace,typeof t==\`object\`&&typeof e==\`object\`&&t&&(t.exports=r.ace)})})()})),$t=o(((e,t)=>{ace.define(\`ace/snippets\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/dom\`,\`ace/lib/oop\`,\`ace/lib/event_emitter\`,\`ace/lib/lang\`,\`ace/range\`,\`ace/range_list\`,\`ace/keyboard/hash_handler\`,\`ace/tokenizer\`,\`ace/clipboard\`,\`ace/editor\`],function(e,t,n){var r=e("./lib/dom"),i=e("./lib/oop"),a=e("./lib/event_emitter").EventEmitter,o=e("./lib/lang"),s=e("./range").Range,c=e("./range_list").RangeList,l=e("./keyboard/hash_handler").HashHandler,u=e("./tokenizer").Tokenizer,d=e("./clipboard"),f={CURRENT_WORD:function(e){return e.session.getTextRange(e.session.getWordRange())},SELECTION:function(e,t,n){var r=e.session.getTextRange();return n?r.replace(/\\n\\r?([ \\t]*\\S)/g,\`
1008
+ \`,\`error_marker.css\`,!1)}),ace.define(\`ace/ace\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/dom\`,\`ace/range\`,\`ace/editor\`,\`ace/edit_session\`,\`ace/undomanager\`,\`ace/virtual_renderer\`,\`ace/worker/worker_client\`,\`ace/keyboard/hash_handler\`,\`ace/placeholder\`,\`ace/multi_select\`,\`ace/mode/folding/fold_mode\`,\`ace/theme/textmate\`,\`ace/ext/error_marker\`,\`ace/config\`,\`ace/loader_build\`],function(e,t,n){e("./loader_build")(t);var r=e("./lib/dom"),i=e("./range").Range,a=e("./editor").Editor,o=e("./edit_session").EditSession,s=e("./undomanager").UndoManager,c=e("./virtual_renderer").VirtualRenderer;e("./worker/worker_client"),e("./keyboard/hash_handler"),e("./placeholder"),e("./multi_select"),e("./mode/folding/fold_mode"),e("./theme/textmate"),e("./ext/error_marker"),t.config=e("./config"),t.edit=function(e,n){if(typeof e==\`string\`){var i=e;if(e=document.getElementById(i),!e)throw Error(\`ace.edit can't find div #\`+i)}if(e&&e.env&&e.env.editor instanceof a)return e.env.editor;var o=\`\`;if(e&&/input|textarea/i.test(e.tagName)){var s=e;o=s.value,e=r.createElement(\`pre\`),s.parentNode.replaceChild(e,s)}else e&&(o=e.textContent,e.innerHTML=\`\`);var l=t.createEditSession(o),u=new a(new c(e),l,n),d={document:l,editor:u,onResize:u.resize.bind(u,null)};return s&&(d.textarea=s),u.on(\`destroy\`,function(){d.editor.container.env=null}),u.container.env=u.env=d,u},t.createEditSession=function(e,t){var n=new o(e,t);return n.setUndoManager(new s),n},t.Range=i,t.Editor=a,t.EditSession=o,t.UndoManager=s,t.VirtualRenderer=c,t.version=t.config.version}),(function(){ace.require([\`ace/ace\`],function(n){n&&(n.config.init(!0),n.define=ace.define);var r=(function(){return this})();for(var i in!r&&typeof window<\`u\`&&(r=window),!r&&typeof self<\`u\`&&(r=self),r.ace||=n,n)n.hasOwnProperty(i)&&(r.ace[i]=n[i]);r.ace.default=r.ace,typeof t==\`object\`&&typeof e==\`object\`&&t&&(t.exports=r.ace)})})()})),tn=o(((e,t)=>{ace.define(\`ace/snippets\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/dom\`,\`ace/lib/oop\`,\`ace/lib/event_emitter\`,\`ace/lib/lang\`,\`ace/range\`,\`ace/range_list\`,\`ace/keyboard/hash_handler\`,\`ace/tokenizer\`,\`ace/clipboard\`,\`ace/editor\`],function(e,t,n){var r=e("./lib/dom"),i=e("./lib/oop"),a=e("./lib/event_emitter").EventEmitter,o=e("./lib/lang"),s=e("./range").Range,c=e("./range_list").RangeList,l=e("./keyboard/hash_handler").HashHandler,u=e("./tokenizer").Tokenizer,d=e("./clipboard"),f={CURRENT_WORD:function(e){return e.session.getTextRange(e.session.getWordRange())},SELECTION:function(e,t,n){var r=e.session.getTextRange();return n?r.replace(/\\n\\r?([ \\t]*\\S)/g,\`
1009
1009
  \`+n+\`$1\`):r},CURRENT_LINE:function(e){return e.session.getLine(e.getCursorPosition().row)},PREV_LINE:function(e){return e.session.getLine(e.getCursorPosition().row-1)},LINE_INDEX:function(e){return e.getCursorPosition().row},LINE_NUMBER:function(e){return e.getCursorPosition().row+1},SOFT_TABS:function(e){return e.session.getUseSoftTabs()?\`YES\`:\`NO\`},TAB_SIZE:function(e){return e.session.getTabSize()},CLIPBOARD:function(e){return d.getText&&d.getText()},FILENAME:function(e){return/[^/\\\\]*$/.exec(this.FILEPATH(e))[0]},FILENAME_BASE:function(e){return/[^/\\\\]*$/.exec(this.FILEPATH(e))[0].replace(/\\.[^.]*$/,\`\`)},DIRECTORY:function(e){return this.FILEPATH(e).replace(/[^/\\\\]*$/,\`\`)},FILEPATH:function(e){return\`/not implemented.txt\`},WORKSPACE_NAME:function(){return\`Unknown\`},FULLNAME:function(){return\`Unknown\`},BLOCK_COMMENT_START:function(e){var t=e.session.$mode||{};return t.blockComment&&t.blockComment.start||\`\`},BLOCK_COMMENT_END:function(e){var t=e.session.$mode||{};return t.blockComment&&t.blockComment.end||\`\`},LINE_COMMENT:function(e){return(e.session.$mode||{}).lineCommentStart||\`\`},CURRENT_YEAR:p.bind(null,{year:\`numeric\`}),CURRENT_YEAR_SHORT:p.bind(null,{year:\`2-digit\`}),CURRENT_MONTH:p.bind(null,{month:\`numeric\`}),CURRENT_MONTH_NAME:p.bind(null,{month:\`long\`}),CURRENT_MONTH_NAME_SHORT:p.bind(null,{month:\`short\`}),CURRENT_DATE:p.bind(null,{day:\`2-digit\`}),CURRENT_DAY_NAME:p.bind(null,{weekday:\`long\`}),CURRENT_DAY_NAME_SHORT:p.bind(null,{weekday:\`short\`}),CURRENT_HOUR:p.bind(null,{hour:\`2-digit\`,hour12:!1}),CURRENT_MINUTE:p.bind(null,{minute:\`2-digit\`}),CURRENT_SECOND:p.bind(null,{second:\`2-digit\`})};f.SELECTED_TEXT=f.SELECTION;function p(e){var t=new Date().toLocaleString(\`en-us\`,e);return t.length==1?\`0\`+t:t}var m=function(){function e(){this.snippetMap={},this.snippetNameMap={},this.variables=f}return e.prototype.getTokenizer=function(){return e.$tokenizer||this.createTokenizer()},e.prototype.createTokenizer=function(){function t(e){return e=e.substr(1),/^\\d+$/.test(e)?[{tabstopId:parseInt(e,10)}]:[{text:e}]}function n(e){return\`(?:[^\\\\\\\\\`+e+\`]|\\\\\\\\.)\`}var r={regex:\`/(\`+n(\`/\`)+\`+)/\`,onMatch:function(e,t,n){var r=n[0];return r.fmtString=!0,r.guard=e.slice(1,-1),r.flag=\`\`,\`\`},next:\`formatString\`};return e.$tokenizer=new u({start:[{regex:/\\\\./,onMatch:function(e,t,n){var r=e[1];return(r==\`}\`&&n.length||"\`$\\\\".indexOf(r)!=-1)&&(e=r),[e]}},{regex:/}/,onMatch:function(e,t,n){return[n.length?n.shift():e]}},{regex:/\\$(?:\\d+|\\w+)/,onMatch:t},{regex:/\\$\\{[\\dA-Z_a-z]+/,onMatch:function(e,n,r){var i=t(e.substr(1));return r.unshift(i[0]),i},next:\`snippetVar\`},{regex:/\\n/,token:\`newline\`,merge:!1}],snippetVar:[{regex:\`\\\\|\`+n(\`\\\\|\`)+\`*\\\\|\`,onMatch:function(e,t,n){var r=e.slice(1,-1).replace(/\\\\[,|\\\\]|,/g,function(e){return e.length==2?e[1]:\`\\0\`}).split(\`\\0\`).map(function(e){return{value:e}});return n[0].choices=r,[r[0]]},next:\`start\`},r,{regex:\`([^:}\\\\\\\\]|\\\\\\\\.)*:?\`,token:\`\`,next:\`start\`}],formatString:[{regex:/:/,onMatch:function(e,t,n){return n.length&&n[0].expectElse?(n[0].expectElse=!1,n[0].ifEnd={elseEnd:n[0]},[n[0].ifEnd]):\`:\`}},{regex:/\\\\./,onMatch:function(e,t,n){var r=e[1];return r==\`}\`&&n.length?e=r:"\`$\\\\".indexOf(r)==-1?r==\`n\`?e=\`
1010
1010
  \`:r==\`t\`?e=\` \`:\`ulULE\`.indexOf(r)!=-1&&(e={changeCase:r,local:r>\`a\`}):e=r,[e]}},{regex:\`/\\\\w*}\`,onMatch:function(e,t,n){var r=n.shift();return r&&(r.flag=e.slice(1,-1)),this.next=r&&r.tabstopId?\`start\`:\`\`,[r||e]},next:\`start\`},{regex:/\\$(?:\\d+|\\w+)/,onMatch:function(e,t,n){return[{text:e.slice(1)}]}},{regex:/\\\${\\w+/,onMatch:function(e,t,n){var r={text:e.slice(2)};return n.unshift(r),[r]},next:\`formatStringVar\`},{regex:/\\n/,token:\`newline\`,merge:!1},{regex:/}/,onMatch:function(e,t,n){var r=n.shift();return this.next=r&&r.tabstopId?\`start\`:\`\`,[r||e]},next:\`start\`}],formatStringVar:[{regex:/:\\/\\w+}/,onMatch:function(e,t,n){var r=n[0];return r.formatFunction=e.slice(2,-1),[n.shift()]},next:\`formatString\`},r,{regex:/:[\\?\\-+]?/,onMatch:function(e,t,n){e[1]==\`+\`&&(n[0].ifEnd=n[0]),e[1]==\`?\`&&(n[0].expectElse=!0)},next:\`formatString\`},{regex:\`([^:}\\\\\\\\]|\\\\\\\\.)*:?\`,token:\`\`,next:\`formatString\`}]}),e.$tokenizer},e.prototype.tokenizeTmSnippet=function(e,t){return this.getTokenizer().getLineTokens(e,t).tokens.map(function(e){return e.value||e})},e.prototype.getVariableValue=function(e,t,n){if(/^\\d+$/.test(t))return(this.variables.__||{})[t]||\`\`;if(/^[A-Z]\\d+$/.test(t))return(this.variables[t[0]+\`__\`]||{})[t.substr(1)]||\`\`;if(t=t.replace(/^TM_/,\`\`),!this.variables.hasOwnProperty(t))return\`\`;var r=this.variables[t];return typeof r==\`function\`&&(r=this.variables[t](e,t,n)),r??\`\`},e.prototype.tmStrFormat=function(e,t,n){if(!t.fmt)return e;var r=t.flag||\`\`,i=t.guard;i=new RegExp(i,r.replace(/[^gim]/g,\`\`));var a=typeof t.fmt==\`string\`?this.tokenizeTmSnippet(t.fmt,\`formatString\`):t.fmt,o=this;return e.replace(i,function(){var e=o.variables.__;o.variables.__=[].slice.call(arguments);for(var t=o.resolveVariables(a,n),r=\`E\`,i=0;i<t.length;i++){var s=t[i];if(typeof s==\`object\`)if(t[i]=\`\`,s.changeCase&&s.local){var c=t[i+1];c&&typeof c==\`string\`&&(s.changeCase==\`u\`?t[i]=c[0].toUpperCase():t[i]=c[0].toLowerCase(),t[i+1]=c.substr(1))}else s.changeCase&&(r=s.changeCase);else r==\`U\`?t[i]=s.toUpperCase():r==\`L\`&&(t[i]=s.toLowerCase())}return o.variables.__=e,t.join(\`\`)})},e.prototype.tmFormatFunction=function(e,t,n){return t.formatFunction==\`upcase\`?e.toUpperCase():t.formatFunction==\`downcase\`?e.toLowerCase():e},e.prototype.resolveVariables=function(e,t){for(var n=[],r=\`\`,i=!0,a=0;a<e.length;a++){var o=e[a];if(typeof o==\`string\`){n.push(o),o==\`
1011
1011
  \`?(i=!0,r=\`\`):i&&=(r=/^\\t*/.exec(o)[0],/\\S/.test(o));continue}if(o){if(i=!1,o.fmtString){var s=e.indexOf(o,a+1);s==-1&&(s=e.length),o.fmt=e.slice(a+1,s),a=s}if(o.text){var c=this.getVariableValue(t,o.text,r)+\`\`;o.fmtString&&(c=this.tmStrFormat(c,o,t)),o.formatFunction&&(c=this.tmFormatFunction(c,o,t)),c&&!o.ifEnd?(n.push(c),l(o)):!c&&o.ifEnd&&l(o.ifEnd)}else o.elseEnd?l(o.elseEnd):o.tabstopId==null?o.changeCase!=null&&n.push(o):n.push(o)}}function l(t){var n=e.indexOf(t,a+1);n!=-1&&(a=n)}return n},e.prototype.getDisplayTextForSnippet=function(e,t){return h.call(this,e,t).text},e.prototype.insertSnippetForSelection=function(e,t,n){n===void 0&&(n={});var r=h.call(this,e,t,n),i=e.getSelectionRange(),a=e.session.replace(i,r.text),o=new g(e),s=e.inVirtualSelectionMode&&e.selection.index;o.addTabstops(r.tabstops,i.start,a,s)},e.prototype.insertSnippet=function(e,t,n){n===void 0&&(n={});var r=this;if(e.inVirtualSelectionMode)return r.insertSnippetForSelection(e,t,n);e.forEachSelection(function(){r.insertSnippetForSelection(e,t,n)},null,{keepOrder:!0}),e.tabstopManager&&e.tabstopManager.tabNext()},e.prototype.$getScope=function(e){var t=e.session.$mode.$id||\`\`;if(t=t.split(\`/\`).pop(),t===\`html\`||t===\`php\`){t===\`php\`&&!e.session.$mode.inlinePhp&&(t=\`html\`);var n=e.getCursorPosition(),r=e.session.getState(n.row);typeof r==\`object\`&&(r=r[0]),r.substring&&(r.substring(0,3)==\`js-\`?t=\`javascript\`:r.substring(0,4)==\`css-\`?t=\`css\`:r.substring(0,4)==\`php-\`&&(t=\`php\`))}return t},e.prototype.getActiveScopes=function(e){var t=this.$getScope(e),n=[t],r=this.snippetMap;return r[t]&&r[t].includeScopes&&n.push.apply(n,r[t].includeScopes),n.push(\`_\`),n},e.prototype.expandWithTab=function(e,t){var n=this,r=e.forEachSelection(function(){return n.expandSnippetForSelection(e,t)},null,{keepOrder:!0});return r&&e.tabstopManager&&e.tabstopManager.tabNext(),r},e.prototype.expandSnippetForSelection=function(e,t){var n=e.getCursorPosition(),r=e.session.getLine(n.row),i=r.substring(0,n.column),a=r.substr(n.column),o=this.snippetMap,s;return this.getActiveScopes(e).some(function(e){var t=o[e];return t&&(s=this.findMatchingSnippet(t,i,a)),!!s},this),s?t&&t.dryRun?!0:(e.session.doc.removeInLine(n.row,n.column-s.replaceBefore.length,n.column+s.replaceAfter.length),this.variables.M__=s.matchBefore,this.variables.T__=s.matchAfter,this.insertSnippetForSelection(e,s.content),this.variables.M__=this.variables.T__=null,!0):!1},e.prototype.findMatchingSnippet=function(e,t,n){for(var r=e.length;r--;){var i=e[r];if(!(i.startRe&&!i.startRe.test(t))&&!(i.endRe&&!i.endRe.test(n))&&!(!i.startRe&&!i.endRe))return i.matchBefore=i.startRe?i.startRe.exec(t):[\`\`],i.matchAfter=i.endRe?i.endRe.exec(n):[\`\`],i.replaceBefore=i.triggerRe?i.triggerRe.exec(t)[0]:\`\`,i.replaceAfter=i.endTriggerRe?i.endTriggerRe.exec(n)[0]:\`\`,i}},e.prototype.register=function(e,t){var n=this.snippetMap,r=this.snippetNameMap,i=this;e||=[];function a(e){return e&&!/^\\^?\\(.*\\)\\$?$|^\\\\b$/.test(e)&&(e=\`(?:\`+e+\`)\`),e||\`\`}function s(e,t,n){return e=a(e),t=a(t),n?(e=t+e,e&&e[e.length-1]!=\`$\`&&(e+=\`$\`)):(e+=t,e&&e[0]!=\`^\`&&(e=\`^\`+e)),new RegExp(e)}function c(e){e.scope||=t||\`_\`,t=e.scope,n[t]||(n[t]=[],r[t]={});var a=r[t];if(e.name){var c=a[e.name];c&&i.unregister(c),a[e.name]=e}n[t].push(e),e.prefix&&(e.tabTrigger=e.prefix),!e.content&&e.body&&(e.content=Array.isArray(e.body)?e.body.join(\`
@@ -1111,11 +1111,11 @@ Error generating stack: \`+e.message+\`
1111
1111
  animation: none;
1112
1112
  }
1113
1113
  }
1114
- \`,\`autocompletion.css\`,!1),t.AcePopup=g,t.$singleLineEditor=h,t.getAriaId=d}),ace.define(\`ace/autocomplete/inline_screenreader\`,[\`require\`,\`exports\`,\`module\`],function(e,t,n){t.AceInlineScreenReader=function(){function e(e){this.editor=e,this.screenReaderDiv=document.createElement(\`div\`),this.screenReaderDiv.classList.add(\`ace_screenreader-only\`),this.editor.container.appendChild(this.screenReaderDiv)}return e.prototype.setScreenReaderContent=function(e){for(!this.popup&&this.editor.completer&&this.editor.completer.popup&&(this.popup=this.editor.completer.popup,this.popup.renderer.on(\`afterRender\`,function(){var e=this.popup.getRow(),t=this.popup.renderer.$textLayer,n=t.element.childNodes[e-t.config.firstRow];if(n){for(var r=\`doc-tooltip \`,i=0;i<this._lines.length;i++)r+=\`ace-inline-screenreader-line-\${i} \`;n.setAttribute(\`aria-describedby\`,r)}}.bind(this)));this.screenReaderDiv.firstChild;)this.screenReaderDiv.removeChild(this.screenReaderDiv.firstChild);this._lines=e.split(/\\r\\n|\\r|\\n/);var t=this.createCodeBlock();this.screenReaderDiv.appendChild(t)},e.prototype.destroy=function(){this.screenReaderDiv.remove()},e.prototype.createCodeBlock=function(){var e=document.createElement(\`pre\`);e.setAttribute(\`id\`,\`ace-inline-screenreader\`);for(var t=0;t<this._lines.length;t++){var n=document.createElement(\`code\`);n.setAttribute(\`id\`,\`ace-inline-screenreader-line-\${t}\`);var r=document.createTextNode(this._lines[t]);n.appendChild(r),e.appendChild(n)}return e},e}()}),ace.define(\`ace/autocomplete/inline\`,[\`require\`,\`exports\`,\`module\`,\`ace/snippets\`,\`ace/autocomplete/inline_screenreader\`],function(e,t,n){var r=e("../snippets").snippetManager,i=e("./inline_screenreader").AceInlineScreenReader;t.AceInline=function(){function e(){this.editor=null}return e.prototype.show=function(e,t,n){if(n||=\`\`,e&&this.editor&&this.editor!==e&&(this.hide(),this.editor=null,this.inlineScreenReader=null),!e||!t)return!1;this.inlineScreenReader||=new i(e);var a=t.snippet?r.getDisplayTextForSnippet(e,t.snippet):t.value;return t.hideInlinePreview||!a||!a.startsWith(n)?!1:(this.editor=e,this.inlineScreenReader.setScreenReaderContent(a),a=a.slice(n.length),a===\`\`?e.removeGhostText():e.setGhostText(a),!0)},e.prototype.isOpen=function(){return this.editor?!!this.editor.renderer.$ghostText:!1},e.prototype.hide=function(){return this.editor?(this.editor.removeGhostText(),!0):!1},e.prototype.destroy=function(){this.hide(),this.editor=null,this.inlineScreenReader&&=(this.inlineScreenReader.destroy(),null)},e}()}),ace.define(\`ace/autocomplete/util\`,[\`require\`,\`exports\`,\`module\`],function(e,t,n){t.parForEach=function(e,t,n){var r=0,i=e.length;i===0&&n();for(var a=0;a<i;a++)t(e[a],function(e,t){r++,r===i&&n(e,t)})};var r=/[a-zA-Z_0-9\\$\\-\\u00A2-\\u2000\\u2070-\\uFFFF]/;t.retrievePrecedingIdentifier=function(e,t,n){n||=r;for(var i=[],a=t-1;a>=0&&n.test(e[a]);a--)i.push(e[a]);return i.reverse().join(\`\`)},t.retrieveFollowingIdentifier=function(e,t,n){n||=r;for(var i=[],a=t;a<e.length&&n.test(e[a]);a++)i.push(e[a]);return i},t.getCompletionPrefix=function(e){var t=e.getCursorPosition(),n=e.session.getLine(t.row),r;return e.completers.forEach(function(e){e.identifierRegexps&&e.identifierRegexps.forEach(function(e){!r&&e&&(r=this.retrievePrecedingIdentifier(n,t.column,e))}.bind(this))}.bind(this)),r||this.retrievePrecedingIdentifier(n,t.column)},t.triggerAutocomplete=function(e,t){var t=t??e.session.getPrecedingCharacter();return e.completers.some(function(e){if(e.triggerCharacters&&Array.isArray(e.triggerCharacters))return e.triggerCharacters.includes(t)})}}),ace.define(\`ace/autocomplete\`,[\`require\`,\`exports\`,\`module\`,\`ace/keyboard/hash_handler\`,\`ace/autocomplete/popup\`,\`ace/autocomplete/inline\`,\`ace/autocomplete/popup\`,\`ace/autocomplete/util\`,\`ace/lib/lang\`,\`ace/lib/dom\`,\`ace/snippets\`,\`ace/config\`,\`ace/lib/event\`,\`ace/lib/scroll\`],function(e,t,n){var r=e("./keyboard/hash_handler").HashHandler,i=e("./autocomplete/popup").AcePopup,a=e("./autocomplete/inline").AceInline,o=e("./autocomplete/popup").getAriaId,s=e("./autocomplete/util"),c=e("./lib/lang"),l=e("./lib/dom"),u=e("./snippets").snippetManager,d=e("./config"),f=e("./lib/event"),p=e("./lib/scroll").preventParentScroll,m=function(e,t){t.completer&&t.completer.destroy()},h=function(){function e(){this.autoInsert=!1,this.autoSelect=!0,this.autoShown=!1,this.exactMatch=!1,this.inlineEnabled=!1,this.keyboardHandler=new r,this.keyboardHandler.bindKeys(this.commands),this.parentNode=null,this.setSelectOnHover=!1,this.hasSeen=new Set,this.showLoadingState=!1,this.stickySelectionDelay=500,this.blurListener=this.blurListener.bind(this),this.changeListener=this.changeListener.bind(this),this.mousedownListener=this.mousedownListener.bind(this),this.mousewheelListener=this.mousewheelListener.bind(this),this.onLayoutChange=this.onLayoutChange.bind(this),this.changeTimer=c.delayedCall(function(){this.updateCompletions(!0)}.bind(this)),this.tooltipTimer=c.delayedCall(this.updateDocTooltip.bind(this),50),this.popupTimer=c.delayedCall(this.$updatePopupPosition.bind(this),50),this.stickySelectionTimer=c.delayedCall(function(){this.stickySelection=!0}.bind(this),this.stickySelectionDelay),this.$firstOpenTimer=c.delayedCall(function(){var t=this.completionProvider&&this.completionProvider.initialPosition;this.autoShown||this.popup&&this.popup.isOpen||!t||this.editor.completers.length===0||(this.completions=new _(e.completionsForLoading),this.openPopup(this.editor,t.prefix,!1),this.popup.renderer.setStyle(\`ace_loading\`,!0))}.bind(this),this.stickySelectionDelay)}return Object.defineProperty(e,"completionsForLoading",{get:function(){return[{caption:d.nls(\`autocomplete.loading\`,\`Loading...\`),value:\`\`}]},enumerable:!1,configurable:!0}),e.prototype.$init=function(){return this.popup=new i(this.parentNode||document.body||document.documentElement),this.popup.on(\`click\`,function(e){this.insertMatch(),e.stop()}.bind(this)),this.popup.focus=this.editor.focus.bind(this.editor),this.popup.on(\`show\`,this.$onPopupShow.bind(this)),this.popup.on(\`hide\`,this.$onHidePopup.bind(this)),this.popup.on(\`select\`,this.$onPopupChange.bind(this)),f.addListener(this.popup.container,\`mouseout\`,this.mouseOutListener.bind(this)),this.popup.on(\`changeHoverMarker\`,this.tooltipTimer.bind(null,null)),this.popup.renderer.on(\`afterRender\`,this.$onPopupRender.bind(this)),this.popup},e.prototype.$initInline=function(){if(!(!this.inlineEnabled||this.inlineRenderer))return this.inlineRenderer=new a,this.inlineRenderer},e.prototype.getPopup=function(){return this.popup||this.$init()},e.prototype.$onHidePopup=function(){this.inlineRenderer&&this.inlineRenderer.hide(),this.hideDocTooltip(),this.stickySelectionTimer.cancel(),this.popupTimer.cancel(),this.stickySelection=!1},e.prototype.$seen=function(e){!this.hasSeen.has(e)&&e&&e.completer&&e.completer.onSeen&&typeof e.completer.onSeen==\`function\`&&(e.completer.onSeen(this.editor,e),this.hasSeen.add(e))},e.prototype.$onPopupChange=function(e){if(this.inlineRenderer&&this.inlineEnabled){var t=e?null:this.popup.getData(this.popup.getRow());if(this.$updateGhostText(t),this.popup.isMouseOver&&this.setSelectOnHover){this.tooltipTimer.call(null,null);return}this.popupTimer.schedule(),this.tooltipTimer.schedule()}else this.popupTimer.call(null,null),this.tooltipTimer.call(null,null)},e.prototype.$updateGhostText=function(e){var t=this.base.row,n=this.base.column,r=this.editor.getCursorPosition().column,i=this.editor.session.getLine(t).slice(n,r);this.inlineRenderer.show(this.editor,e,i)?this.$seen(e):this.inlineRenderer.hide()},e.prototype.$onPopupRender=function(){var e=this.inlineRenderer&&this.inlineEnabled;if(this.completions&&this.completions.filtered&&this.completions.filtered.length>0)for(var t=this.popup.getFirstVisibleRow();t<=this.popup.getLastVisibleRow();t++){var n=this.popup.getData(t);n&&(!e||n.hideInlinePreview)&&this.$seen(n)}},e.prototype.$onPopupShow=function(e){this.$onPopupChange(e),this.stickySelection=!1,this.stickySelectionDelay>=0&&this.stickySelectionTimer.schedule(this.stickySelectionDelay)},e.prototype.observeLayoutChanges=function(){if(!(this.$elements||!this.editor)){window.addEventListener(\`resize\`,this.onLayoutChange,{passive:!0}),window.addEventListener(\`wheel\`,this.mousewheelListener);for(var e=this.editor.container.parentNode,t=[];e;)t.push(e),e.addEventListener(\`scroll\`,this.onLayoutChange,{passive:!0}),e=e.parentNode;this.$elements=t}},e.prototype.unObserveLayoutChanges=function(){var e=this;window.removeEventListener(\`resize\`,this.onLayoutChange,{passive:!0}),window.removeEventListener(\`wheel\`,this.mousewheelListener),this.$elements&&this.$elements.forEach(function(t){t.removeEventListener(\`scroll\`,e.onLayoutChange,{passive:!0})}),this.$elements=null},e.prototype.onLayoutChange=function(){if(!this.popup.isOpen)return this.unObserveLayoutChanges();this.$updatePopupPosition(),this.updateDocTooltip()},e.prototype.$updatePopupPosition=function(){var e=this.editor,t=e.renderer,n=t.layerConfig.lineHeight,r=t.$cursorLayer.getPixelPosition(this.base,!0);r.left-=this.popup.getTextLeftOffset();var i=e.container.getBoundingClientRect();r.top+=i.top-t.layerConfig.offset,r.left+=i.left-e.renderer.scrollLeft,r.left+=t.gutterWidth;var a={top:r.top,left:r.left};t.$ghostText&&t.$ghostTextWidget&&this.base.row===t.$ghostText.position.row&&(a.top+=t.$ghostTextWidget.el.offsetHeight);var o=e.container.getBoundingClientRect().bottom-n,s=o<a.top?{top:o,left:a.left}:a;this.popup.tryShow(s,n,\`bottom\`)||this.popup.tryShow(r,n,\`top\`)||this.popup.show(r,n)},e.prototype.openPopup=function(e,t,n){this.$firstOpenTimer.cancel(),this.popup||this.$init(),this.inlineEnabled&&!this.inlineRenderer&&this.$initInline(),this.popup.autoSelect=this.autoSelect,this.popup.setSelectOnHover(this.setSelectOnHover);var r=this.popup.getRow(),i=this.popup.data[r];this.popup.setData(this.completions.filtered,this.completions.filterText),this.editor.textInput.setAriaOptions&&this.editor.textInput.setAriaOptions({activeDescendant:o(this.popup.getRow()),inline:this.inlineEnabled}),e.keyBinding.addKeyboardHandler(this.keyboardHandler);var a;this.stickySelection&&(a=this.popup.data.indexOf(i)),(!a||a===-1)&&(a=0),this.popup.setRow(this.autoSelect?a:-1),a===r&&i!==this.completions.filtered[a]&&this.$onPopupChange();var s=this.inlineRenderer&&this.inlineEnabled;if(a===r&&s){var c=this.popup.getData(this.popup.getRow());this.$updateGhostText(c)}n||(this.popup.setTheme(e.getTheme()),this.popup.setFontSize(e.getFontSize()),this.$updatePopupPosition(),this.tooltipNode&&this.updateDocTooltip()),this.changeTimer.cancel(),this.observeLayoutChanges()},e.prototype.detach=function(){this.editor&&(this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.off(\`changeSelection\`,this.changeListener),this.editor.off(\`blur\`,this.blurListener),this.editor.off(\`mousedown\`,this.mousedownListener),this.editor.off(\`mousewheel\`,this.mousewheelListener)),this.$firstOpenTimer.cancel(),this.changeTimer.cancel(),this.hideDocTooltip(),this.completionProvider&&this.completionProvider.detach(),this.popup&&this.popup.isOpen&&this.popup.hide(),this.popup&&this.popup.renderer&&this.popup.renderer.off(\`afterRender\`,this.$onPopupRender),this.base&&this.base.detach(),this.activated=!1,this.completionProvider=this.completions=this.base=null,this.unObserveLayoutChanges()},e.prototype.changeListener=function(e){var t=this.editor.selection.lead;(t.row!=this.base.row||t.column<this.base.column)&&this.detach(),this.activated?this.changeTimer.schedule():this.detach()},e.prototype.blurListener=function(e){var t=document.activeElement,n=this.editor.textInput.getElement(),r=e.relatedTarget&&this.tooltipNode&&this.tooltipNode.contains(e.relatedTarget),i=this.popup&&this.popup.container;t!=n&&t.parentNode!=i&&!r&&t!=this.tooltipNode&&e.relatedTarget!=n&&this.detach()},e.prototype.mousedownListener=function(e){this.detach()},e.prototype.mousewheelListener=function(e){this.popup&&!this.popup.isMouseOver&&this.detach()},e.prototype.mouseOutListener=function(e){this.popup.isOpen&&this.$updatePopupPosition()},e.prototype.goTo=function(e){this.popup.goTo(e)},e.prototype.insertMatch=function(e,t){if(e||=this.popup.getData(this.popup.getRow()),!e)return!1;if(e.value===\`\`)return this.detach();var n=this.completions,r=this.getCompletionProvider().insertMatch(this.editor,e,n.filterText,t);return this.completions==n&&this.detach(),r},e.prototype.showPopup=function(e,t){this.editor&&this.detach(),this.activated=!0,this.editor=e,e.completer!=this&&(e.completer&&e.completer.detach(),e.completer=this),e.on(\`changeSelection\`,this.changeListener),e.on(\`blur\`,this.blurListener),e.on(\`mousedown\`,this.mousedownListener),e.on(\`mousewheel\`,this.mousewheelListener),this.updateCompletions(!1,t)},e.prototype.getCompletionProvider=function(e){return this.completionProvider||=new g(e),this.completionProvider},e.prototype.gatherCompletions=function(e,t){return this.getCompletionProvider().gatherCompletions(e,t)},e.prototype.updateCompletions=function(t,n){if(t&&this.base&&this.completions){var r=this.editor.getCursorPosition(),i=this.editor.session.getTextRange({start:this.base,end:r});if(i==this.completions.filterText)return;if(this.completions.setFilter(i),!this.completions.filtered.length||this.completions.filtered.length==1&&this.completions.filtered[0].value==i&&!this.completions.filtered[0].snippet)return this.detach();this.openPopup(this.editor,i,t);return}if(n&&n.matches){var r=this.editor.getSelectionRange().start;return this.base=this.editor.session.doc.createAnchor(r.row,r.column),this.base.$insertRight=!0,this.completions=new _(n.matches),this.getCompletionProvider().completions=this.completions,this.openPopup(this.editor,\`\`,t)}var a=this.editor.getSession(),r=this.editor.getCursorPosition(),i=s.getCompletionPrefix(this.editor);this.base=a.doc.createAnchor(r.row,r.column-i.length),this.base.$insertRight=!0;var o={exactMatch:this.exactMatch,ignoreCaption:this.ignoreCaption};this.getCompletionProvider({prefix:i,pos:r}).provideCompletions(this.editor,o,function(n,r,i){var a=r.filtered,o=s.getCompletionPrefix(this.editor);if(this.$firstOpenTimer.cancel(),i){if(!a.length){var c=!this.autoShown&&this.emptyMessage;if(typeof c==\`function\`&&(c=this.emptyMessage(o)),c){var l=[{caption:c,value:\`\`}];this.completions=new _(l),this.openPopup(this.editor,o,t),this.popup.renderer.setStyle(\`ace_loading\`,!1),this.popup.renderer.setStyle(\`ace_empty-message\`,!0);return}return this.detach()}if(a.length==1&&a[0].value==o&&!a[0].snippet)return this.detach();if(this.autoInsert&&!this.autoShown&&a.length==1)return this.insertMatch(a[0])}this.completions=!i&&this.showLoadingState?new _(e.completionsForLoading.concat(a),r.filterText):r,this.openPopup(this.editor,o,t),this.popup.renderer.setStyle(\`ace_empty-message\`,!1),this.popup.renderer.setStyle(\`ace_loading\`,!i)}.bind(this)),this.showLoadingState&&!this.autoShown&&!(this.popup&&this.popup.isOpen)&&this.$firstOpenTimer.delay(this.stickySelectionDelay/2)},e.prototype.cancelContextMenu=function(){this.editor.$mouseHandler.cancelContextMenu()},e.prototype.updateDocTooltip=function(){var e=this.popup,t=this.completions&&this.completions.filtered,n=t&&(t[e.getHoveredRow()]||t[e.getRow()]),r=null;if(!n||!this.editor||!this.popup.isOpen)return this.hideDocTooltip();for(var i=this.editor.completers.length,a=0;a<i;a++){var o=this.editor.completers[a];if(o.getDocTooltip&&n.completerId===o.id){r=o.getDocTooltip(n);break}}if(!r&&typeof n!=\`string\`&&(r=n),typeof r==\`string\`&&(r={docText:r}),!r||!(r.docHTML||r.docText))return this.hideDocTooltip();this.showDocTooltip(r)},e.prototype.showDocTooltip=function(e){this.tooltipNode||(this.tooltipNode=l.createElement(\`div\`),this.tooltipNode.style.margin=\`0\`,this.tooltipNode.style.pointerEvents=\`auto\`,this.tooltipNode.style.overscrollBehavior=\`contain\`,this.tooltipNode.tabIndex=-1,this.tooltipNode.onblur=this.blurListener.bind(this),this.tooltipNode.onclick=this.onTooltipClick.bind(this),this.tooltipNode.id=\`doc-tooltip\`,this.tooltipNode.setAttribute(\`role\`,\`tooltip\`),this.tooltipNode.addEventListener(\`wheel\`,p));var t=this.editor.renderer.theme;this.tooltipNode.className=\`ace_tooltip ace_doc-tooltip \`+(t.isDark?\`ace_dark \`:\`\`)+(t.cssClass||\`\`);var n=this.tooltipNode;e.docHTML?n.innerHTML=e.docHTML:e.docText&&(n.textContent=e.docText),n.parentNode||this.popup.container.appendChild(this.tooltipNode);var r=this.popup,i=r.container.getBoundingClientRect(),a=400,o=300,s=r.renderer.scrollBar.width||10,c=i.left,u=window.innerWidth-i.right-s,d=r.isTopdown?window.innerHeight-s-i.bottom:i.top,f=[Math.min(u/a,1),Math.min(c/a,1),Math.min(d/o,1)*.9],m=Math.max.apply(Math,f),h=n.style;h.display=\`block\`,m==f[0]||f[0]>=1?(h.left=i.right+1+\`px\`,h.right=\`\`,h.maxWidth=a*m+\`px\`,h.top=i.top+\`px\`,h.bottom=\`\`,h.maxHeight=Math.min(window.innerHeight-s-i.top,o)+\`px\`):m==f[1]||f[1]>=1?(h.right=window.innerWidth-i.left+\`px\`,h.left=\`\`,h.maxWidth=a*m+\`px\`,h.top=i.top+\`px\`,h.bottom=\`\`,h.maxHeight=Math.min(window.innerHeight-s-i.top,o)+\`px\`):m==f[2]&&(h.left=i.left+\`px\`,h.right=\`\`,h.maxWidth=Math.min(a,window.innerWidth-i.left)+\`px\`,r.isTopdown?(h.top=i.bottom+\`px\`,h.bottom=\`\`,h.maxHeight=Math.min(window.innerHeight-s-i.bottom,o)+\`px\`):(h.top=\`\`,h.bottom=window.innerHeight-i.top+\`px\`,h.maxHeight=Math.min(i.top,o)+\`px\`)),l.$fixPositionBug(n)},e.prototype.hideDocTooltip=function(){if(this.tooltipTimer.cancel(),this.tooltipNode){var e=this.tooltipNode;!this.editor.isFocused()&&document.activeElement==e&&this.editor.focus(),this.tooltipNode=null,e.parentNode&&e.parentNode.removeChild(e)}},e.prototype.onTooltipClick=function(e){for(var t=e.target;t&&t!=this.tooltipNode;){if(t.nodeName==\`A\`&&t.href){t.rel=\`noreferrer\`,t.target=\`_blank\`;break}t=t.parentNode}},e.prototype.destroy=function(){if(this.detach(),this.popup){this.popup.destroy();var e=this.popup.container;e&&e.parentNode&&e.parentNode.removeChild(e)}this.editor&&this.editor.completer==this&&(this.editor.off(\`destroy\`,m),this.editor.completer=null),this.inlineRenderer=this.popup=this.editor=null},e.for=function(t){return t.completer instanceof e?t.completer:(t.completer&&=(t.completer.destroy(),null),d.get(\`sharedPopups\`)?(e.$sharedInstance||=new e,t.completer=e.$sharedInstance):(t.completer=new e,t.once(\`destroy\`,m)),t.completer)},e}();h.prototype.commands={Up:function(e){e.completer.goTo(\`up\`)},Down:function(e){e.completer.goTo(\`down\`)},"Ctrl-Up|Ctrl-Home":function(e){e.completer.goTo(\`start\`)},"Ctrl-Down|Ctrl-End":function(e){e.completer.goTo(\`end\`)},Esc:function(e){e.completer.detach()},Return:function(e){return e.completer.insertMatch()},"Shift-Return":function(e){e.completer.insertMatch(null,{deleteSuffix:!0})},Tab:function(e){var t=e.completer.insertMatch();if(!t&&!e.tabstopManager)e.completer.goTo(\`down\`);else return t},Backspace:function(e){e.execCommand(\`backspace\`),!s.getCompletionPrefix(e)&&e.completer&&e.completer.detach()},PageUp:function(e){e.completer.popup.gotoPageUp()},PageDown:function(e){e.completer.popup.gotoPageDown()}},h.startCommand={name:\`startAutocomplete\`,exec:function(e,t){var n=h.for(e);n.autoInsert=!1,n.autoSelect=!0,n.autoShown=!1,n.showPopup(e,t),n.cancelContextMenu()},bindKey:\`Ctrl-Space|Ctrl-Shift-Space|Alt-Space\`};var g=function(){function e(e){this.initialPosition=e,this.active=!0}return e.prototype.insertByIndex=function(e,t,n){return!this.completions||!this.completions.filtered?!1:this.insertMatch(e,this.completions.filtered[t],n)},e.prototype.insertMatch=function(e,t,n){if(!t)return!1;if(e.startOperation({command:{name:\`insertMatch\`}}),t.completer&&t.completer.insertMatch)t.completer.insertMatch(e,t);else{if(!this.completions)return!1;var r=this.completions.filterText.length,i=0;if(t.range&&t.range.start.row===t.range.end.row&&(r-=this.initialPosition.prefix.length,r+=this.initialPosition.pos.column-t.range.start.column,i+=t.range.end.column-this.initialPosition.pos.column),r||i)for(var a=e.selection.getAllRanges?e.selection.getAllRanges():[e.getSelectionRange()],o=0,s;s=a[o];o++)s.start.column-=r,s.end.column+=i,e.session.remove(s);t.snippet?u.insertSnippet(e,t.snippet):this.$insertString(e,t),t.completer&&t.completer.onInsert&&typeof t.completer.onInsert==\`function\`&&t.completer.onInsert(e,t),t.command&&t.command===\`startAutocomplete\`&&e.execCommand(t.command)}return e.endOperation(),!0},e.prototype.$insertString=function(e,t){var n=t.value||t;e.execCommand(\`insertstring\`,n)},e.prototype.gatherCompletions=function(e,t){var n=e.getSession(),r=e.getCursorPosition(),i=s.getCompletionPrefix(e),a=[];this.completers=e.completers;var o=e.completers.length;return e.completers.forEach(function(c,l){c.getCompletions(e,n,r,i,function(n,r){c.hideInlinePreview&&(r=r.map(function(e){return Object.assign(e,{hideInlinePreview:c.hideInlinePreview})})),!n&&r&&(a=a.concat(r)),t(null,{prefix:s.getCompletionPrefix(e),matches:a,finished:--o===0})})}),!0},e.prototype.provideCompletions=function(e,t,n){var r=function(e){var r=e.prefix,i=e.matches;this.completions=new _(i),t.exactMatch&&(this.completions.exactMatch=!0),t.ignoreCaption&&(this.completions.ignoreCaption=!0),this.completions.setFilter(r),(e.finished||this.completions.filtered.length)&&n(null,this.completions,e.finished)}.bind(this),i=!0,a=null;if(this.gatherCompletions(e,function(e,t){if(this.active&&(e&&(n(e,[],!0),this.detach()),t.prefix.indexOf(t.prefix)===0)){if(i){a=t;return}r(t)}}.bind(this)),i=!1,a){var o=a;a=null,r(o)}},e.prototype.detach=function(){this.active=!1,this.completers&&this.completers.forEach(function(e){typeof e.cancel==\`function\`&&e.cancel()})},e}(),_=function(){function e(e,t){this.all=e,this.filtered=e,this.filterText=t||\`\`,this.exactMatch=!1,this.ignoreCaption=!1}return e.prototype.setFilter=function(e){if(e.length>this.filterText&&e.lastIndexOf(this.filterText,0)===0)var t=this.filtered;else var t=this.all;this.filterText=e,t=this.filterCompletions(t,this.filterText),t=t.sort(function(e,t){return t.exactMatch-e.exactMatch||t.$score-e.$score||(e.caption||e.value).localeCompare(t.caption||t.value)});var n=null;t=t.filter(function(e){var t=e.snippet||e.caption||e.value;return t===n?!1:(n=t,!0)}),this.filtered=t},e.prototype.filterCompletions=function(e,t){var n=[],r=t.toUpperCase(),i=t.toLowerCase();loop:for(var a=0,o;o=e[a];a++){if(o.skipFilter){o.$score=o.score,n.push(o);continue}var s=!this.ignoreCaption&&o.caption||o.value||o.snippet;if(s){var c=-1,l=0,u=0,d,f;if(this.exactMatch){if(t!==s.substr(0,t.length))continue loop}else{var p=s.toLowerCase().indexOf(i);if(p>-1)u=p;else for(var m=0;m<t.length;m++){var h=s.indexOf(i[m],c+1),g=s.indexOf(r[m],c+1);if(d=h>=0&&(g<0||h<g)?h:g,d<0)continue loop;f=d-c-1,f>0&&(c===-1&&(u+=10),u+=f,l|=1<<m),c=d}}o.matchMask=l,o.exactMatch=+!u,o.$score=(o.score||0)-u,n.push(o)}}return n},e}();t.Autocomplete=h,t.CompletionProvider=g,t.FilteredList=_}),ace.define(\`ace/marker_group\`,[\`require\`,\`exports\`,\`module\`],function(e,t,n){var r=function(){function e(e,t){t&&(this.markerType=t.markerType),this.markers=[],this.session=e,e.addDynamicMarker(this)}return e.prototype.getMarkerAtPosition=function(e){return this.markers.find(function(t){return t.range.contains(e.row,e.column)})},e.prototype.markersComparator=function(e,t){return e.range.start.row-t.range.start.row},e.prototype.setMarkers=function(e){this.markers=e.sort(this.markersComparator).slice(0,this.MAX_MARKERS),this.session._signal(\`changeBackMarker\`)},e.prototype.update=function(e,t,n,r){if(!(!this.markers||!this.markers.length))for(var i=r.firstRow,a=r.lastRow,o,s=0,c=0,l=0;l<this.markers.length;l++){var u=this.markers[l];if(!(u.range.end.row<i)&&!(u.range.start.row>a)&&(u.range.start.row===c?s++:(c=u.range.start.row,s=0),!(s>200))){var d=u.range.clipRows(i,a);if(!(d.start.row===d.end.row&&d.start.column===d.end.column)){var f=d.toScreenRange(n);if(f.isEmpty()){o=n.getNextFoldLine(d.end.row,o),o&&o.end.row>d.end.row&&(i=o.end.row);continue}this.markerType===\`fullLine\`?t.drawFullLineMarker(e,f,u.className,r):f.isMultiLine()?this.markerType===\`line\`?t.drawMultiLineMarker(e,f,u.className,r):t.drawTextMarker(e,f,u.className,r):t.drawSingleLineMarker(e,f,u.className+\` ace_br15\`,r)}}}},e}();r.prototype.MAX_MARKERS=1e4,t.MarkerGroup=r}),ace.define(\`ace/autocomplete/text_completer\`,[\`require\`,\`exports\`,\`module\`,\`ace/range\`],function(e,t,n){var r=e("../range").Range,i=/[^a-zA-Z_0-9\\$\\-\\u00C0-\\u1FFF\\u2C00-\\uD7FF\\w]+/;function a(e,t){return e.getTextRange(r.fromPoints({row:0,column:0},t)).split(i).length-1}function o(e,t){var n=a(e,t),r=e.getValue().split(i),o=Object.create(null),s=r[n];return r.forEach(function(e,t){if(!(!e||e===s)){var i=Math.abs(n-t),a=r.length-i;o[e]?o[e]=Math.max(a,o[e]):o[e]=a}}),o}t.id=\`textCompleter\`,t.getCompletions=function(e,t,n,r,i){var a=o(t,n);i(null,Object.keys(a).map(function(e){return{caption:e,value:e,score:a[e],meta:\`local\`}}))}}),ace.define(\`ace/ext/language_tools\`,[\`require\`,\`exports\`,\`module\`,\`ace/snippets\`,\`ace/autocomplete\`,\`ace/config\`,\`ace/lib/lang\`,\`ace/autocomplete/util\`,\`ace/marker_group\`,\`ace/autocomplete/text_completer\`,\`ace/editor\`,\`ace/config\`],function(e,t,n){var r=e("../snippets").snippetManager,i=e("../autocomplete").Autocomplete,a=e("../config"),o=e("../lib/lang"),s=e("../autocomplete/util"),c=e("../marker_group").MarkerGroup,l=e("../autocomplete/text_completer"),u={getCompletions:function(e,t,n,r,i){if(t.$mode.completer)return t.$mode.completer.getCompletions(e,t,n,r,i);var a=e.session.getState(n.row),o=t.$mode.getCompletions(a,t,n,r);o=o.map(function(e){return e.completerId=u.id,e}),i(null,o)},id:\`keywordCompleter\`},d=function(e){var t={};return e.replace(/\\\${(\\d+)(:(.*?))?}/g,function(e,n,r,i){return t[n]=i||\`\`}).replace(/\\$(\\d+?)/g,function(e,n){return t[n]})},f={getCompletions:function(e,t,n,i,a){var o=[],s=t.getTokenAt(n.row,n.column);s&&s.type.match(/(tag-name|tag-open|tag-whitespace|attribute-name|attribute-value)\\.xml$/)?o.push(\`html-tag\`):o=r.getActiveScopes(e);var c=r.snippetMap,l=[];o.forEach(function(e){for(var t=c[e]||[],n=t.length;n--;){var r=t[n],i=r.name||r.tabTrigger;i&&l.push({caption:i,snippet:r.content,meta:r.tabTrigger&&!r.name?r.tabTrigger+\`⇥ \`:\`snippet\`,completerId:f.id})}},this),a(null,l)},getDocTooltip:function(e){e.snippet&&!e.docHTML&&(e.docHTML=[\`<b>\`,o.escapeHTML(e.caption),\`</b>\`,\`<hr></hr>\`,o.escapeHTML(d(e.snippet))].join(\`\`))},id:\`snippetCompleter\`},p=[f,l,u];t.setCompleters=function(e){p.length=0,e&&p.push.apply(p,e)},t.addCompleter=function(e){p.push(e)},t.textCompleter=l,t.keyWordCompleter=u,t.snippetCompleter=f;var m={name:\`expandSnippet\`,exec:function(e){return r.expandWithTab(e)},bindKey:\`Tab\`},h=function(e,t){g(t.session.$mode)},g=function(e){typeof e==\`string\`&&(e=a.$modes[e]),e&&(r.files||={},_(e.$id,e.snippetFileId),e.modes&&e.modes.forEach(g))},_=function(e,t){!t||!e||r.files[e]||(r.files[e]={},a.loadModule(t,function(t){t&&(r.files[e]=t,!t.snippets&&t.snippetText&&(t.snippets=r.parseSnippetFile(t.snippetText)),r.register(t.snippets||[],t.scope),t.includeScopes&&(r.snippetMap[t.scope].includeScopes=t.includeScopes,t.includeScopes.forEach(function(e){g(\`ace/mode/\`+e)})))}))},v=function(e){var t=e.editor,n=t.completer&&t.completer.activated;if(e.command.name===\`backspace\`)n&&!s.getCompletionPrefix(t)&&t.completer.detach();else if(e.command.name===\`insertstring\`&&!n){y=e;var r=e.editor.$liveAutocompletionDelay;r?b.delay(r):x(e)}},y,b=o.delayedCall(function(){x(y)},0),x=function(e){var t=e.editor,n=s.getCompletionPrefix(t),r=e.args,a=s.triggerAutocomplete(t,r);if(n&&n.length>=t.$liveAutocompletionThreshold||a){var o=i.for(t);o.autoShown=!0,o.showPopup(t)}},S=e("../editor").Editor;e("../config").defineOptions(S.prototype,\`editor\`,{enableBasicAutocompletion:{set:function(e){e?(i.for(this),this.completers||=Array.isArray(e)?e:p,this.commands.addCommand(i.startCommand)):this.commands.removeCommand(i.startCommand)},value:!1},enableLiveAutocompletion:{set:function(e){e?(this.completers||=Array.isArray(e)?e:p,this.commands.on(\`afterExec\`,v)):this.commands.off(\`afterExec\`,v)},value:!1},liveAutocompletionDelay:{initialValue:0},liveAutocompletionThreshold:{initialValue:0},enableSnippets:{set:function(e){e?(this.commands.addCommand(m),this.on(\`changeMode\`,h),h(null,this)):(this.commands.removeCommand(m),this.off(\`changeMode\`,h))},value:!1}}),t.MarkerGroup=c}),(function(){ace.require([\`ace/ext/language_tools\`],function(n){typeof t==\`object\`&&typeof e==\`object\`&&t&&(t.exports=n)})})()})),en=o(((e,t)=>{ace.define(\`ace/mode/jsdoc_comment_highlight_rules\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/oop\`,\`ace/mode/text_highlight_rules\`],function(e,t,n){var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,a=function(){this.$rules={start:[{token:[\`comment.doc.tag\`,\`comment.doc.text\`,\`lparen.doc\`],regex:\`(@(?:param|member|typedef|property|namespace|var|const|callback))(\\\\s*)({)\`,push:[{token:\`lparen.doc\`,regex:\`{\`,push:[{include:\`doc-syntax\`},{token:\`rparen.doc\`,regex:\`}|(?=$)\`,next:\`pop\`}]},{token:[\`rparen.doc\`,\`text.doc\`,\`variable.parameter.doc\`,\`lparen.doc\`,\`variable.parameter.doc\`,\`rparen.doc\`],regex:/(})(\\s*)(?:([\\w=:\\/\\.]+)|(?:(\\[)([\\w=:\\/\\.\\-\\'\\" ]+)(\\])))/,next:\`pop\`},{token:\`rparen.doc\`,regex:\`}|(?=$)\`,next:\`pop\`},{include:\`doc-syntax\`},{defaultToken:\`text.doc\`}]},{token:[\`comment.doc.tag\`,\`text.doc\`,\`lparen.doc\`],regex:\`(@(?:returns?|yields|type|this|suppress|public|protected|private|package|modifies|implements|external|exception|throws|enum|define|extends))(\\\\s*)({)\`,push:[{token:\`lparen.doc\`,regex:\`{\`,push:[{include:\`doc-syntax\`},{token:\`rparen.doc\`,regex:\`}|(?=$)\`,next:\`pop\`}]},{token:\`rparen.doc\`,regex:\`}|(?=$)\`,next:\`pop\`},{include:\`doc-syntax\`},{defaultToken:\`text.doc\`}]},{token:[\`comment.doc.tag\`,\`text.doc\`,\`variable.parameter.doc\`],regex:\`(@(?:alias|memberof|instance|module|name|lends|namespace|external|this|template|requires|param|implements|function|extends|typedef|mixes|constructor|var|memberof\\\\!|event|listens|exports|class|constructs|interface|emits|fires|throws|const|callback|borrows|augments))(\\\\s+)(\\\\w[\\\\w#.:/~"\\\\-]*)?\`},{token:[\`comment.doc.tag\`,\`text.doc\`,\`variable.parameter.doc\`],regex:\`(@method)(\\\\s+)(\\\\w[\\\\w.\\\\(\\\\)]*)\`},{token:\`comment.doc.tag\`,regex:\`@access\\\\s+(?:private|public|protected)\`},{token:\`comment.doc.tag\`,regex:\`@kind\\\\s+(?:class|constant|event|external|file|function|member|mixin|module|namespace|typedef)\`},{token:\`comment.doc.tag\`,regex:\`@\\\\w+(?=\\\\s|$)\`},a.getTagRule(),{defaultToken:\`comment.doc.body\`,caseInsensitive:!0}],"doc-syntax":[{token:\`operator.doc\`,regex:/[|:]/},{token:\`paren.doc\`,regex:/[\\[\\]]/}]},this.normalizeRules()};r.inherits(a,i),a.getTagRule=function(e){return{token:\`comment.doc.tag.storage.type\`,regex:\`\\\\b(?:TODO|FIXME|XXX|HACK)\\\\b\`}},a.getStartRule=function(e){return{token:\`comment.doc\`,regex:/\\/\\*\\*(?!\\/)/,next:e}},a.getEndRule=function(e){return{token:\`comment.doc\`,regex:\`\\\\*\\\\/\`,next:e}},t.JsDocCommentHighlightRules=a}),ace.define(\`ace/mode/javascript_highlight_rules\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/oop\`,\`ace/mode/jsdoc_comment_highlight_rules\`,\`ace/mode/text_highlight_rules\`],function(e,t,n){var r=e("../lib/oop"),i=e("./jsdoc_comment_highlight_rules").JsDocCommentHighlightRules,a=e("./text_highlight_rules").TextHighlightRules,o=\`[a-zA-Z\\\\$_¡-￿][a-zA-Z\\\\d\\\\$_¡-￿]*\`,s=function(e){var t={"variable.language":\`Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|Namespace|QName|XML|XMLList|ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|SyntaxError|TypeError|URIError|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt|JSON|Math|this|arguments|prototype|window|document\`,keyword:\`const|yield|import|get|set|async|await|break|case|catch|continue|default|delete|do|else|finally|for|if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|__parent__|__count__|escape|unescape|with|__proto__|class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor\`,"storage.type":\`const|let|var|function\`,"constant.language":\`null|Infinity|NaN|undefined\`,"support.function":\`alert\`,"constant.language.boolean":\`true|false\`},n=this.createKeywordMapper(t,\`identifier\`),r=\`case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void\`,a=\`\\\\\\\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|u{[0-9a-fA-F]{1,6}}|[0-2][0-7]{0,2}|3[0-7][0-7]?|[4-7][0-7]?|.)\`,s=\`(function)(\\\\s*)(\\\\*?)\`,u={token:[\`identifier\`,\`text\`,\`paren.lparen\`],regex:\`(\\\\b(?!\`+Object.values(t).join(\`|\`)+\`\\\\b)\`+o+\`)(\\\\s*)(\\\\()\`};this.$rules={no_regex:[i.getStartRule(\`doc-start\`),l(\`no_regex\`),u,{token:\`string\`,regex:\`'(?=.)\`,next:\`qstring\`},{token:\`string\`,regex:\`"(?=.)\`,next:\`qqstring\`},{include:\`numeric_constants\`},{token:[\`entity.name.function\`,\`text\`,\`keyword.operator\`,\`text\`,\`storage.type\`,\`text\`,\`storage.type\`,\`text\`,\`paren.lparen\`],regex:\`(\`+o+\`)(\\\\s*)(=)(\\\\s*)\`+s+\`(\\\\s*)(\\\\()\`,next:\`function_arguments\`},{token:[\`storage.type\`,\`text\`,\`storage.type\`,\`text\`,\`text\`,\`entity.name.function\`,\`text\`,\`paren.lparen\`],regex:\`(function)(?:(?:(\\\\s*)(\\\\*)(\\\\s*))|(\\\\s+))(\`+o+\`)(\\\\s*)(\\\\()\`,next:\`function_arguments\`},{token:[\`entity.name.function\`,\`text\`,\`punctuation.operator\`,\`text\`,\`storage.type\`,\`text\`,\`storage.type\`,\`text\`,\`paren.lparen\`],regex:\`(\`+o+\`)(\\\\s*)(:)(\\\\s*)\`+s+\`(\\\\s*)(\\\\()\`,next:\`function_arguments\`},{token:[\`text\`,\`text\`,\`storage.type\`,\`text\`,\`storage.type\`,\`text\`,\`paren.lparen\`],regex:\`(:)(\\\\s*)\`+s+\`(\\\\s*)(\\\\()\`,next:\`function_arguments\`},{token:\`keyword\`,regex:\`from(?=\\\\s*('|"))\`},{token:\`keyword\`,regex:\`(?:\`+r+\`)\\\\b\`,next:\`start\`},{token:\`support.constant\`,regex:/that\\b/},{token:[\`storage.type\`,\`punctuation.operator\`,\`support.function.firebug\`],regex:/(console)(\\.)(warn|info|log|error|debug|time|trace|timeEnd|assert)\\b/},{token:n,regex:o},{token:\`punctuation.operator\`,regex:/[.](?![.])/,next:\`property\`},{token:\`storage.type\`,regex:/=>/,next:\`start\`},{token:\`keyword.operator\`,regex:/--|\\+\\+|\\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\\|\\||\\?:|[!$%&*+\\-~\\/^]=?/,next:\`start\`},{token:\`punctuation.operator\`,regex:/[?:,;.]/,next:\`start\`},{token:\`paren.lparen\`,regex:/[\\[({]/,next:\`start\`},{token:\`paren.rparen\`,regex:/[\\])}]/},{token:\`comment\`,regex:/^#!.*$/}],property:[{token:\`text\`,regex:\`\\\\s+\`},{token:\`keyword.operator\`,regex:/=/},{token:[\`storage.type\`,\`text\`,\`storage.type\`,\`text\`,\`paren.lparen\`],regex:s+\`(\\\\s*)(\\\\()\`,next:\`function_arguments\`},{token:[\`storage.type\`,\`text\`,\`storage.type\`,\`text\`,\`text\`,\`entity.name.function\`,\`text\`,\`paren.lparen\`],regex:\`(function)(?:(?:(\\\\s*)(\\\\*)(\\\\s*))|(\\\\s+))(\\\\w+)(\\\\s*)(\\\\()\`,next:\`function_arguments\`},{token:\`punctuation.operator\`,regex:/[.](?![.])/},{token:\`support.function\`,regex:\`prototype\`},{token:\`support.function\`,regex:/(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\\b(?=\\()/},{token:\`support.function.dom\`,regex:/(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\\b(?=\\()/},{token:\`support.constant\`,regex:/(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\\b/},{token:\`identifier\`,regex:o},{regex:\`\`,token:\`empty\`,next:\`no_regex\`}],start:[i.getStartRule(\`doc-start\`),l(\`start\`),{token:\`string.regexp\`,regex:\`\\\\/\`,next:\`regex\`},{token:\`text\`,regex:\`\\\\s+|^$\`,next:\`start\`},{token:\`empty\`,regex:\`\`,next:\`no_regex\`}],regex:[{token:\`regexp.keyword.operator\`,regex:\`\\\\\\\\(?:u[\\\\da-fA-F]{4}|x[\\\\da-fA-F]{2}|.)\`},{token:\`string.regexp\`,regex:\`/[sxngimy]*\`,next:\`no_regex\`},{token:\`invalid\`,regex:/\\{\\d+\\b,?\\d*\\}[+*]|[+*$^?][+*]|[$^][?]|\\?{3,}/},{token:\`constant.language.escape\`,regex:/\\(\\?[:=!]|\\)|\\{\\d+\\b,?\\d*\\}|[+*]\\?|[()$^+*?.]/},{token:\`constant.language.delimiter\`,regex:/\\|/},{token:\`constant.language.escape\`,regex:/\\[\\^?/,next:\`regex_character_class\`},{token:\`empty\`,regex:\`$\`,next:\`no_regex\`},{defaultToken:\`string.regexp\`}],regex_character_class:[{token:\`regexp.charclass.keyword.operator\`,regex:\`\\\\\\\\(?:u[\\\\da-fA-F]{4}|x[\\\\da-fA-F]{2}|.)\`},{token:\`constant.language.escape\`,regex:\`]\`,next:\`regex\`},{token:\`constant.language.escape\`,regex:\`-\`},{token:\`empty\`,regex:\`$\`,next:\`no_regex\`},{defaultToken:\`string.regexp.charachterclass\`}],default_parameter:[{token:\`string\`,regex:\`'(?=.)\`,push:[{token:\`string\`,regex:\`'|$\`,next:\`pop\`},{include:\`qstring\`}]},{token:\`string\`,regex:\`"(?=.)\`,push:[{token:\`string\`,regex:\`"|$\`,next:\`pop\`},{include:\`qqstring\`}]},{token:\`constant.language\`,regex:\`null|Infinity|NaN|undefined\`},{include:\`numeric_constants\`},{token:\`punctuation.operator\`,regex:\`,\`,next:\`function_arguments\`},{token:\`text\`,regex:\`\\\\s+\`},{token:\`punctuation.operator\`,regex:\`$\`},{token:\`empty\`,regex:\`\`,next:\`no_regex\`}],function_arguments:[l(\`function_arguments\`),{token:\`variable.parameter\`,regex:o},{token:\`punctuation.operator\`,regex:\`,\`},{token:\`text\`,regex:\`\\\\s+\`},{token:\`punctuation.operator\`,regex:\`$\`},{token:\`empty\`,regex:\`\`,next:\`no_regex\`}],qqstring:[{token:\`constant.language.escape\`,regex:a},{token:\`string\`,regex:\`\\\\\\\\$\`,consumeLineEnd:!0},{token:\`string\`,regex:\`"|$\`,next:\`no_regex\`},{defaultToken:\`string\`}],qstring:[{token:\`constant.language.escape\`,regex:a},{token:\`string\`,regex:\`\\\\\\\\$\`,consumeLineEnd:!0},{token:\`string\`,regex:\`'|$\`,next:\`no_regex\`},{defaultToken:\`string\`}],numeric_constants:[{token:\`constant.numeric\`,regex:/0(?:[xX][0-9a-fA-F_]+|[oO][0-7_]+|[bB][01_]+)\\b/},{token:\`constant.numeric\`,regex:/(?:\\d[\\d_]*(?:\\.[\\d_]*)?|\\.\\d[\\d_]*)(?:[eE][+-]?\\d+\\b)?/}]},(!e||!e.noES6)&&(this.$rules.no_regex.unshift({regex:\`[{}]\`,onMatch:function(e,t,n){if(this.next=e==\`{\`?this.nextState:\`\`,e==\`{\`&&n.length)n.unshift(\`start\`,t);else if(e==\`}\`&&n.length&&(n.shift(),this.next=n.shift(),this.next.indexOf(\`string\`)!=-1||this.next.indexOf(\`jsx\`)!=-1))return\`paren.quasi.end\`;return e==\`{\`?\`paren.lparen\`:\`paren.rparen\`},nextState:\`start\`},{token:\`string.quasi.start\`,regex:/\`/,push:[{token:\`constant.language.escape\`,regex:a},{token:\`paren.quasi.start\`,regex:/\\\${/,push:\`start\`},{token:\`string.quasi.end\`,regex:/\`/,next:\`pop\`},{defaultToken:\`string.quasi\`}]},{token:[\`variable.parameter\`,\`text\`],regex:\`(\`+o+\`)(\\\\s*)(?=\\\\=>)\`},{token:\`paren.lparen\`,regex:\`(\\\\()(?=[^\\\\(]+\\\\s*=>)\`,next:\`function_arguments\`},{token:\`variable.language\`,regex:\`(?:(?:(?:Weak)?(?:Set|Map))|Promise)\\\\b\`}),this.$rules.function_arguments.unshift({token:\`keyword.operator\`,regex:\`=\`,next:\`default_parameter\`},{token:\`keyword.operator\`,regex:\`\\\\.{3}\`}),this.$rules.property.unshift({token:\`support.function\`,regex:\`(findIndex|repeat|startsWith|endsWith|includes|isSafeInteger|trunc|cbrt|log2|log10|sign|then|catch|finally|resolve|reject|race|any|all|allSettled|keys|entries|isInteger)\\\\b(?=\\\\()\`},{token:\`constant.language\`,regex:\`(?:MAX_SAFE_INTEGER|MIN_SAFE_INTEGER|EPSILON)\\\\b\`}),(!e||e.jsx!=0)&&c.call(this)),this.embedRules(i,\`doc-\`,[i.getEndRule(\`no_regex\`)]),this.normalizeRules()};r.inherits(s,a);function c(){var e=o.replace(\`\\\\d\`,\`\\\\d\\\\-\`),t={onMatch:function(e,t,n){var r=e.charAt(1)==\`/\`?2:1;return r==1?(t==this.nextState?n.unshift(this.next):n.unshift(this.next,this.nextState,0),n[2]++):r==2&&t==this.nextState&&(n[1]--,(!n[1]||n[1]<0)&&(n.shift(),n.shift())),[{type:\`meta.tag.punctuation.\`+(r==1?\`\`:\`end-\`)+\`tag-open.xml\`,value:e.slice(0,r)},{type:\`meta.tag.tag-name.xml\`,value:e.substr(r)}]},regex:\`</?(?:\`+e+\`|(?=>))\`,next:\`jsxAttributes\`,nextState:\`jsx\`};this.$rules.start.unshift(t);var n={regex:\`{\`,token:\`paren.quasi.start\`,push:\`start\`};this.$rules.jsx=[n,t,{include:\`reference\`},{defaultToken:\`string.xml\`}],this.$rules.jsxAttributes=[{token:\`meta.tag.punctuation.tag-close.xml\`,regex:\`/?>\`,onMatch:function(e,t,n){return t==n[0]&&n.shift(),e.length==2&&(n[0]==this.nextState&&n[1]--,(!n[1]||n[1]<0)&&n.splice(0,2)),this.next=n[0]||\`start\`,[{type:this.token,value:e}]},nextState:\`jsx\`},n,l(\`jsxAttributes\`),{token:\`entity.other.attribute-name.xml\`,regex:e},{token:\`keyword.operator.attribute-equals.xml\`,regex:\`=\`},{token:\`text.tag-whitespace.xml\`,regex:\`\\\\s+\`},{token:\`string.attribute-value.xml\`,regex:\`'\`,stateName:\`jsx_attr_q\`,push:[{token:\`string.attribute-value.xml\`,regex:\`'\`,next:\`pop\`},{include:\`reference\`},{defaultToken:\`string.attribute-value.xml\`}]},{token:\`string.attribute-value.xml\`,regex:\`"\`,stateName:\`jsx_attr_qq\`,push:[{token:\`string.attribute-value.xml\`,regex:\`"\`,next:\`pop\`},{include:\`reference\`},{defaultToken:\`string.attribute-value.xml\`}]},t],this.$rules.reference=[{token:\`constant.language.escape.reference.xml\`,regex:\`(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\\\.-]+;)\`}]}function l(e){return[{token:\`comment\`,regex:/\\/\\*/,next:[i.getTagRule(),{token:\`comment\`,regex:\`\\\\*\\\\/\`,next:e||\`pop\`},{defaultToken:\`comment\`,caseInsensitive:!0}]},{token:\`comment\`,regex:\`\\\\/\\\\/\`,next:[i.getTagRule(),{token:\`comment\`,regex:\`$|^\`,next:e||\`pop\`},{defaultToken:\`comment\`,caseInsensitive:!0}]}]}t.JavaScriptHighlightRules=s}),ace.define(\`ace/mode/matching_brace_outdent\`,[\`require\`,\`exports\`,\`module\`,\`ace/range\`],function(e,t,n){var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\\s+$/.test(e)?/^\\s*\\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t).match(/^(\\s*\\})/);if(!n)return 0;var i=n[1].length,a=e.findMatchingBracket({row:t,column:i});if(!a||a.row==t)return 0;var o=this.$getIndent(e.getLine(a.row));e.replace(new r(t,0,t,i-1),o)},this.$getIndent=function(e){return e.match(/^\\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),ace.define(\`ace/mode/behaviour/xml\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/oop\`,\`ace/mode/behaviour\`,\`ace/token_iterator\`],function(e,t,n){var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,a=e("../../token_iterator").TokenIterator;function o(e,t){return e&&e.type.lastIndexOf(t+\`.xml\`)>-1}var s=function(){this.add(\`string_dquotes\`,\`insertion\`,function(e,t,n,r,i){if(i==\`"\`||i==\`'\`){var s=i,c=r.doc.getTextRange(n.getSelectionRange());if(c!==\`\`&&c!==\`'\`&&c!=\`"\`&&n.getWrapBehavioursEnabled())return{text:s+c+s,selection:!1};var l=n.getCursorPosition(),u=r.doc.getLine(l.row).substring(l.column,l.column+1),d=new a(r,l.row,l.column),f=d.getCurrentToken();if(u==s&&(o(f,\`attribute-value\`)||o(f,\`string\`)))return{text:\`\`,selection:[1,1]};if(f||=d.stepBackward(),!f)return;for(;o(f,\`tag-whitespace\`)||o(f,\`whitespace\`);)f=d.stepBackward();var p=!u||u.match(/\\s/);if(o(f,\`attribute-equals\`)&&(p||u==\`>\`)||o(f,\`decl-attribute-equals\`)&&(p||u==\`?\`))return{text:s+s,selection:[1,1]}}}),this.add(\`string_dquotes\`,\`deletion\`,function(e,t,n,r,i){var a=r.doc.getTextRange(i);if(!i.isMultiLine()&&(a==\`"\`||a==\`'\`)&&r.doc.getLine(i.start.row).substring(i.start.column+1,i.start.column+2)==a)return i.end.column++,i}),this.add(\`autoclosing\`,\`insertion\`,function(e,t,n,r,i){if(i==\`>\`){var s=n.getSelectionRange().start,c=new a(r,s.row,s.column),l=c.getCurrentToken()||c.stepBackward();if(!l||!(o(l,\`tag-name\`)||o(l,\`tag-whitespace\`)||o(l,\`attribute-name\`)||o(l,\`attribute-equals\`)||o(l,\`attribute-value\`))||o(l,\`reference.attribute-value\`))return;if(o(l,\`attribute-value\`)){var u=c.getCurrentTokenColumn()+l.value.length;if(s.column<u)return;if(s.column==u){var d=c.stepForward();if(d&&o(d,\`attribute-value\`))return;c.stepBackward()}}if(/^\\s*>/.test(r.getLine(s.row).slice(s.column)))return;for(;!o(l,\`tag-name\`);)if(l=c.stepBackward(),l.value==\`<\`){l=c.stepForward();break}var f=c.getCurrentTokenRow(),p=c.getCurrentTokenColumn();if(o(c.stepBackward(),\`end-tag-open\`))return;var m=l.value;return f==s.row&&(m=m.substring(0,s.column-p)),this.voidElements&&this.voidElements.hasOwnProperty(m.toLowerCase())?void 0:{text:\`></\`+m+\`>\`,selection:[1,1]}}}),this.add(\`autoindent\`,\`insertion\`,function(e,t,n,r,i){if(i==\`
1114
+ \`,\`autocompletion.css\`,!1),t.AcePopup=g,t.$singleLineEditor=h,t.getAriaId=d}),ace.define(\`ace/autocomplete/inline_screenreader\`,[\`require\`,\`exports\`,\`module\`],function(e,t,n){t.AceInlineScreenReader=function(){function e(e){this.editor=e,this.screenReaderDiv=document.createElement(\`div\`),this.screenReaderDiv.classList.add(\`ace_screenreader-only\`),this.editor.container.appendChild(this.screenReaderDiv)}return e.prototype.setScreenReaderContent=function(e){for(!this.popup&&this.editor.completer&&this.editor.completer.popup&&(this.popup=this.editor.completer.popup,this.popup.renderer.on(\`afterRender\`,function(){var e=this.popup.getRow(),t=this.popup.renderer.$textLayer,n=t.element.childNodes[e-t.config.firstRow];if(n){for(var r=\`doc-tooltip \`,i=0;i<this._lines.length;i++)r+=\`ace-inline-screenreader-line-\${i} \`;n.setAttribute(\`aria-describedby\`,r)}}.bind(this)));this.screenReaderDiv.firstChild;)this.screenReaderDiv.removeChild(this.screenReaderDiv.firstChild);this._lines=e.split(/\\r\\n|\\r|\\n/);var t=this.createCodeBlock();this.screenReaderDiv.appendChild(t)},e.prototype.destroy=function(){this.screenReaderDiv.remove()},e.prototype.createCodeBlock=function(){var e=document.createElement(\`pre\`);e.setAttribute(\`id\`,\`ace-inline-screenreader\`);for(var t=0;t<this._lines.length;t++){var n=document.createElement(\`code\`);n.setAttribute(\`id\`,\`ace-inline-screenreader-line-\${t}\`);var r=document.createTextNode(this._lines[t]);n.appendChild(r),e.appendChild(n)}return e},e}()}),ace.define(\`ace/autocomplete/inline\`,[\`require\`,\`exports\`,\`module\`,\`ace/snippets\`,\`ace/autocomplete/inline_screenreader\`],function(e,t,n){var r=e("../snippets").snippetManager,i=e("./inline_screenreader").AceInlineScreenReader;t.AceInline=function(){function e(){this.editor=null}return e.prototype.show=function(e,t,n){if(n||=\`\`,e&&this.editor&&this.editor!==e&&(this.hide(),this.editor=null,this.inlineScreenReader=null),!e||!t)return!1;this.inlineScreenReader||=new i(e);var a=t.snippet?r.getDisplayTextForSnippet(e,t.snippet):t.value;return t.hideInlinePreview||!a||!a.startsWith(n)?!1:(this.editor=e,this.inlineScreenReader.setScreenReaderContent(a),a=a.slice(n.length),a===\`\`?e.removeGhostText():e.setGhostText(a),!0)},e.prototype.isOpen=function(){return this.editor?!!this.editor.renderer.$ghostText:!1},e.prototype.hide=function(){return this.editor?(this.editor.removeGhostText(),!0):!1},e.prototype.destroy=function(){this.hide(),this.editor=null,this.inlineScreenReader&&=(this.inlineScreenReader.destroy(),null)},e}()}),ace.define(\`ace/autocomplete/util\`,[\`require\`,\`exports\`,\`module\`],function(e,t,n){t.parForEach=function(e,t,n){var r=0,i=e.length;i===0&&n();for(var a=0;a<i;a++)t(e[a],function(e,t){r++,r===i&&n(e,t)})};var r=/[a-zA-Z_0-9\\$\\-\\u00A2-\\u2000\\u2070-\\uFFFF]/;t.retrievePrecedingIdentifier=function(e,t,n){n||=r;for(var i=[],a=t-1;a>=0&&n.test(e[a]);a--)i.push(e[a]);return i.reverse().join(\`\`)},t.retrieveFollowingIdentifier=function(e,t,n){n||=r;for(var i=[],a=t;a<e.length&&n.test(e[a]);a++)i.push(e[a]);return i},t.getCompletionPrefix=function(e){var t=e.getCursorPosition(),n=e.session.getLine(t.row),r;return e.completers.forEach(function(e){e.identifierRegexps&&e.identifierRegexps.forEach(function(e){!r&&e&&(r=this.retrievePrecedingIdentifier(n,t.column,e))}.bind(this))}.bind(this)),r||this.retrievePrecedingIdentifier(n,t.column)},t.triggerAutocomplete=function(e,t){var t=t??e.session.getPrecedingCharacter();return e.completers.some(function(e){if(e.triggerCharacters&&Array.isArray(e.triggerCharacters))return e.triggerCharacters.includes(t)})}}),ace.define(\`ace/autocomplete\`,[\`require\`,\`exports\`,\`module\`,\`ace/keyboard/hash_handler\`,\`ace/autocomplete/popup\`,\`ace/autocomplete/inline\`,\`ace/autocomplete/popup\`,\`ace/autocomplete/util\`,\`ace/lib/lang\`,\`ace/lib/dom\`,\`ace/snippets\`,\`ace/config\`,\`ace/lib/event\`,\`ace/lib/scroll\`],function(e,t,n){var r=e("./keyboard/hash_handler").HashHandler,i=e("./autocomplete/popup").AcePopup,a=e("./autocomplete/inline").AceInline,o=e("./autocomplete/popup").getAriaId,s=e("./autocomplete/util"),c=e("./lib/lang"),l=e("./lib/dom"),u=e("./snippets").snippetManager,d=e("./config"),f=e("./lib/event"),p=e("./lib/scroll").preventParentScroll,m=function(e,t){t.completer&&t.completer.destroy()},h=function(){function e(){this.autoInsert=!1,this.autoSelect=!0,this.autoShown=!1,this.exactMatch=!1,this.inlineEnabled=!1,this.keyboardHandler=new r,this.keyboardHandler.bindKeys(this.commands),this.parentNode=null,this.setSelectOnHover=!1,this.hasSeen=new Set,this.showLoadingState=!1,this.stickySelectionDelay=500,this.blurListener=this.blurListener.bind(this),this.changeListener=this.changeListener.bind(this),this.mousedownListener=this.mousedownListener.bind(this),this.mousewheelListener=this.mousewheelListener.bind(this),this.onLayoutChange=this.onLayoutChange.bind(this),this.changeTimer=c.delayedCall(function(){this.updateCompletions(!0)}.bind(this)),this.tooltipTimer=c.delayedCall(this.updateDocTooltip.bind(this),50),this.popupTimer=c.delayedCall(this.$updatePopupPosition.bind(this),50),this.stickySelectionTimer=c.delayedCall(function(){this.stickySelection=!0}.bind(this),this.stickySelectionDelay),this.$firstOpenTimer=c.delayedCall(function(){var t=this.completionProvider&&this.completionProvider.initialPosition;this.autoShown||this.popup&&this.popup.isOpen||!t||this.editor.completers.length===0||(this.completions=new _(e.completionsForLoading),this.openPopup(this.editor,t.prefix,!1),this.popup.renderer.setStyle(\`ace_loading\`,!0))}.bind(this),this.stickySelectionDelay)}return Object.defineProperty(e,"completionsForLoading",{get:function(){return[{caption:d.nls(\`autocomplete.loading\`,\`Loading...\`),value:\`\`}]},enumerable:!1,configurable:!0}),e.prototype.$init=function(){return this.popup=new i(this.parentNode||document.body||document.documentElement),this.popup.on(\`click\`,function(e){this.insertMatch(),e.stop()}.bind(this)),this.popup.focus=this.editor.focus.bind(this.editor),this.popup.on(\`show\`,this.$onPopupShow.bind(this)),this.popup.on(\`hide\`,this.$onHidePopup.bind(this)),this.popup.on(\`select\`,this.$onPopupChange.bind(this)),f.addListener(this.popup.container,\`mouseout\`,this.mouseOutListener.bind(this)),this.popup.on(\`changeHoverMarker\`,this.tooltipTimer.bind(null,null)),this.popup.renderer.on(\`afterRender\`,this.$onPopupRender.bind(this)),this.popup},e.prototype.$initInline=function(){if(!(!this.inlineEnabled||this.inlineRenderer))return this.inlineRenderer=new a,this.inlineRenderer},e.prototype.getPopup=function(){return this.popup||this.$init()},e.prototype.$onHidePopup=function(){this.inlineRenderer&&this.inlineRenderer.hide(),this.hideDocTooltip(),this.stickySelectionTimer.cancel(),this.popupTimer.cancel(),this.stickySelection=!1},e.prototype.$seen=function(e){!this.hasSeen.has(e)&&e&&e.completer&&e.completer.onSeen&&typeof e.completer.onSeen==\`function\`&&(e.completer.onSeen(this.editor,e),this.hasSeen.add(e))},e.prototype.$onPopupChange=function(e){if(this.inlineRenderer&&this.inlineEnabled){var t=e?null:this.popup.getData(this.popup.getRow());if(this.$updateGhostText(t),this.popup.isMouseOver&&this.setSelectOnHover){this.tooltipTimer.call(null,null);return}this.popupTimer.schedule(),this.tooltipTimer.schedule()}else this.popupTimer.call(null,null),this.tooltipTimer.call(null,null)},e.prototype.$updateGhostText=function(e){var t=this.base.row,n=this.base.column,r=this.editor.getCursorPosition().column,i=this.editor.session.getLine(t).slice(n,r);this.inlineRenderer.show(this.editor,e,i)?this.$seen(e):this.inlineRenderer.hide()},e.prototype.$onPopupRender=function(){var e=this.inlineRenderer&&this.inlineEnabled;if(this.completions&&this.completions.filtered&&this.completions.filtered.length>0)for(var t=this.popup.getFirstVisibleRow();t<=this.popup.getLastVisibleRow();t++){var n=this.popup.getData(t);n&&(!e||n.hideInlinePreview)&&this.$seen(n)}},e.prototype.$onPopupShow=function(e){this.$onPopupChange(e),this.stickySelection=!1,this.stickySelectionDelay>=0&&this.stickySelectionTimer.schedule(this.stickySelectionDelay)},e.prototype.observeLayoutChanges=function(){if(!(this.$elements||!this.editor)){window.addEventListener(\`resize\`,this.onLayoutChange,{passive:!0}),window.addEventListener(\`wheel\`,this.mousewheelListener);for(var e=this.editor.container.parentNode,t=[];e;)t.push(e),e.addEventListener(\`scroll\`,this.onLayoutChange,{passive:!0}),e=e.parentNode;this.$elements=t}},e.prototype.unObserveLayoutChanges=function(){var e=this;window.removeEventListener(\`resize\`,this.onLayoutChange,{passive:!0}),window.removeEventListener(\`wheel\`,this.mousewheelListener),this.$elements&&this.$elements.forEach(function(t){t.removeEventListener(\`scroll\`,e.onLayoutChange,{passive:!0})}),this.$elements=null},e.prototype.onLayoutChange=function(){if(!this.popup.isOpen)return this.unObserveLayoutChanges();this.$updatePopupPosition(),this.updateDocTooltip()},e.prototype.$updatePopupPosition=function(){var e=this.editor,t=e.renderer,n=t.layerConfig.lineHeight,r=t.$cursorLayer.getPixelPosition(this.base,!0);r.left-=this.popup.getTextLeftOffset();var i=e.container.getBoundingClientRect();r.top+=i.top-t.layerConfig.offset,r.left+=i.left-e.renderer.scrollLeft,r.left+=t.gutterWidth;var a={top:r.top,left:r.left};t.$ghostText&&t.$ghostTextWidget&&this.base.row===t.$ghostText.position.row&&(a.top+=t.$ghostTextWidget.el.offsetHeight);var o=e.container.getBoundingClientRect().bottom-n,s=o<a.top?{top:o,left:a.left}:a;this.popup.tryShow(s,n,\`bottom\`)||this.popup.tryShow(r,n,\`top\`)||this.popup.show(r,n)},e.prototype.openPopup=function(e,t,n){this.$firstOpenTimer.cancel(),this.popup||this.$init(),this.inlineEnabled&&!this.inlineRenderer&&this.$initInline(),this.popup.autoSelect=this.autoSelect,this.popup.setSelectOnHover(this.setSelectOnHover);var r=this.popup.getRow(),i=this.popup.data[r];this.popup.setData(this.completions.filtered,this.completions.filterText),this.editor.textInput.setAriaOptions&&this.editor.textInput.setAriaOptions({activeDescendant:o(this.popup.getRow()),inline:this.inlineEnabled}),e.keyBinding.addKeyboardHandler(this.keyboardHandler);var a;this.stickySelection&&(a=this.popup.data.indexOf(i)),(!a||a===-1)&&(a=0),this.popup.setRow(this.autoSelect?a:-1),a===r&&i!==this.completions.filtered[a]&&this.$onPopupChange();var s=this.inlineRenderer&&this.inlineEnabled;if(a===r&&s){var c=this.popup.getData(this.popup.getRow());this.$updateGhostText(c)}n||(this.popup.setTheme(e.getTheme()),this.popup.setFontSize(e.getFontSize()),this.$updatePopupPosition(),this.tooltipNode&&this.updateDocTooltip()),this.changeTimer.cancel(),this.observeLayoutChanges()},e.prototype.detach=function(){this.editor&&(this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.off(\`changeSelection\`,this.changeListener),this.editor.off(\`blur\`,this.blurListener),this.editor.off(\`mousedown\`,this.mousedownListener),this.editor.off(\`mousewheel\`,this.mousewheelListener)),this.$firstOpenTimer.cancel(),this.changeTimer.cancel(),this.hideDocTooltip(),this.completionProvider&&this.completionProvider.detach(),this.popup&&this.popup.isOpen&&this.popup.hide(),this.popup&&this.popup.renderer&&this.popup.renderer.off(\`afterRender\`,this.$onPopupRender),this.base&&this.base.detach(),this.activated=!1,this.completionProvider=this.completions=this.base=null,this.unObserveLayoutChanges()},e.prototype.changeListener=function(e){var t=this.editor.selection.lead;(t.row!=this.base.row||t.column<this.base.column)&&this.detach(),this.activated?this.changeTimer.schedule():this.detach()},e.prototype.blurListener=function(e){var t=document.activeElement,n=this.editor.textInput.getElement(),r=e.relatedTarget&&this.tooltipNode&&this.tooltipNode.contains(e.relatedTarget),i=this.popup&&this.popup.container;t!=n&&t.parentNode!=i&&!r&&t!=this.tooltipNode&&e.relatedTarget!=n&&this.detach()},e.prototype.mousedownListener=function(e){this.detach()},e.prototype.mousewheelListener=function(e){this.popup&&!this.popup.isMouseOver&&this.detach()},e.prototype.mouseOutListener=function(e){this.popup.isOpen&&this.$updatePopupPosition()},e.prototype.goTo=function(e){this.popup.goTo(e)},e.prototype.insertMatch=function(e,t){if(e||=this.popup.getData(this.popup.getRow()),!e)return!1;if(e.value===\`\`)return this.detach();var n=this.completions,r=this.getCompletionProvider().insertMatch(this.editor,e,n.filterText,t);return this.completions==n&&this.detach(),r},e.prototype.showPopup=function(e,t){this.editor&&this.detach(),this.activated=!0,this.editor=e,e.completer!=this&&(e.completer&&e.completer.detach(),e.completer=this),e.on(\`changeSelection\`,this.changeListener),e.on(\`blur\`,this.blurListener),e.on(\`mousedown\`,this.mousedownListener),e.on(\`mousewheel\`,this.mousewheelListener),this.updateCompletions(!1,t)},e.prototype.getCompletionProvider=function(e){return this.completionProvider||=new g(e),this.completionProvider},e.prototype.gatherCompletions=function(e,t){return this.getCompletionProvider().gatherCompletions(e,t)},e.prototype.updateCompletions=function(t,n){if(t&&this.base&&this.completions){var r=this.editor.getCursorPosition(),i=this.editor.session.getTextRange({start:this.base,end:r});if(i==this.completions.filterText)return;if(this.completions.setFilter(i),!this.completions.filtered.length||this.completions.filtered.length==1&&this.completions.filtered[0].value==i&&!this.completions.filtered[0].snippet)return this.detach();this.openPopup(this.editor,i,t);return}if(n&&n.matches){var r=this.editor.getSelectionRange().start;return this.base=this.editor.session.doc.createAnchor(r.row,r.column),this.base.$insertRight=!0,this.completions=new _(n.matches),this.getCompletionProvider().completions=this.completions,this.openPopup(this.editor,\`\`,t)}var a=this.editor.getSession(),r=this.editor.getCursorPosition(),i=s.getCompletionPrefix(this.editor);this.base=a.doc.createAnchor(r.row,r.column-i.length),this.base.$insertRight=!0;var o={exactMatch:this.exactMatch,ignoreCaption:this.ignoreCaption};this.getCompletionProvider({prefix:i,pos:r}).provideCompletions(this.editor,o,function(n,r,i){var a=r.filtered,o=s.getCompletionPrefix(this.editor);if(this.$firstOpenTimer.cancel(),i){if(!a.length){var c=!this.autoShown&&this.emptyMessage;if(typeof c==\`function\`&&(c=this.emptyMessage(o)),c){var l=[{caption:c,value:\`\`}];this.completions=new _(l),this.openPopup(this.editor,o,t),this.popup.renderer.setStyle(\`ace_loading\`,!1),this.popup.renderer.setStyle(\`ace_empty-message\`,!0);return}return this.detach()}if(a.length==1&&a[0].value==o&&!a[0].snippet)return this.detach();if(this.autoInsert&&!this.autoShown&&a.length==1)return this.insertMatch(a[0])}this.completions=!i&&this.showLoadingState?new _(e.completionsForLoading.concat(a),r.filterText):r,this.openPopup(this.editor,o,t),this.popup.renderer.setStyle(\`ace_empty-message\`,!1),this.popup.renderer.setStyle(\`ace_loading\`,!i)}.bind(this)),this.showLoadingState&&!this.autoShown&&!(this.popup&&this.popup.isOpen)&&this.$firstOpenTimer.delay(this.stickySelectionDelay/2)},e.prototype.cancelContextMenu=function(){this.editor.$mouseHandler.cancelContextMenu()},e.prototype.updateDocTooltip=function(){var e=this.popup,t=this.completions&&this.completions.filtered,n=t&&(t[e.getHoveredRow()]||t[e.getRow()]),r=null;if(!n||!this.editor||!this.popup.isOpen)return this.hideDocTooltip();for(var i=this.editor.completers.length,a=0;a<i;a++){var o=this.editor.completers[a];if(o.getDocTooltip&&n.completerId===o.id){r=o.getDocTooltip(n);break}}if(!r&&typeof n!=\`string\`&&(r=n),typeof r==\`string\`&&(r={docText:r}),!r||!(r.docHTML||r.docText))return this.hideDocTooltip();this.showDocTooltip(r)},e.prototype.showDocTooltip=function(e){this.tooltipNode||(this.tooltipNode=l.createElement(\`div\`),this.tooltipNode.style.margin=\`0\`,this.tooltipNode.style.pointerEvents=\`auto\`,this.tooltipNode.style.overscrollBehavior=\`contain\`,this.tooltipNode.tabIndex=-1,this.tooltipNode.onblur=this.blurListener.bind(this),this.tooltipNode.onclick=this.onTooltipClick.bind(this),this.tooltipNode.id=\`doc-tooltip\`,this.tooltipNode.setAttribute(\`role\`,\`tooltip\`),this.tooltipNode.addEventListener(\`wheel\`,p));var t=this.editor.renderer.theme;this.tooltipNode.className=\`ace_tooltip ace_doc-tooltip \`+(t.isDark?\`ace_dark \`:\`\`)+(t.cssClass||\`\`);var n=this.tooltipNode;e.docHTML?n.innerHTML=e.docHTML:e.docText&&(n.textContent=e.docText),n.parentNode||this.popup.container.appendChild(this.tooltipNode);var r=this.popup,i=r.container.getBoundingClientRect(),a=400,o=300,s=r.renderer.scrollBar.width||10,c=i.left,u=window.innerWidth-i.right-s,d=r.isTopdown?window.innerHeight-s-i.bottom:i.top,f=[Math.min(u/a,1),Math.min(c/a,1),Math.min(d/o,1)*.9],m=Math.max.apply(Math,f),h=n.style;h.display=\`block\`,m==f[0]||f[0]>=1?(h.left=i.right+1+\`px\`,h.right=\`\`,h.maxWidth=a*m+\`px\`,h.top=i.top+\`px\`,h.bottom=\`\`,h.maxHeight=Math.min(window.innerHeight-s-i.top,o)+\`px\`):m==f[1]||f[1]>=1?(h.right=window.innerWidth-i.left+\`px\`,h.left=\`\`,h.maxWidth=a*m+\`px\`,h.top=i.top+\`px\`,h.bottom=\`\`,h.maxHeight=Math.min(window.innerHeight-s-i.top,o)+\`px\`):m==f[2]&&(h.left=i.left+\`px\`,h.right=\`\`,h.maxWidth=Math.min(a,window.innerWidth-i.left)+\`px\`,r.isTopdown?(h.top=i.bottom+\`px\`,h.bottom=\`\`,h.maxHeight=Math.min(window.innerHeight-s-i.bottom,o)+\`px\`):(h.top=\`\`,h.bottom=window.innerHeight-i.top+\`px\`,h.maxHeight=Math.min(i.top,o)+\`px\`)),l.$fixPositionBug(n)},e.prototype.hideDocTooltip=function(){if(this.tooltipTimer.cancel(),this.tooltipNode){var e=this.tooltipNode;!this.editor.isFocused()&&document.activeElement==e&&this.editor.focus(),this.tooltipNode=null,e.parentNode&&e.parentNode.removeChild(e)}},e.prototype.onTooltipClick=function(e){for(var t=e.target;t&&t!=this.tooltipNode;){if(t.nodeName==\`A\`&&t.href){t.rel=\`noreferrer\`,t.target=\`_blank\`;break}t=t.parentNode}},e.prototype.destroy=function(){if(this.detach(),this.popup){this.popup.destroy();var e=this.popup.container;e&&e.parentNode&&e.parentNode.removeChild(e)}this.editor&&this.editor.completer==this&&(this.editor.off(\`destroy\`,m),this.editor.completer=null),this.inlineRenderer=this.popup=this.editor=null},e.for=function(t){return t.completer instanceof e?t.completer:(t.completer&&=(t.completer.destroy(),null),d.get(\`sharedPopups\`)?(e.$sharedInstance||=new e,t.completer=e.$sharedInstance):(t.completer=new e,t.once(\`destroy\`,m)),t.completer)},e}();h.prototype.commands={Up:function(e){e.completer.goTo(\`up\`)},Down:function(e){e.completer.goTo(\`down\`)},"Ctrl-Up|Ctrl-Home":function(e){e.completer.goTo(\`start\`)},"Ctrl-Down|Ctrl-End":function(e){e.completer.goTo(\`end\`)},Esc:function(e){e.completer.detach()},Return:function(e){return e.completer.insertMatch()},"Shift-Return":function(e){e.completer.insertMatch(null,{deleteSuffix:!0})},Tab:function(e){var t=e.completer.insertMatch();if(!t&&!e.tabstopManager)e.completer.goTo(\`down\`);else return t},Backspace:function(e){e.execCommand(\`backspace\`),!s.getCompletionPrefix(e)&&e.completer&&e.completer.detach()},PageUp:function(e){e.completer.popup.gotoPageUp()},PageDown:function(e){e.completer.popup.gotoPageDown()}},h.startCommand={name:\`startAutocomplete\`,exec:function(e,t){var n=h.for(e);n.autoInsert=!1,n.autoSelect=!0,n.autoShown=!1,n.showPopup(e,t),n.cancelContextMenu()},bindKey:\`Ctrl-Space|Ctrl-Shift-Space|Alt-Space\`};var g=function(){function e(e){this.initialPosition=e,this.active=!0}return e.prototype.insertByIndex=function(e,t,n){return!this.completions||!this.completions.filtered?!1:this.insertMatch(e,this.completions.filtered[t],n)},e.prototype.insertMatch=function(e,t,n){if(!t)return!1;if(e.startOperation({command:{name:\`insertMatch\`}}),t.completer&&t.completer.insertMatch)t.completer.insertMatch(e,t);else{if(!this.completions)return!1;var r=this.completions.filterText.length,i=0;if(t.range&&t.range.start.row===t.range.end.row&&(r-=this.initialPosition.prefix.length,r+=this.initialPosition.pos.column-t.range.start.column,i+=t.range.end.column-this.initialPosition.pos.column),r||i)for(var a=e.selection.getAllRanges?e.selection.getAllRanges():[e.getSelectionRange()],o=0,s;s=a[o];o++)s.start.column-=r,s.end.column+=i,e.session.remove(s);t.snippet?u.insertSnippet(e,t.snippet):this.$insertString(e,t),t.completer&&t.completer.onInsert&&typeof t.completer.onInsert==\`function\`&&t.completer.onInsert(e,t),t.command&&t.command===\`startAutocomplete\`&&e.execCommand(t.command)}return e.endOperation(),!0},e.prototype.$insertString=function(e,t){var n=t.value||t;e.execCommand(\`insertstring\`,n)},e.prototype.gatherCompletions=function(e,t){var n=e.getSession(),r=e.getCursorPosition(),i=s.getCompletionPrefix(e),a=[];this.completers=e.completers;var o=e.completers.length;return e.completers.forEach(function(c,l){c.getCompletions(e,n,r,i,function(n,r){c.hideInlinePreview&&(r=r.map(function(e){return Object.assign(e,{hideInlinePreview:c.hideInlinePreview})})),!n&&r&&(a=a.concat(r)),t(null,{prefix:s.getCompletionPrefix(e),matches:a,finished:--o===0})})}),!0},e.prototype.provideCompletions=function(e,t,n){var r=function(e){var r=e.prefix,i=e.matches;this.completions=new _(i),t.exactMatch&&(this.completions.exactMatch=!0),t.ignoreCaption&&(this.completions.ignoreCaption=!0),this.completions.setFilter(r),(e.finished||this.completions.filtered.length)&&n(null,this.completions,e.finished)}.bind(this),i=!0,a=null;if(this.gatherCompletions(e,function(e,t){if(this.active&&(e&&(n(e,[],!0),this.detach()),t.prefix.indexOf(t.prefix)===0)){if(i){a=t;return}r(t)}}.bind(this)),i=!1,a){var o=a;a=null,r(o)}},e.prototype.detach=function(){this.active=!1,this.completers&&this.completers.forEach(function(e){typeof e.cancel==\`function\`&&e.cancel()})},e}(),_=function(){function e(e,t){this.all=e,this.filtered=e,this.filterText=t||\`\`,this.exactMatch=!1,this.ignoreCaption=!1}return e.prototype.setFilter=function(e){if(e.length>this.filterText&&e.lastIndexOf(this.filterText,0)===0)var t=this.filtered;else var t=this.all;this.filterText=e,t=this.filterCompletions(t,this.filterText),t=t.sort(function(e,t){return t.exactMatch-e.exactMatch||t.$score-e.$score||(e.caption||e.value).localeCompare(t.caption||t.value)});var n=null;t=t.filter(function(e){var t=e.snippet||e.caption||e.value;return t===n?!1:(n=t,!0)}),this.filtered=t},e.prototype.filterCompletions=function(e,t){var n=[],r=t.toUpperCase(),i=t.toLowerCase();loop:for(var a=0,o;o=e[a];a++){if(o.skipFilter){o.$score=o.score,n.push(o);continue}var s=!this.ignoreCaption&&o.caption||o.value||o.snippet;if(s){var c=-1,l=0,u=0,d,f;if(this.exactMatch){if(t!==s.substr(0,t.length))continue loop}else{var p=s.toLowerCase().indexOf(i);if(p>-1)u=p;else for(var m=0;m<t.length;m++){var h=s.indexOf(i[m],c+1),g=s.indexOf(r[m],c+1);if(d=h>=0&&(g<0||h<g)?h:g,d<0)continue loop;f=d-c-1,f>0&&(c===-1&&(u+=10),u+=f,l|=1<<m),c=d}}o.matchMask=l,o.exactMatch=+!u,o.$score=(o.score||0)-u,n.push(o)}}return n},e}();t.Autocomplete=h,t.CompletionProvider=g,t.FilteredList=_}),ace.define(\`ace/marker_group\`,[\`require\`,\`exports\`,\`module\`],function(e,t,n){var r=function(){function e(e,t){t&&(this.markerType=t.markerType),this.markers=[],this.session=e,e.addDynamicMarker(this)}return e.prototype.getMarkerAtPosition=function(e){return this.markers.find(function(t){return t.range.contains(e.row,e.column)})},e.prototype.markersComparator=function(e,t){return e.range.start.row-t.range.start.row},e.prototype.setMarkers=function(e){this.markers=e.sort(this.markersComparator).slice(0,this.MAX_MARKERS),this.session._signal(\`changeBackMarker\`)},e.prototype.update=function(e,t,n,r){if(!(!this.markers||!this.markers.length))for(var i=r.firstRow,a=r.lastRow,o,s=0,c=0,l=0;l<this.markers.length;l++){var u=this.markers[l];if(!(u.range.end.row<i)&&!(u.range.start.row>a)&&(u.range.start.row===c?s++:(c=u.range.start.row,s=0),!(s>200))){var d=u.range.clipRows(i,a);if(!(d.start.row===d.end.row&&d.start.column===d.end.column)){var f=d.toScreenRange(n);if(f.isEmpty()){o=n.getNextFoldLine(d.end.row,o),o&&o.end.row>d.end.row&&(i=o.end.row);continue}this.markerType===\`fullLine\`?t.drawFullLineMarker(e,f,u.className,r):f.isMultiLine()?this.markerType===\`line\`?t.drawMultiLineMarker(e,f,u.className,r):t.drawTextMarker(e,f,u.className,r):t.drawSingleLineMarker(e,f,u.className+\` ace_br15\`,r)}}}},e}();r.prototype.MAX_MARKERS=1e4,t.MarkerGroup=r}),ace.define(\`ace/autocomplete/text_completer\`,[\`require\`,\`exports\`,\`module\`,\`ace/range\`],function(e,t,n){var r=e("../range").Range,i=/[^a-zA-Z_0-9\\$\\-\\u00C0-\\u1FFF\\u2C00-\\uD7FF\\w]+/;function a(e,t){return e.getTextRange(r.fromPoints({row:0,column:0},t)).split(i).length-1}function o(e,t){var n=a(e,t),r=e.getValue().split(i),o=Object.create(null),s=r[n];return r.forEach(function(e,t){if(!(!e||e===s)){var i=Math.abs(n-t),a=r.length-i;o[e]?o[e]=Math.max(a,o[e]):o[e]=a}}),o}t.id=\`textCompleter\`,t.getCompletions=function(e,t,n,r,i){var a=o(t,n);i(null,Object.keys(a).map(function(e){return{caption:e,value:e,score:a[e],meta:\`local\`}}))}}),ace.define(\`ace/ext/language_tools\`,[\`require\`,\`exports\`,\`module\`,\`ace/snippets\`,\`ace/autocomplete\`,\`ace/config\`,\`ace/lib/lang\`,\`ace/autocomplete/util\`,\`ace/marker_group\`,\`ace/autocomplete/text_completer\`,\`ace/editor\`,\`ace/config\`],function(e,t,n){var r=e("../snippets").snippetManager,i=e("../autocomplete").Autocomplete,a=e("../config"),o=e("../lib/lang"),s=e("../autocomplete/util"),c=e("../marker_group").MarkerGroup,l=e("../autocomplete/text_completer"),u={getCompletions:function(e,t,n,r,i){if(t.$mode.completer)return t.$mode.completer.getCompletions(e,t,n,r,i);var a=e.session.getState(n.row),o=t.$mode.getCompletions(a,t,n,r);o=o.map(function(e){return e.completerId=u.id,e}),i(null,o)},id:\`keywordCompleter\`},d=function(e){var t={};return e.replace(/\\\${(\\d+)(:(.*?))?}/g,function(e,n,r,i){return t[n]=i||\`\`}).replace(/\\$(\\d+?)/g,function(e,n){return t[n]})},f={getCompletions:function(e,t,n,i,a){var o=[],s=t.getTokenAt(n.row,n.column);s&&s.type.match(/(tag-name|tag-open|tag-whitespace|attribute-name|attribute-value)\\.xml$/)?o.push(\`html-tag\`):o=r.getActiveScopes(e);var c=r.snippetMap,l=[];o.forEach(function(e){for(var t=c[e]||[],n=t.length;n--;){var r=t[n],i=r.name||r.tabTrigger;i&&l.push({caption:i,snippet:r.content,meta:r.tabTrigger&&!r.name?r.tabTrigger+\`⇥ \`:\`snippet\`,completerId:f.id})}},this),a(null,l)},getDocTooltip:function(e){e.snippet&&!e.docHTML&&(e.docHTML=[\`<b>\`,o.escapeHTML(e.caption),\`</b>\`,\`<hr></hr>\`,o.escapeHTML(d(e.snippet))].join(\`\`))},id:\`snippetCompleter\`},p=[f,l,u];t.setCompleters=function(e){p.length=0,e&&p.push.apply(p,e)},t.addCompleter=function(e){p.push(e)},t.textCompleter=l,t.keyWordCompleter=u,t.snippetCompleter=f;var m={name:\`expandSnippet\`,exec:function(e){return r.expandWithTab(e)},bindKey:\`Tab\`},h=function(e,t){g(t.session.$mode)},g=function(e){typeof e==\`string\`&&(e=a.$modes[e]),e&&(r.files||={},_(e.$id,e.snippetFileId),e.modes&&e.modes.forEach(g))},_=function(e,t){!t||!e||r.files[e]||(r.files[e]={},a.loadModule(t,function(t){t&&(r.files[e]=t,!t.snippets&&t.snippetText&&(t.snippets=r.parseSnippetFile(t.snippetText)),r.register(t.snippets||[],t.scope),t.includeScopes&&(r.snippetMap[t.scope].includeScopes=t.includeScopes,t.includeScopes.forEach(function(e){g(\`ace/mode/\`+e)})))}))},v=function(e){var t=e.editor,n=t.completer&&t.completer.activated;if(e.command.name===\`backspace\`)n&&!s.getCompletionPrefix(t)&&t.completer.detach();else if(e.command.name===\`insertstring\`&&!n){y=e;var r=e.editor.$liveAutocompletionDelay;r?b.delay(r):x(e)}},y,b=o.delayedCall(function(){x(y)},0),x=function(e){var t=e.editor,n=s.getCompletionPrefix(t),r=e.args,a=s.triggerAutocomplete(t,r);if(n&&n.length>=t.$liveAutocompletionThreshold||a){var o=i.for(t);o.autoShown=!0,o.showPopup(t)}},S=e("../editor").Editor;e("../config").defineOptions(S.prototype,\`editor\`,{enableBasicAutocompletion:{set:function(e){e?(i.for(this),this.completers||=Array.isArray(e)?e:p,this.commands.addCommand(i.startCommand)):this.commands.removeCommand(i.startCommand)},value:!1},enableLiveAutocompletion:{set:function(e){e?(this.completers||=Array.isArray(e)?e:p,this.commands.on(\`afterExec\`,v)):this.commands.off(\`afterExec\`,v)},value:!1},liveAutocompletionDelay:{initialValue:0},liveAutocompletionThreshold:{initialValue:0},enableSnippets:{set:function(e){e?(this.commands.addCommand(m),this.on(\`changeMode\`,h),h(null,this)):(this.commands.removeCommand(m),this.off(\`changeMode\`,h))},value:!1}}),t.MarkerGroup=c}),(function(){ace.require([\`ace/ext/language_tools\`],function(n){typeof t==\`object\`&&typeof e==\`object\`&&t&&(t.exports=n)})})()})),nn=o(((e,t)=>{ace.define(\`ace/mode/jsdoc_comment_highlight_rules\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/oop\`,\`ace/mode/text_highlight_rules\`],function(e,t,n){var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,a=function(){this.$rules={start:[{token:[\`comment.doc.tag\`,\`comment.doc.text\`,\`lparen.doc\`],regex:\`(@(?:param|member|typedef|property|namespace|var|const|callback))(\\\\s*)({)\`,push:[{token:\`lparen.doc\`,regex:\`{\`,push:[{include:\`doc-syntax\`},{token:\`rparen.doc\`,regex:\`}|(?=$)\`,next:\`pop\`}]},{token:[\`rparen.doc\`,\`text.doc\`,\`variable.parameter.doc\`,\`lparen.doc\`,\`variable.parameter.doc\`,\`rparen.doc\`],regex:/(})(\\s*)(?:([\\w=:\\/\\.]+)|(?:(\\[)([\\w=:\\/\\.\\-\\'\\" ]+)(\\])))/,next:\`pop\`},{token:\`rparen.doc\`,regex:\`}|(?=$)\`,next:\`pop\`},{include:\`doc-syntax\`},{defaultToken:\`text.doc\`}]},{token:[\`comment.doc.tag\`,\`text.doc\`,\`lparen.doc\`],regex:\`(@(?:returns?|yields|type|this|suppress|public|protected|private|package|modifies|implements|external|exception|throws|enum|define|extends))(\\\\s*)({)\`,push:[{token:\`lparen.doc\`,regex:\`{\`,push:[{include:\`doc-syntax\`},{token:\`rparen.doc\`,regex:\`}|(?=$)\`,next:\`pop\`}]},{token:\`rparen.doc\`,regex:\`}|(?=$)\`,next:\`pop\`},{include:\`doc-syntax\`},{defaultToken:\`text.doc\`}]},{token:[\`comment.doc.tag\`,\`text.doc\`,\`variable.parameter.doc\`],regex:\`(@(?:alias|memberof|instance|module|name|lends|namespace|external|this|template|requires|param|implements|function|extends|typedef|mixes|constructor|var|memberof\\\\!|event|listens|exports|class|constructs|interface|emits|fires|throws|const|callback|borrows|augments))(\\\\s+)(\\\\w[\\\\w#.:/~"\\\\-]*)?\`},{token:[\`comment.doc.tag\`,\`text.doc\`,\`variable.parameter.doc\`],regex:\`(@method)(\\\\s+)(\\\\w[\\\\w.\\\\(\\\\)]*)\`},{token:\`comment.doc.tag\`,regex:\`@access\\\\s+(?:private|public|protected)\`},{token:\`comment.doc.tag\`,regex:\`@kind\\\\s+(?:class|constant|event|external|file|function|member|mixin|module|namespace|typedef)\`},{token:\`comment.doc.tag\`,regex:\`@\\\\w+(?=\\\\s|$)\`},a.getTagRule(),{defaultToken:\`comment.doc.body\`,caseInsensitive:!0}],"doc-syntax":[{token:\`operator.doc\`,regex:/[|:]/},{token:\`paren.doc\`,regex:/[\\[\\]]/}]},this.normalizeRules()};r.inherits(a,i),a.getTagRule=function(e){return{token:\`comment.doc.tag.storage.type\`,regex:\`\\\\b(?:TODO|FIXME|XXX|HACK)\\\\b\`}},a.getStartRule=function(e){return{token:\`comment.doc\`,regex:/\\/\\*\\*(?!\\/)/,next:e}},a.getEndRule=function(e){return{token:\`comment.doc\`,regex:\`\\\\*\\\\/\`,next:e}},t.JsDocCommentHighlightRules=a}),ace.define(\`ace/mode/javascript_highlight_rules\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/oop\`,\`ace/mode/jsdoc_comment_highlight_rules\`,\`ace/mode/text_highlight_rules\`],function(e,t,n){var r=e("../lib/oop"),i=e("./jsdoc_comment_highlight_rules").JsDocCommentHighlightRules,a=e("./text_highlight_rules").TextHighlightRules,o=\`[a-zA-Z\\\\$_¡-￿][a-zA-Z\\\\d\\\\$_¡-￿]*\`,s=function(e){var t={"variable.language":\`Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|Namespace|QName|XML|XMLList|ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|SyntaxError|TypeError|URIError|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt|JSON|Math|this|arguments|prototype|window|document\`,keyword:\`const|yield|import|get|set|async|await|break|case|catch|continue|default|delete|do|else|finally|for|if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|__parent__|__count__|escape|unescape|with|__proto__|class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor\`,"storage.type":\`const|let|var|function\`,"constant.language":\`null|Infinity|NaN|undefined\`,"support.function":\`alert\`,"constant.language.boolean":\`true|false\`},n=this.createKeywordMapper(t,\`identifier\`),r=\`case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void\`,a=\`\\\\\\\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|u{[0-9a-fA-F]{1,6}}|[0-2][0-7]{0,2}|3[0-7][0-7]?|[4-7][0-7]?|.)\`,s=\`(function)(\\\\s*)(\\\\*?)\`,u={token:[\`identifier\`,\`text\`,\`paren.lparen\`],regex:\`(\\\\b(?!\`+Object.values(t).join(\`|\`)+\`\\\\b)\`+o+\`)(\\\\s*)(\\\\()\`};this.$rules={no_regex:[i.getStartRule(\`doc-start\`),l(\`no_regex\`),u,{token:\`string\`,regex:\`'(?=.)\`,next:\`qstring\`},{token:\`string\`,regex:\`"(?=.)\`,next:\`qqstring\`},{include:\`numeric_constants\`},{token:[\`entity.name.function\`,\`text\`,\`keyword.operator\`,\`text\`,\`storage.type\`,\`text\`,\`storage.type\`,\`text\`,\`paren.lparen\`],regex:\`(\`+o+\`)(\\\\s*)(=)(\\\\s*)\`+s+\`(\\\\s*)(\\\\()\`,next:\`function_arguments\`},{token:[\`storage.type\`,\`text\`,\`storage.type\`,\`text\`,\`text\`,\`entity.name.function\`,\`text\`,\`paren.lparen\`],regex:\`(function)(?:(?:(\\\\s*)(\\\\*)(\\\\s*))|(\\\\s+))(\`+o+\`)(\\\\s*)(\\\\()\`,next:\`function_arguments\`},{token:[\`entity.name.function\`,\`text\`,\`punctuation.operator\`,\`text\`,\`storage.type\`,\`text\`,\`storage.type\`,\`text\`,\`paren.lparen\`],regex:\`(\`+o+\`)(\\\\s*)(:)(\\\\s*)\`+s+\`(\\\\s*)(\\\\()\`,next:\`function_arguments\`},{token:[\`text\`,\`text\`,\`storage.type\`,\`text\`,\`storage.type\`,\`text\`,\`paren.lparen\`],regex:\`(:)(\\\\s*)\`+s+\`(\\\\s*)(\\\\()\`,next:\`function_arguments\`},{token:\`keyword\`,regex:\`from(?=\\\\s*('|"))\`},{token:\`keyword\`,regex:\`(?:\`+r+\`)\\\\b\`,next:\`start\`},{token:\`support.constant\`,regex:/that\\b/},{token:[\`storage.type\`,\`punctuation.operator\`,\`support.function.firebug\`],regex:/(console)(\\.)(warn|info|log|error|debug|time|trace|timeEnd|assert)\\b/},{token:n,regex:o},{token:\`punctuation.operator\`,regex:/[.](?![.])/,next:\`property\`},{token:\`storage.type\`,regex:/=>/,next:\`start\`},{token:\`keyword.operator\`,regex:/--|\\+\\+|\\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\\|\\||\\?:|[!$%&*+\\-~\\/^]=?/,next:\`start\`},{token:\`punctuation.operator\`,regex:/[?:,;.]/,next:\`start\`},{token:\`paren.lparen\`,regex:/[\\[({]/,next:\`start\`},{token:\`paren.rparen\`,regex:/[\\])}]/},{token:\`comment\`,regex:/^#!.*$/}],property:[{token:\`text\`,regex:\`\\\\s+\`},{token:\`keyword.operator\`,regex:/=/},{token:[\`storage.type\`,\`text\`,\`storage.type\`,\`text\`,\`paren.lparen\`],regex:s+\`(\\\\s*)(\\\\()\`,next:\`function_arguments\`},{token:[\`storage.type\`,\`text\`,\`storage.type\`,\`text\`,\`text\`,\`entity.name.function\`,\`text\`,\`paren.lparen\`],regex:\`(function)(?:(?:(\\\\s*)(\\\\*)(\\\\s*))|(\\\\s+))(\\\\w+)(\\\\s*)(\\\\()\`,next:\`function_arguments\`},{token:\`punctuation.operator\`,regex:/[.](?![.])/},{token:\`support.function\`,regex:\`prototype\`},{token:\`support.function\`,regex:/(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\\b(?=\\()/},{token:\`support.function.dom\`,regex:/(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\\b(?=\\()/},{token:\`support.constant\`,regex:/(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\\b/},{token:\`identifier\`,regex:o},{regex:\`\`,token:\`empty\`,next:\`no_regex\`}],start:[i.getStartRule(\`doc-start\`),l(\`start\`),{token:\`string.regexp\`,regex:\`\\\\/\`,next:\`regex\`},{token:\`text\`,regex:\`\\\\s+|^$\`,next:\`start\`},{token:\`empty\`,regex:\`\`,next:\`no_regex\`}],regex:[{token:\`regexp.keyword.operator\`,regex:\`\\\\\\\\(?:u[\\\\da-fA-F]{4}|x[\\\\da-fA-F]{2}|.)\`},{token:\`string.regexp\`,regex:\`/[sxngimy]*\`,next:\`no_regex\`},{token:\`invalid\`,regex:/\\{\\d+\\b,?\\d*\\}[+*]|[+*$^?][+*]|[$^][?]|\\?{3,}/},{token:\`constant.language.escape\`,regex:/\\(\\?[:=!]|\\)|\\{\\d+\\b,?\\d*\\}|[+*]\\?|[()$^+*?.]/},{token:\`constant.language.delimiter\`,regex:/\\|/},{token:\`constant.language.escape\`,regex:/\\[\\^?/,next:\`regex_character_class\`},{token:\`empty\`,regex:\`$\`,next:\`no_regex\`},{defaultToken:\`string.regexp\`}],regex_character_class:[{token:\`regexp.charclass.keyword.operator\`,regex:\`\\\\\\\\(?:u[\\\\da-fA-F]{4}|x[\\\\da-fA-F]{2}|.)\`},{token:\`constant.language.escape\`,regex:\`]\`,next:\`regex\`},{token:\`constant.language.escape\`,regex:\`-\`},{token:\`empty\`,regex:\`$\`,next:\`no_regex\`},{defaultToken:\`string.regexp.charachterclass\`}],default_parameter:[{token:\`string\`,regex:\`'(?=.)\`,push:[{token:\`string\`,regex:\`'|$\`,next:\`pop\`},{include:\`qstring\`}]},{token:\`string\`,regex:\`"(?=.)\`,push:[{token:\`string\`,regex:\`"|$\`,next:\`pop\`},{include:\`qqstring\`}]},{token:\`constant.language\`,regex:\`null|Infinity|NaN|undefined\`},{include:\`numeric_constants\`},{token:\`punctuation.operator\`,regex:\`,\`,next:\`function_arguments\`},{token:\`text\`,regex:\`\\\\s+\`},{token:\`punctuation.operator\`,regex:\`$\`},{token:\`empty\`,regex:\`\`,next:\`no_regex\`}],function_arguments:[l(\`function_arguments\`),{token:\`variable.parameter\`,regex:o},{token:\`punctuation.operator\`,regex:\`,\`},{token:\`text\`,regex:\`\\\\s+\`},{token:\`punctuation.operator\`,regex:\`$\`},{token:\`empty\`,regex:\`\`,next:\`no_regex\`}],qqstring:[{token:\`constant.language.escape\`,regex:a},{token:\`string\`,regex:\`\\\\\\\\$\`,consumeLineEnd:!0},{token:\`string\`,regex:\`"|$\`,next:\`no_regex\`},{defaultToken:\`string\`}],qstring:[{token:\`constant.language.escape\`,regex:a},{token:\`string\`,regex:\`\\\\\\\\$\`,consumeLineEnd:!0},{token:\`string\`,regex:\`'|$\`,next:\`no_regex\`},{defaultToken:\`string\`}],numeric_constants:[{token:\`constant.numeric\`,regex:/0(?:[xX][0-9a-fA-F_]+|[oO][0-7_]+|[bB][01_]+)\\b/},{token:\`constant.numeric\`,regex:/(?:\\d[\\d_]*(?:\\.[\\d_]*)?|\\.\\d[\\d_]*)(?:[eE][+-]?\\d+\\b)?/}]},(!e||!e.noES6)&&(this.$rules.no_regex.unshift({regex:\`[{}]\`,onMatch:function(e,t,n){if(this.next=e==\`{\`?this.nextState:\`\`,e==\`{\`&&n.length)n.unshift(\`start\`,t);else if(e==\`}\`&&n.length&&(n.shift(),this.next=n.shift(),this.next.indexOf(\`string\`)!=-1||this.next.indexOf(\`jsx\`)!=-1))return\`paren.quasi.end\`;return e==\`{\`?\`paren.lparen\`:\`paren.rparen\`},nextState:\`start\`},{token:\`string.quasi.start\`,regex:/\`/,push:[{token:\`constant.language.escape\`,regex:a},{token:\`paren.quasi.start\`,regex:/\\\${/,push:\`start\`},{token:\`string.quasi.end\`,regex:/\`/,next:\`pop\`},{defaultToken:\`string.quasi\`}]},{token:[\`variable.parameter\`,\`text\`],regex:\`(\`+o+\`)(\\\\s*)(?=\\\\=>)\`},{token:\`paren.lparen\`,regex:\`(\\\\()(?=[^\\\\(]+\\\\s*=>)\`,next:\`function_arguments\`},{token:\`variable.language\`,regex:\`(?:(?:(?:Weak)?(?:Set|Map))|Promise)\\\\b\`}),this.$rules.function_arguments.unshift({token:\`keyword.operator\`,regex:\`=\`,next:\`default_parameter\`},{token:\`keyword.operator\`,regex:\`\\\\.{3}\`}),this.$rules.property.unshift({token:\`support.function\`,regex:\`(findIndex|repeat|startsWith|endsWith|includes|isSafeInteger|trunc|cbrt|log2|log10|sign|then|catch|finally|resolve|reject|race|any|all|allSettled|keys|entries|isInteger)\\\\b(?=\\\\()\`},{token:\`constant.language\`,regex:\`(?:MAX_SAFE_INTEGER|MIN_SAFE_INTEGER|EPSILON)\\\\b\`}),(!e||e.jsx!=0)&&c.call(this)),this.embedRules(i,\`doc-\`,[i.getEndRule(\`no_regex\`)]),this.normalizeRules()};r.inherits(s,a);function c(){var e=o.replace(\`\\\\d\`,\`\\\\d\\\\-\`),t={onMatch:function(e,t,n){var r=e.charAt(1)==\`/\`?2:1;return r==1?(t==this.nextState?n.unshift(this.next):n.unshift(this.next,this.nextState,0),n[2]++):r==2&&t==this.nextState&&(n[1]--,(!n[1]||n[1]<0)&&(n.shift(),n.shift())),[{type:\`meta.tag.punctuation.\`+(r==1?\`\`:\`end-\`)+\`tag-open.xml\`,value:e.slice(0,r)},{type:\`meta.tag.tag-name.xml\`,value:e.substr(r)}]},regex:\`</?(?:\`+e+\`|(?=>))\`,next:\`jsxAttributes\`,nextState:\`jsx\`};this.$rules.start.unshift(t);var n={regex:\`{\`,token:\`paren.quasi.start\`,push:\`start\`};this.$rules.jsx=[n,t,{include:\`reference\`},{defaultToken:\`string.xml\`}],this.$rules.jsxAttributes=[{token:\`meta.tag.punctuation.tag-close.xml\`,regex:\`/?>\`,onMatch:function(e,t,n){return t==n[0]&&n.shift(),e.length==2&&(n[0]==this.nextState&&n[1]--,(!n[1]||n[1]<0)&&n.splice(0,2)),this.next=n[0]||\`start\`,[{type:this.token,value:e}]},nextState:\`jsx\`},n,l(\`jsxAttributes\`),{token:\`entity.other.attribute-name.xml\`,regex:e},{token:\`keyword.operator.attribute-equals.xml\`,regex:\`=\`},{token:\`text.tag-whitespace.xml\`,regex:\`\\\\s+\`},{token:\`string.attribute-value.xml\`,regex:\`'\`,stateName:\`jsx_attr_q\`,push:[{token:\`string.attribute-value.xml\`,regex:\`'\`,next:\`pop\`},{include:\`reference\`},{defaultToken:\`string.attribute-value.xml\`}]},{token:\`string.attribute-value.xml\`,regex:\`"\`,stateName:\`jsx_attr_qq\`,push:[{token:\`string.attribute-value.xml\`,regex:\`"\`,next:\`pop\`},{include:\`reference\`},{defaultToken:\`string.attribute-value.xml\`}]},t],this.$rules.reference=[{token:\`constant.language.escape.reference.xml\`,regex:\`(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\\\.-]+;)\`}]}function l(e){return[{token:\`comment\`,regex:/\\/\\*/,next:[i.getTagRule(),{token:\`comment\`,regex:\`\\\\*\\\\/\`,next:e||\`pop\`},{defaultToken:\`comment\`,caseInsensitive:!0}]},{token:\`comment\`,regex:\`\\\\/\\\\/\`,next:[i.getTagRule(),{token:\`comment\`,regex:\`$|^\`,next:e||\`pop\`},{defaultToken:\`comment\`,caseInsensitive:!0}]}]}t.JavaScriptHighlightRules=s}),ace.define(\`ace/mode/matching_brace_outdent\`,[\`require\`,\`exports\`,\`module\`,\`ace/range\`],function(e,t,n){var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\\s+$/.test(e)?/^\\s*\\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t).match(/^(\\s*\\})/);if(!n)return 0;var i=n[1].length,a=e.findMatchingBracket({row:t,column:i});if(!a||a.row==t)return 0;var o=this.$getIndent(e.getLine(a.row));e.replace(new r(t,0,t,i-1),o)},this.$getIndent=function(e){return e.match(/^\\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),ace.define(\`ace/mode/behaviour/xml\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/oop\`,\`ace/mode/behaviour\`,\`ace/token_iterator\`],function(e,t,n){var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,a=e("../../token_iterator").TokenIterator;function o(e,t){return e&&e.type.lastIndexOf(t+\`.xml\`)>-1}var s=function(){this.add(\`string_dquotes\`,\`insertion\`,function(e,t,n,r,i){if(i==\`"\`||i==\`'\`){var s=i,c=r.doc.getTextRange(n.getSelectionRange());if(c!==\`\`&&c!==\`'\`&&c!=\`"\`&&n.getWrapBehavioursEnabled())return{text:s+c+s,selection:!1};var l=n.getCursorPosition(),u=r.doc.getLine(l.row).substring(l.column,l.column+1),d=new a(r,l.row,l.column),f=d.getCurrentToken();if(u==s&&(o(f,\`attribute-value\`)||o(f,\`string\`)))return{text:\`\`,selection:[1,1]};if(f||=d.stepBackward(),!f)return;for(;o(f,\`tag-whitespace\`)||o(f,\`whitespace\`);)f=d.stepBackward();var p=!u||u.match(/\\s/);if(o(f,\`attribute-equals\`)&&(p||u==\`>\`)||o(f,\`decl-attribute-equals\`)&&(p||u==\`?\`))return{text:s+s,selection:[1,1]}}}),this.add(\`string_dquotes\`,\`deletion\`,function(e,t,n,r,i){var a=r.doc.getTextRange(i);if(!i.isMultiLine()&&(a==\`"\`||a==\`'\`)&&r.doc.getLine(i.start.row).substring(i.start.column+1,i.start.column+2)==a)return i.end.column++,i}),this.add(\`autoclosing\`,\`insertion\`,function(e,t,n,r,i){if(i==\`>\`){var s=n.getSelectionRange().start,c=new a(r,s.row,s.column),l=c.getCurrentToken()||c.stepBackward();if(!l||!(o(l,\`tag-name\`)||o(l,\`tag-whitespace\`)||o(l,\`attribute-name\`)||o(l,\`attribute-equals\`)||o(l,\`attribute-value\`))||o(l,\`reference.attribute-value\`))return;if(o(l,\`attribute-value\`)){var u=c.getCurrentTokenColumn()+l.value.length;if(s.column<u)return;if(s.column==u){var d=c.stepForward();if(d&&o(d,\`attribute-value\`))return;c.stepBackward()}}if(/^\\s*>/.test(r.getLine(s.row).slice(s.column)))return;for(;!o(l,\`tag-name\`);)if(l=c.stepBackward(),l.value==\`<\`){l=c.stepForward();break}var f=c.getCurrentTokenRow(),p=c.getCurrentTokenColumn();if(o(c.stepBackward(),\`end-tag-open\`))return;var m=l.value;return f==s.row&&(m=m.substring(0,s.column-p)),this.voidElements&&this.voidElements.hasOwnProperty(m.toLowerCase())?void 0:{text:\`></\`+m+\`>\`,selection:[1,1]}}}),this.add(\`autoindent\`,\`insertion\`,function(e,t,n,r,i){if(i==\`
1115
1115
  \`){var s=n.getCursorPosition(),c=r.getLine(s.row),l=new a(r,s.row,s.column),u=l.getCurrentToken();if(o(u,\`\`)&&u.type.indexOf(\`tag-close\`)!==-1){if(u.value==\`/>\`)return;for(;u&&u.type.indexOf(\`tag-name\`)===-1;)u=l.stepBackward();if(!u)return;var d=u.value,f=l.getCurrentTokenRow();if(u=l.stepBackward(),!u||u.type.indexOf(\`end-tag\`)!==-1)return;if(this.voidElements&&!this.voidElements[d]||!this.voidElements){var p=r.getTokenAt(s.row,s.column+1),c=r.getLine(f),m=this.$getIndent(c),h=m+r.getTabString();return p&&p.value===\`</\`?{text:\`
1116
1116
  \`+h+\`
1117
1117
  \`+m,selection:[1,h.length,1,h.length]}:{text:\`
1118
- \`+h}}}}})};r.inherits(s,i),t.XmlBehaviour=s}),ace.define(\`ace/mode/behaviour/javascript\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/oop\`,\`ace/token_iterator\`,\`ace/mode/behaviour/cstyle\`,\`ace/mode/behaviour/xml\`],function(e,t,n){var r=e("../../lib/oop"),i=e("../../token_iterator").TokenIterator,a=e("../behaviour/cstyle").CstyleBehaviour,o=e("../behaviour/xml").XmlBehaviour,s=function(){var e=new o({closeCurlyBraces:!0}).getBehaviours();this.addBehaviours(e),this.inherit(a),this.add(\`autoclosing-fragment\`,\`insertion\`,function(e,t,n,r,a){if(a==\`>\`){var o=n.getSelectionRange().start,s=new i(r,o.row,o.column),c=s.getCurrentToken()||s.stepBackward();if(!c)return;if(c.value==\`<\`)return{text:\`></>\`,selection:[1,1]}}})};r.inherits(s,a),t.JavaScriptBehaviour=s}),ace.define(\`ace/mode/folding/xml\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/oop\`,\`ace/range\`,\`ace/mode/folding/fold_mode\`],function(e,t,n){var r=e("../../lib/oop"),i=e("../../range").Range,a=e("./fold_mode").FoldMode,o=t.FoldMode=function(e,t){a.call(this),this.voidElements=e||{},this.optionalEndTags=r.mixin({},this.voidElements),t&&r.mixin(this.optionalEndTags,t)};r.inherits(o,a);var s=function(){this.tagName=\`\`,this.closing=!1,this.selfClosing=!1,this.start={row:0,column:0},this.end={row:0,column:0}};function c(e,t){return e&&e.type&&e.type.lastIndexOf(t+\`.xml\`)>-1}(function(){this.getFoldWidget=function(e,t,n){var r=this._getFirstTagInLine(e,n);return r?r.closing||!r.tagName&&r.selfClosing?t===\`markbeginend\`?\`end\`:\`\`:!r.tagName||r.selfClosing||this.voidElements.hasOwnProperty(r.tagName.toLowerCase())||this._findEndTagInLine(e,n,r.tagName,r.end.column)?\`\`:\`start\`:this.getCommentFoldWidget(e,n)},this.getCommentFoldWidget=function(e,t){return/comment/.test(e.getState(t))&&/<!-/.test(e.getLine(t))?\`start\`:\`\`},this._getFirstTagInLine=function(e,t){for(var n=e.getTokens(t),r=new s,i=0;i<n.length;i++){var a=n[i];if(c(a,\`tag-open\`)){if(r.end.column=r.start.column+a.value.length,r.closing=c(a,\`end-tag-open\`),a=n[++i],!a)return null;if(r.tagName=a.value,a.value===\`\`){if(a=n[++i],!a)return null;r.tagName=a.value}for(r.end.column+=a.value.length,i++;i<n.length;i++)if(a=n[i],r.end.column+=a.value.length,c(a,\`tag-close\`)){r.selfClosing=a.value==\`/>\`;break}return r}else if(c(a,\`tag-close\`))return r.selfClosing=a.value==\`/>\`,r;r.start.column+=a.value.length}return null},this._findEndTagInLine=function(e,t,n,r){for(var i=e.getTokens(t),a=0,o=0;o<i.length;o++){var s=i[o];if(a+=s.value.length,!(a<r-1)&&c(s,\`end-tag-open\`)&&(s=i[o+1],c(s,\`tag-name\`)&&s.value===\`\`&&(s=i[o+2]),s&&s.value==n))return!0}return!1},this.getFoldWidgetRange=function(e,t,n){if(!this._getFirstTagInLine(e,n))return this.getCommentFoldWidget(e,n)&&e.getCommentFoldRange(n,e.getLine(n).length);var r=e.getMatchingTags({row:n,column:0});if(r)return new i(r.openTag.end.row,r.openTag.end.column,r.closeTag.start.row,r.closeTag.start.column)}}).call(o.prototype)}),ace.define(\`ace/mode/folding/cstyle\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/oop\`,\`ace/range\`,\`ace/mode/folding/fold_mode\`],function(e,t,n){var r=e("../../lib/oop"),i=e("../../range").Range,a=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\\|[^|]*?$/,\`|\`+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\\|[^|]*?$/,\`|\`+e.end)))};r.inherits(o,a),(function(){this.foldingStartMarker=/([\\{\\[\\(])[^\\}\\]\\)]*$|^\\s*(\\/\\*)/,this.foldingStopMarker=/^[^\\[\\{\\(]*([\\}\\]\\)])|^[\\s\\*]*(\\*\\/)/,this.singleLineBlockCommentRe=/^\\s*(\\/\\*).*\\*\\/\\s*$/,this.tripleStarBlockCommentRe=/^\\s*(\\/\\*\\*\\*).*\\*\\/\\s*$/,this.startRegionRe=/^\\s*(\\/\\*|\\/\\/)#?region\\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return\`\`;var i=this._getFoldWidgetBase(e,t,n);return!i&&this.startRegionRe.test(r)?\`start\`:i},this.getFoldWidgetRange=function(e,t,n,r){var i=e.getLine(n);if(this.startRegionRe.test(i))return this.getCommentRegionBlock(e,i,n);var a=i.match(this.foldingStartMarker);if(a){var o=a.index;if(a[1])return this.openingBracketBlock(e,a[1],n,o);var s=e.getCommentFoldRange(n,o+a[0].length,1);return s&&!s.isMultiLine()&&(r?s=this.getSectionRange(e,n):t!=\`all\`&&(s=null)),s}if(t!==\`markbegin\`){var a=i.match(this.foldingStopMarker);if(a){var o=a.index+a[0].length;return a[1]?this.closingBracketBlock(e,a[1],n,o):e.getCommentFoldRange(n,o,-1)}}},this.getSectionRange=function(e,t){var n=e.getLine(t),r=n.search(/\\S/),a=t,o=n.length;t+=1;for(var s=t,c=e.getLength();++t<c;){n=e.getLine(t);var l=n.search(/\\S/);if(l!==-1){if(r>l)break;var u=this.getFoldWidgetRange(e,\`all\`,t);if(u){if(u.start.row<=a)break;if(u.isMultiLine())t=u.end.row;else if(r==l)break}s=t}}return new i(a,o,s,e.getLine(s).length)},this.getCommentRegionBlock=function(e,t,n){for(var r=t.search(/\\s*$/),a=e.getLength(),o=n,s=/^\\s*(?:\\/\\*|\\/\\/|--)#?(end)?region\\b/,c=1;++n<a;){t=e.getLine(n);var l=s.exec(t);if(l&&(l[1]?c--:c++,!c))break}var u=n;if(u>o)return new i(o,r,u,t.length)}}).call(o.prototype)}),ace.define(\`ace/mode/folding/javascript\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/oop\`,\`ace/mode/folding/xml\`,\`ace/mode/folding/cstyle\`],function(e,t,n){var r=e("../../lib/oop"),i=e("./xml").FoldMode,a=e("./cstyle").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\\|[^|]*?$/,\`|\`+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\\|[^|]*?$/,\`|\`+e.end))),this.xmlFoldMode=new i};r.inherits(o,a),(function(){this.getFoldWidgetRangeBase=this.getFoldWidgetRange,this.getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){return this.getFoldWidgetBase(e,t,n)||this.xmlFoldMode.getFoldWidget(e,t,n)},this.getFoldWidgetRange=function(e,t,n,r){return this.getFoldWidgetRangeBase(e,t,n,r)||this.xmlFoldMode.getFoldWidgetRange(e,t,n)}}).call(o.prototype)}),ace.define(\`ace/mode/javascript\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/oop\`,\`ace/mode/text\`,\`ace/mode/javascript_highlight_rules\`,\`ace/mode/matching_brace_outdent\`,\`ace/worker/worker_client\`,\`ace/mode/behaviour/javascript\`,\`ace/mode/folding/javascript\`],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,a=e("./javascript_highlight_rules").JavaScriptHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,s=e("../worker/worker_client").WorkerClient,c=e("./behaviour/javascript").JavaScriptBehaviour,l=e("./folding/javascript").FoldMode,u=function(){this.HighlightRules=a,this.$outdent=new o,this.$behaviour=new c,this.foldingRules=new l};r.inherits(u,i),(function(){this.lineCommentStart=\`//\`,this.blockComment={start:\`/*\`,end:\`*/\`},this.$quotes={'"':\`"\`,"'":\`'\`,"\`":"\`"},this.$pairQuotesAfter={"\`":/\\w/},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e),a=i.tokens,o=i.state;if(a.length&&a[a.length-1].type==\`comment\`)return r;if(e==\`start\`||e==\`no_regex\`)t.match(/^.*(?:\\bcase\\b.*:|[\\{\\(\\[])\\s*$/)&&(r+=n);else if(e==\`doc-start\`&&(o==\`start\`||o==\`no_regex\`))return\`\`;return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.createWorker=function(e){var t=new s([\`ace\`],\`ace/mode/javascript_worker\`,\`JavaScriptWorker\`);return t.attachToDocument(e.getDocument()),t.on(\`annotate\`,function(t){e.setAnnotations(t.data)}),t.on(\`terminate\`,function(){e.clearAnnotations()}),t},this.$id=\`ace/mode/javascript\`,this.snippetFileId=\`ace/snippets/javascript\`}).call(u.prototype),t.Mode=u}),(function(){ace.require([\`ace/mode/javascript\`],function(n){typeof t==\`object\`&&typeof e==\`object\`&&t&&(t.exports=n)})})()})),tn=o(((e,t)=>{ace.define(\`ace/mode/sql_highlight_rules\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/oop\`,\`ace/mode/text_highlight_rules\`],function(e,t,n){var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,a=function(){var e=this.createKeywordMapper({"support.function":\`avg|count|first|last|max|min|sum|ucase|lcase|mid|len|round|rank|now|format|coalesce|ifnull|isnull|nvl\`,keyword:\`select|insert|update|delete|from|where|and|or|group|by|order|limit|offset|having|as|case|when|then|else|end|type|left|right|join|on|outer|desc|asc|union|create|table|primary|key|if|foreign|not|references|default|null|inner|cross|natural|database|drop|grant|distinct|is|in|all|alter|any|array|at|authorization|between|both|cast|check|collate|column|commit|constraint|cube|current|current_date|current_time|current_timestamp|current_user|describe|escape|except|exists|external|extract|fetch|filter|for|full|function|global|grouping|intersect|interval|into|leading|like|local|no|of|only|out|overlaps|partition|position|range|revoke|rollback|rollup|row|rows|session_user|set|some|start|tablesample|time|to|trailing|truncate|unique|unknown|user|using|values|window|with\`,"constant.language":\`true|false\`,"storage.type":\`int|numeric|decimal|date|varchar|char|bigint|float|double|bit|binary|text|set|timestamp|money|real|number|integer|string\`},\`identifier\`,!0);this.$rules={start:[{token:\`comment\`,regex:\`--.*$\`},{token:\`comment\`,start:\`/\\\\*\`,end:\`\\\\*/\`},{token:\`string\`,regex:\`".*?"\`},{token:\`string\`,regex:\`'.*?'\`},{token:\`string\`,regex:"\`.*?\`"},{token:\`constant.numeric\`,regex:\`[+-]?\\\\d+(?:(?:\\\\.\\\\d*)?(?:[eE][+-]?\\\\d+)?)?\\\\b\`},{token:e,regex:\`[a-zA-Z_$][a-zA-Z0-9_$]*\\\\b\`},{token:\`keyword.operator\`,regex:\`\\\\+|\\\\-|\\\\/|\\\\/\\\\/|%|<@>|@>|<@|&|\\\\^|~|<|>|<=|=>|==|!=|<>|=\`},{token:\`paren.lparen\`,regex:\`[\\\\(]\`},{token:\`paren.rparen\`,regex:\`[\\\\)]\`},{token:\`text\`,regex:\`\\\\s+\`}]},this.normalizeRules()};r.inherits(a,i),t.SqlHighlightRules=a}),ace.define(\`ace/mode/folding/cstyle\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/oop\`,\`ace/range\`,\`ace/mode/folding/fold_mode\`],function(e,t,n){var r=e("../../lib/oop"),i=e("../../range").Range,a=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\\|[^|]*?$/,\`|\`+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\\|[^|]*?$/,\`|\`+e.end)))};r.inherits(o,a),(function(){this.foldingStartMarker=/([\\{\\[\\(])[^\\}\\]\\)]*$|^\\s*(\\/\\*)/,this.foldingStopMarker=/^[^\\[\\{\\(]*([\\}\\]\\)])|^[\\s\\*]*(\\*\\/)/,this.singleLineBlockCommentRe=/^\\s*(\\/\\*).*\\*\\/\\s*$/,this.tripleStarBlockCommentRe=/^\\s*(\\/\\*\\*\\*).*\\*\\/\\s*$/,this.startRegionRe=/^\\s*(\\/\\*|\\/\\/)#?region\\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return\`\`;var i=this._getFoldWidgetBase(e,t,n);return!i&&this.startRegionRe.test(r)?\`start\`:i},this.getFoldWidgetRange=function(e,t,n,r){var i=e.getLine(n);if(this.startRegionRe.test(i))return this.getCommentRegionBlock(e,i,n);var a=i.match(this.foldingStartMarker);if(a){var o=a.index;if(a[1])return this.openingBracketBlock(e,a[1],n,o);var s=e.getCommentFoldRange(n,o+a[0].length,1);return s&&!s.isMultiLine()&&(r?s=this.getSectionRange(e,n):t!=\`all\`&&(s=null)),s}if(t!==\`markbegin\`){var a=i.match(this.foldingStopMarker);if(a){var o=a.index+a[0].length;return a[1]?this.closingBracketBlock(e,a[1],n,o):e.getCommentFoldRange(n,o,-1)}}},this.getSectionRange=function(e,t){var n=e.getLine(t),r=n.search(/\\S/),a=t,o=n.length;t+=1;for(var s=t,c=e.getLength();++t<c;){n=e.getLine(t);var l=n.search(/\\S/);if(l!==-1){if(r>l)break;var u=this.getFoldWidgetRange(e,\`all\`,t);if(u){if(u.start.row<=a)break;if(u.isMultiLine())t=u.end.row;else if(r==l)break}s=t}}return new i(a,o,s,e.getLine(s).length)},this.getCommentRegionBlock=function(e,t,n){for(var r=t.search(/\\s*$/),a=e.getLength(),o=n,s=/^\\s*(?:\\/\\*|\\/\\/|--)#?(end)?region\\b/,c=1;++n<a;){t=e.getLine(n);var l=s.exec(t);if(l&&(l[1]?c--:c++,!c))break}var u=n;if(u>o)return new i(o,r,u,t.length)}}).call(o.prototype)}),ace.define(\`ace/mode/folding/sql\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/oop\`,\`ace/mode/folding/cstyle\`],function(e,t,n){var r=e("../../lib/oop"),i=e("./cstyle").FoldMode,a=t.FoldMode=function(){};r.inherits(a,i),(function(){}).call(a.prototype)}),ace.define(\`ace/mode/sql\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/oop\`,\`ace/mode/text\`,\`ace/mode/sql_highlight_rules\`,\`ace/mode/folding/sql\`],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,a=e("./sql_highlight_rules").SqlHighlightRules,o=e("./folding/sql").FoldMode,s=function(){this.HighlightRules=a,this.foldingRules=new o,this.$behaviour=this.$defaultBehaviour};r.inherits(s,i),(function(){this.lineCommentStart=\`--\`,this.blockComment={start:\`/*\`,end:\`*/\`},this.$id=\`ace/mode/sql\`,this.snippetFileId=\`ace/snippets/sql\`}).call(s.prototype),t.Mode=s}),(function(){ace.require([\`ace/mode/sql\`],function(n){typeof t==\`object\`&&typeof e==\`object\`&&t&&(t.exports=n)})})()})),nn=o(((e,t)=>{ace.define(\`ace/theme/github-css\`,[\`require\`,\`exports\`,\`module\`],function(e,t,n){n.exports=\`/* CSS style content from github's default pygments highlighter template.
1118
+ \`+h}}}}})};r.inherits(s,i),t.XmlBehaviour=s}),ace.define(\`ace/mode/behaviour/javascript\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/oop\`,\`ace/token_iterator\`,\`ace/mode/behaviour/cstyle\`,\`ace/mode/behaviour/xml\`],function(e,t,n){var r=e("../../lib/oop"),i=e("../../token_iterator").TokenIterator,a=e("../behaviour/cstyle").CstyleBehaviour,o=e("../behaviour/xml").XmlBehaviour,s=function(){var e=new o({closeCurlyBraces:!0}).getBehaviours();this.addBehaviours(e),this.inherit(a),this.add(\`autoclosing-fragment\`,\`insertion\`,function(e,t,n,r,a){if(a==\`>\`){var o=n.getSelectionRange().start,s=new i(r,o.row,o.column),c=s.getCurrentToken()||s.stepBackward();if(!c)return;if(c.value==\`<\`)return{text:\`></>\`,selection:[1,1]}}})};r.inherits(s,a),t.JavaScriptBehaviour=s}),ace.define(\`ace/mode/folding/xml\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/oop\`,\`ace/range\`,\`ace/mode/folding/fold_mode\`],function(e,t,n){var r=e("../../lib/oop"),i=e("../../range").Range,a=e("./fold_mode").FoldMode,o=t.FoldMode=function(e,t){a.call(this),this.voidElements=e||{},this.optionalEndTags=r.mixin({},this.voidElements),t&&r.mixin(this.optionalEndTags,t)};r.inherits(o,a);var s=function(){this.tagName=\`\`,this.closing=!1,this.selfClosing=!1,this.start={row:0,column:0},this.end={row:0,column:0}};function c(e,t){return e&&e.type&&e.type.lastIndexOf(t+\`.xml\`)>-1}(function(){this.getFoldWidget=function(e,t,n){var r=this._getFirstTagInLine(e,n);return r?r.closing||!r.tagName&&r.selfClosing?t===\`markbeginend\`?\`end\`:\`\`:!r.tagName||r.selfClosing||this.voidElements.hasOwnProperty(r.tagName.toLowerCase())||this._findEndTagInLine(e,n,r.tagName,r.end.column)?\`\`:\`start\`:this.getCommentFoldWidget(e,n)},this.getCommentFoldWidget=function(e,t){return/comment/.test(e.getState(t))&&/<!-/.test(e.getLine(t))?\`start\`:\`\`},this._getFirstTagInLine=function(e,t){for(var n=e.getTokens(t),r=new s,i=0;i<n.length;i++){var a=n[i];if(c(a,\`tag-open\`)){if(r.end.column=r.start.column+a.value.length,r.closing=c(a,\`end-tag-open\`),a=n[++i],!a)return null;if(r.tagName=a.value,a.value===\`\`){if(a=n[++i],!a)return null;r.tagName=a.value}for(r.end.column+=a.value.length,i++;i<n.length;i++)if(a=n[i],r.end.column+=a.value.length,c(a,\`tag-close\`)){r.selfClosing=a.value==\`/>\`;break}return r}else if(c(a,\`tag-close\`))return r.selfClosing=a.value==\`/>\`,r;r.start.column+=a.value.length}return null},this._findEndTagInLine=function(e,t,n,r){for(var i=e.getTokens(t),a=0,o=0;o<i.length;o++){var s=i[o];if(a+=s.value.length,!(a<r-1)&&c(s,\`end-tag-open\`)&&(s=i[o+1],c(s,\`tag-name\`)&&s.value===\`\`&&(s=i[o+2]),s&&s.value==n))return!0}return!1},this.getFoldWidgetRange=function(e,t,n){if(!this._getFirstTagInLine(e,n))return this.getCommentFoldWidget(e,n)&&e.getCommentFoldRange(n,e.getLine(n).length);var r=e.getMatchingTags({row:n,column:0});if(r)return new i(r.openTag.end.row,r.openTag.end.column,r.closeTag.start.row,r.closeTag.start.column)}}).call(o.prototype)}),ace.define(\`ace/mode/folding/cstyle\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/oop\`,\`ace/range\`,\`ace/mode/folding/fold_mode\`],function(e,t,n){var r=e("../../lib/oop"),i=e("../../range").Range,a=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\\|[^|]*?$/,\`|\`+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\\|[^|]*?$/,\`|\`+e.end)))};r.inherits(o,a),(function(){this.foldingStartMarker=/([\\{\\[\\(])[^\\}\\]\\)]*$|^\\s*(\\/\\*)/,this.foldingStopMarker=/^[^\\[\\{\\(]*([\\}\\]\\)])|^[\\s\\*]*(\\*\\/)/,this.singleLineBlockCommentRe=/^\\s*(\\/\\*).*\\*\\/\\s*$/,this.tripleStarBlockCommentRe=/^\\s*(\\/\\*\\*\\*).*\\*\\/\\s*$/,this.startRegionRe=/^\\s*(\\/\\*|\\/\\/)#?region\\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return\`\`;var i=this._getFoldWidgetBase(e,t,n);return!i&&this.startRegionRe.test(r)?\`start\`:i},this.getFoldWidgetRange=function(e,t,n,r){var i=e.getLine(n);if(this.startRegionRe.test(i))return this.getCommentRegionBlock(e,i,n);var a=i.match(this.foldingStartMarker);if(a){var o=a.index;if(a[1])return this.openingBracketBlock(e,a[1],n,o);var s=e.getCommentFoldRange(n,o+a[0].length,1);return s&&!s.isMultiLine()&&(r?s=this.getSectionRange(e,n):t!=\`all\`&&(s=null)),s}if(t!==\`markbegin\`){var a=i.match(this.foldingStopMarker);if(a){var o=a.index+a[0].length;return a[1]?this.closingBracketBlock(e,a[1],n,o):e.getCommentFoldRange(n,o,-1)}}},this.getSectionRange=function(e,t){var n=e.getLine(t),r=n.search(/\\S/),a=t,o=n.length;t+=1;for(var s=t,c=e.getLength();++t<c;){n=e.getLine(t);var l=n.search(/\\S/);if(l!==-1){if(r>l)break;var u=this.getFoldWidgetRange(e,\`all\`,t);if(u){if(u.start.row<=a)break;if(u.isMultiLine())t=u.end.row;else if(r==l)break}s=t}}return new i(a,o,s,e.getLine(s).length)},this.getCommentRegionBlock=function(e,t,n){for(var r=t.search(/\\s*$/),a=e.getLength(),o=n,s=/^\\s*(?:\\/\\*|\\/\\/|--)#?(end)?region\\b/,c=1;++n<a;){t=e.getLine(n);var l=s.exec(t);if(l&&(l[1]?c--:c++,!c))break}var u=n;if(u>o)return new i(o,r,u,t.length)}}).call(o.prototype)}),ace.define(\`ace/mode/folding/javascript\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/oop\`,\`ace/mode/folding/xml\`,\`ace/mode/folding/cstyle\`],function(e,t,n){var r=e("../../lib/oop"),i=e("./xml").FoldMode,a=e("./cstyle").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\\|[^|]*?$/,\`|\`+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\\|[^|]*?$/,\`|\`+e.end))),this.xmlFoldMode=new i};r.inherits(o,a),(function(){this.getFoldWidgetRangeBase=this.getFoldWidgetRange,this.getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){return this.getFoldWidgetBase(e,t,n)||this.xmlFoldMode.getFoldWidget(e,t,n)},this.getFoldWidgetRange=function(e,t,n,r){return this.getFoldWidgetRangeBase(e,t,n,r)||this.xmlFoldMode.getFoldWidgetRange(e,t,n)}}).call(o.prototype)}),ace.define(\`ace/mode/javascript\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/oop\`,\`ace/mode/text\`,\`ace/mode/javascript_highlight_rules\`,\`ace/mode/matching_brace_outdent\`,\`ace/worker/worker_client\`,\`ace/mode/behaviour/javascript\`,\`ace/mode/folding/javascript\`],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,a=e("./javascript_highlight_rules").JavaScriptHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,s=e("../worker/worker_client").WorkerClient,c=e("./behaviour/javascript").JavaScriptBehaviour,l=e("./folding/javascript").FoldMode,u=function(){this.HighlightRules=a,this.$outdent=new o,this.$behaviour=new c,this.foldingRules=new l};r.inherits(u,i),(function(){this.lineCommentStart=\`//\`,this.blockComment={start:\`/*\`,end:\`*/\`},this.$quotes={'"':\`"\`,"'":\`'\`,"\`":"\`"},this.$pairQuotesAfter={"\`":/\\w/},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e),a=i.tokens,o=i.state;if(a.length&&a[a.length-1].type==\`comment\`)return r;if(e==\`start\`||e==\`no_regex\`)t.match(/^.*(?:\\bcase\\b.*:|[\\{\\(\\[])\\s*$/)&&(r+=n);else if(e==\`doc-start\`&&(o==\`start\`||o==\`no_regex\`))return\`\`;return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.createWorker=function(e){var t=new s([\`ace\`],\`ace/mode/javascript_worker\`,\`JavaScriptWorker\`);return t.attachToDocument(e.getDocument()),t.on(\`annotate\`,function(t){e.setAnnotations(t.data)}),t.on(\`terminate\`,function(){e.clearAnnotations()}),t},this.$id=\`ace/mode/javascript\`,this.snippetFileId=\`ace/snippets/javascript\`}).call(u.prototype),t.Mode=u}),(function(){ace.require([\`ace/mode/javascript\`],function(n){typeof t==\`object\`&&typeof e==\`object\`&&t&&(t.exports=n)})})()})),rn=o(((e,t)=>{ace.define(\`ace/mode/sql_highlight_rules\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/oop\`,\`ace/mode/text_highlight_rules\`],function(e,t,n){var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,a=function(){var e=this.createKeywordMapper({"support.function":\`avg|count|first|last|max|min|sum|ucase|lcase|mid|len|round|rank|now|format|coalesce|ifnull|isnull|nvl\`,keyword:\`select|insert|update|delete|from|where|and|or|group|by|order|limit|offset|having|as|case|when|then|else|end|type|left|right|join|on|outer|desc|asc|union|create|table|primary|key|if|foreign|not|references|default|null|inner|cross|natural|database|drop|grant|distinct|is|in|all|alter|any|array|at|authorization|between|both|cast|check|collate|column|commit|constraint|cube|current|current_date|current_time|current_timestamp|current_user|describe|escape|except|exists|external|extract|fetch|filter|for|full|function|global|grouping|intersect|interval|into|leading|like|local|no|of|only|out|overlaps|partition|position|range|revoke|rollback|rollup|row|rows|session_user|set|some|start|tablesample|time|to|trailing|truncate|unique|unknown|user|using|values|window|with\`,"constant.language":\`true|false\`,"storage.type":\`int|numeric|decimal|date|varchar|char|bigint|float|double|bit|binary|text|set|timestamp|money|real|number|integer|string\`},\`identifier\`,!0);this.$rules={start:[{token:\`comment\`,regex:\`--.*$\`},{token:\`comment\`,start:\`/\\\\*\`,end:\`\\\\*/\`},{token:\`string\`,regex:\`".*?"\`},{token:\`string\`,regex:\`'.*?'\`},{token:\`string\`,regex:"\`.*?\`"},{token:\`constant.numeric\`,regex:\`[+-]?\\\\d+(?:(?:\\\\.\\\\d*)?(?:[eE][+-]?\\\\d+)?)?\\\\b\`},{token:e,regex:\`[a-zA-Z_$][a-zA-Z0-9_$]*\\\\b\`},{token:\`keyword.operator\`,regex:\`\\\\+|\\\\-|\\\\/|\\\\/\\\\/|%|<@>|@>|<@|&|\\\\^|~|<|>|<=|=>|==|!=|<>|=\`},{token:\`paren.lparen\`,regex:\`[\\\\(]\`},{token:\`paren.rparen\`,regex:\`[\\\\)]\`},{token:\`text\`,regex:\`\\\\s+\`}]},this.normalizeRules()};r.inherits(a,i),t.SqlHighlightRules=a}),ace.define(\`ace/mode/folding/cstyle\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/oop\`,\`ace/range\`,\`ace/mode/folding/fold_mode\`],function(e,t,n){var r=e("../../lib/oop"),i=e("../../range").Range,a=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\\|[^|]*?$/,\`|\`+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\\|[^|]*?$/,\`|\`+e.end)))};r.inherits(o,a),(function(){this.foldingStartMarker=/([\\{\\[\\(])[^\\}\\]\\)]*$|^\\s*(\\/\\*)/,this.foldingStopMarker=/^[^\\[\\{\\(]*([\\}\\]\\)])|^[\\s\\*]*(\\*\\/)/,this.singleLineBlockCommentRe=/^\\s*(\\/\\*).*\\*\\/\\s*$/,this.tripleStarBlockCommentRe=/^\\s*(\\/\\*\\*\\*).*\\*\\/\\s*$/,this.startRegionRe=/^\\s*(\\/\\*|\\/\\/)#?region\\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return\`\`;var i=this._getFoldWidgetBase(e,t,n);return!i&&this.startRegionRe.test(r)?\`start\`:i},this.getFoldWidgetRange=function(e,t,n,r){var i=e.getLine(n);if(this.startRegionRe.test(i))return this.getCommentRegionBlock(e,i,n);var a=i.match(this.foldingStartMarker);if(a){var o=a.index;if(a[1])return this.openingBracketBlock(e,a[1],n,o);var s=e.getCommentFoldRange(n,o+a[0].length,1);return s&&!s.isMultiLine()&&(r?s=this.getSectionRange(e,n):t!=\`all\`&&(s=null)),s}if(t!==\`markbegin\`){var a=i.match(this.foldingStopMarker);if(a){var o=a.index+a[0].length;return a[1]?this.closingBracketBlock(e,a[1],n,o):e.getCommentFoldRange(n,o,-1)}}},this.getSectionRange=function(e,t){var n=e.getLine(t),r=n.search(/\\S/),a=t,o=n.length;t+=1;for(var s=t,c=e.getLength();++t<c;){n=e.getLine(t);var l=n.search(/\\S/);if(l!==-1){if(r>l)break;var u=this.getFoldWidgetRange(e,\`all\`,t);if(u){if(u.start.row<=a)break;if(u.isMultiLine())t=u.end.row;else if(r==l)break}s=t}}return new i(a,o,s,e.getLine(s).length)},this.getCommentRegionBlock=function(e,t,n){for(var r=t.search(/\\s*$/),a=e.getLength(),o=n,s=/^\\s*(?:\\/\\*|\\/\\/|--)#?(end)?region\\b/,c=1;++n<a;){t=e.getLine(n);var l=s.exec(t);if(l&&(l[1]?c--:c++,!c))break}var u=n;if(u>o)return new i(o,r,u,t.length)}}).call(o.prototype)}),ace.define(\`ace/mode/folding/sql\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/oop\`,\`ace/mode/folding/cstyle\`],function(e,t,n){var r=e("../../lib/oop"),i=e("./cstyle").FoldMode,a=t.FoldMode=function(){};r.inherits(a,i),(function(){}).call(a.prototype)}),ace.define(\`ace/mode/sql\`,[\`require\`,\`exports\`,\`module\`,\`ace/lib/oop\`,\`ace/mode/text\`,\`ace/mode/sql_highlight_rules\`,\`ace/mode/folding/sql\`],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,a=e("./sql_highlight_rules").SqlHighlightRules,o=e("./folding/sql").FoldMode,s=function(){this.HighlightRules=a,this.foldingRules=new o,this.$behaviour=this.$defaultBehaviour};r.inherits(s,i),(function(){this.lineCommentStart=\`--\`,this.blockComment={start:\`/*\`,end:\`*/\`},this.$id=\`ace/mode/sql\`,this.snippetFileId=\`ace/snippets/sql\`}).call(s.prototype),t.Mode=s}),(function(){ace.require([\`ace/mode/sql\`],function(n){typeof t==\`object\`&&typeof e==\`object\`&&t&&(t.exports=n)})})()})),an=o(((e,t)=>{ace.define(\`ace/theme/github-css\`,[\`require\`,\`exports\`,\`module\`],function(e,t,n){n.exports=\`/* CSS style content from github's default pygments highlighter template.
1119
1119
  Cursor and selection styles from textmate.css. */
1120
1120
  .ace-github .ace_gutter {
1121
1121
  background: #e8e8e8;
@@ -1243,7 +1243,7 @@ Error generating stack: \`+e.message+\`
1243
1243
  .ace-github .ace_indent-guide-active {
1244
1244
  background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAZSURBVHjaYvj///9/hivKyv8BAAAA//8DACLqBhbvk+/eAAAAAElFTkSuQmCC") right repeat-y;
1245
1245
  }
1246
- \`}),ace.define(\`ace/theme/github\`,[\`require\`,\`exports\`,\`module\`,\`ace/theme/github-css\`,\`ace/lib/dom\`],function(e,t,n){t.isDark=!1,t.cssClass=\`ace-github\`,t.cssText=e("./github-css"),e("../lib/dom").importCssString(t.cssText,t.cssClass,!1)}),(function(){ace.require([\`ace/theme/github\`],function(n){typeof t==\`object\`&&typeof e==\`object\`&&t&&(t.exports=n)})})()})),rn=o(((e,t)=>{ace.define(\`ace/theme/one_dark-css\`,[\`require\`,\`exports\`,\`module\`],function(e,t,n){n.exports=\`.ace-one-dark .ace_gutter {
1246
+ \`}),ace.define(\`ace/theme/github\`,[\`require\`,\`exports\`,\`module\`,\`ace/theme/github-css\`,\`ace/lib/dom\`],function(e,t,n){t.isDark=!1,t.cssClass=\`ace-github\`,t.cssText=e("./github-css"),e("../lib/dom").importCssString(t.cssText,t.cssClass,!1)}),(function(){ace.require([\`ace/theme/github\`],function(n){typeof t==\`object\`&&typeof e==\`object\`&&t&&(t.exports=n)})})()})),on=o(((e,t)=>{ace.define(\`ace/theme/one_dark-css\`,[\`require\`,\`exports\`,\`module\`],function(e,t,n){n.exports=\`.ace-one-dark .ace_gutter {
1247
1247
  background: #282c34;
1248
1248
  color: #6a6f7a
1249
1249
  }
@@ -1407,12 +1407,12 @@ Error generating stack: \`+e.message+\`
1407
1407
  .ace-one-dark .ace_indent-guide-active {
1408
1408
  background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQIW2PQ1dX9zzBz5sz/ABCcBFFentLlAAAAAElFTkSuQmCC) right repeat-y;
1409
1409
  }
1410
- \`}),ace.define(\`ace/theme/one_dark\`,[\`require\`,\`exports\`,\`module\`,\`ace/theme/one_dark-css\`,\`ace/lib/dom\`],function(e,t,n){t.isDark=!0,t.cssClass=\`ace-one-dark\`,t.cssText=e("./one_dark-css"),e("../lib/dom").importCssString(t.cssText,t.cssClass,!1)}),(function(){ace.require([\`ace/theme/one_dark\`],function(n){typeof t==\`object\`&&typeof e==\`object\`&&t&&(t.exports=n)})})()})),an=c(Qt(),1);$t(),en(),tn(),nn(),rn();function on(e,t,n){let r=(()=>{let r=localStorage.getItem(e);return n.includes(r)?r:t})(),i=new Set;return{get:()=>r,set:t=>{r=t,localStorage.setItem(e,t),i.forEach(e=>e())},subscribe:e=>(i.add(e),()=>i.delete(e))}}var sn=on(\`tinbase_theme\`,\`dark\`,[\`dark\`,\`light\`,\`system\`]),cn=window.matchMedia(\`(prefers-color-scheme: dark)\`);function ln(e){return e===\`system\`?cn.matches?\`dark\`:\`light\`:e}function un(){document.documentElement.classList.toggle(\`dark\`,ln(sn.get())===\`dark\`)}un(),sn.subscribe(un),cn.addEventListener(\`change\`,()=>{un(),sn.set(sn.get())});function dn(){return[(0,_.useSyncExternalStore)(sn.subscribe,sn.get),sn.set]}function fn(){return ln((0,_.useSyncExternalStore)(sn.subscribe,sn.get))}var pn=on(\`tinbase_sidebar\`,\`hover\`,[\`expanded\`,\`collapsed\`,\`hover\`]);function mn(){return[(0,_.useSyncExternalStore)(pn.subscribe,pn.get),pn.set]}var hn=c(m(),1);function gn(e){if(!e||typeof document>\`u\`)return;let t=document.head||document.getElementsByTagName(\`head\`)[0],n=document.createElement(\`style\`);n.type=\`text/css\`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var _n=e=>{switch(e){case\`success\`:return bn;case\`info\`:return Sn;case\`warning\`:return xn;case\`error\`:return Cn;default:return null}},vn=Array(12).fill(0),yn=({visible:e,className:t})=>_.createElement(\`div\`,{className:[\`sonner-loading-wrapper\`,t].filter(Boolean).join(\` \`),"data-visible":e},_.createElement(\`div\`,{className:\`sonner-spinner\`},vn.map((e,t)=>_.createElement(\`div\`,{className:\`sonner-loading-bar\`,key:\`spinner-bar-\${t}\`})))),bn=_.createElement(\`svg\`,{xmlns:\`http://www.w3.org/2000/svg\`,viewBox:\`0 0 20 20\`,fill:\`currentColor\`,height:\`20\`,width:\`20\`},_.createElement(\`path\`,{fillRule:\`evenodd\`,d:\`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z\`,clipRule:\`evenodd\`})),xn=_.createElement(\`svg\`,{xmlns:\`http://www.w3.org/2000/svg\`,viewBox:\`0 0 24 24\`,fill:\`currentColor\`,height:\`20\`,width:\`20\`},_.createElement(\`path\`,{fillRule:\`evenodd\`,d:\`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z\`,clipRule:\`evenodd\`})),Sn=_.createElement(\`svg\`,{xmlns:\`http://www.w3.org/2000/svg\`,viewBox:\`0 0 20 20\`,fill:\`currentColor\`,height:\`20\`,width:\`20\`},_.createElement(\`path\`,{fillRule:\`evenodd\`,d:\`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z\`,clipRule:\`evenodd\`})),Cn=_.createElement(\`svg\`,{xmlns:\`http://www.w3.org/2000/svg\`,viewBox:\`0 0 20 20\`,fill:\`currentColor\`,height:\`20\`,width:\`20\`},_.createElement(\`path\`,{fillRule:\`evenodd\`,d:\`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z\`,clipRule:\`evenodd\`})),wn=_.createElement(\`svg\`,{xmlns:\`http://www.w3.org/2000/svg\`,width:\`12\`,height:\`12\`,viewBox:\`0 0 24 24\`,fill:\`none\`,stroke:\`currentColor\`,strokeWidth:\`1.5\`,strokeLinecap:\`round\`,strokeLinejoin:\`round\`},_.createElement(\`line\`,{x1:\`18\`,y1:\`6\`,x2:\`6\`,y2:\`18\`}),_.createElement(\`line\`,{x1:\`6\`,y1:\`6\`,x2:\`18\`,y2:\`18\`})),Tn=()=>{let[e,t]=_.useState(document.hidden);return _.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(\`visibilitychange\`,e),()=>window.removeEventListener(\`visibilitychange\`,e)},[]),e},En=1,Dn=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{let{message:t,...n}=e,r=typeof e?.id==\`number\`||e.id?.length>0?e.id:En++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:\`error\`}),this.success=(e,t)=>this.create({...t,type:\`success\`,message:e}),this.info=(e,t)=>this.create({...t,type:\`info\`,message:e}),this.warning=(e,t)=>this.create({...t,type:\`warning\`,message:e}),this.loading=(e,t)=>this.create({...t,type:\`loading\`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:\`loading\`,message:t.loading,description:typeof t.description==\`function\`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[\`resolve\`,e],_.isValidElement(e))i=!1,this.create({id:n,type:\`default\`,message:e});else if(kn(e)&&!e.ok){i=!1;let r=typeof t.error==\`function\`?await t.error(\`HTTP error! status: \${e.status}\`):t.error,a=typeof t.description==\`function\`?await t.description(\`HTTP error! status: \${e.status}\`):t.description,o=typeof r==\`object\`&&!_.isValidElement(r)?r:{message:r};this.create({id:n,type:\`error\`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==\`function\`?await t.error(e):t.error,a=typeof t.description==\`function\`?await t.description(e):t.description,o=typeof r==\`object\`&&!_.isValidElement(r)?r:{message:r};this.create({id:n,type:\`error\`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==\`function\`?await t.success(e):t.success,a=typeof t.description==\`function\`?await t.description(e):t.description,o=typeof r==\`object\`&&!_.isValidElement(r)?r:{message:r};this.create({id:n,type:\`success\`,description:a,...o})}}).catch(async e=>{if(a=[\`reject\`,e],t.error!==void 0){i=!1;let r=typeof t.error==\`function\`?await t.error(e):t.error,a=typeof t.description==\`function\`?await t.description(e):t.description,o=typeof r==\`object\`&&!_.isValidElement(r)?r:{message:r};this.create({id:n,type:\`error\`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===\`reject\`?t(a[1]):e(a[1])).catch(t));return typeof n!=\`string\`&&typeof n!=\`number\`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=t?.id||En++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},On=(e,t)=>{let n=t?.id||En++;return Dn.addToast({title:e,...t,id:n}),n},kn=e=>e&&typeof e==\`object\`&&\`ok\`in e&&typeof e.ok==\`boolean\`&&\`status\`in e&&typeof e.status==\`number\`,An=Object.assign(On,{success:Dn.success,info:Dn.info,warning:Dn.warning,error:Dn.error,custom:Dn.custom,message:Dn.message,promise:Dn.promise,dismiss:Dn.dismiss,loading:Dn.loading},{getHistory:()=>Dn.toasts,getToasts:()=>Dn.getActiveToasts()});gn(\`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}\`);function jn(e){return e.label!==void 0}var Mn=3,Nn=\`24px\`,Pn=\`16px\`,Fn=4e3,In=356,Ln=14,Rn=45,zn=200;function Bn(...e){return e.filter(Boolean).join(\` \`)}function Vn(e){let[t,n]=e.split(\`-\`),r=[];return t&&r.push(t),n&&r.push(n),r}var Hn=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:v=\`\`,descriptionClassName:y=\`\`,duration:b,position:x,gap:S,expandByDefault:C,classNames:w,icons:T,closeButtonAriaLabel:E=\`Close toast\`}=e,[D,O]=_.useState(null),[k,A]=_.useState(null),[j,M]=_.useState(!1),[N,P]=_.useState(!1),[ee,F]=_.useState(!1),[I,te]=_.useState(!1),[ne,re]=_.useState(!1),[ie,ae]=_.useState(0),[L,oe]=_.useState(0),se=_.useRef(n.duration||b||Fn),ce=_.useRef(null),le=_.useRef(null),ue=c===0,de=c+1<=o,fe=n.type,pe=n.dismissible!==!1,me=n.className||\`\`,he=n.descriptionClassName||\`\`,ge=_.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),_e=_.useMemo(()=>n.closeButton??p,[n.closeButton,p]),ve=_.useMemo(()=>n.duration||b||Fn,[n.duration,b]),ye=_.useRef(0),be=_.useRef(0),xe=_.useRef(0),Se=_.useRef(null),[Ce,we]=x.split(\`-\`),Te=_.useMemo(()=>s.reduce((e,t,n)=>n>=ge?e:e+t.height,0),[s,ge]),Ee=Tn(),De=n.invert||t,Oe=fe===\`loading\`;be.current=_.useMemo(()=>ge*S+Te,[ge,Te]),_.useEffect(()=>{se.current=ve},[ve]),_.useEffect(()=>{M(!0)},[]),_.useEffect(()=>{let e=le.current;if(e){let t=e.getBoundingClientRect().height;return oe(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),_.useLayoutEffect(()=>{if(!j)return;let e=le.current,t=e.style.height;e.style.height=\`auto\`;let r=e.getBoundingClientRect().height;e.style.height=t,oe(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[j,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let ke=_.useCallback(()=>{P(!0),ae(be.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},zn)},[n,d,a,be]);_.useEffect(()=>{if(n.promise&&fe===\`loading\`||n.duration===1/0||n.type===\`loading\`)return;let e;return u||i||Ee?(()=>{if(xe.current<ye.current){let e=new Date().getTime()-ye.current;se.current-=e}xe.current=new Date().getTime()})():se.current!==1/0&&(ye.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),ke()},se.current)),()=>clearTimeout(e)},[u,i,n,fe,Ee,ke]),_.useEffect(()=>{n.delete&&(ke(),n.onDismiss==null||n.onDismiss.call(n,n))},[ke,n.delete]);function Ae(){return T?.loading?_.createElement(\`div\`,{className:Bn(w?.loader,n?.classNames?.loader,\`sonner-loader\`),"data-visible":fe===\`loading\`},T.loading):_.createElement(yn,{className:Bn(w?.loader,n?.classNames?.loader),visible:fe===\`loading\`})}let je=n.icon||T?.[fe]||_n(fe);return _.createElement(\`li\`,{tabIndex:0,ref:le,className:Bn(v,me,w?.toast,n?.classNames?.toast,w?.default,w?.[fe],n?.classNames?.[fe]),"data-sonner-toast":\`\`,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":j,"data-promise":!!n.promise,"data-swiped":ne,"data-removed":N,"data-visible":de,"data-y-position":Ce,"data-x-position":we,"data-index":c,"data-front":ue,"data-swiping":ee,"data-dismissible":pe,"data-type":fe,"data-invert":De,"data-swipe-out":I,"data-swipe-direction":k,"data-expanded":!!(u||C&&j),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":\`\${N?ie:be.current}px\`,"--initial-height":C?\`auto\`:\`\${L}px\`,...m,...n.style},onDragEnd:()=>{F(!1),O(null),Se.current=null},onPointerDown:e=>{e.button!==2&&(Oe||!pe||(ce.current=new Date,ae(be.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==\`BUTTON\`&&(F(!0),Se.current={x:e.clientX,y:e.clientY})))},onPointerUp:()=>{if(I||!pe)return;Se.current=null;let e=Number(le.current?.style.getPropertyValue(\`--swipe-amount-x\`).replace(\`px\`,\`\`)||0),t=Number(le.current?.style.getPropertyValue(\`--swipe-amount-y\`).replace(\`px\`,\`\`)||0),r=new Date().getTime()-ce.current?.getTime(),i=D===\`x\`?e:t,a=Math.abs(i)/r;if(Math.abs(i)>=Rn||a>.11){ae(be.current),n.onDismiss==null||n.onDismiss.call(n,n),A(D===\`x\`?e>0?\`right\`:\`left\`:t>0?\`down\`:\`up\`),ke(),te(!0);return}else{var o,s;(o=le.current)==null||o.style.setProperty(\`--swipe-amount-x\`,\`0px\`),(s=le.current)==null||s.style.setProperty(\`--swipe-amount-y\`,\`0px\`)}re(!1),F(!1),O(null)},onPointerMove:t=>{var n,r;if(!Se.current||!pe||window.getSelection()?.toString().length>0)return;let i=t.clientY-Se.current.y,a=t.clientX-Se.current.x,o=e.swipeDirections??Vn(x);!D&&(Math.abs(a)>1||Math.abs(i)>1)&&O(Math.abs(a)>Math.abs(i)?\`x\`:\`y\`);let s={x:0,y:0},c=e=>1/(1.5+Math.abs(e)/20);if(D===\`y\`){if(o.includes(\`top\`)||o.includes(\`bottom\`))if(o.includes(\`top\`)&&i<0||o.includes(\`bottom\`)&&i>0)s.y=i;else{let e=i*c(i);s.y=Math.abs(e)<Math.abs(i)?e:i}}else if(D===\`x\`&&(o.includes(\`left\`)||o.includes(\`right\`)))if(o.includes(\`left\`)&&a<0||o.includes(\`right\`)&&a>0)s.x=a;else{let e=a*c(a);s.x=Math.abs(e)<Math.abs(a)?e:a}(Math.abs(s.x)>0||Math.abs(s.y)>0)&&re(!0),(n=le.current)==null||n.style.setProperty(\`--swipe-amount-x\`,\`\${s.x}px\`),(r=le.current)==null||r.style.setProperty(\`--swipe-amount-y\`,\`\${s.y}px\`)}},_e&&!n.jsx&&fe!==\`loading\`?_.createElement(\`button\`,{"aria-label":E,"data-disabled":Oe,"data-close-button":!0,onClick:Oe||!pe?()=>{}:()=>{ke(),n.onDismiss==null||n.onDismiss.call(n,n)},className:Bn(w?.closeButton,n?.classNames?.closeButton)},T?.close??wn):null,(fe||n.icon||n.promise)&&n.icon!==null&&(T?.[fe]!==null||n.icon)?_.createElement(\`div\`,{"data-icon":\`\`,className:Bn(w?.icon,n?.classNames?.icon)},n.promise||n.type===\`loading\`&&!n.icon?n.icon||Ae():null,n.type===\`loading\`?null:je):null,_.createElement(\`div\`,{"data-content":\`\`,className:Bn(w?.content,n?.classNames?.content)},_.createElement(\`div\`,{"data-title":\`\`,className:Bn(w?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==\`function\`?n.title():n.title),n.description?_.createElement(\`div\`,{"data-description":\`\`,className:Bn(y,he,w?.description,n?.classNames?.description)},typeof n.description==\`function\`?n.description():n.description):null),_.isValidElement(n.cancel)?n.cancel:n.cancel&&jn(n.cancel)?_.createElement(\`button\`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{jn(n.cancel)&&pe&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),ke())},className:Bn(w?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,_.isValidElement(n.action)?n.action:n.action&&jn(n.action)?_.createElement(\`button\`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{jn(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&ke())},className:Bn(w?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function Un(){if(typeof window>\`u\`||typeof document>\`u\`)return\`ltr\`;let e=document.documentElement.getAttribute(\`dir\`);return e===\`auto\`||!e?window.getComputedStyle(document.documentElement).direction:e}function Wn(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?\`--mobile-offset\`:\`--offset\`,a=r?Pn:Nn;function o(e){[\`top\`,\`right\`,\`bottom\`,\`left\`].forEach(t=>{n[\`\${i}-\${t}\`]=typeof e==\`number\`?\`\${e}px\`:e})}typeof e==\`number\`||typeof e==\`string\`?o(e):typeof e==\`object\`?[\`top\`,\`right\`,\`bottom\`,\`left\`].forEach(t=>{e[t]===void 0?n[\`\${i}-\${t}\`]=a:n[\`\${i}-\${t}\`]=typeof e[t]==\`number\`?\`\${e[t]}px\`:e[t]}):o(a)}),n}var Gn=_.forwardRef(function(e,t){let{id:n,invert:r,position:i=\`bottom-right\`,hotkey:a=[\`altKey\`,\`KeyT\`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=\`light\`,richColors:f,duration:p,style:m,visibleToasts:h=Mn,toastOptions:g,dir:v=Un(),gap:y=Ln,icons:b,containerAriaLabel:x=\`Notifications\`}=e,[S,C]=_.useState([]),w=_.useMemo(()=>n?S.filter(e=>e.toasterId===n):S.filter(e=>!e.toasterId),[S,n]),T=_.useMemo(()=>Array.from(new Set([i].concat(w.filter(e=>e.position).map(e=>e.position)))),[w,i]),[E,D]=_.useState([]),[O,k]=_.useState(!1),[A,j]=_.useState(!1),[M,N]=_.useState(d===\`system\`?typeof window<\`u\`&&window.matchMedia&&window.matchMedia(\`(prefers-color-scheme: dark)\`).matches?\`dark\`:\`light\`:d),P=_.useRef(null),ee=a.join(\`+\`).replace(/Key/g,\`\`).replace(/Digit/g,\`\`),F=_.useRef(null),I=_.useRef(!1),te=_.useCallback(e=>{C(t=>(t.find(t=>t.id===e.id)?.delete||Dn.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return _.useEffect(()=>Dn.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{C(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{hn.flushSync(()=>{C(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[S]),_.useEffect(()=>{if(d!==\`system\`){N(d);return}if(d===\`system\`&&(window.matchMedia&&window.matchMedia(\`(prefers-color-scheme: dark)\`).matches?N(\`dark\`):N(\`light\`)),typeof window>\`u\`)return;let e=window.matchMedia(\`(prefers-color-scheme: dark)\`);try{e.addEventListener(\`change\`,({matches:e})=>{N(e?\`dark\`:\`light\`)})}catch{e.addListener(({matches:e})=>{try{N(e?\`dark\`:\`light\`)}catch(e){console.error(e)}})}},[d]),_.useEffect(()=>{S.length<=1&&k(!1)},[S]),_.useEffect(()=>{let e=e=>{if(a.every(t=>e[t]||e.code===t)){var t;k(!0),(t=P.current)==null||t.focus()}e.code===\`Escape\`&&(document.activeElement===P.current||P.current?.contains(document.activeElement))&&k(!1)};return document.addEventListener(\`keydown\`,e),()=>document.removeEventListener(\`keydown\`,e)},[a]),_.useEffect(()=>{if(P.current)return()=>{F.current&&(F.current.focus({preventScroll:!0}),F.current=null,I.current=!1)}},[P.current]),_.createElement(\`section\`,{ref:t,"aria-label":\`\${x} \${ee}\`,tabIndex:-1,"aria-live":\`polite\`,"aria-relevant":\`additions text\`,"aria-atomic":\`false\`,suppressHydrationWarning:!0},T.map((t,n)=>{let[i,a]=t.split(\`-\`);return w.length?_.createElement(\`ol\`,{key:t,dir:v===\`auto\`?Un():v,tabIndex:-1,ref:P,className:c,"data-sonner-toaster":!0,"data-sonner-theme":M,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":\`\${E[0]?.height||0}px\`,"--width":\`\${In}px\`,"--gap":\`\${y}px\`,...m,...Wn(l,u)},onBlur:e=>{I.current&&!e.currentTarget.contains(e.relatedTarget)&&(I.current=!1,F.current&&=(F.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===\`false\`||I.current||(I.current=!0,F.current=e.relatedTarget)},onMouseEnter:()=>k(!0),onMouseMove:()=>k(!0),onMouseLeave:()=>{A||k(!1)},onDragEnd:()=>k(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===\`false\`||j(!0)},onPointerUp:()=>j(!1)},w.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>_.createElement(Hn,{key:n.id,icons:b,index:i,toast:n,defaultRichColors:f,duration:g?.duration??p,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:r,visibleToasts:h,closeButton:g?.closeButton??s,interacting:A,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:te,toasts:w.filter(e=>e.position==n.position),heights:E.filter(e=>e.position==n.position),setHeights:D,expandByDefault:o,gap:y,expanded:O,swipeDirections:e.swipeDirections}))):null}))}),Kn={info:We,success:_e,error:ge},qn={info:\`text-info\`,success:\`text-brand\`,error:\`text-destructive\`};function Jn({id:e,kind:t,msg:n}){let r=Kn[t];return(0,B.jsxs)(\`div\`,{className:\`group pointer-events-auto relative flex w-[360px] items-start gap-2.5 rounded-md border border-input bg-popover py-2.5 pl-3 pr-8 shadow-xl\`,children:[(0,B.jsx)(r,{size:15,className:\`mt-px shrink-0 \${qn[t]}\`}),(0,B.jsx)(\`p\`,{className:\`min-w-0 flex-1 break-words text-[13px] leading-snug text-foreground\`,children:n}),(0,B.jsx)(\`button\`,{onClick:()=>An.dismiss(e),"aria-label":\`Dismiss\`,className:\`absolute right-1.5 top-1.5 flex size-6 items-center justify-center rounded text-muted-foreground/80 opacity-0 transition-colors hover:bg-accent hover:text-foreground group-hover:opacity-100 focus-visible:opacity-100 focus-visible:outline-none\`,children:(0,B.jsx)(Ft,{size:14})})]})}function U(e,t=\`info\`){return An.custom(n=>(0,B.jsx)(Jn,{id:n,kind:t,msg:e}),{duration:t===\`error\`?6e3:3500})}U.error=e=>U(e,\`error\`),U.success=e=>U(e,\`success\`);function Yn(){return(0,B.jsx)(Gn,{position:\`bottom-right\`,gap:8,offset:16})}function Xn(e,t=\`Value\`){return navigator.clipboard.writeText(e).then(()=>(U.success(\`\${t} copied\`),!0),()=>(U.error(\`Clipboard write failed\`),!1))}function Zn(e,t){let[n,r]=(0,_.useState)(!1),i=(0,_.useRef)(void 0);return(0,_.useEffect)(()=>()=>clearTimeout(i.current),[]),{copied:n,copy:()=>{Xn(typeof e==\`function\`?e():e,t).then(e=>{e&&(r(!0),clearTimeout(i.current),i.current=setTimeout(()=>r(!1),1800))})}}}function Qn({value:e,label:t=\`Value\`,variant:n=\`ghost\`,size:r=\`iconXs\`,iconSize:i=12,className:a,disabled:o,children:s}){let{copied:c,copy:l}=Zn(e,t);return(0,B.jsxs)(H,{variant:n,size:r,className:a,disabled:o,title:c?\`Copied!\`:\`Copy \${t}\`,onClick:l,children:[c?(0,B.jsx)(fe,{size:i,className:\`text-brand\`}):(0,B.jsx)(xe,{size:i}),s]})}var $n={js:\`ace/mode/javascript\`,sql:\`ace/mode/sql\`};function er({value:e,lang:t,onChange:n,readOnly:r,gutter:i=!1,minLines:a,maxLines:o,placeholder:s,onCmdEnter:c,className:l}){let u=(0,_.useRef)(null),d=(0,_.useRef)(null),f=fn(),p=(0,_.useRef)({onChange:n,onCmdEnter:c});return p.current={onChange:n,onCmdEnter:c},(0,_.useEffect)(()=>{let n=an.default.edit(u.current,{mode:$n[t],theme:f===\`dark\`?\`ace/theme/one_dark\`:\`ace/theme/github\`,readOnly:!!r,showGutter:i,minLines:a,maxLines:o,fontSize:13,fontFamily:\`ui-monospace, 'SF Mono', Menlo, monospace\`,useWorker:!1,showPrintMargin:!1,highlightActiveLine:!r,highlightGutterLine:!r,tabSize:2,useSoftTabs:!0,placeholder:s,enableBasicAutocompletion:!r,enableLiveAutocompletion:!r});return n.setValue(e??\`\`,-1),n.on(\`change\`,()=>p.current.onChange?.(n.getValue())),n.commands.addCommand({name:\`cmd-enter\`,bindKey:{win:\`Ctrl-Enter\`,mac:\`Command-Enter\`},exec:()=>p.current.onCmdEnter?.()}),n.renderer.setPadding(12),n.renderer.setScrollMargin(8,8,0,0),r&&(n.renderer.$cursorLayer.element.style.display=\`none\`),d.current=n,()=>{n.destroy(),d.current=null}},[t,r,i,a,o,f]),(0,_.useEffect)(()=>{let t=d.current;t&&t.getValue()!==e&&t.setValue(e??\`\`,-1)},[e]),(0,B.jsx)(\`div\`,{ref:u,className:Yt(\`w-full\`,l)})}function tr({code:e,lang:t=\`js\`,gutter:n}){return(0,B.jsxs)(\`div\`,{className:\`relative overflow-hidden rounded-md border border-border bg-code\`,children:[(0,B.jsx)(er,{value:e,lang:t,readOnly:!0,gutter:n,minLines:2,maxLines:80}),(0,B.jsx)(Qn,{value:e,label:\`Snippet\`,className:\`absolute right-2 top-2 z-10\`})]})}function nr({value:e,onChange:t,lang:n,className:r,placeholder:i,onCmdEnter:a}){return(0,B.jsx)(\`div\`,{className:Yt(\`overflow-hidden rounded-md border border-input bg-field focus-within:border-brand\`,r),children:(0,B.jsx)(er,{value:e,onChange:t,lang:n,gutter:!0,placeholder:i,onCmdEnter:a,className:\`h-full\`})})}typeof window<\`u\`&&window.document&&window.document.createElement;function W(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function rr(e,t){if(typeof e==\`function\`)return e(t);e!=null&&(e.current=t)}function ir(...e){return t=>{let n=!1,r=e.map(e=>{let r=rr(e,t);return!n&&typeof r==\`function\`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==\`function\`?n():rr(e[t],null)}}}}function ar(...e){return _.useCallback(ir(...e),e)}function or(e,t=[]){let n=[];function r(t,r){let i=_.createContext(r);i.displayName=t+\`Context\`;let a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=_.useMemo(()=>o,Object.values(o));return(0,B.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+\`Provider\`;function s(n,o){let s=o?.[e]?.[a]||i,c=_.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(\`\\\`\${n}\\\` must be used within \\\`\${t}\\\`\`)}return[o,s]}let i=()=>{let t=n.map(e=>_.createContext(e));return function(n){let r=n?.[e]||t;return _.useMemo(()=>({[\`__scope\${e}\`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,sr(i,...t)]}function sr(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[\`__scope\${r}\`];return{...t,...i}},{});return _.useMemo(()=>({[\`__scope\${t.scopeName}\`]:r}),[r])}};return n.scopeName=t.scopeName,n}var cr=globalThis?.document?_.useLayoutEffect:()=>{},lr=_.useId||(()=>void 0),ur=0;function dr(e){let[t,n]=_.useState(lr());return cr(()=>{e||n(e=>e??String(ur++))},[e]),e||(t?\`radix-\${t}\`:\`\`)}var fr=_.useEffectEvent,pr=_.useInsertionEffect;function mr(e){if(typeof fr==\`function\`)return fr(e);let t=_.useRef(()=>{throw Error(\`Cannot call an event handler while rendering.\`)});return typeof pr==\`function\`?pr(()=>{t.current=e}):cr(()=>{t.current=e}),_.useMemo(()=>((...e)=>t.current?.(...e)),[])}var hr=_.useInsertionEffect||cr;function gr({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=_r({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=_.useRef(e!==void 0);_.useEffect(()=>{let e=t.current;e!==s&&console.warn(\`\${r} is changing from \${e?\`controlled\`:\`uncontrolled\`} to \${s?\`controlled\`:\`uncontrolled\`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.\`),t.current=s},[s,r])}return[c,_.useCallback(t=>{if(s){let n=vr(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function _r({defaultProp:e,onChange:t}){let[n,r]=_.useState(e),i=_.useRef(n),a=_.useRef(t);return hr(()=>{a.current=t},[t]),_.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function vr(e){return typeof e==\`function\`}function yr(e){let t=_.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];Dr(r)&&typeof jr==\`function\`&&(r=jr(r._payload)),_.Children.forEach(r,e=>{if(Tr(e)){o=!0;let t=e,n=\`child\`in t.props?t.props.child:t.props.children;Dr(n)&&typeof jr==\`function\`&&(n=jr(n._payload)),a=Sr(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=_.cloneElement(a,void 0,s):!o&&_.Children.count(r)===1&&_.isValidElement(r)&&(a=r);let c=a?wr(a):void 0,l=ar(n,c);if(!a){if(r||r===0)throw Error(o?Ar(e):kr(e));return r}let u=Cr(i,a.props??{});return a.type!==_.Fragment&&(u.ref=n?l:c),_.cloneElement(a,u)});return t.displayName=\`\${e}.Slot\`,t}var br=Symbol.for(\`radix.slottable\`);function xr(e){let t=e=>\`child\`in e?e.children(e.child):e.children;return t.displayName=\`\${e}.Slottable\`,t.__radixId=br,t}var Sr=(e,t)=>{if(\`child\`in e.props){let t=e.props.child;return _.isValidElement(t)?_.cloneElement(t,void 0,e.props.children(t.props.children)):null}return _.isValidElement(t)?t:null};function Cr(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===\`style\`?n[r]={...i,...a}:r===\`className\`&&(n[r]=[i,a].filter(Boolean).join(\` \`))}return{...e,...n}}function wr(e){let t=Object.getOwnPropertyDescriptor(e.props,\`ref\`)?.get,n=t&&\`isReactWarning\`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,\`ref\`)?.get,n=t&&\`isReactWarning\`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Tr(e){return _.isValidElement(e)&&typeof e.type==\`function\`&&\`__radixId\`in e.type&&e.type.__radixId===br}var Er=Symbol.for(\`react.lazy\`);function Dr(e){return typeof e==\`object\`&&!!e&&\`$$typeof\`in e&&e.$$typeof===Er&&\`_payload\`in e&&Or(e._payload)}function Or(e){return typeof e==\`object\`&&!!e&&\`then\`in e}var kr=e=>\`\${e} failed to slot onto its children. Expected a single React element child or \\\`Slottable\\\`.\`,Ar=e=>\`\${e} failed to slot onto its \\\`Slottable\\\`. Expected \\\`Slottable\\\` to receive a single React element child.\`,jr=_.use,G=[\`a\`,\`button\`,\`div\`,\`form\`,\`h2\`,\`h3\`,\`img\`,\`input\`,\`label\`,\`li\`,\`nav\`,\`ol\`,\`p\`,\`select\`,\`span\`,\`svg\`,\`ul\`].reduce((e,t)=>{let n=yr(\`Primitive.\${t}\`),r=_.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<\`u\`&&(window[Symbol.for(\`radix-ui\`)]=!0),(0,B.jsx)(o,{...a,ref:r})});return r.displayName=\`Primitive.\${t}\`,{...e,[t]:r}},{});function Mr(e,t){e&&hn.flushSync(()=>e.dispatchEvent(t))}function Nr(e){let t=_.useRef(e);return _.useEffect(()=>{t.current=e}),_.useMemo(()=>((...e)=>t.current?.(...e)),[])}var Pr=\`DismissableLayer\`,Fr=\`dismissableLayer.update\`,Ir=\`dismissableLayer.pointerDownOutside\`,Lr=\`dismissableLayer.focusOutside\`,Rr,zr=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Br=_.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=_.useContext(zr),[d,f]=_.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=_.useState({}),h=ar(t,f),g=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=g.indexOf(v),b=d?g.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=_.useRef(!1),w=Wr(e=>{let t=e.target;if(!(t instanceof Node))return;let n=[...u.branches].some(e=>e.contains(t));!S||n||(a?.(e),s?.(e),e.defaultPrevented||c?.())},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:u.dismissableSurfaces}),T=Gr(e=>{if(r&&C.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),E=d?b===g.length-1:!1,D=mr(e=>{e.key===\`Escape\`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return _.useEffect(()=>{if(E)return p.addEventListener(\`keydown\`,D,{capture:!0}),()=>p.removeEventListener(\`keydown\`,D,{capture:!0})},[p,E]),_.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Rr=p.body.style.pointerEvents,p.body.style.pointerEvents=\`none\`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Kr(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=Rr))}},[d,p,n,u]),_.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Kr())},[d,u]),_.useEffect(()=>{let e=()=>m({});return document.addEventListener(Fr,e),()=>document.removeEventListener(Fr,e)},[]),(0,B.jsx)(G.div,{...l,ref:h,style:{pointerEvents:x?S?\`auto\`:\`none\`:void 0,...e.style},onFocusCapture:W(e.onFocusCapture,T.onFocusCapture),onBlurCapture:W(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:W(e.onPointerDownCapture,w.onPointerDownCapture)})});Br.displayName=Pr;var Vr=\`DismissableLayerBranch\`,Hr=_.forwardRef((e,t)=>{let n=_.useContext(zr),r=_.useRef(null),i=ar(t,r);return _.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,B.jsx)(G.div,{...e,ref:i})});Hr.displayName=Vr;function Ur(){let e=_.useContext(zr),[t,n]=_.useState(null);return _.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}function Wr(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a}=t,o=Nr(e),s=_.useRef(!1),c=_.useRef(!1),l=_.useRef(new Map),u=_.useRef(()=>{});return _.useEffect(()=>{function e(){c.current=!1,i.current=!1,l.current.clear()}function t(){return Array.from(l.current.values()).some(Boolean)}function d(e){if(!c.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||l.current.set(e.type,!0),e.type===\`click\`&&window.setTimeout(()=>{c.current&&u.current()},0)}function f(e){c.current&&l.current.set(e.type,!1)}let p=a=>{if(a.target&&!s.current){let s=function(){n.removeEventListener(\`click\`,u.current);let r=t();e(),r||qr(Ir,o,d,{discrete:!0})},d={originalEvent:a};c.current=!0,i.current=r&&a.button===0,l.current.clear(),!r||a.button!==0?s():(n.removeEventListener(\`click\`,u.current),u.current=s,n.addEventListener(\`click\`,u.current,{once:!0}))}else n.removeEventListener(\`click\`,u.current),e();s.current=!1},m=[\`pointerup\`,\`mousedown\`,\`mouseup\`,\`touchstart\`,\`touchend\`,\`click\`];for(let e of m)n.addEventListener(e,d,!0),n.addEventListener(e,f);let h=window.setTimeout(()=>{n.addEventListener(\`pointerdown\`,p)},0);return()=>{window.clearTimeout(h),n.removeEventListener(\`pointerdown\`,p),n.removeEventListener(\`click\`,u.current);for(let e of m)n.removeEventListener(e,d,!0),n.removeEventListener(e,f)}},[n,o,r,i,a]),{onPointerDownCapture:()=>s.current=!0}}function Gr(e,t=globalThis?.document){let n=Nr(e),r=_.useRef(!1);return _.useEffect(()=>{let e=e=>{e.target&&!r.current&&qr(Lr,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(\`focusin\`,e),()=>t.removeEventListener(\`focusin\`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Kr(){let e=new CustomEvent(Fr);document.dispatchEvent(e)}function qr(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Mr(i,a):i.dispatchEvent(a)}var Jr=\`focusScope.autoFocusOnMount\`,Yr=\`focusScope.autoFocusOnUnmount\`,Xr={bubbles:!1,cancelable:!0},Zr=\`FocusScope\`,Qr=_.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=_.useState(null),l=Nr(i),u=Nr(a),d=_.useRef(null),f=ar(t,c),p=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:ai(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||ai(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&ai(s)};document.addEventListener(\`focusin\`,e),document.addEventListener(\`focusout\`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(\`focusin\`,e),document.removeEventListener(\`focusout\`,t),r.disconnect()}}},[r,s,p.paused]),_.useEffect(()=>{if(s){oi.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(Jr,Xr);s.addEventListener(Jr,l),s.dispatchEvent(t),t.defaultPrevented||($r(li(ti(s)),{select:!0}),document.activeElement===e&&ai(s))}return()=>{s.removeEventListener(Jr,l),setTimeout(()=>{let t=new CustomEvent(Yr,Xr);s.addEventListener(Yr,u),s.dispatchEvent(t),t.defaultPrevented||ai(e??document.body,{select:!0}),s.removeEventListener(Yr,u),oi.remove(p)},0)}}},[s,l,u,p]);let m=_.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===\`Tab\`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=ei(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&ai(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&ai(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,B.jsx)(G.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});Qr.displayName=Zr;function $r(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(ai(r,{select:t}),document.activeElement!==n)return}function ei(e){let t=ti(e);return[ni(t,e),ni(t.reverse(),e)]}function ti(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===\`INPUT\`&&e.type===\`hidden\`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ni(e,t){for(let n of e)if(!ri(n,{upTo:t}))return n}function ri(e,{upTo:t}){if(getComputedStyle(e).visibility===\`hidden\`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===\`none\`)return!0;e=e.parentElement}return!1}function ii(e){return e instanceof HTMLInputElement&&\`select\`in e}function ai(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ii(e)&&t&&e.select()}}var oi=si();function si(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=ci(e,t),e.unshift(t)},remove(t){e=ci(e,t),e[0]?.resume()}}}function ci(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function li(e){return e.filter(e=>e.tagName!==\`A\`)}var ui=\`Portal\`,di=_.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=_.useState(!1);cr(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?hn.createPortal((0,B.jsx)(G.div,{...r,ref:t}),o):null});di.displayName=ui;function fi(e,t){return _.useReducer((e,n)=>t[e][n]??e,e)}var pi=e=>{let{present:t,children:n}=e,r=mi(t),i=typeof n==\`function\`?n({present:r.isPresent}):_.Children.only(n),a=gi(r.ref,vi(i));return typeof n==\`function\`||r.isPresent?_.cloneElement(i,{ref:a}):null};pi.displayName=\`Presence\`;function mi(e){let[t,n]=_.useState(),r=_.useRef(null),i=_.useRef(e),a=_.useRef(\`none\`),[o,s]=fi(e?\`mounted\`:\`unmounted\`,{mounted:{UNMOUNT:\`unmounted\`,ANIMATION_OUT:\`unmountSuspended\`},unmountSuspended:{MOUNT:\`mounted\`,ANIMATION_END:\`unmounted\`},unmounted:{MOUNT:\`mounted\`}});return _.useEffect(()=>{let e=_i(r.current);a.current=o===\`mounted\`?e:\`none\`},[o]),cr(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=_i(t);e?s(\`MOUNT\`):o===\`none\`||t?.display===\`none\`?s(\`UNMOUNT\`):s(n&&r!==o?\`ANIMATION_OUT\`:\`UNMOUNT\`),i.current=e}},[e,s]),cr(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=_i(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(\`ANIMATION_END\`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=\`forwards\`,e=n.setTimeout(()=>{t.style.animationFillMode===\`forwards\`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=_i(r.current))};return t.addEventListener(\`animationstart\`,c),t.addEventListener(\`animationcancel\`,o),t.addEventListener(\`animationend\`,o),()=>{n.clearTimeout(e),t.removeEventListener(\`animationstart\`,c),t.removeEventListener(\`animationcancel\`,o),t.removeEventListener(\`animationend\`,o)}}else s(\`ANIMATION_END\`)},[t,s]),{isPresent:[\`mounted\`,\`unmountSuspended\`].includes(o),ref:_.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function hi(e,t){if(typeof e==\`function\`)return e(t);e!=null&&(e.current=t)}function gi(...e){let t=_.useRef(e);return t.current=e,_.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=hi(t,e);return!r&&typeof n==\`function\`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==\`function\`?t():hi(n[e],null)}}},[])}function _i(e){return e?.animationName||\`none\`}function vi(e){let t=Object.getOwnPropertyDescriptor(e.props,\`ref\`)?.get,n=t&&\`isReactWarning\`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,\`ref\`)?.get,n=t&&\`isReactWarning\`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var yi=0,bi=null;function xi(){_.useEffect(()=>{bi||={start:Si(),end:Si()};let{start:e,end:t}=bi;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(\`afterbegin\`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(\`beforeend\`,t),yi++,()=>{yi===1&&(bi?.start.remove(),bi?.end.remove(),bi=null),yi=Math.max(0,yi-1)}},[])}function Si(){let e=document.createElement(\`span\`);return e.setAttribute(\`data-radix-focus-guard\`,\`\`),e.tabIndex=0,e.style.outline=\`none\`,e.style.opacity=\`0\`,e.style.position=\`fixed\`,e.style.pointerEvents=\`none\`,e}var Ci=function(){return Ci=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ci.apply(this,arguments)};function wi(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==\`function\`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Ti(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Ei=\`right-scroll-bar-position\`,Di=\`width-before-scroll-bar\`,Oi=\`with-scroll-bars-hidden\`,ki=\`--removed-body-scroll-bar-size\`;function Ai(e,t){return typeof e==\`function\`?e(t):e&&(e.current=t),e}function ji(e,t){var n=(0,_.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Mi=typeof window<\`u\`?_.useLayoutEffect:_.useEffect,Ni=new WeakMap;function Pi(e,t){var n=ji(t||null,function(t){return e.forEach(function(e){return Ai(e,t)})});return Mi(function(){var t=Ni.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Ai(e,null)}),i.forEach(function(e){r.has(e)||Ai(e,a)})}Ni.set(n,e)},[e]),n}function Fi(e){return e}function Ii(e,t){t===void 0&&(t=Fi);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not \`read\` from an \`assigned\` medium. \`read\` could be used only with \`useMedium\`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Li(e){e===void 0&&(e={});var t=Ii(null);return t.options=Ci({async:!0,ssr:!1},e),t}var Ri=function(e){var t=e.sideCar,n=wi(e,[\`sideCar\`]);if(!t)throw Error("Sidecar: please provide \`sideCar\` property to import the right car");var r=t.read();if(!r)throw Error(\`Sidecar medium not found\`);return _.createElement(r,Ci({},n))};Ri.isSideCarExport=!0;function zi(e,t){return e.useMedium(t),Ri}var Bi=Li(),Vi=function(){},Hi=_.forwardRef(function(e,t){var n=_.useRef(null),r=_.useState({onScrollCapture:Vi,onWheelCapture:Vi,onTouchMoveCapture:Vi}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,v=e.as,y=v===void 0?\`div\`:v,b=e.gapMode,x=wi(e,[\`forwardProps\`,\`children\`,\`className\`,\`removeScrollBar\`,\`enabled\`,\`shards\`,\`sideCar\`,\`noRelative\`,\`noIsolation\`,\`inert\`,\`allowPinchZoom\`,\`as\`,\`gapMode\`]),S=f,C=Pi([n,t]),w=Ci(Ci({},x),i);return _.createElement(_.Fragment,null,u&&_.createElement(S,{sideCar:Bi,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:b}),o?_.cloneElement(_.Children.only(s),Ci(Ci({},w),{ref:C})):_.createElement(y,Ci({},w,{className:c,ref:C}),s))});Hi.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Hi.classNames={fullWidth:Di,zeroRight:Ei};var Ui,Wi=function(){if(Ui)return Ui;if(typeof __webpack_nonce__<\`u\`)return __webpack_nonce__};function Gi(){if(!document)return null;var e=document.createElement(\`style\`);e.type=\`text/css\`;var t=Wi();return t&&e.setAttribute(\`nonce\`,t),e}function Ki(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function qi(e){(document.head||document.getElementsByTagName(\`head\`)[0]).appendChild(e)}var Ji=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Gi())&&(Ki(t,n),qi(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Yi=function(){var e=Ji();return function(t,n){_.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Xi=function(){var e=Yi();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Zi={left:0,top:0,right:0,gap:0},Qi=function(e){return parseInt(e||\`\`,10)||0},$i=function(e){var t=window.getComputedStyle(document.body),n=t[e===\`padding\`?\`paddingLeft\`:\`marginLeft\`],r=t[e===\`padding\`?\`paddingTop\`:\`marginTop\`],i=t[e===\`padding\`?\`paddingRight\`:\`marginRight\`];return[Qi(n),Qi(r),Qi(i)]},ea=function(e){if(e===void 0&&(e=\`margin\`),typeof window>\`u\`)return Zi;var t=$i(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},ta=Xi(),na=\`data-scroll-locked\`,ra=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=\`margin\`),\`
1411
- .\${Oi} {
1410
+ \`}),ace.define(\`ace/theme/one_dark\`,[\`require\`,\`exports\`,\`module\`,\`ace/theme/one_dark-css\`,\`ace/lib/dom\`],function(e,t,n){t.isDark=!0,t.cssClass=\`ace-one-dark\`,t.cssText=e("./one_dark-css"),e("../lib/dom").importCssString(t.cssText,t.cssClass,!1)}),(function(){ace.require([\`ace/theme/one_dark\`],function(n){typeof t==\`object\`&&typeof e==\`object\`&&t&&(t.exports=n)})})()})),sn=c(en(),1);tn(),nn(),rn(),an(),on();function cn(e,t,n){let r=(()=>{let r=localStorage.getItem(e);return n.includes(r)?r:t})(),i=new Set;return{get:()=>r,set:t=>{r=t,localStorage.setItem(e,t),i.forEach(e=>e())},subscribe:e=>(i.add(e),()=>i.delete(e))}}var ln=cn(\`tinbase_theme\`,\`dark\`,[\`dark\`,\`light\`,\`system\`]),un=window.matchMedia(\`(prefers-color-scheme: dark)\`);function dn(e){return e===\`system\`?un.matches?\`dark\`:\`light\`:e}function fn(){document.documentElement.classList.toggle(\`dark\`,dn(ln.get())===\`dark\`)}fn(),ln.subscribe(fn),un.addEventListener(\`change\`,()=>{fn(),ln.set(ln.get())});function pn(){return[(0,_.useSyncExternalStore)(ln.subscribe,ln.get),ln.set]}function mn(){return dn((0,_.useSyncExternalStore)(ln.subscribe,ln.get))}var hn=cn(\`tinbase_sidebar\`,\`hover\`,[\`expanded\`,\`collapsed\`,\`hover\`]);function gn(){return[(0,_.useSyncExternalStore)(hn.subscribe,hn.get),hn.set]}var _n=c(m(),1);function vn(e){if(!e||typeof document>\`u\`)return;let t=document.head||document.getElementsByTagName(\`head\`)[0],n=document.createElement(\`style\`);n.type=\`text/css\`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var yn=e=>{switch(e){case\`success\`:return Sn;case\`info\`:return wn;case\`warning\`:return Cn;case\`error\`:return Tn;default:return null}},bn=Array(12).fill(0),xn=({visible:e,className:t})=>_.createElement(\`div\`,{className:[\`sonner-loading-wrapper\`,t].filter(Boolean).join(\` \`),"data-visible":e},_.createElement(\`div\`,{className:\`sonner-spinner\`},bn.map((e,t)=>_.createElement(\`div\`,{className:\`sonner-loading-bar\`,key:\`spinner-bar-\${t}\`})))),Sn=_.createElement(\`svg\`,{xmlns:\`http://www.w3.org/2000/svg\`,viewBox:\`0 0 20 20\`,fill:\`currentColor\`,height:\`20\`,width:\`20\`},_.createElement(\`path\`,{fillRule:\`evenodd\`,d:\`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z\`,clipRule:\`evenodd\`})),Cn=_.createElement(\`svg\`,{xmlns:\`http://www.w3.org/2000/svg\`,viewBox:\`0 0 24 24\`,fill:\`currentColor\`,height:\`20\`,width:\`20\`},_.createElement(\`path\`,{fillRule:\`evenodd\`,d:\`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z\`,clipRule:\`evenodd\`})),wn=_.createElement(\`svg\`,{xmlns:\`http://www.w3.org/2000/svg\`,viewBox:\`0 0 20 20\`,fill:\`currentColor\`,height:\`20\`,width:\`20\`},_.createElement(\`path\`,{fillRule:\`evenodd\`,d:\`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z\`,clipRule:\`evenodd\`})),Tn=_.createElement(\`svg\`,{xmlns:\`http://www.w3.org/2000/svg\`,viewBox:\`0 0 20 20\`,fill:\`currentColor\`,height:\`20\`,width:\`20\`},_.createElement(\`path\`,{fillRule:\`evenodd\`,d:\`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z\`,clipRule:\`evenodd\`})),En=_.createElement(\`svg\`,{xmlns:\`http://www.w3.org/2000/svg\`,width:\`12\`,height:\`12\`,viewBox:\`0 0 24 24\`,fill:\`none\`,stroke:\`currentColor\`,strokeWidth:\`1.5\`,strokeLinecap:\`round\`,strokeLinejoin:\`round\`},_.createElement(\`line\`,{x1:\`18\`,y1:\`6\`,x2:\`6\`,y2:\`18\`}),_.createElement(\`line\`,{x1:\`6\`,y1:\`6\`,x2:\`18\`,y2:\`18\`})),Dn=()=>{let[e,t]=_.useState(document.hidden);return _.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(\`visibilitychange\`,e),()=>window.removeEventListener(\`visibilitychange\`,e)},[]),e},On=1,kn=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{let{message:t,...n}=e,r=typeof e?.id==\`number\`||e.id?.length>0?e.id:On++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:\`error\`}),this.success=(e,t)=>this.create({...t,type:\`success\`,message:e}),this.info=(e,t)=>this.create({...t,type:\`info\`,message:e}),this.warning=(e,t)=>this.create({...t,type:\`warning\`,message:e}),this.loading=(e,t)=>this.create({...t,type:\`loading\`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:\`loading\`,message:t.loading,description:typeof t.description==\`function\`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[\`resolve\`,e],_.isValidElement(e))i=!1,this.create({id:n,type:\`default\`,message:e});else if(jn(e)&&!e.ok){i=!1;let r=typeof t.error==\`function\`?await t.error(\`HTTP error! status: \${e.status}\`):t.error,a=typeof t.description==\`function\`?await t.description(\`HTTP error! status: \${e.status}\`):t.description,o=typeof r==\`object\`&&!_.isValidElement(r)?r:{message:r};this.create({id:n,type:\`error\`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==\`function\`?await t.error(e):t.error,a=typeof t.description==\`function\`?await t.description(e):t.description,o=typeof r==\`object\`&&!_.isValidElement(r)?r:{message:r};this.create({id:n,type:\`error\`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==\`function\`?await t.success(e):t.success,a=typeof t.description==\`function\`?await t.description(e):t.description,o=typeof r==\`object\`&&!_.isValidElement(r)?r:{message:r};this.create({id:n,type:\`success\`,description:a,...o})}}).catch(async e=>{if(a=[\`reject\`,e],t.error!==void 0){i=!1;let r=typeof t.error==\`function\`?await t.error(e):t.error,a=typeof t.description==\`function\`?await t.description(e):t.description,o=typeof r==\`object\`&&!_.isValidElement(r)?r:{message:r};this.create({id:n,type:\`error\`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===\`reject\`?t(a[1]):e(a[1])).catch(t));return typeof n!=\`string\`&&typeof n!=\`number\`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=t?.id||On++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},An=(e,t)=>{let n=t?.id||On++;return kn.addToast({title:e,...t,id:n}),n},jn=e=>e&&typeof e==\`object\`&&\`ok\`in e&&typeof e.ok==\`boolean\`&&\`status\`in e&&typeof e.status==\`number\`,Mn=Object.assign(An,{success:kn.success,info:kn.info,warning:kn.warning,error:kn.error,custom:kn.custom,message:kn.message,promise:kn.promise,dismiss:kn.dismiss,loading:kn.loading},{getHistory:()=>kn.toasts,getToasts:()=>kn.getActiveToasts()});vn(\`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}\`);function Nn(e){return e.label!==void 0}var Pn=3,Fn=\`24px\`,In=\`16px\`,Ln=4e3,Rn=356,zn=14,Bn=45,Vn=200;function Hn(...e){return e.filter(Boolean).join(\` \`)}function Un(e){let[t,n]=e.split(\`-\`),r=[];return t&&r.push(t),n&&r.push(n),r}var Wn=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:v=\`\`,descriptionClassName:y=\`\`,duration:b,position:x,gap:S,expandByDefault:C,classNames:w,icons:T,closeButtonAriaLabel:E=\`Close toast\`}=e,[D,O]=_.useState(null),[k,A]=_.useState(null),[j,M]=_.useState(!1),[N,ee]=_.useState(!1),[te,P]=_.useState(!1),[F,ne]=_.useState(!1),[re,ie]=_.useState(!1),[ae,oe]=_.useState(0),[I,se]=_.useState(0),ce=_.useRef(n.duration||b||Ln),le=_.useRef(null),ue=_.useRef(null),de=c===0,fe=c+1<=o,pe=n.type,me=n.dismissible!==!1,he=n.className||\`\`,ge=n.descriptionClassName||\`\`,_e=_.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),ve=_.useMemo(()=>n.closeButton??p,[n.closeButton,p]),ye=_.useMemo(()=>n.duration||b||Ln,[n.duration,b]),be=_.useRef(0),xe=_.useRef(0),Se=_.useRef(0),Ce=_.useRef(null),[we,Te]=x.split(\`-\`),Ee=_.useMemo(()=>s.reduce((e,t,n)=>n>=_e?e:e+t.height,0),[s,_e]),De=Dn(),Oe=n.invert||t,ke=pe===\`loading\`;xe.current=_.useMemo(()=>_e*S+Ee,[_e,Ee]),_.useEffect(()=>{ce.current=ye},[ye]),_.useEffect(()=>{M(!0)},[]),_.useEffect(()=>{let e=ue.current;if(e){let t=e.getBoundingClientRect().height;return se(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),_.useLayoutEffect(()=>{if(!j)return;let e=ue.current,t=e.style.height;e.style.height=\`auto\`;let r=e.getBoundingClientRect().height;e.style.height=t,se(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[j,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let Ae=_.useCallback(()=>{ee(!0),oe(xe.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},Vn)},[n,d,a,xe]);_.useEffect(()=>{if(n.promise&&pe===\`loading\`||n.duration===1/0||n.type===\`loading\`)return;let e;return u||i||De?(()=>{if(Se.current<be.current){let e=new Date().getTime()-be.current;ce.current-=e}Se.current=new Date().getTime()})():ce.current!==1/0&&(be.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),Ae()},ce.current)),()=>clearTimeout(e)},[u,i,n,pe,De,Ae]),_.useEffect(()=>{n.delete&&(Ae(),n.onDismiss==null||n.onDismiss.call(n,n))},[Ae,n.delete]);function je(){return T?.loading?_.createElement(\`div\`,{className:Hn(w?.loader,n?.classNames?.loader,\`sonner-loader\`),"data-visible":pe===\`loading\`},T.loading):_.createElement(xn,{className:Hn(w?.loader,n?.classNames?.loader),visible:pe===\`loading\`})}let Me=n.icon||T?.[pe]||yn(pe);return _.createElement(\`li\`,{tabIndex:0,ref:ue,className:Hn(v,he,w?.toast,n?.classNames?.toast,w?.default,w?.[pe],n?.classNames?.[pe]),"data-sonner-toast":\`\`,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":j,"data-promise":!!n.promise,"data-swiped":re,"data-removed":N,"data-visible":fe,"data-y-position":we,"data-x-position":Te,"data-index":c,"data-front":de,"data-swiping":te,"data-dismissible":me,"data-type":pe,"data-invert":Oe,"data-swipe-out":F,"data-swipe-direction":k,"data-expanded":!!(u||C&&j),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":\`\${N?ae:xe.current}px\`,"--initial-height":C?\`auto\`:\`\${I}px\`,...m,...n.style},onDragEnd:()=>{P(!1),O(null),Ce.current=null},onPointerDown:e=>{e.button!==2&&(ke||!me||(le.current=new Date,oe(xe.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==\`BUTTON\`&&(P(!0),Ce.current={x:e.clientX,y:e.clientY})))},onPointerUp:()=>{if(F||!me)return;Ce.current=null;let e=Number(ue.current?.style.getPropertyValue(\`--swipe-amount-x\`).replace(\`px\`,\`\`)||0),t=Number(ue.current?.style.getPropertyValue(\`--swipe-amount-y\`).replace(\`px\`,\`\`)||0),r=new Date().getTime()-le.current?.getTime(),i=D===\`x\`?e:t,a=Math.abs(i)/r;if(Math.abs(i)>=Bn||a>.11){oe(xe.current),n.onDismiss==null||n.onDismiss.call(n,n),A(D===\`x\`?e>0?\`right\`:\`left\`:t>0?\`down\`:\`up\`),Ae(),ne(!0);return}else{var o,s;(o=ue.current)==null||o.style.setProperty(\`--swipe-amount-x\`,\`0px\`),(s=ue.current)==null||s.style.setProperty(\`--swipe-amount-y\`,\`0px\`)}ie(!1),P(!1),O(null)},onPointerMove:t=>{var n,r;if(!Ce.current||!me||window.getSelection()?.toString().length>0)return;let i=t.clientY-Ce.current.y,a=t.clientX-Ce.current.x,o=e.swipeDirections??Un(x);!D&&(Math.abs(a)>1||Math.abs(i)>1)&&O(Math.abs(a)>Math.abs(i)?\`x\`:\`y\`);let s={x:0,y:0},c=e=>1/(1.5+Math.abs(e)/20);if(D===\`y\`){if(o.includes(\`top\`)||o.includes(\`bottom\`))if(o.includes(\`top\`)&&i<0||o.includes(\`bottom\`)&&i>0)s.y=i;else{let e=i*c(i);s.y=Math.abs(e)<Math.abs(i)?e:i}}else if(D===\`x\`&&(o.includes(\`left\`)||o.includes(\`right\`)))if(o.includes(\`left\`)&&a<0||o.includes(\`right\`)&&a>0)s.x=a;else{let e=a*c(a);s.x=Math.abs(e)<Math.abs(a)?e:a}(Math.abs(s.x)>0||Math.abs(s.y)>0)&&ie(!0),(n=ue.current)==null||n.style.setProperty(\`--swipe-amount-x\`,\`\${s.x}px\`),(r=ue.current)==null||r.style.setProperty(\`--swipe-amount-y\`,\`\${s.y}px\`)}},ve&&!n.jsx&&pe!==\`loading\`?_.createElement(\`button\`,{"aria-label":E,"data-disabled":ke,"data-close-button":!0,onClick:ke||!me?()=>{}:()=>{Ae(),n.onDismiss==null||n.onDismiss.call(n,n)},className:Hn(w?.closeButton,n?.classNames?.closeButton)},T?.close??En):null,(pe||n.icon||n.promise)&&n.icon!==null&&(T?.[pe]!==null||n.icon)?_.createElement(\`div\`,{"data-icon":\`\`,className:Hn(w?.icon,n?.classNames?.icon)},n.promise||n.type===\`loading\`&&!n.icon?n.icon||je():null,n.type===\`loading\`?null:Me):null,_.createElement(\`div\`,{"data-content":\`\`,className:Hn(w?.content,n?.classNames?.content)},_.createElement(\`div\`,{"data-title":\`\`,className:Hn(w?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==\`function\`?n.title():n.title),n.description?_.createElement(\`div\`,{"data-description":\`\`,className:Hn(y,ge,w?.description,n?.classNames?.description)},typeof n.description==\`function\`?n.description():n.description):null),_.isValidElement(n.cancel)?n.cancel:n.cancel&&Nn(n.cancel)?_.createElement(\`button\`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{Nn(n.cancel)&&me&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),Ae())},className:Hn(w?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,_.isValidElement(n.action)?n.action:n.action&&Nn(n.action)?_.createElement(\`button\`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{Nn(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&Ae())},className:Hn(w?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function Gn(){if(typeof window>\`u\`||typeof document>\`u\`)return\`ltr\`;let e=document.documentElement.getAttribute(\`dir\`);return e===\`auto\`||!e?window.getComputedStyle(document.documentElement).direction:e}function Kn(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?\`--mobile-offset\`:\`--offset\`,a=r?In:Fn;function o(e){[\`top\`,\`right\`,\`bottom\`,\`left\`].forEach(t=>{n[\`\${i}-\${t}\`]=typeof e==\`number\`?\`\${e}px\`:e})}typeof e==\`number\`||typeof e==\`string\`?o(e):typeof e==\`object\`?[\`top\`,\`right\`,\`bottom\`,\`left\`].forEach(t=>{e[t]===void 0?n[\`\${i}-\${t}\`]=a:n[\`\${i}-\${t}\`]=typeof e[t]==\`number\`?\`\${e[t]}px\`:e[t]}):o(a)}),n}var qn=_.forwardRef(function(e,t){let{id:n,invert:r,position:i=\`bottom-right\`,hotkey:a=[\`altKey\`,\`KeyT\`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=\`light\`,richColors:f,duration:p,style:m,visibleToasts:h=Pn,toastOptions:g,dir:v=Gn(),gap:y=zn,icons:b,containerAriaLabel:x=\`Notifications\`}=e,[S,C]=_.useState([]),w=_.useMemo(()=>n?S.filter(e=>e.toasterId===n):S.filter(e=>!e.toasterId),[S,n]),T=_.useMemo(()=>Array.from(new Set([i].concat(w.filter(e=>e.position).map(e=>e.position)))),[w,i]),[E,D]=_.useState([]),[O,k]=_.useState(!1),[A,j]=_.useState(!1),[M,N]=_.useState(d===\`system\`?typeof window<\`u\`&&window.matchMedia&&window.matchMedia(\`(prefers-color-scheme: dark)\`).matches?\`dark\`:\`light\`:d),ee=_.useRef(null),te=a.join(\`+\`).replace(/Key/g,\`\`).replace(/Digit/g,\`\`),P=_.useRef(null),F=_.useRef(!1),ne=_.useCallback(e=>{C(t=>(t.find(t=>t.id===e.id)?.delete||kn.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return _.useEffect(()=>kn.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{C(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{_n.flushSync(()=>{C(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[S]),_.useEffect(()=>{if(d!==\`system\`){N(d);return}if(d===\`system\`&&(window.matchMedia&&window.matchMedia(\`(prefers-color-scheme: dark)\`).matches?N(\`dark\`):N(\`light\`)),typeof window>\`u\`)return;let e=window.matchMedia(\`(prefers-color-scheme: dark)\`);try{e.addEventListener(\`change\`,({matches:e})=>{N(e?\`dark\`:\`light\`)})}catch{e.addListener(({matches:e})=>{try{N(e?\`dark\`:\`light\`)}catch(e){console.error(e)}})}},[d]),_.useEffect(()=>{S.length<=1&&k(!1)},[S]),_.useEffect(()=>{let e=e=>{if(a.every(t=>e[t]||e.code===t)){var t;k(!0),(t=ee.current)==null||t.focus()}e.code===\`Escape\`&&(document.activeElement===ee.current||ee.current?.contains(document.activeElement))&&k(!1)};return document.addEventListener(\`keydown\`,e),()=>document.removeEventListener(\`keydown\`,e)},[a]),_.useEffect(()=>{if(ee.current)return()=>{P.current&&(P.current.focus({preventScroll:!0}),P.current=null,F.current=!1)}},[ee.current]),_.createElement(\`section\`,{ref:t,"aria-label":\`\${x} \${te}\`,tabIndex:-1,"aria-live":\`polite\`,"aria-relevant":\`additions text\`,"aria-atomic":\`false\`,suppressHydrationWarning:!0},T.map((t,n)=>{let[i,a]=t.split(\`-\`);return w.length?_.createElement(\`ol\`,{key:t,dir:v===\`auto\`?Gn():v,tabIndex:-1,ref:ee,className:c,"data-sonner-toaster":!0,"data-sonner-theme":M,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":\`\${E[0]?.height||0}px\`,"--width":\`\${Rn}px\`,"--gap":\`\${y}px\`,...m,...Kn(l,u)},onBlur:e=>{F.current&&!e.currentTarget.contains(e.relatedTarget)&&(F.current=!1,P.current&&=(P.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===\`false\`||F.current||(F.current=!0,P.current=e.relatedTarget)},onMouseEnter:()=>k(!0),onMouseMove:()=>k(!0),onMouseLeave:()=>{A||k(!1)},onDragEnd:()=>k(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===\`false\`||j(!0)},onPointerUp:()=>j(!1)},w.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>_.createElement(Wn,{key:n.id,icons:b,index:i,toast:n,defaultRichColors:f,duration:g?.duration??p,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:r,visibleToasts:h,closeButton:g?.closeButton??s,interacting:A,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:ne,toasts:w.filter(e=>e.position==n.position),heights:E.filter(e=>e.position==n.position),setHeights:D,expandByDefault:o,gap:y,expanded:O,swipeDirections:e.swipeDirections}))):null}))}),Jn={info:Ge,success:ve,error:_e},Yn={info:\`text-info\`,success:\`text-brand\`,error:\`text-destructive\`};function Xn({id:e,kind:t,msg:n}){let r=Jn[t];return(0,z.jsxs)(\`div\`,{className:\`group pointer-events-auto relative flex w-[360px] items-start gap-2.5 rounded-md border border-input bg-popover py-2.5 pl-3 pr-8 shadow-xl\`,children:[(0,z.jsx)(r,{size:15,className:\`mt-px shrink-0 \${Yn[t]}\`}),(0,z.jsx)(\`p\`,{className:\`min-w-0 flex-1 break-words text-[13px] leading-snug text-foreground\`,children:n}),(0,z.jsx)(\`button\`,{onClick:()=>Mn.dismiss(e),"aria-label":\`Dismiss\`,className:\`absolute right-1.5 top-1.5 flex size-6 items-center justify-center rounded text-muted-foreground/80 opacity-0 transition-colors hover:bg-accent hover:text-foreground group-hover:opacity-100 focus-visible:opacity-100 focus-visible:outline-none\`,children:(0,z.jsx)(Lt,{size:14})})]})}function H(e,t=\`info\`){return Mn.custom(n=>(0,z.jsx)(Xn,{id:n,kind:t,msg:e}),{duration:t===\`error\`?6e3:3500})}H.error=e=>H(e,\`error\`),H.success=e=>H(e,\`success\`);function Zn(){return(0,z.jsx)(qn,{position:\`bottom-right\`,gap:8,offset:16})}function Qn(e,t=\`Value\`){return navigator.clipboard.writeText(e).then(()=>(H.success(\`\${t} copied\`),!0),()=>(H.error(\`Clipboard write failed\`),!1))}function $n(e,t){let[n,r]=(0,_.useState)(!1),i=(0,_.useRef)(void 0);return(0,_.useEffect)(()=>()=>clearTimeout(i.current),[]),{copied:n,copy:()=>{Qn(typeof e==\`function\`?e():e,t).then(e=>{e&&(r(!0),clearTimeout(i.current),i.current=setTimeout(()=>r(!1),1800))})}}}function er({value:e,label:t=\`Value\`,variant:n=\`ghost\`,size:r=\`iconXs\`,iconSize:i=12,className:a,disabled:o,children:s}){let{copied:c,copy:l}=$n(e,t);return(0,z.jsxs)(V,{variant:n,size:r,className:a,disabled:o,title:c?\`Copied!\`:\`Copy \${t}\`,onClick:l,children:[c?(0,z.jsx)(pe,{size:i,className:\`text-brand\`}):(0,z.jsx)(Se,{size:i}),s]})}var tr={js:\`ace/mode/javascript\`,sql:\`ace/mode/sql\`};function nr({value:e,lang:t,onChange:n,readOnly:r,gutter:i=!1,minLines:a,maxLines:o,placeholder:s,onCmdEnter:c,className:l}){let u=(0,_.useRef)(null),d=(0,_.useRef)(null),f=mn(),p=(0,_.useRef)({onChange:n,onCmdEnter:c});return p.current={onChange:n,onCmdEnter:c},(0,_.useEffect)(()=>{let n=sn.default.edit(u.current,{mode:tr[t],theme:f===\`dark\`?\`ace/theme/one_dark\`:\`ace/theme/github\`,readOnly:!!r,showGutter:i,minLines:a,maxLines:o,fontSize:13,fontFamily:\`ui-monospace, 'SF Mono', Menlo, monospace\`,useWorker:!1,showPrintMargin:!1,highlightActiveLine:!r,highlightGutterLine:!r,tabSize:2,useSoftTabs:!0,placeholder:s,enableBasicAutocompletion:!r,enableLiveAutocompletion:!r});return n.setValue(e??\`\`,-1),n.on(\`change\`,()=>p.current.onChange?.(n.getValue())),n.commands.addCommand({name:\`cmd-enter\`,bindKey:{win:\`Ctrl-Enter\`,mac:\`Command-Enter\`},exec:()=>p.current.onCmdEnter?.()}),n.renderer.setPadding(12),n.renderer.setScrollMargin(8,8,0,0),r&&(n.renderer.$cursorLayer.element.style.display=\`none\`),d.current=n,()=>{n.destroy(),d.current=null}},[t,r,i,a,o,f]),(0,_.useEffect)(()=>{let t=d.current;t&&t.getValue()!==e&&t.setValue(e??\`\`,-1)},[e]),(0,z.jsx)(\`div\`,{ref:u,className:Zt(\`w-full\`,l)})}function rr({code:e,lang:t=\`js\`,gutter:n}){return(0,z.jsxs)(\`div\`,{className:\`relative overflow-hidden rounded-md border border-border bg-code\`,children:[(0,z.jsx)(nr,{value:e,lang:t,readOnly:!0,gutter:n,minLines:2,maxLines:80}),(0,z.jsx)(er,{value:e,label:\`Snippet\`,className:\`absolute right-2 top-2 z-10\`})]})}function ir({value:e,onChange:t,lang:n,className:r,placeholder:i,onCmdEnter:a}){return(0,z.jsx)(\`div\`,{className:Zt(\`overflow-hidden rounded-md border border-input bg-field focus-within:border-brand\`,r),children:(0,z.jsx)(nr,{value:e,onChange:t,lang:n,gutter:!0,placeholder:i,onCmdEnter:a,className:\`h-full\`})})}typeof window<\`u\`&&window.document&&window.document.createElement;function U(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function ar(e,t){if(typeof e==\`function\`)return e(t);e!=null&&(e.current=t)}function or(...e){return t=>{let n=!1,r=e.map(e=>{let r=ar(e,t);return!n&&typeof r==\`function\`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==\`function\`?n():ar(e[t],null)}}}}function sr(...e){return _.useCallback(or(...e),e)}function cr(e,t=[]){let n=[];function r(t,r){let i=_.createContext(r);i.displayName=t+\`Context\`;let a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=_.useMemo(()=>o,Object.values(o));return(0,z.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+\`Provider\`;function s(n,o){let s=o?.[e]?.[a]||i,c=_.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(\`\\\`\${n}\\\` must be used within \\\`\${t}\\\`\`)}return[o,s]}let i=()=>{let t=n.map(e=>_.createContext(e));return function(n){let r=n?.[e]||t;return _.useMemo(()=>({[\`__scope\${e}\`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,lr(i,...t)]}function lr(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[\`__scope\${r}\`];return{...t,...i}},{});return _.useMemo(()=>({[\`__scope\${t.scopeName}\`]:r}),[r])}};return n.scopeName=t.scopeName,n}var ur=globalThis?.document?_.useLayoutEffect:()=>{},dr=_.useId||(()=>void 0),fr=0;function pr(e){let[t,n]=_.useState(dr());return ur(()=>{e||n(e=>e??String(fr++))},[e]),e||(t?\`radix-\${t}\`:\`\`)}var mr=_.useEffectEvent,hr=_.useInsertionEffect;function gr(e){if(typeof mr==\`function\`)return mr(e);let t=_.useRef(()=>{throw Error(\`Cannot call an event handler while rendering.\`)});return typeof hr==\`function\`?hr(()=>{t.current=e}):ur(()=>{t.current=e}),_.useMemo(()=>((...e)=>t.current?.(...e)),[])}var _r=_.useInsertionEffect||ur;function vr({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=yr({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=_.useRef(e!==void 0);_.useEffect(()=>{let e=t.current;e!==s&&console.warn(\`\${r} is changing from \${e?\`controlled\`:\`uncontrolled\`} to \${s?\`controlled\`:\`uncontrolled\`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.\`),t.current=s},[s,r])}return[c,_.useCallback(t=>{if(s){let n=br(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function yr({defaultProp:e,onChange:t}){let[n,r]=_.useState(e),i=_.useRef(n),a=_.useRef(t);return _r(()=>{a.current=t},[t]),_.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function br(e){return typeof e==\`function\`}function xr(e){let t=_.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];kr(r)&&typeof Nr==\`function\`&&(r=Nr(r._payload)),_.Children.forEach(r,e=>{if(Dr(e)){o=!0;let t=e,n=\`child\`in t.props?t.props.child:t.props.children;kr(n)&&typeof Nr==\`function\`&&(n=Nr(n._payload)),a=wr(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=_.cloneElement(a,void 0,s):!o&&_.Children.count(r)===1&&_.isValidElement(r)&&(a=r);let c=a?Er(a):void 0,l=sr(n,c);if(!a){if(r||r===0)throw Error(o?Mr(e):jr(e));return r}let u=Tr(i,a.props??{});return a.type!==_.Fragment&&(u.ref=n?l:c),_.cloneElement(a,u)});return t.displayName=\`\${e}.Slot\`,t}var Sr=Symbol.for(\`radix.slottable\`);function Cr(e){let t=e=>\`child\`in e?e.children(e.child):e.children;return t.displayName=\`\${e}.Slottable\`,t.__radixId=Sr,t}var wr=(e,t)=>{if(\`child\`in e.props){let t=e.props.child;return _.isValidElement(t)?_.cloneElement(t,void 0,e.props.children(t.props.children)):null}return _.isValidElement(t)?t:null};function Tr(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===\`style\`?n[r]={...i,...a}:r===\`className\`&&(n[r]=[i,a].filter(Boolean).join(\` \`))}return{...e,...n}}function Er(e){let t=Object.getOwnPropertyDescriptor(e.props,\`ref\`)?.get,n=t&&\`isReactWarning\`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,\`ref\`)?.get,n=t&&\`isReactWarning\`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Dr(e){return _.isValidElement(e)&&typeof e.type==\`function\`&&\`__radixId\`in e.type&&e.type.__radixId===Sr}var Or=Symbol.for(\`react.lazy\`);function kr(e){return typeof e==\`object\`&&!!e&&\`$$typeof\`in e&&e.$$typeof===Or&&\`_payload\`in e&&Ar(e._payload)}function Ar(e){return typeof e==\`object\`&&!!e&&\`then\`in e}var jr=e=>\`\${e} failed to slot onto its children. Expected a single React element child or \\\`Slottable\\\`.\`,Mr=e=>\`\${e} failed to slot onto its \\\`Slottable\\\`. Expected \\\`Slottable\\\` to receive a single React element child.\`,Nr=_.use,W=[\`a\`,\`button\`,\`div\`,\`form\`,\`h2\`,\`h3\`,\`img\`,\`input\`,\`label\`,\`li\`,\`nav\`,\`ol\`,\`p\`,\`select\`,\`span\`,\`svg\`,\`ul\`].reduce((e,t)=>{let n=xr(\`Primitive.\${t}\`),r=_.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<\`u\`&&(window[Symbol.for(\`radix-ui\`)]=!0),(0,z.jsx)(o,{...a,ref:r})});return r.displayName=\`Primitive.\${t}\`,{...e,[t]:r}},{});function Pr(e,t){e&&_n.flushSync(()=>e.dispatchEvent(t))}function Fr(e){let t=_.useRef(e);return _.useEffect(()=>{t.current=e}),_.useMemo(()=>((...e)=>t.current?.(...e)),[])}var Ir=\`DismissableLayer\`,Lr=\`dismissableLayer.update\`,Rr=\`dismissableLayer.pointerDownOutside\`,zr=\`dismissableLayer.focusOutside\`,Br,Vr=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Hr=_.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=_.useContext(Vr),[d,f]=_.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=_.useState({}),h=sr(t,f),g=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=g.indexOf(v),b=d?g.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=_.useRef(!1),w=Kr(e=>{let t=e.target;if(!(t instanceof Node))return;let n=[...u.branches].some(e=>e.contains(t));!S||n||(a?.(e),s?.(e),e.defaultPrevented||c?.())},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:u.dismissableSurfaces}),T=qr(e=>{if(r&&C.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),E=d?b===g.length-1:!1,D=gr(e=>{e.key===\`Escape\`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return _.useEffect(()=>{if(E)return p.addEventListener(\`keydown\`,D,{capture:!0}),()=>p.removeEventListener(\`keydown\`,D,{capture:!0})},[p,E]),_.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Br=p.body.style.pointerEvents,p.body.style.pointerEvents=\`none\`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Jr(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=Br))}},[d,p,n,u]),_.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Jr())},[d,u]),_.useEffect(()=>{let e=()=>m({});return document.addEventListener(Lr,e),()=>document.removeEventListener(Lr,e)},[]),(0,z.jsx)(W.div,{...l,ref:h,style:{pointerEvents:x?S?\`auto\`:\`none\`:void 0,...e.style},onFocusCapture:U(e.onFocusCapture,T.onFocusCapture),onBlurCapture:U(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:U(e.onPointerDownCapture,w.onPointerDownCapture)})});Hr.displayName=Ir;var Ur=\`DismissableLayerBranch\`,Wr=_.forwardRef((e,t)=>{let n=_.useContext(Vr),r=_.useRef(null),i=sr(t,r);return _.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,z.jsx)(W.div,{...e,ref:i})});Wr.displayName=Ur;function Gr(){let e=_.useContext(Vr),[t,n]=_.useState(null);return _.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}function Kr(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a}=t,o=Fr(e),s=_.useRef(!1),c=_.useRef(!1),l=_.useRef(new Map),u=_.useRef(()=>{});return _.useEffect(()=>{function e(){c.current=!1,i.current=!1,l.current.clear()}function t(){return Array.from(l.current.values()).some(Boolean)}function d(e){if(!c.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||l.current.set(e.type,!0),e.type===\`click\`&&window.setTimeout(()=>{c.current&&u.current()},0)}function f(e){c.current&&l.current.set(e.type,!1)}let p=a=>{if(a.target&&!s.current){let s=function(){n.removeEventListener(\`click\`,u.current);let r=t();e(),r||Yr(Rr,o,d,{discrete:!0})},d={originalEvent:a};c.current=!0,i.current=r&&a.button===0,l.current.clear(),!r||a.button!==0?s():(n.removeEventListener(\`click\`,u.current),u.current=s,n.addEventListener(\`click\`,u.current,{once:!0}))}else n.removeEventListener(\`click\`,u.current),e();s.current=!1},m=[\`pointerup\`,\`mousedown\`,\`mouseup\`,\`touchstart\`,\`touchend\`,\`click\`];for(let e of m)n.addEventListener(e,d,!0),n.addEventListener(e,f);let h=window.setTimeout(()=>{n.addEventListener(\`pointerdown\`,p)},0);return()=>{window.clearTimeout(h),n.removeEventListener(\`pointerdown\`,p),n.removeEventListener(\`click\`,u.current);for(let e of m)n.removeEventListener(e,d,!0),n.removeEventListener(e,f)}},[n,o,r,i,a]),{onPointerDownCapture:()=>s.current=!0}}function qr(e,t=globalThis?.document){let n=Fr(e),r=_.useRef(!1);return _.useEffect(()=>{let e=e=>{e.target&&!r.current&&Yr(zr,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(\`focusin\`,e),()=>t.removeEventListener(\`focusin\`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Jr(){let e=new CustomEvent(Lr);document.dispatchEvent(e)}function Yr(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Pr(i,a):i.dispatchEvent(a)}var Xr=\`focusScope.autoFocusOnMount\`,Zr=\`focusScope.autoFocusOnUnmount\`,Qr={bubbles:!1,cancelable:!0},$r=\`FocusScope\`,ei=_.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=_.useState(null),l=Fr(i),u=Fr(a),d=_.useRef(null),f=sr(t,c),p=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:si(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||si(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&si(s)};document.addEventListener(\`focusin\`,e),document.addEventListener(\`focusout\`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(\`focusin\`,e),document.removeEventListener(\`focusout\`,t),r.disconnect()}}},[r,s,p.paused]),_.useEffect(()=>{if(s){ci.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(Xr,Qr);s.addEventListener(Xr,l),s.dispatchEvent(t),t.defaultPrevented||(ti(di(ri(s)),{select:!0}),document.activeElement===e&&si(s))}return()=>{s.removeEventListener(Xr,l),setTimeout(()=>{let t=new CustomEvent(Zr,Qr);s.addEventListener(Zr,u),s.dispatchEvent(t),t.defaultPrevented||si(e??document.body,{select:!0}),s.removeEventListener(Zr,u),ci.remove(p)},0)}}},[s,l,u,p]);let m=_.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===\`Tab\`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=ni(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&si(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&si(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,z.jsx)(W.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});ei.displayName=$r;function ti(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(si(r,{select:t}),document.activeElement!==n)return}function ni(e){let t=ri(e);return[ii(t,e),ii(t.reverse(),e)]}function ri(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===\`INPUT\`&&e.type===\`hidden\`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ii(e,t){for(let n of e)if(!ai(n,{upTo:t}))return n}function ai(e,{upTo:t}){if(getComputedStyle(e).visibility===\`hidden\`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===\`none\`)return!0;e=e.parentElement}return!1}function oi(e){return e instanceof HTMLInputElement&&\`select\`in e}function si(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&oi(e)&&t&&e.select()}}var ci=li();function li(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=ui(e,t),e.unshift(t)},remove(t){e=ui(e,t),e[0]?.resume()}}}function ui(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function di(e){return e.filter(e=>e.tagName!==\`A\`)}var fi=\`Portal\`,pi=_.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=_.useState(!1);ur(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?_n.createPortal((0,z.jsx)(W.div,{...r,ref:t}),o):null});pi.displayName=fi;function mi(e,t){return _.useReducer((e,n)=>t[e][n]??e,e)}var hi=e=>{let{present:t,children:n}=e,r=gi(t),i=typeof n==\`function\`?n({present:r.isPresent}):_.Children.only(n),a=vi(r.ref,bi(i));return typeof n==\`function\`||r.isPresent?_.cloneElement(i,{ref:a}):null};hi.displayName=\`Presence\`;function gi(e){let[t,n]=_.useState(),r=_.useRef(null),i=_.useRef(e),a=_.useRef(\`none\`),[o,s]=mi(e?\`mounted\`:\`unmounted\`,{mounted:{UNMOUNT:\`unmounted\`,ANIMATION_OUT:\`unmountSuspended\`},unmountSuspended:{MOUNT:\`mounted\`,ANIMATION_END:\`unmounted\`},unmounted:{MOUNT:\`mounted\`}});return _.useEffect(()=>{let e=yi(r.current);a.current=o===\`mounted\`?e:\`none\`},[o]),ur(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=yi(t);e?s(\`MOUNT\`):o===\`none\`||t?.display===\`none\`?s(\`UNMOUNT\`):s(n&&r!==o?\`ANIMATION_OUT\`:\`UNMOUNT\`),i.current=e}},[e,s]),ur(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=yi(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(\`ANIMATION_END\`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=\`forwards\`,e=n.setTimeout(()=>{t.style.animationFillMode===\`forwards\`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=yi(r.current))};return t.addEventListener(\`animationstart\`,c),t.addEventListener(\`animationcancel\`,o),t.addEventListener(\`animationend\`,o),()=>{n.clearTimeout(e),t.removeEventListener(\`animationstart\`,c),t.removeEventListener(\`animationcancel\`,o),t.removeEventListener(\`animationend\`,o)}}else s(\`ANIMATION_END\`)},[t,s]),{isPresent:[\`mounted\`,\`unmountSuspended\`].includes(o),ref:_.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function _i(e,t){if(typeof e==\`function\`)return e(t);e!=null&&(e.current=t)}function vi(...e){let t=_.useRef(e);return t.current=e,_.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=_i(t,e);return!r&&typeof n==\`function\`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==\`function\`?t():_i(n[e],null)}}},[])}function yi(e){return e?.animationName||\`none\`}function bi(e){let t=Object.getOwnPropertyDescriptor(e.props,\`ref\`)?.get,n=t&&\`isReactWarning\`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,\`ref\`)?.get,n=t&&\`isReactWarning\`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var xi=0,Si=null;function Ci(){_.useEffect(()=>{Si||={start:wi(),end:wi()};let{start:e,end:t}=Si;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(\`afterbegin\`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(\`beforeend\`,t),xi++,()=>{xi===1&&(Si?.start.remove(),Si?.end.remove(),Si=null),xi=Math.max(0,xi-1)}},[])}function wi(){let e=document.createElement(\`span\`);return e.setAttribute(\`data-radix-focus-guard\`,\`\`),e.tabIndex=0,e.style.outline=\`none\`,e.style.opacity=\`0\`,e.style.position=\`fixed\`,e.style.pointerEvents=\`none\`,e}var Ti=function(){return Ti=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ti.apply(this,arguments)};function Ei(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==\`function\`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Di(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Oi=\`right-scroll-bar-position\`,G=\`width-before-scroll-bar\`,ki=\`with-scroll-bars-hidden\`,Ai=\`--removed-body-scroll-bar-size\`;function ji(e,t){return typeof e==\`function\`?e(t):e&&(e.current=t),e}function Mi(e,t){var n=(0,_.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Ni=typeof window<\`u\`?_.useLayoutEffect:_.useEffect,Pi=new WeakMap;function Fi(e,t){var n=Mi(t||null,function(t){return e.forEach(function(e){return ji(e,t)})});return Ni(function(){var t=Pi.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||ji(e,null)}),i.forEach(function(e){r.has(e)||ji(e,a)})}Pi.set(n,e)},[e]),n}function Ii(e){return e}function Li(e,t){t===void 0&&(t=Ii);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not \`read\` from an \`assigned\` medium. \`read\` could be used only with \`useMedium\`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Ri(e){e===void 0&&(e={});var t=Li(null);return t.options=Ti({async:!0,ssr:!1},e),t}var zi=function(e){var t=e.sideCar,n=Ei(e,[\`sideCar\`]);if(!t)throw Error("Sidecar: please provide \`sideCar\` property to import the right car");var r=t.read();if(!r)throw Error(\`Sidecar medium not found\`);return _.createElement(r,Ti({},n))};zi.isSideCarExport=!0;function Bi(e,t){return e.useMedium(t),zi}var Vi=Ri(),Hi=function(){},Ui=_.forwardRef(function(e,t){var n=_.useRef(null),r=_.useState({onScrollCapture:Hi,onWheelCapture:Hi,onTouchMoveCapture:Hi}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,v=e.as,y=v===void 0?\`div\`:v,b=e.gapMode,x=Ei(e,[\`forwardProps\`,\`children\`,\`className\`,\`removeScrollBar\`,\`enabled\`,\`shards\`,\`sideCar\`,\`noRelative\`,\`noIsolation\`,\`inert\`,\`allowPinchZoom\`,\`as\`,\`gapMode\`]),S=f,C=Fi([n,t]),w=Ti(Ti({},x),i);return _.createElement(_.Fragment,null,u&&_.createElement(S,{sideCar:Vi,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:b}),o?_.cloneElement(_.Children.only(s),Ti(Ti({},w),{ref:C})):_.createElement(y,Ti({},w,{className:c,ref:C}),s))});Ui.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Ui.classNames={fullWidth:G,zeroRight:Oi};var Wi,Gi=function(){if(Wi)return Wi;if(typeof __webpack_nonce__<\`u\`)return __webpack_nonce__};function Ki(){if(!document)return null;var e=document.createElement(\`style\`);e.type=\`text/css\`;var t=Gi();return t&&e.setAttribute(\`nonce\`,t),e}function qi(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Ji(e){(document.head||document.getElementsByTagName(\`head\`)[0]).appendChild(e)}var Yi=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Ki())&&(qi(t,n),Ji(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Xi=function(){var e=Yi();return function(t,n){_.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Zi=function(){var e=Xi();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Qi={left:0,top:0,right:0,gap:0},$i=function(e){return parseInt(e||\`\`,10)||0},ea=function(e){var t=window.getComputedStyle(document.body),n=t[e===\`padding\`?\`paddingLeft\`:\`marginLeft\`],r=t[e===\`padding\`?\`paddingTop\`:\`marginTop\`],i=t[e===\`padding\`?\`paddingRight\`:\`marginRight\`];return[$i(n),$i(r),$i(i)]},ta=function(e){if(e===void 0&&(e=\`margin\`),typeof window>\`u\`)return Qi;var t=ea(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},na=Zi(),ra=\`data-scroll-locked\`,ia=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=\`margin\`),\`
1411
+ .\${ki} {
1412
1412
  overflow: hidden \${r};
1413
1413
  padding-right: \${s}px \${r};
1414
1414
  }
1415
- body[\${na}] {
1415
+ body[\${ra}] {
1416
1416
  overflow: hidden \${r};
1417
1417
  overscroll-behavior: contain;
1418
1418
  \${[t&&\`position: relative \${r};\`,n===\`margin\`&&\`
@@ -1425,29 +1425,29 @@ Error generating stack: \`+e.message+\`
1425
1425
  \`,n===\`padding\`&&\`padding-right: \${s}px \${r};\`].filter(Boolean).join(\`\`)}
1426
1426
  }
1427
1427
 
1428
- .\${Ei} {
1428
+ .\${Oi} {
1429
1429
  right: \${s}px \${r};
1430
1430
  }
1431
1431
 
1432
- .\${Di} {
1432
+ .\${G} {
1433
1433
  margin-right: \${s}px \${r};
1434
1434
  }
1435
1435
 
1436
- .\${Ei} .\${Ei} {
1436
+ .\${Oi} .\${Oi} {
1437
1437
  right: 0 \${r};
1438
1438
  }
1439
1439
 
1440
- .\${Di} .\${Di} {
1440
+ .\${G} .\${G} {
1441
1441
  margin-right: 0 \${r};
1442
1442
  }
1443
1443
 
1444
- body[\${na}] {
1445
- \${ki}: \${s}px;
1444
+ body[\${ra}] {
1445
+ \${Ai}: \${s}px;
1446
1446
  }
1447
- \`},ia=function(){var e=parseInt(document.body.getAttribute(\`data-scroll-locked\`)||\`0\`,10);return isFinite(e)?e:0},aa=function(){_.useEffect(function(){return document.body.setAttribute(na,(ia()+1).toString()),function(){var e=ia()-1;e<=0?document.body.removeAttribute(na):document.body.setAttribute(na,e.toString())}},[])},oa=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?\`margin\`:r;aa();var a=_.useMemo(function(){return ea(i)},[i]);return _.createElement(ta,{styles:ra(a,!t,i,n?\`\`:\`!important\`)})},sa=!1;if(typeof window<\`u\`)try{var ca=Object.defineProperty({},"passive",{get:function(){return sa=!0,!0}});window.addEventListener(\`test\`,ca,ca),window.removeEventListener(\`test\`,ca,ca)}catch{sa=!1}var la=sa?{passive:!1}:!1,ua=function(e){return e.tagName===\`TEXTAREA\`},da=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==\`hidden\`&&!(n.overflowY===n.overflowX&&!ua(e)&&n[t]===\`visible\`)},fa=function(e){return da(e,\`overflowY\`)},pa=function(e){return da(e,\`overflowX\`)},ma=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<\`u\`&&r instanceof ShadowRoot&&(r=r.host),_a(e,r)){var i=va(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},ha=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},ga=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},_a=function(e,t){return e===\`v\`?fa(t):pa(t)},va=function(e,t){return e===\`v\`?ha(t):ga(t)},ya=function(e,t){return e===\`h\`&&t===\`rtl\`?-1:1},ba=function(e,t,n,r,i){var a=ya(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=va(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&_a(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},xa=function(e){return\`changedTouches\`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Sa=function(e){return[e.deltaX,e.deltaY]},Ca=function(e){return e&&\`current\`in e?e.current:e},wa=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Ta=function(e){return\`
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
- \`},Ea=0,Da=[];function Oa(e){var t=_.useRef([]),n=_.useRef([0,0]),r=_.useRef(),i=_.useState(Ea++)[0],a=_.useState(Xi)[0],o=_.useRef(e);_.useEffect(function(){o.current=e},[e]),_.useEffect(function(){if(e.inert){document.body.classList.add(\`block-interactivity-\${i}\`);var t=Ti([e.lockRef.current],(e.shards||[]).map(Ca),!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=xa(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=ma(d,u);if(!m)return!0;if(m?l=d:(l=d===\`v\`?\`h\`:\`v\`,m=ma(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 ba(h,t,e,h===\`h\`?s:c,!0)},[]),c=_.useCallback(function(e){var n=e;if(!(!Da.length||Da[Da.length-1]!==a)){var r=\`deltaY\`in n?Sa(n):xa(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&wa(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Ca).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:ka(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=_.useCallback(function(e){n.current=xa(e),r.current=void 0},[]),d=_.useCallback(function(t){l(t.type,Sa(t),t.target,s(t,e.lockRef.current))},[]),f=_.useCallback(function(t){l(t.type,xa(t),t.target,s(t,e.lockRef.current))},[]);_.useEffect(function(){return Da.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(\`wheel\`,c,la),document.addEventListener(\`touchmove\`,c,la),document.addEventListener(\`touchstart\`,u,la),function(){Da=Da.filter(function(e){return e!==a}),document.removeEventListener(\`wheel\`,c,la),document.removeEventListener(\`touchmove\`,c,la),document.removeEventListener(\`touchstart\`,u,la)}},[]);var p=e.removeScrollBar,m=e.inert;return _.createElement(_.Fragment,null,m?_.createElement(a,{styles:Ta(i)}):null,p?_.createElement(oa,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function ka(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Aa=zi(Bi,Oa),ja=_.forwardRef(function(e,t){return _.createElement(Hi,Ci({},e,{ref:t,sideCar:Aa}))});ja.classNames=Hi.classNames;var Ma=function(e){return typeof document>\`u\`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Na=new WeakMap,Pa=new WeakMap,Fa={},Ia=0,La=function(e){return e&&(e.host||La(e.parentNode))},Ra=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=La(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})},za=function(e,t,n,r){var i=Ra(t,Array.isArray(e)?e:[e]);Fa[n]||(Fa[n]=new WeakMap);var a=Fa[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=(Na.get(e)||0)+1,l=(a.get(e)||0)+1;Na.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Pa.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(),Ia++,function(){o.forEach(function(e){var t=Na.get(e)-1,i=a.get(e)-1;Na.set(e,t),a.set(e,i),t||(Pa.has(e)||e.removeAttribute(r),Pa.delete(e)),i||e.removeAttribute(n)}),Ia--,Ia||(Na=new WeakMap,Na=new WeakMap,Pa=new WeakMap,Fa={})}},Ba=function(e,t,n){n===void 0&&(n=\`data-aria-hidden\`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Ma(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(\`[aria-live], script\`))),za(r,i,n,\`aria-hidden\`)):function(){return null}},Va=\`Dialog\`,[Ha,Ua]=or(Va),[Wa,Ga]=Ha(Va),Ka=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=_.useRef(null),c=_.useRef(null),[l,u]=gr({prop:r,defaultProp:i??!1,onChange:a,caller:Va});return(0,B.jsx)(Wa,{scope:t,triggerRef:s,contentRef:c,contentId:dr(),titleId:dr(),descriptionId:dr(),open:l,onOpenChange:u,onOpenToggle:_.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};Ka.displayName=Va;var qa=\`DialogTrigger\`,Ja=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Ga(qa,n),a=ar(t,i.triggerRef);return(0,B.jsx)(G.button,{type:\`button\`,"aria-haspopup":\`dialog\`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":mo(i.open),...r,ref:a,onClick:W(e.onClick,i.onOpenToggle)})});Ja.displayName=qa;var Ya=\`DialogPortal\`,[Xa,Za]=Ha(Ya,{forceMount:void 0}),Qa=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Ga(Ya,t);return(0,B.jsx)(Xa,{scope:t,forceMount:n,children:_.Children.map(r,e=>(0,B.jsx)(pi,{present:n||a.open,children:(0,B.jsx)(di,{asChild:!0,container:i,children:e})}))})};Qa.displayName=Ya;var $a=\`DialogOverlay\`,eo=_.forwardRef((e,t)=>{let n=Za($a,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Ga($a,e.__scopeDialog);return a.modal?(0,B.jsx)(pi,{present:r||a.open,children:(0,B.jsx)(no,{...i,ref:t})}):null});eo.displayName=$a;var to=yr(\`DialogOverlay.RemoveScroll\`),no=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Ga($a,n),a=ar(t,Ur());return(0,B.jsx)(ja,{as:to,allowPinchZoom:!0,shards:[i.contentRef],children:(0,B.jsx)(G.div,{"data-state":mo(i.open),...r,ref:a,style:{pointerEvents:\`auto\`,...r.style}})})}),ro=\`DialogContent\`,io=_.forwardRef((e,t)=>{let n=Za(ro,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Ga(ro,e.__scopeDialog);return(0,B.jsx)(pi,{present:r||a.open,children:a.modal?(0,B.jsx)(ao,{...i,ref:t}):(0,B.jsx)(oo,{...i,ref:t})})});io.displayName=ro;var ao=_.forwardRef((e,t)=>{let n=Ga(ro,e.__scopeDialog),r=_.useRef(null),i=ar(t,n.contentRef,r);return _.useEffect(()=>{let e=r.current;if(e)return Ba(e)},[]),(0,B.jsx)(K,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:W(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:W(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:W(e.onFocusOutside,e=>e.preventDefault())})}),oo=_.forwardRef((e,t)=>{let n=Ga(ro,e.__scopeDialog),r=_.useRef(!1),i=_.useRef(!1);return(0,B.jsx)(K,{...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()}})}),K=_.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=Ga(ro,n);return xi(),(0,B.jsx)(B.Fragment,{children:(0,B.jsx)(Qr,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,B.jsx)(Br,{role:\`dialog\`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":mo(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})}),so=\`DialogTitle\`,co=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Ga(so,n);return(0,B.jsx)(G.h2,{id:i.titleId,...r,ref:t})});co.displayName=so;var lo=\`DialogDescription\`,uo=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Ga(lo,n);return(0,B.jsx)(G.p,{id:i.descriptionId,...r,ref:t})});uo.displayName=lo;var fo=\`DialogClose\`,po=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Ga(fo,n);return(0,B.jsx)(G.button,{type:\`button\`,...r,ref:t,onClick:W(e.onClick,()=>i.onOpenChange(!1))})});po.displayName=fo;function mo(e){return e?\`open\`:\`closed\`}function ho({open:e,onClose:t,title:n,children:r,wide:i,width:a}){return(0,B.jsx)(Ka,{open:e,onOpenChange:e=>!e&&t(),children:(0,B.jsxs)(Qa,{children:[(0,B.jsx)(eo,{className:\`fixed inset-0 z-50 bg-black/60 backdrop-blur-sm animate-[fade-in_.15s_ease-out]\`}),(0,B.jsxs)(io,{className:Yt(\`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,B.jsxs)(\`div\`,{className:\`flex items-center justify-between border-b border-border px-4 py-3\`,children:[(0,B.jsx)(co,{className:\`text-sm font-semibold\`,children:n}),(0,B.jsx)(po,{className:\`text-muted-foreground/80 hover:text-foreground\`,children:(0,B.jsx)(Ft,{size:16})})]}),(0,B.jsx)(\`div\`,{className:\`p-4\`,children:r})]})]})})}function go({open:e,title:t,description:n,confirmLabel:r=\`Confirm\`,cancelLabel:i=\`Cancel\`,danger:a,onConfirm:o,onClose:s}){return(0,B.jsxs)(ho,{open:e,onClose:s,title:t,children:[(0,B.jsxs)(\`div\`,{className:\`flex items-start gap-3\`,children:[a&&(0,B.jsx)(\`div\`,{className:\`flex size-8 shrink-0 items-center justify-center rounded-full bg-destructive/15\`,children:(0,B.jsx)(kt,{size:15,className:\`text-destructive\`})}),(0,B.jsx)(\`p\`,{className:\`min-w-0 text-[13px] leading-relaxed text-muted-foreground\`,children:n??\`Are you sure?\`})]}),(0,B.jsxs)(\`div\`,{className:\`mt-5 flex justify-end gap-2\`,children:[(0,B.jsx)(H,{variant:\`outline\`,onClick:s,children:i}),(0,B.jsx)(H,{variant:a?\`dangerSolid\`:\`default\`,autoFocus:!0,onClick:()=>{o(),s()},children:r})]})]})}function _o(e){let t=e+\`CollectionProvider\`,[n,r]=or(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,B.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+\`CollectionSlot\`,c=yr(s),l=_.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=ar(t,a(s,n).collectionRef);return(0,B.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+\`CollectionItemSlot\`,d=\`data-radix-collection-item\`,f=yr(u),p=_.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=_.useRef(null),s=ar(t,o),c=a(u,n);return _.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,B.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,hn.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]),P=_.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:P}),[u,A,M,N,P])}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,B.jsx)(G.svg,{...a,ref:t,width:r,height:i,viewBox:\`0 0 30 10\`,preserveAspectRatio:\`none\`,children:e.asChild?n:(0,B.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 cr(()=>{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]=or(Ic),[zc,Bc]=Lc(Ic),Vc=e=>{let{__scopePopper:t,children:n}=e,[r,i]=_.useState(null),[a,o]=_.useState(void 0);return(0,B.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=ar(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,B.jsx)(G.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=ar(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:P,middlewareData:ee}=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})]}),F=g.setPlacementState;cr(()=>(F(N),()=>{F(void 0)}),[N,F]);let[I,te]=$c(N),ne=Nr(m);cr(()=>{P&&ne?.()},[P,ne]);let re=ee.arrow?.x,ie=ee.arrow?.y,ae=ee.arrow?.centerOffset!==0,[L,oe]=_.useState();return cr(()=>{v&&oe(window.getComputedStyle(v).zIndex)},[v]),(0,B.jsx)(\`div\`,{ref:j.setFloating,"data-radix-popper-content-wrapper":\`\`,style:{...M,transform:P?M.transform:\`translate(0, -200%)\`,minWidth:\`max-content\`,zIndex:L,"--radix-popper-transform-origin":[ee.transformOrigin?.x,ee.transformOrigin?.y].join(\` \`),...ee.hide?.referenceHidden&&{visibility:\`hidden\`,pointerEvents:\`none\`}},dir:e.dir,children:(0,B.jsx)(Gc,{scope:n,placedSide:I,placedAlign:te,onArrowChange:S,arrowX:re,arrowY:ie,shouldHideArrow:ae,children:(0,B.jsx)(G.div,{"data-side":I,"data-align":te,...h,ref:b,style:{...h.style,animation:P?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,B.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,B.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]=or(ol,[ll]),[fl,pl]=ul(ol),ml=_.forwardRef((e,t)=>(0,B.jsx)(sl.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,B.jsx)(sl.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,B.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=ar(t,f),m=yo(a),[h,g]=gr({prop:o,defaultProp:s??null,onChange:c,caller:ol}),[v,y]=_.useState(!1),b=Nr(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,B.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,B.jsx)(G.div,{tabIndex:v||C===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:\`none\`,...e.style},onMouseDown:W(e.onMouseDown,()=>{S.current=!0}),onFocus:W(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:W(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=dr(),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,B.jsx)(sl.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,B.jsx)(G.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:W(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:W(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:W(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]=or(jl,[Pl,Rc,dl]),Ll=Rc(),Rl=dl(),[zl,q]=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=Nr(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,B.jsx)(el,{...s,children:(0,B.jsx)(zl,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,B.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,B.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=q(Gl,t);return(0,B.jsx)(Kl,{scope:t,forceMount:n,children:(0,B.jsx)(pi,{present:n||a.open,children:(0,B.jsx)(di,{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=q(Yl,e.__scopeMenu),o=Vl(Yl,e.__scopeMenu);return(0,B.jsx)(Ml.Provider,{scope:e.__scopeMenu,children:(0,B.jsx)(pi,{present:r||a.open,children:(0,B.jsx)(Ml.Slot,{scope:e.__scopeMenu,children:o.modal?(0,B.jsx)($l,{...i,ref:t}):(0,B.jsx)(eu,{...i,ref:t})})})})}),$l=_.forwardRef((e,t)=>{let n=q(Yl,e.__scopeMenu),r=_.useRef(null),i=ar(t,r);return _.useEffect(()=>{let e=r.current;if(e)return Ba(e)},[]),(0,B.jsx)(nu,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:W(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),eu=_.forwardRef((e,t)=>{let n=q(Yl,e.__scopeMenu);return(0,B.jsx)(nu,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),tu=yr(\`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=q(Yl,n),v=Vl(Yl,n),y=Ll(n),b=Rl(n),x=Nl(n),[S,C]=_.useState(null),w=_.useRef(null),T=ar(t,w,g.onContentChange),E=_.useRef(0),D=_.useRef(\`\`),O=_.useRef(0),k=_.useRef(null),A=_.useRef(\`right\`),j=_.useRef(0),M=m?ja:_.Fragment,N=m?{as:tu,allowPinchZoom:!0}:void 0,P=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),[]),xi();let ee=_.useCallback(e=>A.current===k.current?.side&&Hu(e,k.current?.area),[]);return(0,B.jsx)(Xl,{scope:n,searchRef:D,onItemEnter:_.useCallback(e=>{ee(e)&&e.preventDefault()},[ee]),onItemLeave:_.useCallback(e=>{ee(e)||(w.current?.focus(),C(null))},[ee]),onTriggerLeave:_.useCallback(e=>{ee(e)&&e.preventDefault()},[ee]),pointerGraceTimerRef:O,onPointerGraceIntentChange:_.useCallback(e=>{k.current=e},[]),children:(0,B.jsx)(M,{...N,children:(0,B.jsx)(Qr,{asChild:!0,trapped:i,onMountAutoFocus:W(a,e=>{e.preventDefault(),w.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,B.jsx)(Br,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,B.jsx)(Cl,{asChild:!0,...b,dir:v.dir,orientation:\`vertical\`,loop:r,currentTabStopId:S,onCurrentTabStopIdChange:C,onEntryFocus:W(c,e=>{v.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,B.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:W(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&&P(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:W(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(E.current),D.current=\`\`)}),onPointerMove:W(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,B.jsx)(G.div,{role:\`group\`,...r,ref:t})});iu.displayName=ru;var au=\`MenuLabel\`,ou=_.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,B.jsx)(G.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=ar(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}),Mr(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,B.jsx)(uu,{...i,ref:c,disabled:n,onClick:W(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:W(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:W(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=ar(t,c),[u,d]=_.useState(!1),[f,p]=_.useState(\`\`);return _.useEffect(()=>{let e=c.current;e&&p((e.textContent??\`\`).trim())},[a.children]),(0,B.jsx)(Ml.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,B.jsx)(wl,{asChild:!0,...s,focusable:!r,children:(0,B.jsx)(G.div,{role:\`menuitem\`,"data-highlighted":u?\`\`:void 0,"aria-disabled":r||void 0,"data-disabled":r?\`\`:void 0,...a,ref:l,onPointerMove:W(e.onPointerMove,Uu(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:W(e.onPointerLeave,Uu(e=>o.onItemLeave(e))),onFocus:W(e.onFocus,()=>d(!0)),onBlur:W(e.onBlur,()=>d(!1))})})})}),du=\`MenuCheckboxItem\`,fu=_.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,B.jsx)(bu,{scope:e.__scopeMenu,checked:n,children:(0,B.jsx)(lu,{role:\`menuitemcheckbox\`,"aria-checked":Iu(n)?\`mixed\`:n,...i,ref:t,"data-state":Lu(n),onSelect:W(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=Nr(r);return(0,B.jsx)(mu,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,B.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,B.jsx)(bu,{scope:e.__scopeMenu,checked:a,children:(0,B.jsx)(lu,{role:\`menuitemradio\`,"aria-checked":a,...r,ref:t,"data-state":Lu(a),onSelect:W(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,B.jsx)(pi,{present:r||Iu(a.checked)||a.checked===!0,children:(0,B.jsx)(G.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,B.jsx)(G.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,B.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=q(Du,t),o=Ll(t),[s,c]=_.useState(null),[l,u]=_.useState(null),d=Nr(i);return _.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,B.jsx)(el,{...o,children:(0,B.jsx)(zl,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,B.jsx)(Ou,{scope:t,contentId:dr(),triggerId:dr(),trigger:s,onTriggerChange:c,children:n})})})};Au.displayName=Du;var ju=\`MenuSubTrigger\`,Mu=_.forwardRef((e,t)=>{let n=q(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=ar(t,i.onTriggerChange);return(0,B.jsx)(Wl,{asChild:!0,...l,children:(0,B.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:W(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:W(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:W(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=q(Yl,e.__scopeMenu),s=Vl(Yl,e.__scopeMenu),c=ku(Nu,e.__scopeMenu),l=_.useRef(null),u=ar(t,l);return(0,B.jsx)(Ml.Provider,{scope:e.__scopeMenu,children:(0,B.jsx)(pi,{present:r||o.open,children:(0,B.jsx)(Ml.Slot,{scope:e.__scopeMenu,children:(0,B.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:W(e.onFocusOutside,e=>{e.target!==c.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:W(e.onEscapeKeyDown,e=>{s.onClose(),e.preventDefault()}),onKeyDown:W(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]=or(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]=gr({prop:i,defaultProp:a??!1,onChange:o,caller:od});return(0,B.jsx)(ud,{scope:t,triggerId:dr(),triggerRef:l,contentId:dr(),open:u,onOpenChange:d,onOpenToggle:_.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,B.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=ar(t,a.triggerRef);return(0,B.jsx)(Gu,{asChild:!0,...o,children:(0,B.jsx)(G.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:W(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:W(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,B.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,B.jsx)(qu,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:W(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:W(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,B.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,B.jsx)(Yu,{...i,...r,ref:t})});Sd.displayName=xd;var Cd=\`DropdownMenuItem\`,J=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=ld(n);return(0,B.jsx)(Xu,{...i,...r,ref:t})});J.displayName=Cd;var wd=\`DropdownMenuCheckboxItem\`,Td=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=ld(n);return(0,B.jsx)(Zu,{...i,...r,ref:t})});Td.displayName=wd;var Ed=\`DropdownMenuRadioGroup\`,Dd=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=ld(n);return(0,B.jsx)(Qu,{...i,...r,ref:t})});Dd.displayName=Ed;var Od=\`DropdownMenuRadioItem\`,kd=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=ld(n);return(0,B.jsx)($u,{...i,...r,ref:t})});kd.displayName=Od;var Ad=\`DropdownMenuItemIndicator\`,jd=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=ld(n);return(0,B.jsx)(ed,{...i,...r,ref:t})});jd.displayName=Ad;var Md=\`DropdownMenuSeparator\`,Nd=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=ld(n);return(0,B.jsx)(td,{...i,...r,ref:t})});Nd.displayName=Md;var Pd=\`DropdownMenuArrow\`,Fd=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=ld(n);return(0,B.jsx)(nd,{...i,...r,ref:t})});Fd.displayName=Pd;var Id=e=>{let{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:i,defaultOpen:a}=e,o=ld(t),[s,c]=gr({prop:r,defaultProp:a??!1,onChange:i,caller:\`DropdownMenuSub\`});return(0,B.jsx)(rd,{...o,open:s,onOpenChange:c,children:n})},Ld=\`DropdownMenuSubTrigger\`,Rd=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=ld(n);return(0,B.jsx)(id,{...i,...r,ref:t})});Rd.displayName=Ld;var zd=\`DropdownMenuSubContent\`,Bd=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=ld(n);return(0,B.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)\`}})});Bd.displayName=zd;var Vd=fd,Hd=md,Ud=gd,Wd=vd,Gd=Sd,Kd=J,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,B.jsx)(Ud,{children:(0,B.jsx)(Wd,{align:t,sideOffset:4,className:Yt(\`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,B.jsxs)(Kd,{disabled:r,onSelect:t,className:Yt(\`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,B.jsx)(\`span\`,{className:\`ml-auto pl-4 text-[11px] text-muted-foreground/80\`,children:i})]})}function rf({children:e}){return(0,B.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,B.jsx)(he,{size:12,className:\`ml-auto text-muted-foreground/80\`})]})}function af({children:e}){return(0,B.jsx)(Ud,{children:(0,B.jsx)(Xd,{sideOffset:6,className:ef,children:e})})}function of(){return(0,B.jsx)(qd,{className:\`my-1 h-px bg-accent\`})}function sf({children:e}){return(0,B.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,B.jsx)(\`div\`,{className:\`py-16 text-center text-[13px] text-muted-foreground/80\`,children:e})}function Y({className:e,mono:t,...n}){return(0,B.jsx)(\`input\`,{className:Yt(\`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 lf({children:e}){return(0,B.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,B.jsx)(\`label\`,{className:\`mb-1 block text-xs font-medium text-muted-foreground\`,children:e})}function uf({label:e,hint:t,value:n,danger:r,bare:i}){let[a,o]=(0,_.useState)(!r);return(0,B.jsxs)(\`div\`,{children:[!i&&(0,B.jsxs)(X,{children:[e,\` \`,(0,B.jsx)(\`span\`,{className:\`ml-1 font-normal \`+(r?\`text-destructive/80\`:\`text-muted-foreground/80\`),children:t})]}),(0,B.jsxs)(\`div\`,{className:\`flex items-center gap-2\`,children:[(0,B.jsxs)(\`div\`,{className:\`relative min-w-0 flex-1\`,children:[(0,B.jsx)(Y,{mono:!0,readOnly:!0,type:a?\`text\`:\`password\`,value:n||\`unavailable\`,className:\`pr-9\`}),(0,B.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,B.jsx)(Oe,{size:14}):(0,B.jsx)(ke,{size:14})})]}),(0,B.jsx)(Qn,{value:n,label:e,variant:\`outline\`,size:\`icon\`,iconSize:13,disabled:!n})]})]})}function df({message:e}){return(0,B.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,B.jsx)(ge,{size:14,className:\`mt-0.5 shrink-0\`}),(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(\`span\`,{className:\`font-medium\`,children:\`Couldn't load this view.\`}),\` \`,e]})]})}function ff({open:e,onOpenChange:t,trigger:n,children:r,align:i=\`start\`,className:a}){return(0,B.jsxs)(\`div\`,{className:\`relative\`,children:[n,e&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(\`div\`,{className:\`fixed inset-0 z-40\`,onClick:()=>t(!1)}),(0,B.jsx)(\`div\`,{className:Yt(\`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 pf=(e,t,n)=>Math.min(n,Math.max(t,e));function mf({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 pf(Number.isFinite(e)?e:r,i,a)}),d=(0,_.useRef)(l);d.current=l;let f=(0,_.useRef)(null);return(0,B.jsxs)(\`div\`,{className:Yt(\`relative shrink-0\`,o),style:t===\`x\`?{width:l}:{height:l},children:[s,(0,B.jsx)(\`div\`,{role:\`separator\`,"aria-orientation":t===\`x\`?\`vertical\`:\`horizontal\`,title:\`Drag to resize — double-click to reset\`,className:Yt(\`absolute z-20 transition-colors hover:bg-brand/40 active:bg-brand/60\`,t===\`x\`?Yt(\`inset-y-0 w-1 cursor-col-resize\`,n===\`left\`?\`-right-0.5\`:\`-left-0.5\`):Yt(\`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(pf(r.startSize+s,i,a))},onPointerUp:()=>{f.current=null,localStorage.setItem(c,String(d.current))},onDoubleClick:()=>{u(pf(r,i,a)),localStorage.setItem(c,String(r))}})]})}function hf(e,[t,n]){return Math.min(n,Math.max(t,e))}function gf(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 _f=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\`}),vf=\`VisuallyHidden\`,yf=_.forwardRef((e,t)=>(0,B.jsx)(G.span,{...e,ref:t,style:{..._f,...e.style}}));yf.displayName=vf;var bf=yf,xf=[\` \`,\`Enter\`,\`ArrowUp\`,\`ArrowDown\`],Sf=[\` \`,\`Enter\`],Cf=\`Select\`,[wf,Tf,Ef]=_o(Cf),[Df,Of]=or(Cf,[Ef,Rc]),kf=Rc(),[Af,jf]=Df(Cf),[Mf,Nf]=Df(Cf),Pf=\`SelectProvider\`;function Ff(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=kf(t),[v,y]=_.useState(null),[b,x]=_.useState(null),[S,C]=_.useState(!1),w=yo(l),[T,E]=gr({prop:r,defaultProp:i??!1,onChange:a,caller:Cf}),[D,O]=gr({prop:o,defaultProp:s,onChange:c,caller:Cf}),k=_.useRef(null),A=v?!!m||!!v.closest(\`form\`):!0,[j,M]=_.useState(new Set),N=dr(),P=Array.from(j).map(e=>e.props.value).join(\`;\`),ee=_.useCallback(e=>{M(t=>new Set(t).add(e))},[]),F=_.useCallback(e=>{M(t=>{let n=new Set(t);return n.delete(e),n})},[]),I={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:P,isFormControl:A};return(0,B.jsx)(el,{...g,children:(0,B.jsx)(Af,{scope:t,...I,children:(0,B.jsx)(wf.Provider,{scope:t,children:(0,B.jsx)(Mf,{scope:t,onNativeOptionAdd:ee,onNativeOptionRemove:F,children:Fp(h)?h(I):n})})})})}Ff.displayName=Pf;var If=e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,B.jsx)(Ff,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,B.jsxs)(B.Fragment,{children:[n,e?(0,B.jsx)(Pp,{__scopeSelect:t}):null]})})};If.displayName=Cf;var Lf=\`SelectTrigger\`,Rf=_.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=kf(n),o=jf(Lf,n),s=o.disabled||r,c=ar(t,o.onTriggerChange),l=Tf(n),u=_.useRef(\`touch\`),[d,f,p]=Lp(e=>{let t=l().filter(e=>!e.disabled),n=Rp(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,B.jsx)(tl,{asChild:!0,...a,children:(0,B.jsx)(G.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":Ip(o.value)?\`\`:void 0,...i,ref:c,onClick:W(i.onClick,e=>{e.currentTarget.focus(),u.current!==\`mouse\`&&m(e)}),onPointerDown:W(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:W(i.onKeyDown,e=>{let t=d.current!==\`\`;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===\` \`)&&xf.includes(e.key)&&(m(),e.preventDefault())})})})});Rf.displayName=Lf;var zf=\`SelectValue\`,Bf=_.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=\`\`,...s}=e,c=jf(zf,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=ar(t,c.onValueNodeChange);cr(()=>{l(u)},[l,u]);let f=Ip(c.value);return(0,B.jsx)(G.span,{...s,asChild:f?!1:s.asChild,ref:d,style:{pointerEvents:\`none\`},children:(0,B.jsx)(_.Fragment,{children:f?o:a},f?\`placeholder\`:\`value\`)})});Bf.displayName=zf;var Vf=\`SelectIcon\`,Hf=_.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,B.jsx)(G.span,{"aria-hidden":!0,...i,ref:t,children:r||\`▼\`})});Hf.displayName=Vf;var Uf=\`SelectPortal\`,[Wf,Gf]=Df(Uf,{forceMount:void 0}),Kf=e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,B.jsx)(Wf,{scope:e.__scopeSelect,forceMount:n,children:(0,B.jsx)(di,{asChild:!0,...r})})};Kf.displayName=Uf;var qf=\`SelectContent\`,Jf=_.forwardRef((e,t)=>{let n=Gf(qf,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=jf(qf,e.__scopeSelect),[o,s]=_.useState();return cr(()=>{s(new DocumentFragment)},[]),(0,B.jsx)(pi,{present:r||a.open,children:({present:e})=>e?(0,B.jsx)(tp,{...i,ref:t}):(0,B.jsx)(Yf,{...i,fragment:o})})});Jf.displayName=qf;var Yf=_.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,fragment:i}=e;return i?hn.createPortal((0,B.jsx)(Zf,{scope:n,children:(0,B.jsx)(wf.Slot,{scope:n,children:(0,B.jsx)(\`div\`,{ref:t,children:r})})}),i):null});Yf.displayName=\`SelectContentFragment\`;var Xf=10,[Zf,Qf]=Df(qf),$f=\`SelectContentImpl\`,ep=yr(\`SelectContent.RemoveScroll\`),tp=_.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=jf(qf,n),[b,x]=_.useState(null),[S,C]=_.useState(null),w=ar(t,x),[T,E]=_.useState(null),[D,O]=_.useState(null),k=Tf(n),[A,j]=_.useState(!1),M=_.useRef(!1);_.useEffect(()=>{if(b)return Ba(b)},[b]),xi();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]),P=_.useCallback(()=>N([T,b]),[N,T,b]);_.useEffect(()=>{A&&P()},[A,P]);let{onOpenChange:ee,triggerPointerDownPosRef:F}=y;_.useEffect(()=>{if(b){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(F.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(F.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(b)||ee(!1),document.removeEventListener(\`pointermove\`,t),F.current=null};return F.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,ee,F]),_.useEffect(()=>{let e=()=>ee(!1);return window.addEventListener(\`blur\`,e),window.addEventListener(\`resize\`,e),()=>{window.removeEventListener(\`blur\`,e),window.removeEventListener(\`resize\`,e)}},[ee]);let[I,te]=Lp(e=>{let t=k().filter(e=>!e.disabled),n=Rp(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),ne=_.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]),re=_.useCallback(()=>b?.focus(),[b]),ie=_.useCallback((e,t,n)=>{let r=!M.current&&!n;(y.value!==void 0&&y.value===t||r)&&O(e)},[y.value]),ae=r===\`popper\`?ap:rp,L=ae===ap?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,B.jsx)(Zf,{scope:n,content:b,viewport:S,onViewportChange:C,itemRefCallback:ne,selectedItem:T,onItemLeave:re,itemTextRefCallback:ie,focusSelectedItem:P,selectedItemText:D,position:r,isPositioned:A,searchRef:I,children:(0,B.jsx)(ja,{as:ep,allowPinchZoom:!0,children:(0,B.jsx)(Qr,{asChild:!0,trapped:y.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:W(i,e=>{y.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,B.jsx)(Br,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:(0,B.jsx)(ae,{role:\`listbox\`,id:y.contentId,"data-state":y.open?\`open\`:\`closed\`,dir:y.dir,onContextMenu:e=>e.preventDefault(),...v,...L,onPlaced:()=>j(!0),ref:w,style:{display:\`flex\`,flexDirection:\`column\`,outline:\`none\`,...v.style},onKeyDown:W(v.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===\`Tab\`&&e.preventDefault(),!t&&e.key.length===1&&te(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()}})})})})})})});tp.displayName=$f;var np=\`SelectItemAlignedPosition\`,rp=_.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=jf(qf,n),o=Qf(qf,n),[s,c]=_.useState(null),[l,u]=_.useState(null),d=ar(t,u),f=Tf(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-Xf,d=hf(a,[Xf,Math.max(Xf,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-Xf,d=hf(a,[Xf,Math.max(Xf,u-l)]);s.style.minWidth=c+\`px\`,s.style.right=d+\`px\`}let o=f(),c=window.innerHeight-Xf*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-Xf,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=\`\${Xf}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]);cr(()=>b(),[b]);let[x,S]=_.useState();return cr(()=>{l&&S(window.getComputedStyle(l).zIndex)},[l]),(0,B.jsx)(op,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:_.useCallback(e=>{e&&m.current===!0&&(b(),y?.(),m.current=!1)},[b,y]),children:(0,B.jsx)(\`div\`,{ref:c,style:{display:\`flex\`,flexDirection:\`column\`,position:\`fixed\`,zIndex:x},children:(0,B.jsx)(G.div,{...i,ref:d,style:{boxSizing:\`border-box\`,maxHeight:\`100%\`,...i.style}})})})});rp.displayName=np;var ip=\`SelectPopperPosition\`,ap=_.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=\`start\`,collisionPadding:i=Xf,...a}=e,o=kf(n);return(0,B.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)\`}})});ap.displayName=ip;var[op,sp]=Df(qf,{}),cp=\`SelectViewport\`,lp=_.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=Qf(cp,n),o=sp(cp,n),s=ar(t,a.onViewportChange),c=_.useRef(0);return(0,B.jsxs)(B.Fragment,{children:[(0,B.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,B.jsx)(wf.Slot,{scope:n,children:(0,B.jsx)(G.div,{"data-radix-select-viewport":\`\`,role:\`presentation\`,...i,ref:s,style:{position:\`relative\`,flex:1,overflow:\`hidden auto\`,...i.style},onScroll:W(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-Xf*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})})})]})});lp.displayName=cp;var up=\`SelectGroup\`,[dp,fp]=Df(up),pp=_.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=dr();return(0,B.jsx)(dp,{scope:n,id:i,children:(0,B.jsx)(G.div,{role:\`group\`,"aria-labelledby":i,...r,ref:t})})});pp.displayName=up;var mp=\`SelectLabel\`,hp=_.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=fp(mp,n);return(0,B.jsx)(G.div,{id:i.id,...r,ref:t})});hp.displayName=mp;var gp=\`SelectItem\`,[_p,vp]=Df(gp),yp=_.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=jf(gp,n),c=Qf(gp,n),l=s.value===r,[u,d]=_.useState(a??\`\`),[f,p]=_.useState(!1),m=ar(t,Nr(e=>c.itemRefCallback?.(e,r,i))),h=dr(),g=_.useRef(\`touch\`),v=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};return(0,B.jsx)(_p,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:_.useCallback(e=>{d(t=>t||(e?.textContent??\`\`).trim())},[]),children:(0,B.jsx)(wf.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,B.jsx)(G.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:W(o.onFocus,()=>p(!0)),onBlur:W(o.onBlur,()=>p(!1)),onClick:W(o.onClick,()=>{g.current!==\`mouse\`&&v()}),onPointerUp:W(o.onPointerUp,()=>{g.current===\`mouse\`&&v()}),onPointerDown:W(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:W(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===\`mouse\`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:W(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:W(o.onKeyDown,e=>{c.searchRef?.current!==\`\`&&e.key===\` \`||(Sf.includes(e.key)&&v(),e.key===\` \`&&e.preventDefault())})})})})});yp.displayName=gp;var bp=\`SelectItemText\`,xp=_.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=jf(bp,n),s=Qf(bp,n),c=vp(bp,n),l=Nf(bp,n),[u,d]=_.useState(null),f=Nr(e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=ar(t,d,c.onItemTextChange,f),m=u?.textContent,h=_.useMemo(()=>(0,B.jsx)(\`option\`,{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:v}=l;return cr(()=>(g(h),()=>v(h)),[g,v,h]),(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(G.span,{id:c.textId,...a,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!Ip(o.value)?hn.createPortal(a.children,o.valueNode):null]})});xp.displayName=bp;var Sp=\`SelectItemIndicator\`,Cp=_.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return vp(Sp,n).isSelected?(0,B.jsx)(G.span,{"aria-hidden":!0,...r,ref:t}):null});Cp.displayName=Sp;var wp=\`SelectScrollUpButton\`,Tp=_.forwardRef((e,t)=>{let n=Qf(wp,e.__scopeSelect),r=sp(wp,e.__scopeSelect),[i,a]=_.useState(!1),o=ar(t,r.onScrollButtonChange);return cr(()=>{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,B.jsx)(Op,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});Tp.displayName=wp;var Ep=\`SelectScrollDownButton\`,Dp=_.forwardRef((e,t)=>{let n=Qf(Ep,e.__scopeSelect),r=sp(Ep,e.__scopeSelect),[i,a]=_.useState(!1),o=ar(t,r.onScrollButtonChange);return cr(()=>{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,B.jsx)(Op,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});Dp.displayName=Ep;var Op=_.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=Qf(\`SelectScrollButton\`,n),o=_.useRef(null),s=Tf(n),c=_.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return _.useEffect(()=>()=>c(),[c]),cr(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:\`nearest\`})},[s]),(0,B.jsx)(G.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:W(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:W(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:W(i.onPointerLeave,()=>{c()})})}),kp=\`SelectSeparator\`,Ap=_.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,B.jsx)(G.div,{"aria-hidden":!0,...r,ref:t})});Ap.displayName=kp;var jp=\`SelectArrow\`,Mp=_.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=kf(n);return Qf(jp,n).position===\`popper\`?(0,B.jsx)(rl,{...i,...r,ref:t}):null});Mp.displayName=jp;var Np=\`SelectBubbleInput\`,Pp=_.forwardRef(({__scopeSelect:e,...t},n)=>{let r=jf(Np,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=ar(n,p),h=i??\`\`,g=gf(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,B.jsxs)(G.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:u,onChange:e=>a(e.target.value),...t,style:{..._f,...t.style},ref:m,defaultValue:h,children:[Ip(i)&&!v?(0,B.jsx)(\`option\`,{value:\`\`}):null,Array.from(d)]},f)});Pp.displayName=Np;function Fp(e){return typeof e==\`function\`}function Ip(e){return e===\`\`||e===void 0}function Lp(e){let t=Nr(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 Rp(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=zp(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 zp(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Bp=\`__select-empty__\`,Vp=e=>e===\`\`?Bp:e,Hp=e=>e===Bp?\`\`:e;function Up({value:e,onValueChange:t,options:n,placeholder:r=\`Select…\`,disabled:i,autoFocus:a,mono:o,size:s=\`sm\`,className:c=\`w-full\`}){return(0,B.jsxs)(If,{value:Vp(e),onValueChange:e=>t(Hp(e)),disabled:i,children:[(0,B.jsxs)(Rf,{autoFocus:a,className:Yt(\`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,B.jsx)(\`span\`,{className:\`min-w-0 flex-1 truncate\`,children:(0,B.jsx)(Bf,{placeholder:r})}),(0,B.jsx)(Hf,{children:(0,B.jsx)(pe,{size:13,className:\`shrink-0 text-muted-foreground/80\`})})]}),(0,B.jsx)(Kf,{children:(0,B.jsx)(Jf,{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,B.jsx)(lp,{className:\`p-1\`,children:n.map(e=>(0,B.jsxs)(yp,{value:Vp(e.value),disabled:e.disabled,className:Yt(\`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,B.jsx)(\`span\`,{className:\`min-w-0 flex-1 truncate\`,children:(0,B.jsx)(xp,{children:e.label??e.value})}),(0,B.jsx)(Cp,{children:(0,B.jsx)(fe,{size:12,className:\`shrink-0 text-brand\`})})]},e.value))})})})]})}var Wp=200,Gp=po;function Kp({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,Wp))};return(0,B.jsx)(Ka,{open:e&&l,onOpenChange:e=>!e&&f(),children:(0,B.jsxs)(Qa,{children:[(0,B.jsx)(eo,{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,B.jsxs)(io,{className:Yt(\`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,B.jsx)(co,{className:\`sr-only\`,children:n}):(0,B.jsxs)(\`div\`,{className:\`flex shrink-0 items-center justify-between border-b border-border px-5 py-3.5\`,children:[(0,B.jsx)(co,{className:\`text-sm font-medium text-foreground\`,children:n}),(0,B.jsxs)(\`div\`,{className:\`flex items-center gap-1\`,children:[a,(0,B.jsx)(po,{className:\`rounded p-0.5 text-muted-foreground/80 hover:bg-accent hover:text-foreground\`,children:(0,B.jsx)(Ft,{size:16})})]})]}),(0,B.jsx)(\`div\`,{className:Yt(\`min-h-0 flex-1\`,o?\`overflow-hidden\`:\`overflow-y-auto px-5 py-4\`),children:r}),i&&(0,B.jsx)(\`div\`,{className:\`flex shrink-0 items-center gap-2 border-t border-border bg-card px-5 py-3\`,children:i})]})]})})}function qp(){return(0,B.jsx)(\`div\`,{className:\`flex items-center justify-center py-16 text-muted-foreground/80\`,children:(0,B.jsx)(\`div\`,{className:\`size-5 animate-spin rounded-full border-2 border-input border-t-brand\`})})}function Jp({checked:e,onChange:t,disabled:n}){return(0,B.jsx)(\`button\`,{type:\`button\`,role:\`switch\`,"aria-checked":e,disabled:n,onClick:()=>t?.(!e),className:Yt(\`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,B.jsx)(\`span\`,{className:Yt(\`absolute left-0 top-0.5 size-3.5 rounded-full bg-white transition-transform\`,e?\`translate-x-4\`:\`translate-x-0.5\`)})})}function Yp({children:e,className:t}){return(0,B.jsx)(\`table\`,{className:Yt(\`w-full border-collapse text-[13px]\`,t),children:e})}function Xp({children:e}){return(0,B.jsx)(\`thead\`,{className:\`sticky top-0 z-10 bg-card\`,children:e})}function Z({className:e,...t}){return(0,B.jsx)(\`th\`,{className:Yt(\`whitespace-nowrap border-b border-border px-3 py-2 text-left font-medium text-muted-foreground\`,e),...t})}function Zp({className:e,...t}){return(0,B.jsx)(\`tr\`,{className:Yt(\`group border-b border-border/60 transition-colors hover:bg-accent/30\`,e),...t})}function Q({className:e,...t}){return(0,B.jsx)(\`td\`,{className:Yt(\`px-3 py-1.5 align-middle\`,e),...t})}function Qp({tabs:e,active:t,onSelect:n}){return(0,B.jsx)(\`div\`,{className:\`flex gap-5 border-b border-border\`,children:e.map(e=>(0,B.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 $p({className:e,...t}){return(0,B.jsx)(\`textarea\`,{className:Yt(\`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[em,tm]=or(\`Tooltip\`,[Rc]),nm=Rc(),rm=\`TooltipProvider\`,im=700,am=\`tooltip.open\`,[om,sm]=em(rm),cm=e=>{let{__scopeTooltip:t,delayDuration:n=im,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,B.jsx)(om,{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})};cm.displayName=rm;var lm=\`Tooltip\`,[um,dm]=em(lm),fm=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=sm(lm,e.__scopeTooltip),l=nm(t),[u,d]=_.useState(null),f=dr(),p=_.useRef(0),m=o??c.disableHoverableContent,h=s??c.delayDuration,g=_.useRef(!1),[v,y]=gr({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(am))):c.onClose(),a?.(e)},caller:lm}),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,B.jsx)(el,{...l,children:(0,B.jsx)(um,{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})})};fm.displayName=lm;var pm=\`TooltipTrigger\`,mm=_.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=dm(pm,n),a=sm(pm,n),o=nm(n),s=ar(t,_.useRef(null),i.onTriggerChange),c=_.useRef(!1),l=_.useRef(!1),u=_.useCallback(()=>c.current=!1,[]);return _.useEffect(()=>()=>document.removeEventListener(\`pointerup\`,u),[u]),(0,B.jsx)(tl,{asChild:!0,...o,children:(0,B.jsx)(G.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:W(e.onPointerMove,e=>{e.pointerType!==\`touch\`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:W(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:W(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(\`pointerup\`,u,{once:!0})}),onFocus:W(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:W(e.onBlur,i.onClose),onClick:W(e.onClick,i.onClose)})})});mm.displayName=pm;var hm=\`TooltipPortal\`,[gm,_m]=em(hm,{forceMount:void 0}),vm=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=dm(hm,t);return(0,B.jsx)(gm,{scope:t,forceMount:n,children:(0,B.jsx)(pi,{present:n||a.open,children:(0,B.jsx)(di,{asChild:!0,container:i,children:r})})})};vm.displayName=hm;var ym=\`TooltipContent\`,bm=_.forwardRef((e,t)=>{let n=_m(ym,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=\`top\`,...a}=e,o=dm(ym,e.__scopeTooltip);return(0,B.jsx)(pi,{present:r||o.open,children:o.disableHoverableContent?(0,B.jsx)(Tm,{side:i,...a,ref:t}):(0,B.jsx)(xm,{side:i,...a,ref:t})})}),xm=_.forwardRef((e,t)=>{let n=dm(ym,e.__scopeTooltip),r=sm(ym,e.__scopeTooltip),i=_.useRef(null),a=ar(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=km(r,Om(r,n.getBoundingClientRect())),a=Am(t.getBoundingClientRect()),o=Mm([...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=!jm(n,o);r?f():i&&(f(),l())};return document.addEventListener(\`pointermove\`,e),()=>document.removeEventListener(\`pointermove\`,e)}},[c,u,o,l,f]),(0,B.jsx)(Tm,{...e,ref:a})}),[Sm,Cm]=em(lm,{isInside:!1}),wm=xr(\`TooltipContent\`),Tm=_.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=dm(ym,n),l=nm(n),{onClose:u}=c;return _.useEffect(()=>(document.addEventListener(am,u),()=>document.removeEventListener(am,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,B.jsx)(Br,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,B.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,B.jsx)(wm,{children:r}),(0,B.jsx)(Sm,{scope:n,isInside:!0,children:(0,B.jsx)(bf,{id:c.contentId,role:\`tooltip\`,children:i||r})})]})})});bm.displayName=ym;var Em=\`TooltipArrow\`,Dm=_.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=nm(n);return Cm(Em,n).isInside?null:(0,B.jsx)(rl,{...i,...r,ref:t})});Dm.displayName=Em;function Om(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 km(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 Am(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 jm(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 Mm(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)),Nm(t)}function Nm(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 Pm=cm,Fm=fm,Im=mm,Lm=vm,Rm=bm;function zm({content:e,children:t,side:n=\`top\`}){return(0,B.jsx)(Pm,{delayDuration:250,children:(0,B.jsxs)(Fm,{children:[(0,B.jsx)(Im,{asChild:!0,children:t}),(0,B.jsx)(Lm,{children:(0,B.jsx)(Rm,{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 Bm=e=>String(e).padStart(2,\`0\`),Vm=e=>e.toLocaleDateString(void 0,{day:\`2-digit\`,month:\`short\`,year:\`2-digit\`}),Hm=e=>\`\${Bm(e.getHours())}:\${Bm(e.getMinutes())}:\${Bm(e.getSeconds())}\`,Um=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 Wm(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 Gm({label:e,value:t}){return(0,B.jsxs)(\`div\`,{className:\`flex items-baseline gap-2 font-mono text-[11px]\`,children:[(0,B.jsx)(\`span\`,{className:\`shrink-0 text-muted-foreground\`,children:e}),(0,B.jsx)(\`span\`,{className:\`min-w-4 flex-1 border-b border-dotted border-muted-foreground/30\`}),(0,B.jsx)(\`span\`,{className:\`shrink-0 tabular-nums text-foreground/90\`,children:t})]})}function Km({value:e,format:t=\`datetime\`,className:n=\`\`}){if(e==null||e===\`\`)return(0,B.jsx)(\`span\`,{className:n,children:\`—\`});let r=e instanceof Date?e:new Date(e);if(Number.isNaN(r.getTime()))return(0,B.jsx)(\`span\`,{className:n,children:String(e)});let i=t===\`time\`?Hm(r):t===\`date\`?Vm(r):t===\`relative\`?Wm(r):\`\${Vm(r)} \${Hm(r)}\`,a=Intl.DateTimeFormat().resolvedOptions().timeZone;return(0,B.jsx)(zm,{side:\`top\`,content:(0,B.jsxs)(\`div\`,{className:\`w-72 space-y-1 p-1\`,children:[(0,B.jsx)(Gm,{label:\`UTC\`,value:Um(r)}),(0,B.jsx)(Gm,{label:a,value:\`\${Vm(r)} \${Hm(r)}\`}),(0,B.jsx)(Gm,{label:\`Relative\`,value:Wm(r)}),(0,B.jsx)(Gm,{label:\`Timestamp\`,value:r.getTime()})]}),children:(0,B.jsx)(\`span\`,{className:\`cursor-default whitespace-nowrap tabular-nums underline decoration-dotted decoration-muted-foreground/40 underline-offset-2 \`+n,children:i})})}function qm({value:e}){return e==null?(0,B.jsx)(\`span\`,{className:\`select-none text-muted-foreground/60\`,children:\`NULL\`}):e===\`\`?(0,B.jsx)(\`span\`,{className:\`select-none italic text-muted-foreground/60\`,children:\`empty\`}):typeof e==\`boolean\`?(0,B.jsx)(\`span\`,{className:\`text-info\`,children:String(e)}):typeof e==\`object\`?(0,B.jsx)(\`span\`,{className:\`text-warning/90\`,children:JSON.stringify(e)}):(0,B.jsx)(B.Fragment,{children:String(e)})}function Jm(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,B.jsx)(\`code\`,{className:\`rounded bg-accent px-1 py-px font-mono text-[12px] text-foreground/90\`,children:e}),Ym=/auth\\.(uid|jwt|role|email)\\(\\)/i,Xm=/\\(\\s*select\\s+(auth\\.|current_setting)/i;async function Zm(){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(),[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,
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
@@ -1490,7 +1490,7 @@ Error generating stack: \`+e.message+\`
1490
1490
  where n.nspname = 'pgmq' and c.relkind = 'r' and c.relname like 'q\\\\_%'
1491
1491
  and (has_table_privilege('anon', c.oid, 'select') or has_table_privilege('authenticated', c.oid, 'select'))
1492
1492
  order by c.relname\`),N.sql(\`select id from storage.buckets where public order by id\`),N.sql(\`select policyname as name, cmd, roles::text[] as roles, coalesce(qual, '') as qual
1493
- from pg_policies where schemaname = 'storage' and tablename = 'objects'\`),N.authConfig()]);if(e.status===\`rejected\`||!e.value.ok){let t=e.status===\`rejected\`?String(e.reason?.message??e.reason):e.value.error??\`catalog unreachable\`;throw Error(t)}let h=[],g=e=>e.status===\`fulfilled\`&&e.value.ok?e.value.rows??[]:[];for(let t of g(e))t.rls?t.policies===0&&h.push({id:\`0008:\${t.name}\`,code:\`0008\`,category:\`security\`,level:\`warning\`,title:\`RLS Enabled No Policy\`,entity:\`public.\${t.name}\`,entityKind:\`table\`,issue:(0,B.jsxs)(B.Fragment,{children:[\`Table \`,(0,B.jsxs)($,{children:[\`public.\`,t.name]}),\` has RLS enabled but no policies — anon and authenticated queries return zero rows, which usually surfaces as an app bug.\`]}),description:\`Detects tables with Row Level Security enabled but no policy granting any access.\`,action:{label:\`Create policy\`,go:()=>z(\`table\`,t.name)}}):(h.push({id:\`0013:\${t.name}\`,code:\`0013\`,category:\`security\`,level:\`critical\`,title:\`RLS Disabled in Public\`,entity:\`public.\${t.name}\`,entityKind:\`table\`,issue:(0,B.jsxs)(B.Fragment,{children:[\`Table \`,(0,B.jsxs)($,{children:[\`public.\`,t.name]}),\` is exposed through the Data API with Row Level Security disabled — anon and authenticated can read and write every row.\`]}),description:\`Detects tables in the public schema without RLS. Public-schema tables are reachable over /rest/v1, so RLS is the row-level access control.\`,action:{label:\`Enable RLS\`,go:()=>z(\`table\`,t.name)}}),t.policies>0&&h.push({id:\`0007:\${t.name}\`,code:\`0007\`,category:\`security\`,level:\`critical\`,title:\`Policy Exists RLS Disabled\`,entity:\`public.\${t.name}\`,entityKind:\`table\`,issue:(0,B.jsxs)(B.Fragment,{children:[\`Table \`,(0,B.jsxs)($,{children:[\`public.\`,t.name]}),\` has \`,t.policies,\` RLS \`,t.policies===1?\`policy\`:\`policies\`,\` but RLS itself is disabled — the policies are written but not enforced.\`]}),description:\`Detects tables where policies exist while row level security is disabled, so none of them apply.\`,action:{label:\`Enable RLS\`,go:()=>z(\`table\`,t.name)}})),t.has_pk||h.push({id:\`0004:\${t.name}\`,code:\`0004\`,category:\`performance\`,level:\`warning\`,title:\`No Primary Key\`,entity:\`public.\${t.name}\`,entityKind:\`table\`,issue:(0,B.jsxs)(B.Fragment,{children:[\`Table \`,(0,B.jsxs)($,{children:[\`public.\`,t.name]}),\` has no primary key — rows can't be uniquely addressed, so updates and deletes through the API and the table editor are disabled.\`]}),description:\`Detects tables without a primary key. Replication, upserts, and row addressing all require one.\`,action:{label:\`Open table\`,go:()=>z(\`table\`,t.name)}});for(let e of g(t))h.push({id:\`0010:\${e.name}\`,code:\`0010\`,category:\`security\`,level:\`critical\`,title:\`Security Definer View\`,entity:\`public.\${e.name}\`,entityKind:\`view\`,issue:(0,B.jsxs)(B.Fragment,{children:[\`View \`,(0,B.jsxs)($,{children:[\`public.\`,e.name]}),\` is defined with the SECURITY DEFINER property.\`]}),description:\`Detects views defined with the SECURITY DEFINER property. These views enforce Postgres permissions and row level security policies (RLS) of the view creator, rather than that of the querying user.\`,action:{label:\`Review view\`,go:()=>z(\`table\`,e.name)}});for(let e of g(r))h.push({id:\`0002:\${e.name}\`,code:\`0002\`,category:\`security\`,level:\`critical\`,title:\`Auth Users Exposed\`,entity:\`public.\${e.name}\`,entityKind:\`view\`,issue:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)($,{children:[\`public.\`,e.name]}),\` selects from \`,(0,B.jsx)($,{children:\`auth.users\`}),\` and is exposed through the Data API — user records (emails, metadata) may leak to anon/authenticated.\`]}),description:\`Detects views or materialized views in an API-exposed schema that read auth.users.\`,action:{label:\`Review view\`,go:()=>z(\`table\`,e.name)}});for(let e of g(n))h.push({id:\`0001:\${e.name}\`,code:\`0001\`,category:\`performance\`,level:\`info\`,title:\`Unindexed foreign keys\`,entity:\`public.\${e.tbl}\`,entityKind:\`table\`,issue:(0,B.jsxs)(B.Fragment,{children:[\`Table \`,(0,B.jsxs)($,{children:[\`public.\`,e.tbl]}),\` has a foreign key \`,(0,B.jsx)($,{children:e.name}),\` on \`,(0,B.jsx)($,{children:e.col}),\` without a covering index. This can lead to suboptimal query performance.\`]}),description:\`Identifies foreign key constraints without a covering index, which can impact database performance.\`,action:{label:\`Create an index\`,go:()=>z(\`database\`,\`indexes\`)}});let _=g(i),v=new Map;for(let e of _){let t=\`\${e.qual} \${e.check}\`;if((Ym.test(t)||/current_setting\\(/i.test(t))&&!Xm.test(t)&&h.push({id:\`0003:\${e.tbl}:\${e.name}\`,code:\`0003\`,category:\`performance\`,level:\`warning\`,title:\`Auth RLS Initialization Plan\`,entity:\`public.\${e.tbl}\`,entityKind:\`table\`,issue:(0,B.jsxs)(B.Fragment,{children:[\`Policy \`,(0,B.jsx)($,{children:e.name}),\` on \`,(0,B.jsxs)($,{children:[\`public.\`,e.tbl]}),\` re-evaluates \`,(0,B.jsx)($,{children:\`auth.<function>()\`}),\` or\`,\` \`,(0,B.jsx)($,{children:\`current_setting()\`}),\` for each row. Replace \`,(0,B.jsx)($,{children:\`auth.uid()\`}),\` with \`,(0,B.jsx)($,{children:\`(select auth.uid())\`}),\` so it runs once per query.\`]}),description:\`Detects if calls to current_setting() and auth.<function>() in RLS policies are being unnecessarily re-evaluated for each row.\`,action:{label:\`View policies\`,go:()=>z(\`table\`,e.tbl)}}),/user_metadata|raw_user_meta_data/i.test(t)&&h.push({id:\`0015:\${e.tbl}:\${e.name}\`,code:\`0015\`,category:\`security\`,level:\`critical\`,title:\`RLS References User Metadata\`,entity:\`public.\${e.tbl}\`,entityKind:\`table\`,issue:(0,B.jsxs)(B.Fragment,{children:[\`Policy \`,(0,B.jsx)($,{children:e.name}),\` on \`,(0,B.jsxs)($,{children:[\`public.\`,e.tbl]}),\` references user metadata, which end users can edit about themselves — it must never gate access.\`]}),description:\`Detects RLS policies that reference user_metadata; use app_metadata or your own tables for authorization data.\`,action:{label:\`View policies\`,go:()=>z(\`table\`,e.tbl)}}),String(e.permissive).toUpperCase()===\`PERMISSIVE\`&&[\`INSERT\`,\`UPDATE\`,\`DELETE\`,\`ALL\`].includes(e.cmd?.toUpperCase())&&(e.qual.trim()===\`true\`||e.check.trim()===\`true\`)&&h.push({id:\`0024:\${e.tbl}:\${e.name}\`,code:\`0024\`,category:\`security\`,level:\`warning\`,title:\`Permissive RLS Policy\`,entity:\`public.\${e.tbl}\`,entityKind:\`table\`,issue:(0,B.jsxs)(B.Fragment,{children:[\`Policy \`,(0,B.jsx)($,{children:e.name}),\` on \`,(0,B.jsxs)($,{children:[\`public.\`,e.tbl]}),\` allows \`,e.cmd,\` with a bare \`,(0,B.jsx)($,{children:\`true\`}),\` expression — every matching role can write unconditionally.\`]}),description:\`Detects write policies whose expression is a constant true, granting unrestricted access.\`,action:{label:\`View policies\`,go:()=>z(\`table\`,e.tbl)}}),String(e.permissive).toUpperCase()===\`PERMISSIVE\`)for(let t of Lt(e.roles)){let n=\`\${e.tbl}|\${e.cmd}|\${t}\`;v.set(n,(v.get(n)??0)+1)}}for(let[e,t]of v)if(t>1){let[n,r,i]=e.split(\`|\`);h.push({id:\`0006:\${e}\`,code:\`0006\`,category:\`performance\`,level:\`warning\`,title:\`Multiple Permissive Policies\`,entity:\`public.\${n}\`,entityKind:\`table\`,issue:(0,B.jsxs)(B.Fragment,{children:[\`Table \`,(0,B.jsxs)($,{children:[\`public.\`,n]}),\` has \`,t,\` permissive policies for role \`,(0,B.jsx)($,{children:i}),\` on \`,r,\` — every policy runs for every relevant query.\`]}),description:\`Detects multiple permissive policies for the same role and command, which multiplies policy evaluation cost.\`,action:{label:\`View policies\`,go:()=>z(\`table\`,n)}})}for(let e of g(a)){let t=Lt(e.idxs);h.push({id:\`0009:\${e.tbl}:\${t.join(\`,\`)}\`,code:\`0009\`,category:\`performance\`,level:\`warning\`,title:\`Duplicate Index\`,entity:\`public.\${e.tbl}\`,entityKind:\`table\`,issue:(0,B.jsxs)(B.Fragment,{children:[\`Table \`,(0,B.jsxs)($,{children:[\`public.\`,e.tbl]}),\` has identical indexes: \`,(0,B.jsx)($,{children:t.join(\`, \`)}),\` — every extra copy slows writes for no read benefit.\`]}),description:\`Detects indexes with identical columns, operator classes, expressions and predicates.\`,action:{label:\`View indexes\`,go:()=>z(\`database\`,\`indexes\`)}})}for(let e of g(o))e.mutable_path&&h.push({id:\`0011:\${e.name}\`,code:\`0011\`,category:\`security\`,level:\`warning\`,title:\`Function Search Path Mutable\`,entity:\`public.\${e.name}()\`,entityKind:\`function\`,issue:(0,B.jsxs)(B.Fragment,{children:[\`Function \`,(0,B.jsxs)($,{children:[\`public.\`,e.name,\`()\`]}),\` does not pin \`,(0,B.jsx)($,{children:\`search_path\`}),\` — a caller-controlled search_path can make it resolve unexpected objects. Add \`,(0,B.jsx)($,{children:\`set search_path = ''\`}),\` (or the schemas it needs).\`]}),description:\`Detects functions without a fixed search_path configuration parameter.\`,action:{label:\`View functions\`,go:()=>z(\`database\`,\`functions\`)}}),e.secdef&&e.anon_exec&&h.push({id:\`0028:\${e.name}\`,code:\`0028\`,category:\`security\`,level:\`warning\`,title:\`Anon Can Execute SECURITY DEFINER Function\`,entity:\`public.\${e.name}()\`,entityKind:\`function\`,issue:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)($,{children:[\`public.\`,e.name,\`()\`]}),\` runs with its owner's privileges and is executable by \`,(0,B.jsx)($,{children:\`anon\`}),\` — any unauthenticated caller inherits those rights for the duration of the call.\`]}),description:\`Detects SECURITY DEFINER functions executable by the anon role.\`,action:{label:\`View functions\`,go:()=>z(\`database\`,\`functions\`)}}),e.secdef&&e.auth_exec&&h.push({id:\`0029:\${e.name}\`,code:\`0029\`,category:\`security\`,level:\`info\`,title:\`Signed-In Users Can Execute SECURITY DEFINER Function\`,entity:\`public.\${e.name}()\`,entityKind:\`function\`,issue:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)($,{children:[\`public.\`,e.name,\`()\`]}),\` runs with its owner's privileges and is executable by \`,(0,B.jsx)($,{children:\`authenticated\`}),\`. Often intentional (policy helpers) — keep the body minimal and pin \`,(0,B.jsx)($,{children:\`search_path\`}),\`.\`]}),description:\`Detects SECURITY DEFINER functions executable by signed-in users.\`,action:{label:\`View functions\`,go:()=>z(\`database\`,\`functions\`)}});for(let e of g(s))h.push({id:\`0014:\${e.name}\`,code:\`0014\`,category:\`security\`,level:\`warning\`,title:\`Extension in Public\`,entity:\`public.\${e.name}\`,entityKind:\`extension\`,issue:(0,B.jsxs)(B.Fragment,{children:[\`Extension \`,(0,B.jsx)($,{children:e.name}),\` is installed in the public schema. Move it to another schema (e.g.\`,\` \`,(0,B.jsx)($,{children:\`extensions\`}),\`).\`]}),description:\`Detects extensions installed in the public schema.\`,action:{label:\`Open SQL editor\`,go:()=>z(\`sql\`)}});for(let e of g(c)){let t=e.kind===\`m\`;h.push({id:\`\${t?\`0016\`:\`0017\`}:\${e.name}\`,code:t?\`0016\`:\`0017\`,category:\`security\`,level:\`critical\`,title:t?\`Materialized View in API\`:\`Foreign Table in API\`,entity:\`public.\${e.name}\`,entityKind:\`view\`,issue:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)($,{children:[\`public.\`,e.name]}),\` is a \`,t?\`materialized view\`:\`foreign table\`,\` in an API-exposed schema —\`,\` \`,t?\`materialized views\`:\`foreign tables\`,\` do not enforce RLS, so every role can read all of it.\`]}),description:t?\`Detects materialized views in API-exposed schemas; they cannot have RLS policies.\`:\`Detects foreign tables in API-exposed schemas; they do not respect RLS.\`,action:{label:\`Open SQL editor\`,go:()=>z(\`sql\`)}})}for(let e of g(l))h.push({id:\`0018:\${e.tbl}.\${e.col}\`,code:\`0018\`,category:\`performance\`,level:\`info\`,title:\`Unsupported reg types\`,entity:\`public.\${e.tbl}\`,entityKind:\`table\`,issue:(0,B.jsxs)(B.Fragment,{children:[\`Column \`,(0,B.jsx)($,{children:e.col}),\` on \`,(0,B.jsxs)($,{children:[\`public.\`,e.tbl]}),\` uses \`,(0,B.jsx)($,{children:e.typ}),\` — reg* types store OIDs that break across dump/restore and upgrades.\`]}),description:\`Detects columns using reg* types (except regtype/regrole handled by tooling), which are not supported by backups and upgrades.\`,action:{label:\`Open table\`,go:()=>z(\`table\`,e.tbl)}});for(let e of g(u))h.push({id:\`0023:\${e.tbl}.\${e.col}\`,code:\`0023\`,category:\`security\`,level:\`info\`,title:\`Sensitive Columns Exposed\`,entity:\`public.\${e.tbl}\`,entityKind:\`table\`,issue:(0,B.jsxs)(B.Fragment,{children:[\`Column \`,(0,B.jsx)($,{children:e.col}),\` on \`,(0,B.jsxs)($,{children:[\`public.\`,e.tbl]}),\` looks like it holds a secret. Public-schema columns are selectable through the Data API — keep secrets out of exposed tables or lock them down with policies/column grants.\`]}),description:\`Heuristically detects likely-sensitive column names (password, token, api_key, …) in API-exposed tables.\`,action:{label:\`Open table\`,go:()=>z(\`table\`,e.tbl)}});for(let e of g(d))h.push({id:\`0019:\${e.name}\`,code:\`0019\`,category:\`security\`,level:\`critical\`,title:\`Insecure Queue Exposed\`,entity:\`pgmq.\${e.name}\`,entityKind:\`queue\`,issue:(0,B.jsxs)(B.Fragment,{children:[\`Queue table \`,(0,B.jsxs)($,{children:[\`pgmq.\`,e.name]}),\` is readable by anon/authenticated — queue payloads often carry internal data. Revoke those grants.\`]}),description:\`Detects pgmq queue tables granted to API roles.\`,action:{label:\`Open queues\`,go:()=>z(\`automations\`,\`queues\`)}});{let e=g(f);if(g(p).some(e=>[\`SELECT\`,\`ALL\`].includes(e.cmd?.toUpperCase())&&e.roles.some(e=>e===\`anon\`||e===\`public\`)&&!/bucket_id/.test(e.qual)))for(let t of e)h.push({id:\`0025:\${t.id}\`,code:\`0025\`,category:\`security\`,level:\`info\`,title:\`Public Bucket Allows Listing\`,entity:\`storage.\${t.id}\`,entityKind:\`storage\`,issue:(0,B.jsxs)(B.Fragment,{children:[\`Bucket \`,(0,B.jsx)($,{children:t.id}),\` is public and an anon SELECT policy on \`,(0,B.jsx)($,{children:\`storage.objects\`}),\` has no\`,\` \`,(0,B.jsx)($,{children:\`bucket_id\`}),\` filter — anyone can enumerate its file names.\`]}),description:\`Detects public buckets whose object-listing policy is not scoped, allowing enumeration of contents.\`,action:{label:\`Open bucket policies\`,go:()=>z(\`storage\`,t.id)}})}m.status===\`fulfilled\`&&m.value.settings?.anonymousUsers&&h.push({id:\`0012\`,code:\`0012\`,category:\`security\`,level:\`info\`,title:\`Auth Allow Anonymous Sign-ins\`,entity:\`Auth\`,entityKind:\`auth\`,issue:(0,B.jsxs)(B.Fragment,{children:[\`Anonymous sign-ins are enabled — anyone can mint an \`,(0,B.jsx)($,{children:\`authenticated\`}),\` session without credentials. Make sure RLS policies distinguish anonymous users where it matters.\`]}),description:\`Detects when anonymous sign-ins are enabled, since anonymous users hold the authenticated role.\`,action:{label:\`Open auth settings\`,go:()=>z(\`auth\`,\`providers\`)}});let y={critical:0,warning:1,info:2};return h.sort((e,t)=>y[e.level]-y[t.level]||e.code.localeCompare(t.code)||e.entity.localeCompare(t.entity))}var Qm=null;function $m(){Qm?.()}var eh={critical:\`red\`,warning:\`amber\`,info:\`neutral\`},th={table:Et,view:ke,function:wt,auth:Ge,storage:ze,queue:Ue,extension:nt};function nh({f:e}){let t=e.level===\`critical\`?\`text-destructive\`:e.level===\`warning\`?\`text-warning\`:\`text-muted-foreground/70\`;return e.category===\`security\`?(0,B.jsx)(bt,{size:15,className:t}):(0,B.jsx)(R,{size:15,className:t})}function rh(){let[e,t]=(0,_.useState)(null);return(0,_.useEffect)(()=>{let e=!0,n=()=>Zm().then(n=>{e&&t(n.some(e=>e.level===\`critical\`)?\`critical\`:n.some(e=>e.level===\`warning\`)?\`warning\`:n.length?\`info\`:null)},()=>{});n();let r=setInterval(n,3e5);return()=>{e=!1,clearInterval(r)}},[]),(0,B.jsxs)(\`button\`,{title:\`Advisor\`,onClick:$m,className:\`relative flex size-7 items-center justify-center rounded-md border border-input text-muted-foreground transition-colors hover:border-muted-foreground hover:bg-accent hover:text-foreground\`,children:[(0,B.jsx)(qe,{size:14}),e&&e!==\`info\`&&(0,B.jsx)(\`span\`,{className:\`absolute -right-0.5 -top-0.5 size-2 rounded-full ring-2 ring-card \`+(e===\`critical\`?\`bg-destructive\`:\`bg-warning\`)})]})}function ih(){let[e,t]=(0,_.useState)(!1);return(0,_.useEffect)(()=>(Qm=()=>t(!0),()=>{Qm=null}),[]),e?(0,B.jsx)(ah,{onClose:()=>t(!1)}):null}function ah({onClose:e}){let[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(\`all\`),[s,c]=(0,_.useState)(\`\`),[l,u]=(0,_.useState)(null),d=(0,_.useCallback)(()=>{Zm().then(e=>{i(null),n(e)},e=>{i(e?.message??\`Advisor could not read the catalog\`),n([])})},[]);(0,_.useEffect)(()=>{d()},[d]);let f=(t??[]).filter(e=>(a===\`all\`||e.category===a)&&(!s||e.level===s));return(0,B.jsx)(Kp,{open:!0,onClose:e,flush:!0,hideHeader:!0,width:\`w-135\`,title:\`Advisor\`,children:(0,B.jsxs)(\`div\`,{className:\`flex h-full flex-col\`,children:[(0,B.jsxs)(\`div\`,{className:\`flex h-14 shrink-0 items-center gap-2.5 border-b border-border px-4\`,children:[l?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(\`button\`,{className:\`rounded p-1 text-muted-foreground/80 hover:bg-accent hover:text-foreground\`,onClick:()=>u(null),children:(0,B.jsx)(me,{size:16})}),(0,B.jsxs)(\`div\`,{className:\`min-w-0 flex-1\`,children:[(0,B.jsx)(\`p\`,{className:\`truncate text-[14px] font-medium text-foreground\`,children:l.title}),(0,B.jsx)(\`p\`,{className:\`truncate font-mono text-[11px] text-muted-foreground/70\`,children:l.entity})]}),(0,B.jsx)(\`span\`,{className:\`font-mono text-[10px] text-muted-foreground/50\`,children:l.code}),(0,B.jsx)(V,{variant:eh[l.level],children:l.level.toUpperCase()})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(qe,{size:15,className:\`text-muted-foreground\`}),(0,B.jsx)(\`p\`,{className:\`flex-1 text-[14px] font-medium text-foreground\`,children:\`Advisor\`})]}),(0,B.jsx)(Gp,{asChild:!0,children:(0,B.jsx)(\`button\`,{className:\`rounded p-1 text-muted-foreground/80 hover:bg-accent hover:text-foreground\`,children:\`✕\`})})]}),l?(0,B.jsxs)(\`div\`,{className:\`min-h-0 flex-1 space-y-5 overflow-y-auto p-5\`,children:[(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(\`p\`,{className:\`mb-1.5 text-[13px] font-semibold text-foreground\`,children:\`Entity\`}),(0,B.jsxs)(\`span\`,{className:\`inline-flex items-center gap-1.5 rounded-md border border-border bg-card px-2.5 py-1.5 font-mono text-[12px] text-foreground/90\`,children:[(()=>{let e=th[l.entityKind];return(0,B.jsx)(e,{size:12,className:\`text-muted-foreground\`})})(),l.entity]})]}),(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(\`p\`,{className:\`mb-1.5 text-[13px] font-semibold text-foreground\`,children:\`Issue\`}),(0,B.jsx)(\`p\`,{className:\`text-[13px] leading-relaxed text-muted-foreground\`,children:l.issue})]}),(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(\`p\`,{className:\`mb-1.5 text-[13px] font-semibold text-foreground\`,children:\`Description\`}),(0,B.jsx)(\`p\`,{className:\`text-[13px] leading-relaxed text-muted-foreground\`,children:l.description})]}),(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(\`p\`,{className:\`mb-1.5 text-[13px] font-semibold text-foreground\`,children:\`Resolve\`}),(0,B.jsx)(H,{variant:\`outline\`,onClick:()=>{l.action.go(),e()},children:l.action.label})]})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(\`div\`,{className:\`flex shrink-0 items-center gap-3 border-b border-border px-4 pt-1.5\`,children:[(0,B.jsx)(Qp,{tabs:[{id:\`all\`,label:\`All\`},{id:\`security\`,label:\`Security\`},{id:\`performance\`,label:\`Performance\`}],active:a,onSelect:e=>o(e)}),(0,B.jsx)(\`div\`,{className:\`ml-auto pb-1.5\`,children:(0,B.jsx)(Up,{size:\`xs\`,className:\`w-28 shrink-0\`,value:s,onValueChange:e=>c(e),options:[{value:\`\`,label:\`Severity\`},{value:\`critical\`,label:\`Critical\`},{value:\`warning\`,label:\`Warning\`},{value:\`info\`,label:\`Info\`}]})})]}),(0,B.jsx)(\`div\`,{className:\`min-h-0 flex-1 overflow-y-auto\`,children:r?(0,B.jsx)(df,{message:r}):t===null?(0,B.jsx)(\`div\`,{className:\`p-5\`,children:(0,B.jsx)(qp,{})}):f.length===0?(0,B.jsx)(\`p\`,{className:\`px-5 py-10 text-center text-[13px] text-muted-foreground/70\`,children:t.length===0?\`No advisor findings — everything looks healthy.\`:\`Nothing matches the filters.\`}):f.map(e=>(0,B.jsxs)(\`button\`,{className:\`flex w-full items-center gap-3 border-b border-border/60 px-4 py-3 text-left transition-colors hover:bg-accent/40\`,onClick:()=>u(e),children:[(0,B.jsx)(nh,{f:e}),(0,B.jsxs)(\`span\`,{className:\`min-w-0 flex-1\`,children:[(0,B.jsx)(\`span\`,{className:\`block truncate text-[13px] font-medium text-foreground\`,children:e.title}),(0,B.jsx)(\`span\`,{className:\`block truncate font-mono text-[11px] text-muted-foreground/70\`,children:e.entity})]}),e.level===\`critical\`&&(0,B.jsx)(V,{variant:\`red\`,children:\`CRITICAL\`}),(0,B.jsx)(he,{size:14,className:\`shrink-0 text-muted-foreground/50\`})]},e.id))})]})]})})}var oh=[{tab:\`database\`,section:\`visualizer\`,label:\`Database · Schema Visualizer\`},{tab:\`database\`,section:\`tables\`,label:\`Database · Tables\`},{tab:\`database\`,section:\`functions\`,label:\`Database · Functions\`},{tab:\`database\`,section:\`triggers\`,label:\`Database · Triggers\`},{tab:\`database\`,section:\`policies\`,label:\`Database · Policies\`},{tab:\`database\`,section:\`enums\`,label:\`Database · Enumerated Types\`},{tab:\`database\`,section:\`indexes\`,label:\`Database · Indexes\`},{tab:\`database\`,section:\`roles\`,label:\`Database · Roles\`},{tab:\`database\`,section:\`migrations\`,label:\`Database · Migrations\`},{tab:\`auth\`,section:\`users\`,label:\`Authentication · Users\`},{tab:\`auth\`,section:\`providers\`,label:\`Authentication · Providers\`},{tab:\`functions\`,section:\`secrets\`,label:\`Edge Functions · Secrets\`},{tab:\`functions\`,section:\`settings\`,label:\`Edge Functions · Settings\`},{tab:\`realtime\`,section:\`inspector\`,label:\`Realtime · Inspector\`},{tab:\`realtime\`,section:\`policies\`,label:\`Realtime · Policies\`},{tab:\`realtime\`,section:\`settings\`,label:\`Realtime · Settings\`},{tab:\`automations\`,section:\`cron\`,label:\`Automations · Cron\`},{tab:\`automations\`,section:\`queues\`,label:\`Automations · Queues\`},{tab:\`automations\`,section:\`webhooks\`,label:\`Automations · Webhooks\`},{tab:\`settings\`,section:\`general\`,label:\`Settings · General\`},{tab:\`settings\`,section:\`api-keys\`,label:\`Settings · API Keys\`}];function sh(){let[e,t]=(0,_.useState)(!1),[n,r]=(0,_.useState)(\`\`),[i,a]=(0,_.useState)(0),[o,s]=(0,_.useState)(null),c=(0,_.useRef)(null);(0,_.useEffect)(()=>{let e=e=>{(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===\`k\`&&(e.preventDefault(),t(e=>!e)),e.key===\`Escape\`&&t(!1)};return window.addEventListener(\`keydown\`,e),()=>window.removeEventListener(\`keydown\`,e)},[]),(0,_.useEffect)(()=>{if(!e){r(\`\`),a(0);return}c.current?.focus(),o===null&&N.tables().then(e=>s(e.map(e=>e.name)),()=>s([]))},[e,o]);let l=(0,_.useMemo)(()=>{let e=Rt.flatMap(e=>e.items.map(e=>({key:\`page:\${e.id}\`,label:e.label,group:\`Pages\`,tab:e.id,icon:e.icon}))),t=oh.map(e=>({key:\`sec:\${e.tab}/\${e.section}\`,label:e.label,group:\`Sections\`,tab:e.tab,section:e.section})),n=(o??[]).map(e=>({key:\`tbl:\${e}\`,label:e,group:\`Tables\`,tab:\`table\`,section:e,icon:Et}));return[...e,...t,...n]},[o]),u=n.toLowerCase().trim(),d=u?l.filter(e=>e.label.toLowerCase().includes(u)):l.slice(0,12);function f(e){z(e.tab,e.section??null),t(!1)}if(!e)return null;let p=\`\`;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(\`div\`,{className:\`fixed inset-0 z-80 bg-black/50 backdrop-blur-[2px] animate-[fade-in_.1s_ease-out]\`,onClick:()=>t(!1)}),(0,B.jsxs)(\`div\`,{className:\`fixed left-1/2 top-24 z-80 w-140 max-w-[92vw] -translate-x-1/2 overflow-hidden rounded-lg border border-input bg-popover shadow-2xl animate-[fade-in_.1s_ease-out]\`,children:[(0,B.jsxs)(\`div\`,{className:\`flex items-center gap-2.5 border-b border-border px-4\`,children:[(0,B.jsx)(_t,{size:15,className:\`shrink-0 text-muted-foreground/60\`}),(0,B.jsx)(\`input\`,{ref:c,value:n,onChange:e=>{r(e.target.value),a(0)},onKeyDown:e=>{e.key===\`ArrowDown\`?(e.preventDefault(),a(e=>Math.min(e+1,d.length-1))):e.key===\`ArrowUp\`?(e.preventDefault(),a(e=>Math.max(e-1,0))):e.key===\`Enter\`&&d[i]&&f(d[i])},placeholder:\`Jump to a page, section, or table…\`,className:\`h-11 w-full bg-transparent text-sm text-foreground placeholder:text-muted-foreground/60 focus:outline-none\`}),(0,B.jsx)(lf,{children:\`esc\`})]}),(0,B.jsxs)(\`div\`,{className:\`max-h-80 overflow-y-auto p-1.5\`,children:[d.length===0&&(0,B.jsx)(\`p\`,{className:\`px-3 py-6 text-center text-xs text-muted-foreground/60\`,children:\`No matches.\`}),d.map((e,t)=>{let n=e.group!==p;p=e.group;let r=e.icon;return(0,B.jsxs)(\`div\`,{children:[n&&(0,B.jsx)(\`p\`,{className:\`px-2.5 pb-1 pt-2 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/60\`,children:e.group}),(0,B.jsxs)(\`button\`,{onMouseEnter:()=>a(t),onClick:()=>f(e),className:\`flex w-full items-center gap-2.5 rounded-md px-2.5 py-2 text-left text-[13px] \`+(i===t?\`bg-accent text-foreground\`:\`text-foreground/80\`),children:[r&&(0,B.jsx)(r,{size:14,className:\`shrink-0 text-muted-foreground/70\`}),(0,B.jsx)(\`span\`,{className:\`min-w-0 flex-1 truncate \`+(e.group===\`Tables\`?\`font-mono\`:\`\`),children:e.label}),i===t&&(0,B.jsx)(Se,{size:12,className:\`shrink-0 text-muted-foreground/60\`})]})]},e.key)})]})]})]})}function ch(){return window.location.origin}function lh(){return\`import { createClient } from '@supabase/supabase-js'
1493
+ from pg_policies where schemaname = 'storage' and tablename = 'objects'\`),N.authConfig()]);if(e.status===\`rejected\`||!e.value.ok){let t=e.status===\`rejected\`?String(e.reason?.message??e.reason):e.value.error??\`catalog unreachable\`;throw Error(t)}let h=[],g=e=>e.status===\`fulfilled\`&&e.value.ok?e.value.rows??[]:[];for(let t of g(e))t.rls?t.policies===0&&h.push({id:\`0008:\${t.name}\`,code:\`0008\`,category:\`security\`,level:\`warning\`,title:\`RLS Enabled No Policy\`,entity:\`public.\${t.name}\`,entityKind:\`table\`,issue:(0,z.jsxs)(z.Fragment,{children:[\`Table \`,(0,z.jsxs)($,{children:[\`public.\`,t.name]}),\` has RLS enabled but no policies — anon and authenticated queries return zero rows, which usually surfaces as an app bug.\`]}),description:\`Detects tables with Row Level Security enabled but no policy granting any access.\`,action:{label:\`Create policy\`,go:()=>R(\`table\`,t.name)}}):(h.push({id:\`0013:\${t.name}\`,code:\`0013\`,category:\`security\`,level:\`critical\`,title:\`RLS Disabled in Public\`,entity:\`public.\${t.name}\`,entityKind:\`table\`,issue:(0,z.jsxs)(z.Fragment,{children:[\`Table \`,(0,z.jsxs)($,{children:[\`public.\`,t.name]}),\` is exposed through the Data API with Row Level Security disabled — anon and authenticated can read and write every row.\`]}),description:\`Detects tables in the public schema without RLS. Public-schema tables are reachable over /rest/v1, so RLS is the row-level access control.\`,action:{label:\`Enable RLS\`,go:()=>R(\`table\`,t.name)}}),t.policies>0&&h.push({id:\`0007:\${t.name}\`,code:\`0007\`,category:\`security\`,level:\`critical\`,title:\`Policy Exists RLS Disabled\`,entity:\`public.\${t.name}\`,entityKind:\`table\`,issue:(0,z.jsxs)(z.Fragment,{children:[\`Table \`,(0,z.jsxs)($,{children:[\`public.\`,t.name]}),\` has \`,t.policies,\` RLS \`,t.policies===1?\`policy\`:\`policies\`,\` but RLS itself is disabled — the policies are written but not enforced.\`]}),description:\`Detects tables where policies exist while row level security is disabled, so none of them apply.\`,action:{label:\`Enable RLS\`,go:()=>R(\`table\`,t.name)}})),t.has_pk||h.push({id:\`0004:\${t.name}\`,code:\`0004\`,category:\`performance\`,level:\`warning\`,title:\`No Primary Key\`,entity:\`public.\${t.name}\`,entityKind:\`table\`,issue:(0,z.jsxs)(z.Fragment,{children:[\`Table \`,(0,z.jsxs)($,{children:[\`public.\`,t.name]}),\` has no primary key — rows can't be uniquely addressed, so updates and deletes through the API and the table editor are disabled.\`]}),description:\`Detects tables without a primary key. Replication, upserts, and row addressing all require one.\`,action:{label:\`Open table\`,go:()=>R(\`table\`,t.name)}});for(let e of g(t))h.push({id:\`0010:\${e.name}\`,code:\`0010\`,category:\`security\`,level:\`critical\`,title:\`Security Definer View\`,entity:\`public.\${e.name}\`,entityKind:\`view\`,issue:(0,z.jsxs)(z.Fragment,{children:[\`View \`,(0,z.jsxs)($,{children:[\`public.\`,e.name]}),\` is defined with the SECURITY DEFINER property.\`]}),description:\`Detects views defined with the SECURITY DEFINER property. These views enforce Postgres permissions and row level security policies (RLS) of the view creator, rather than that of the querying user.\`,action:{label:\`Review view\`,go:()=>R(\`table\`,e.name)}});for(let e of g(r))h.push({id:\`0002:\${e.name}\`,code:\`0002\`,category:\`security\`,level:\`critical\`,title:\`Auth Users Exposed\`,entity:\`public.\${e.name}\`,entityKind:\`view\`,issue:(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)($,{children:[\`public.\`,e.name]}),\` selects from \`,(0,z.jsx)($,{children:\`auth.users\`}),\` and is exposed through the Data API — user records (emails, metadata) may leak to anon/authenticated.\`]}),description:\`Detects views or materialized views in an API-exposed schema that read auth.users.\`,action:{label:\`Review view\`,go:()=>R(\`table\`,e.name)}});for(let e of g(n))h.push({id:\`0001:\${e.name}\`,code:\`0001\`,category:\`performance\`,level:\`info\`,title:\`Unindexed foreign keys\`,entity:\`public.\${e.tbl}\`,entityKind:\`table\`,issue:(0,z.jsxs)(z.Fragment,{children:[\`Table \`,(0,z.jsxs)($,{children:[\`public.\`,e.tbl]}),\` has a foreign key \`,(0,z.jsx)($,{children:e.name}),\` on \`,(0,z.jsx)($,{children:e.col}),\` without a covering index. This can lead to suboptimal query performance.\`]}),description:\`Identifies foreign key constraints without a covering index, which can impact database performance.\`,action:{label:\`Create an index\`,go:()=>R(\`database\`,\`indexes\`)}});let _=g(i),v=new Map;for(let e of _){let t=\`\${e.qual} \${e.check}\`;if((Xm.test(t)||/current_setting\\(/i.test(t))&&!Zm.test(t)&&h.push({id:\`0003:\${e.tbl}:\${e.name}\`,code:\`0003\`,category:\`performance\`,level:\`warning\`,title:\`Auth RLS Initialization Plan\`,entity:\`public.\${e.tbl}\`,entityKind:\`table\`,issue:(0,z.jsxs)(z.Fragment,{children:[\`Policy \`,(0,z.jsx)($,{children:e.name}),\` on \`,(0,z.jsxs)($,{children:[\`public.\`,e.tbl]}),\` re-evaluates \`,(0,z.jsx)($,{children:\`auth.<function>()\`}),\` or\`,\` \`,(0,z.jsx)($,{children:\`current_setting()\`}),\` for each row. Replace \`,(0,z.jsx)($,{children:\`auth.uid()\`}),\` with \`,(0,z.jsx)($,{children:\`(select auth.uid())\`}),\` so it runs once per query.\`]}),description:\`Detects if calls to current_setting() and auth.<function>() in RLS policies are being unnecessarily re-evaluated for each row.\`,action:{label:\`View policies\`,go:()=>R(\`table\`,e.tbl)}}),/user_metadata|raw_user_meta_data/i.test(t)&&h.push({id:\`0015:\${e.tbl}:\${e.name}\`,code:\`0015\`,category:\`security\`,level:\`critical\`,title:\`RLS References User Metadata\`,entity:\`public.\${e.tbl}\`,entityKind:\`table\`,issue:(0,z.jsxs)(z.Fragment,{children:[\`Policy \`,(0,z.jsx)($,{children:e.name}),\` on \`,(0,z.jsxs)($,{children:[\`public.\`,e.tbl]}),\` references user metadata, which end users can edit about themselves — it must never gate access.\`]}),description:\`Detects RLS policies that reference user_metadata; use app_metadata or your own tables for authorization data.\`,action:{label:\`View policies\`,go:()=>R(\`table\`,e.tbl)}}),String(e.permissive).toUpperCase()===\`PERMISSIVE\`&&[\`INSERT\`,\`UPDATE\`,\`DELETE\`,\`ALL\`].includes(e.cmd?.toUpperCase())&&(e.qual.trim()===\`true\`||e.check.trim()===\`true\`)&&h.push({id:\`0024:\${e.tbl}:\${e.name}\`,code:\`0024\`,category:\`security\`,level:\`warning\`,title:\`Permissive RLS Policy\`,entity:\`public.\${e.tbl}\`,entityKind:\`table\`,issue:(0,z.jsxs)(z.Fragment,{children:[\`Policy \`,(0,z.jsx)($,{children:e.name}),\` on \`,(0,z.jsxs)($,{children:[\`public.\`,e.tbl]}),\` allows \`,e.cmd,\` with a bare \`,(0,z.jsx)($,{children:\`true\`}),\` expression — every matching role can write unconditionally.\`]}),description:\`Detects write policies whose expression is a constant true, granting unrestricted access.\`,action:{label:\`View policies\`,go:()=>R(\`table\`,e.tbl)}}),String(e.permissive).toUpperCase()===\`PERMISSIVE\`)for(let t of zt(e.roles)){let n=\`\${e.tbl}|\${e.cmd}|\${t}\`;v.set(n,(v.get(n)??0)+1)}}for(let[e,t]of v)if(t>1){let[n,r,i]=e.split(\`|\`);h.push({id:\`0006:\${e}\`,code:\`0006\`,category:\`performance\`,level:\`warning\`,title:\`Multiple Permissive Policies\`,entity:\`public.\${n}\`,entityKind:\`table\`,issue:(0,z.jsxs)(z.Fragment,{children:[\`Table \`,(0,z.jsxs)($,{children:[\`public.\`,n]}),\` has \`,t,\` permissive policies for role \`,(0,z.jsx)($,{children:i}),\` on \`,r,\` — every policy runs for every relevant query.\`]}),description:\`Detects multiple permissive policies for the same role and command, which multiplies policy evaluation cost.\`,action:{label:\`View policies\`,go:()=>R(\`table\`,n)}})}for(let e of g(a)){let t=zt(e.idxs);h.push({id:\`0009:\${e.tbl}:\${t.join(\`,\`)}\`,code:\`0009\`,category:\`performance\`,level:\`warning\`,title:\`Duplicate Index\`,entity:\`public.\${e.tbl}\`,entityKind:\`table\`,issue:(0,z.jsxs)(z.Fragment,{children:[\`Table \`,(0,z.jsxs)($,{children:[\`public.\`,e.tbl]}),\` has identical indexes: \`,(0,z.jsx)($,{children:t.join(\`, \`)}),\` — every extra copy slows writes for no read benefit.\`]}),description:\`Detects indexes with identical columns, operator classes, expressions and predicates.\`,action:{label:\`View indexes\`,go:()=>R(\`database\`,\`indexes\`)}})}for(let e of g(o))e.mutable_path&&h.push({id:\`0011:\${e.name}\`,code:\`0011\`,category:\`security\`,level:\`warning\`,title:\`Function Search Path Mutable\`,entity:\`public.\${e.name}()\`,entityKind:\`function\`,issue:(0,z.jsxs)(z.Fragment,{children:[\`Function \`,(0,z.jsxs)($,{children:[\`public.\`,e.name,\`()\`]}),\` does not pin \`,(0,z.jsx)($,{children:\`search_path\`}),\` — a caller-controlled search_path can make it resolve unexpected objects. Add \`,(0,z.jsx)($,{children:\`set search_path = ''\`}),\` (or the schemas it needs).\`]}),description:\`Detects functions without a fixed search_path configuration parameter.\`,action:{label:\`View functions\`,go:()=>R(\`database\`,\`functions\`)}}),e.secdef&&e.anon_exec&&h.push({id:\`0028:\${e.name}\`,code:\`0028\`,category:\`security\`,level:\`warning\`,title:\`Anon Can Execute SECURITY DEFINER Function\`,entity:\`public.\${e.name}()\`,entityKind:\`function\`,issue:(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)($,{children:[\`public.\`,e.name,\`()\`]}),\` runs with its owner's privileges and is executable by \`,(0,z.jsx)($,{children:\`anon\`}),\` — any unauthenticated caller inherits those rights for the duration of the call.\`]}),description:\`Detects SECURITY DEFINER functions executable by the anon role.\`,action:{label:\`View functions\`,go:()=>R(\`database\`,\`functions\`)}}),e.secdef&&e.auth_exec&&h.push({id:\`0029:\${e.name}\`,code:\`0029\`,category:\`security\`,level:\`info\`,title:\`Signed-In Users Can Execute SECURITY DEFINER Function\`,entity:\`public.\${e.name}()\`,entityKind:\`function\`,issue:(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)($,{children:[\`public.\`,e.name,\`()\`]}),\` runs with its owner's privileges and is executable by \`,(0,z.jsx)($,{children:\`authenticated\`}),\`. Often intentional (policy helpers) — keep the body minimal and pin \`,(0,z.jsx)($,{children:\`search_path\`}),\`.\`]}),description:\`Detects SECURITY DEFINER functions executable by signed-in users.\`,action:{label:\`View functions\`,go:()=>R(\`database\`,\`functions\`)}});for(let e of g(s))h.push({id:\`0014:\${e.name}\`,code:\`0014\`,category:\`security\`,level:\`warning\`,title:\`Extension in Public\`,entity:\`public.\${e.name}\`,entityKind:\`extension\`,issue:(0,z.jsxs)(z.Fragment,{children:[\`Extension \`,(0,z.jsx)($,{children:e.name}),\` is installed in the public schema. Move it to another schema (e.g.\`,\` \`,(0,z.jsx)($,{children:\`extensions\`}),\`).\`]}),description:\`Detects extensions installed in the public schema.\`,action:{label:\`Open SQL editor\`,go:()=>R(\`sql\`)}});for(let e of g(c)){let t=e.kind===\`m\`;h.push({id:\`\${t?\`0016\`:\`0017\`}:\${e.name}\`,code:t?\`0016\`:\`0017\`,category:\`security\`,level:\`critical\`,title:t?\`Materialized View in API\`:\`Foreign Table in API\`,entity:\`public.\${e.name}\`,entityKind:\`view\`,issue:(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)($,{children:[\`public.\`,e.name]}),\` is a \`,t?\`materialized view\`:\`foreign table\`,\` in an API-exposed schema —\`,\` \`,t?\`materialized views\`:\`foreign tables\`,\` do not enforce RLS, so every role can read all of it.\`]}),description:t?\`Detects materialized views in API-exposed schemas; they cannot have RLS policies.\`:\`Detects foreign tables in API-exposed schemas; they do not respect RLS.\`,action:{label:\`Open SQL editor\`,go:()=>R(\`sql\`)}})}for(let e of g(l))h.push({id:\`0018:\${e.tbl}.\${e.col}\`,code:\`0018\`,category:\`performance\`,level:\`info\`,title:\`Unsupported reg types\`,entity:\`public.\${e.tbl}\`,entityKind:\`table\`,issue:(0,z.jsxs)(z.Fragment,{children:[\`Column \`,(0,z.jsx)($,{children:e.col}),\` on \`,(0,z.jsxs)($,{children:[\`public.\`,e.tbl]}),\` uses \`,(0,z.jsx)($,{children:e.typ}),\` — reg* types store OIDs that break across dump/restore and upgrades.\`]}),description:\`Detects columns using reg* types (except regtype/regrole handled by tooling), which are not supported by backups and upgrades.\`,action:{label:\`Open table\`,go:()=>R(\`table\`,e.tbl)}});for(let e of g(u))h.push({id:\`0023:\${e.tbl}.\${e.col}\`,code:\`0023\`,category:\`security\`,level:\`info\`,title:\`Sensitive Columns Exposed\`,entity:\`public.\${e.tbl}\`,entityKind:\`table\`,issue:(0,z.jsxs)(z.Fragment,{children:[\`Column \`,(0,z.jsx)($,{children:e.col}),\` on \`,(0,z.jsxs)($,{children:[\`public.\`,e.tbl]}),\` looks like it holds a secret. Public-schema columns are selectable through the Data API — keep secrets out of exposed tables or lock them down with policies/column grants.\`]}),description:\`Heuristically detects likely-sensitive column names (password, token, api_key, …) in API-exposed tables.\`,action:{label:\`Open table\`,go:()=>R(\`table\`,e.tbl)}});for(let e of g(d))h.push({id:\`0019:\${e.name}\`,code:\`0019\`,category:\`security\`,level:\`critical\`,title:\`Insecure Queue Exposed\`,entity:\`pgmq.\${e.name}\`,entityKind:\`queue\`,issue:(0,z.jsxs)(z.Fragment,{children:[\`Queue table \`,(0,z.jsxs)($,{children:[\`pgmq.\`,e.name]}),\` is readable by anon/authenticated — queue payloads often carry internal data. Revoke those grants.\`]}),description:\`Detects pgmq queue tables granted to API roles.\`,action:{label:\`Open queues\`,go:()=>R(\`automations\`,\`queues\`)}});{let e=g(f);if(g(p).some(e=>[\`SELECT\`,\`ALL\`].includes(e.cmd?.toUpperCase())&&e.roles.some(e=>e===\`anon\`||e===\`public\`)&&!/bucket_id/.test(e.qual)))for(let t of e)h.push({id:\`0025:\${t.id}\`,code:\`0025\`,category:\`security\`,level:\`info\`,title:\`Public Bucket Allows Listing\`,entity:\`storage.\${t.id}\`,entityKind:\`storage\`,issue:(0,z.jsxs)(z.Fragment,{children:[\`Bucket \`,(0,z.jsx)($,{children:t.id}),\` is public and an anon SELECT policy on \`,(0,z.jsx)($,{children:\`storage.objects\`}),\` has no\`,\` \`,(0,z.jsx)($,{children:\`bucket_id\`}),\` filter — anyone can enumerate its file names.\`]}),description:\`Detects public buckets whose object-listing policy is not scoped, allowing enumeration of contents.\`,action:{label:\`Open bucket policies\`,go:()=>R(\`storage\`,t.id)}})}m.status===\`fulfilled\`&&m.value.settings?.anonymousUsers&&h.push({id:\`0012\`,code:\`0012\`,category:\`security\`,level:\`info\`,title:\`Auth Allow Anonymous Sign-ins\`,entity:\`Auth\`,entityKind:\`auth\`,issue:(0,z.jsxs)(z.Fragment,{children:[\`Anonymous sign-ins are enabled — anyone can mint an \`,(0,z.jsx)($,{children:\`authenticated\`}),\` session without credentials. Make sure RLS policies distinguish anonymous users where it matters.\`]}),description:\`Detects when anonymous sign-ins are enabled, since anonymous users hold the authenticated role.\`,action:{label:\`Open auth settings\`,go:()=>R(\`auth\`,\`providers\`)}});let y={critical:0,warning:1,info:2};return h.sort((e,t)=>y[e.level]-y[t.level]||e.code.localeCompare(t.code)||e.entity.localeCompare(t.entity))}var $m=null;function eh(){$m?.()}var th={critical:\`red\`,warning:\`amber\`,info:\`neutral\`},nh={table:Ot,view:Ae,function:Et,auth:Ke,storage:Be,queue:We,extension:rt};function rh({f:e}){let t=e.level===\`critical\`?\`text-destructive\`:e.level===\`warning\`?\`text-warning\`:\`text-muted-foreground/70\`;return e.category===\`security\`?(0,z.jsx)(xt,{size:15,className:t}):(0,z.jsx)(L,{size:15,className:t})}function ih(){let[e,t]=(0,_.useState)(null);return(0,_.useEffect)(()=>{let e=!0,n=()=>Qm().then(n=>{e&&t(n.some(e=>e.level===\`critical\`)?\`critical\`:n.some(e=>e.level===\`warning\`)?\`warning\`:n.length?\`info\`:null)},()=>{});n();let r=setInterval(n,3e5);return()=>{e=!1,clearInterval(r)}},[]),(0,z.jsxs)(\`button\`,{title:\`Advisor\`,onClick:eh,className:\`relative flex size-7 items-center justify-center rounded-md border border-input text-muted-foreground transition-colors hover:border-muted-foreground hover:bg-accent hover:text-foreground\`,children:[(0,z.jsx)(Je,{size:14}),e&&e!==\`info\`&&(0,z.jsx)(\`span\`,{className:\`absolute -right-0.5 -top-0.5 size-2 rounded-full ring-2 ring-card \`+(e===\`critical\`?\`bg-destructive\`:\`bg-warning\`)})]})}function ah(){let[e,t]=(0,_.useState)(!1);return(0,_.useEffect)(()=>($m=()=>t(!0),()=>{$m=null}),[]),e?(0,z.jsx)(oh,{onClose:()=>t(!1)}):null}function oh({onClose:e}){let[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(\`all\`),[s,c]=(0,_.useState)(\`\`),[l,u]=(0,_.useState)(null),d=(0,_.useCallback)(()=>{Qm().then(e=>{i(null),n(e)},e=>{i(e?.message??\`Advisor could not read the catalog\`),n([])})},[]);(0,_.useEffect)(()=>{d()},[d]);let f=(t??[]).filter(e=>(a===\`all\`||e.category===a)&&(!s||e.level===s));return(0,z.jsx)(qp,{open:!0,onClose:e,flush:!0,hideHeader:!0,width:\`w-135\`,title:\`Advisor\`,children:(0,z.jsxs)(\`div\`,{className:\`flex h-full flex-col\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex h-14 shrink-0 items-center gap-2.5 border-b border-border px-4\`,children:[l?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(\`button\`,{className:\`rounded p-1 text-muted-foreground/80 hover:bg-accent hover:text-foreground\`,onClick:()=>u(null),children:(0,z.jsx)(he,{size:16})}),(0,z.jsxs)(\`div\`,{className:\`min-w-0 flex-1\`,children:[(0,z.jsx)(\`p\`,{className:\`truncate text-[14px] font-medium text-foreground\`,children:l.title}),(0,z.jsx)(\`p\`,{className:\`truncate font-mono text-[11px] text-muted-foreground/70\`,children:l.entity})]}),(0,z.jsx)(\`span\`,{className:\`font-mono text-[10px] text-muted-foreground/50\`,children:l.code}),(0,z.jsx)(B,{variant:th[l.level],children:l.level.toUpperCase()})]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Je,{size:15,className:\`text-muted-foreground\`}),(0,z.jsx)(\`p\`,{className:\`flex-1 text-[14px] font-medium text-foreground\`,children:\`Advisor\`})]}),(0,z.jsx)(Kp,{asChild:!0,children:(0,z.jsx)(\`button\`,{className:\`rounded p-1 text-muted-foreground/80 hover:bg-accent hover:text-foreground\`,children:\`✕\`})})]}),l?(0,z.jsxs)(\`div\`,{className:\`min-h-0 flex-1 space-y-5 overflow-y-auto p-5\`,children:[(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(\`p\`,{className:\`mb-1.5 text-[13px] font-semibold text-foreground\`,children:\`Entity\`}),(0,z.jsxs)(\`span\`,{className:\`inline-flex items-center gap-1.5 rounded-md border border-border bg-card px-2.5 py-1.5 font-mono text-[12px] text-foreground/90\`,children:[(()=>{let e=nh[l.entityKind];return(0,z.jsx)(e,{size:12,className:\`text-muted-foreground\`})})(),l.entity]})]}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(\`p\`,{className:\`mb-1.5 text-[13px] font-semibold text-foreground\`,children:\`Issue\`}),(0,z.jsx)(\`p\`,{className:\`text-[13px] leading-relaxed text-muted-foreground\`,children:l.issue})]}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(\`p\`,{className:\`mb-1.5 text-[13px] font-semibold text-foreground\`,children:\`Description\`}),(0,z.jsx)(\`p\`,{className:\`text-[13px] leading-relaxed text-muted-foreground\`,children:l.description})]}),(0,z.jsxs)(\`div\`,{children:[(0,z.jsx)(\`p\`,{className:\`mb-1.5 text-[13px] font-semibold text-foreground\`,children:\`Resolve\`}),(0,z.jsx)(V,{variant:\`outline\`,onClick:()=>{l.action.go(),e()},children:l.action.label})]})]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(\`div\`,{className:\`flex shrink-0 items-center gap-3 border-b border-border px-4 pt-1.5\`,children:[(0,z.jsx)($p,{tabs:[{id:\`all\`,label:\`All\`},{id:\`security\`,label:\`Security\`},{id:\`performance\`,label:\`Performance\`}],active:a,onSelect:e=>o(e)}),(0,z.jsx)(\`div\`,{className:\`ml-auto pb-1.5\`,children:(0,z.jsx)(Wp,{size:\`xs\`,className:\`w-28 shrink-0\`,value:s,onValueChange:e=>c(e),options:[{value:\`\`,label:\`Severity\`},{value:\`critical\`,label:\`Critical\`},{value:\`warning\`,label:\`Warning\`},{value:\`info\`,label:\`Info\`}]})})]}),(0,z.jsx)(\`div\`,{className:\`min-h-0 flex-1 overflow-y-auto\`,children:r?(0,z.jsx)(ff,{message:r}):t===null?(0,z.jsx)(\`div\`,{className:\`p-5\`,children:(0,z.jsx)(Jp,{})}):f.length===0?(0,z.jsx)(\`p\`,{className:\`px-5 py-10 text-center text-[13px] text-muted-foreground/70\`,children:t.length===0?\`No advisor findings — everything looks healthy.\`:\`Nothing matches the filters.\`}):f.map(e=>(0,z.jsxs)(\`button\`,{className:\`flex w-full items-center gap-3 border-b border-border/60 px-4 py-3 text-left transition-colors hover:bg-accent/40\`,onClick:()=>u(e),children:[(0,z.jsx)(rh,{f:e}),(0,z.jsxs)(\`span\`,{className:\`min-w-0 flex-1\`,children:[(0,z.jsx)(\`span\`,{className:\`block truncate text-[13px] font-medium text-foreground\`,children:e.title}),(0,z.jsx)(\`span\`,{className:\`block truncate font-mono text-[11px] text-muted-foreground/70\`,children:e.entity})]}),e.level===\`critical\`&&(0,z.jsx)(B,{variant:\`red\`,children:\`CRITICAL\`}),(0,z.jsx)(ge,{size:14,className:\`shrink-0 text-muted-foreground/50\`})]},e.id))})]})]})})}var sh=[{tab:\`database\`,section:\`visualizer\`,label:\`Database · Schema Visualizer\`},{tab:\`database\`,section:\`tables\`,label:\`Database · Tables\`},{tab:\`database\`,section:\`functions\`,label:\`Database · Functions\`},{tab:\`database\`,section:\`triggers\`,label:\`Database · Triggers\`},{tab:\`database\`,section:\`policies\`,label:\`Database · Policies\`},{tab:\`database\`,section:\`enums\`,label:\`Database · Enumerated Types\`},{tab:\`database\`,section:\`indexes\`,label:\`Database · Indexes\`},{tab:\`database\`,section:\`roles\`,label:\`Database · Roles\`},{tab:\`database\`,section:\`migrations\`,label:\`Database · Migrations\`},{tab:\`auth\`,section:\`users\`,label:\`Authentication · Users\`},{tab:\`auth\`,section:\`providers\`,label:\`Authentication · Providers\`},{tab:\`functions\`,section:\`secrets\`,label:\`Edge Functions · Secrets\`},{tab:\`functions\`,section:\`settings\`,label:\`Edge Functions · Settings\`},{tab:\`realtime\`,section:\`inspector\`,label:\`Realtime · Inspector\`},{tab:\`realtime\`,section:\`policies\`,label:\`Realtime · Policies\`},{tab:\`realtime\`,section:\`settings\`,label:\`Realtime · Settings\`},{tab:\`automations\`,section:\`cron\`,label:\`Automations · Cron\`},{tab:\`automations\`,section:\`queues\`,label:\`Automations · Queues\`},{tab:\`automations\`,section:\`webhooks\`,label:\`Automations · Webhooks\`},{tab:\`settings\`,section:\`general\`,label:\`Settings · General\`},{tab:\`settings\`,section:\`api-keys\`,label:\`Settings · API Keys\`}];function ch(){let[e,t]=(0,_.useState)(!1),[n,r]=(0,_.useState)(\`\`),[i,a]=(0,_.useState)(0),[o,s]=(0,_.useState)(null),c=(0,_.useRef)(null);(0,_.useEffect)(()=>{let e=e=>{(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===\`k\`&&(e.preventDefault(),t(e=>!e)),e.key===\`Escape\`&&t(!1)};return window.addEventListener(\`keydown\`,e),()=>window.removeEventListener(\`keydown\`,e)},[]),(0,_.useEffect)(()=>{if(!e){r(\`\`),a(0);return}c.current?.focus(),o===null&&N.tables().then(e=>s(e.map(e=>e.name)),()=>s([]))},[e,o]);let l=(0,_.useMemo)(()=>{let e=Bt.flatMap(e=>e.items.map(e=>({key:\`page:\${e.id}\`,label:e.label,group:\`Pages\`,tab:e.id,icon:e.icon}))),t=sh.map(e=>({key:\`sec:\${e.tab}/\${e.section}\`,label:e.label,group:\`Sections\`,tab:e.tab,section:e.section})),n=(o??[]).map(e=>({key:\`tbl:\${e}\`,label:e,group:\`Tables\`,tab:\`table\`,section:e,icon:Ot}));return[...e,...t,...n]},[o]),u=n.toLowerCase().trim(),d=u?l.filter(e=>e.label.toLowerCase().includes(u)):l.slice(0,12);function f(e){R(e.tab,e.section??null),t(!1)}if(!e)return null;let p=\`\`;return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(\`div\`,{className:\`fixed inset-0 z-80 bg-black/50 backdrop-blur-[2px] animate-[fade-in_.1s_ease-out]\`,onClick:()=>t(!1)}),(0,z.jsxs)(\`div\`,{className:\`fixed left-1/2 top-24 z-80 w-140 max-w-[92vw] -translate-x-1/2 overflow-hidden rounded-lg border border-input bg-popover shadow-2xl animate-[fade-in_.1s_ease-out]\`,children:[(0,z.jsxs)(\`div\`,{className:\`flex items-center gap-2.5 border-b border-border px-4\`,children:[(0,z.jsx)(vt,{size:15,className:\`shrink-0 text-muted-foreground/60\`}),(0,z.jsx)(\`input\`,{ref:c,value:n,onChange:e=>{r(e.target.value),a(0)},onKeyDown:e=>{e.key===\`ArrowDown\`?(e.preventDefault(),a(e=>Math.min(e+1,d.length-1))):e.key===\`ArrowUp\`?(e.preventDefault(),a(e=>Math.max(e-1,0))):e.key===\`Enter\`&&d[i]&&f(d[i])},placeholder:\`Jump to a page, section, or table…\`,className:\`h-11 w-full bg-transparent text-sm text-foreground placeholder:text-muted-foreground/60 focus:outline-none\`}),(0,z.jsx)(uf,{children:\`esc\`})]}),(0,z.jsxs)(\`div\`,{className:\`max-h-80 overflow-y-auto p-1.5\`,children:[d.length===0&&(0,z.jsx)(\`p\`,{className:\`px-3 py-6 text-center text-xs text-muted-foreground/60\`,children:\`No matches.\`}),d.map((e,t)=>{let n=e.group!==p;p=e.group;let r=e.icon;return(0,z.jsxs)(\`div\`,{children:[n&&(0,z.jsx)(\`p\`,{className:\`px-2.5 pb-1 pt-2 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/60\`,children:e.group}),(0,z.jsxs)(\`button\`,{onMouseEnter:()=>a(t),onClick:()=>f(e),className:\`flex w-full items-center gap-2.5 rounded-md px-2.5 py-2 text-left text-[13px] \`+(i===t?\`bg-accent text-foreground\`:\`text-foreground/80\`),children:[r&&(0,z.jsx)(r,{size:14,className:\`shrink-0 text-muted-foreground/70\`}),(0,z.jsx)(\`span\`,{className:\`min-w-0 flex-1 truncate \`+(e.group===\`Tables\`?\`font-mono\`:\`\`),children:e.label}),i===t&&(0,z.jsx)(Ce,{size:12,className:\`shrink-0 text-muted-foreground/60\`})]})]},e.key)})]})]})]})}function lh(){return window.location.origin}function uh(){return\`import { createClient } from '@supabase/supabase-js'
1494
1494
  import { createBackend, createPgmemEngine } from 'tinbase'
1495
1495
 
1496
1496
  // a whole backend — in memory, inside the page
@@ -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 uh({size:e=24}){let t=(0,_.useId)(),n=\`\${t}-body\`,r=\`\${t}-lid\`;return(0,B.jsxs)(\`svg\`,{width:e,height:e,viewBox:\`0 0 120 120\`,fill:\`none\`,xmlns:\`http://www.w3.org/2000/svg\`,children:[(0,B.jsxs)(\`defs\`,{children:[(0,B.jsxs)(\`linearGradient\`,{id:n,x1:\`30\`,y1:\`30\`,x2:\`92\`,y2:\`102\`,gradientUnits:\`userSpaceOnUse\`,children:[(0,B.jsx)(\`stop\`,{stopColor:\`#10b981\`}),(0,B.jsx)(\`stop\`,{offset:\`1\`,stopColor:\`#047857\`})]}),(0,B.jsxs)(\`linearGradient\`,{id:r,x1:\`26\`,y1:\`19\`,x2:\`94\`,y2:\`49\`,gradientUnits:\`userSpaceOnUse\`,children:[(0,B.jsx)(\`stop\`,{stopColor:\`#6ee7b7\`}),(0,B.jsx)(\`stop\`,{offset:\`1\`,stopColor:\`#34d399\`})]})]}),(0,B.jsx)(\`path\`,{d:\`M26 34v52c0 8.4 15.2 15.2 34 15.2s34-6.8 34-15.2V34Z\`,fill:\`url(#\${n})\`}),(0,B.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,B.jsx)(\`ellipse\`,{cx:\`60\`,cy:\`34\`,rx:\`34\`,ry:\`15\`,fill:\`url(#\${r})\`}),(0,B.jsx)(\`ellipse\`,{cx:\`60\`,cy:\`34\`,rx:\`25\`,ry:\`10\`,fill:\`none\`,stroke:\`#059669\`,strokeOpacity:\`0.5\`,strokeWidth:\`2.5\`})]})}function dh({onLogout:e}){let[t,n]=(0,_.useState)(!1),r=ch(),i=Zn(r,\`API URL\`);return(0,B.jsxs)(\`header\`,{className:\`flex h-12 shrink-0 items-center gap-2 border-b border-border bg-card px-3\`,children:[(0,B.jsxs)(\`div\`,{className:\`flex items-center gap-2 pl-1\`,children:[(0,B.jsx)(uh,{size:22}),(0,B.jsx)(\`span\`,{className:\`text-[13px] font-semibold text-foreground\`,children:\`tinbase\`}),(0,B.jsx)(V,{variant:\`outline\`,children:\`studio\`})]}),(0,B.jsx)(\`span\`,{className:\`text-muted-foreground\`,children:\`/\`}),(0,B.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,B.jsx)(fe,{size:11,className:\`text-brand\`}):(0,B.jsx)(xe,{size:11,className:\`opacity-0 transition-opacity group-hover:opacity-100\`})]}),(0,B.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-1.5\`,children:[(0,B.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,B.jsx)(_t,{size:12}),\`Search…\`,(0,B.jsx)(lf,{children:\`⌘K\`})]}),(0,B.jsxs)(H,{size:\`xs\`,className:\`h-7\`,onClick:()=>n(!0),children:[(0,B.jsx)(ft,{size:12}),\` Connect\`]}),(0,B.jsx)(rh,{}),(0,B.jsx)(H,{variant:\`outline\`,size:\`icon\`,className:\`size-7\`,title:\`Log out\`,onClick:e,children:(0,B.jsx)(Qe,{size:13})})]}),(0,B.jsx)(fh,{open:t,onClose:()=>n(!1)})]})}function fh({open:e,onClose:t}){let n=ch(),r=x(),[i,a]=(0,_.useState)(\`\`);return(0,_.useEffect)(()=>{e&&N.keys().then(e=>a(e.anonKey??\`\`),()=>a(\`\`))},[e]),(0,B.jsx)(ho,{open:e,onClose:t,title:\`Connect to tinbase\`,wide:!0,children:(0,B.jsxs)(\`div\`,{className:\`space-y-4\`,children:[(0,B.jsxs)(\`p\`,{className:\`text-xs text-muted-foreground/80\`,children:[\`tinbase is a\`,\` \`,(0,B.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,B.jsx)(\`span\`,{className:\`text-foreground/80\`,children:\`supabase-js\`}),\` SDK connects unchanged.\`]}),(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(X,{children:\`API URL\`}),(0,B.jsxs)(\`div\`,{className:\`flex items-center gap-2\`,children:[(0,B.jsx)(Y,{mono:!0,readOnly:!0,value:n}),(0,B.jsx)(Qn,{value:n,label:\`API URL\`,variant:\`outline\`,size:\`icon\`,iconSize:13})]})]}),(0,B.jsx)(uf,{label:\`anon key\`,hint:\`safe for browsers — RLS applies\`,value:i}),(0,B.jsx)(uf,{label:\`service_role key\`,hint:\`server-side only — bypasses RLS\`,value:r,danger:!0}),(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(X,{children:\`Get Started\`}),(0,B.jsx)(tr,{code:lh(),lang:\`js\`})]})]})})}function ph({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,B.jsx)(\`div\`,{className:\`flex h-full items-center justify-center\`,children:(0,B.jsxs)(\`div\`,{className:\`w-[400px] text-center\`,children:[(0,B.jsx)(\`div\`,{className:\`mb-4 flex justify-center\`,children:(0,B.jsx)(uh,{size:48})}),(0,B.jsx)(\`h1\`,{className:\`text-lg font-semibold\`,children:\`tinbase studio\`}),(0,B.jsxs)(\`p\`,{className:\`mt-1 text-[13px] text-muted-foreground/80\`,children:[\`Sign in with the \`,(0,B.jsx)(\`span\`,{className:\`text-foreground/80\`,children:\`service_role\`}),\` key printed when tinbase started.\`]}),(0,B.jsxs)(\`div\`,{className:\`mt-5 space-y-3 text-left\`,children:[(0,B.jsx)(Y,{type:\`password\`,placeholder:\`service_role key (eyJ…)\`,value:t,onChange:e=>n(e.target.value),onKeyDown:e=>e.key===\`Enter\`&&s()}),(0,B.jsx)(H,{className:\`w-full\`,onClick:s,disabled:a||!t.trim(),children:a?\`Checking…\`:\`Continue\`}),r&&(0,B.jsx)(\`p\`,{className:\`text-xs text-destructive\`,children:r})]})]})})}var mh=52,hh=224,gh=[{id:\`expanded\`,label:\`Expanded\`},{id:\`collapsed\`,label:\`Collapsed\`},{id:\`hover\`,label:\`Expand on hover\`}];function _h({tab:e,onTab:t}){let[n,r]=mn(),[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,B.jsx)(\`aside\`,{className:\`relative shrink-0 transition-[width] duration-200 ease-[cubic-bezier(0.16,1,0.3,1)]\`,style:{width:n===\`expanded\`?hh:mh},children:(0,B.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?hh:mh},children:[(0,B.jsx)(\`nav\`,{className:\`flex-1 overflow-y-auto overflow-x-hidden py-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden\`,children:Rt.map((n,r)=>(0,B.jsxs)(\`div\`,{children:[n.title&&(0,B.jsx)(vh,{title:n.title,expanded:u}),n.items.map(n=>(0,B.jsx)(yh,{icon:n.icon,label:n.label,active:e===n.id,expanded:u,onClick:()=>t(n.id)},n.id))]},r))}),(0,B.jsx)(\`div\`,{className:\`shrink-0 border-t border-border py-2\`,children:(0,B.jsxs)(Zd,{open:o,onOpenChange:s,children:[(0,B.jsx)(Qd,{asChild:!0,children:(0,B.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,B.jsx)(\`span\`,{className:\`flex w-10 shrink-0 items-center justify-center\`,children:u?(0,B.jsx)(rt,{size:16}):(0,B.jsx)(it,{size:16})}),(0,B.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,B.jsxs)(tf,{align:\`start\`,className:\`w-48\`,children:[(0,B.jsx)(sf,{children:\`Sidebar control\`}),gh.map(e=>(0,B.jsxs)(nf,{onSelect:()=>f(e.id),children:[(0,B.jsx)(\`span\`,{className:\`size-1.5 shrink-0 rounded-full \`+(n===e.id?\`bg-foreground\`:\`bg-transparent\`)}),e.label]},e.id))]})]})})]})})}function vh({title:e,expanded:t}){return(0,B.jsxs)(\`div\`,{className:\`relative mx-3 mb-1 mt-3 flex h-4 items-center\`,children:[(0,B.jsx)(\`div\`,{className:\`h-px w-full bg-accent transition-opacity duration-200 \`+(t?\`opacity-0\`:\`opacity-100\`)}),(0,B.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 yh({icon:e,label:t,active:n,expanded:r,onClick:i}){return(0,B.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,B.jsx)(\`span\`,{className:\`flex w-10 shrink-0 items-center justify-center\`,children:(0,B.jsx)(e,{size:16,className:n?\`text-brand\`:\`\`})}),(0,B.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 bh({title:e,children:t}){return(0,B.jsxs)(\`div\`,{className:\`mx-auto max-w-4xl px-10 py-8\`,children:[(0,B.jsx)(\`h1\`,{className:\`border-b border-border pb-4 text-xl font-semibold text-foreground\`,children:e}),t]})}function xh({title:e,description:t,children:n}){return(0,B.jsxs)(\`div\`,{className:\`border-b border-border pb-2 last:border-0\`,children:[(0,B.jsxs)(\`div\`,{className:\`pb-1 pt-6 first:pt-0\`,children:[(0,B.jsx)(\`h2\`,{className:\`text-[15px] font-semibold text-foreground\`,children:e}),t&&(0,B.jsx)(\`p\`,{className:\`mt-0.5 text-[13px] text-muted-foreground/80\`,children:t})]}),(0,B.jsx)(\`div\`,{className:\`divide-y divide-border/70\`,children:n})]})}function Sh({label:e,description:t,children:n,wide:r}){return(0,B.jsxs)(\`div\`,{className:\`flex flex-col gap-4 py-6 sm:flex-row sm:items-start sm:gap-10\`,children:[(0,B.jsxs)(\`div\`,{className:\`w-64 shrink-0\`,children:[(0,B.jsx)(\`p\`,{className:\`text-[13px] font-medium text-foreground\`,children:e}),t&&(0,B.jsx)(\`p\`,{className:\`mt-1 text-xs leading-relaxed text-muted-foreground/80\`,children:t})]}),(0,B.jsx)(\`div\`,{className:\`min-w-0 flex-1 \`+(r?\`\`:\`max-w-md\`),children:n})]})}function Ch({label:e,value:t}){return(0,B.jsxs)(\`div\`,{className:\`flex items-center justify-between gap-6 py-1.5 text-[13px]\`,children:[(0,B.jsx)(\`span\`,{className:\`text-muted-foreground\`,children:e}),(0,B.jsx)(\`span\`,{className:\`text-right font-mono text-foreground/90\`,children:t})]})}function wh({title:e,groups:t,active:n,onSelect:r,footer:i}){return(0,B.jsxs)(mf,{id:\`sub-nav\`,side:\`left\`,defaultSize:224,min:176,max:340,className:\`flex flex-col border-r border-border bg-card\`,children:[(0,B.jsx)(\`div\`,{className:\`px-4 pb-1 pt-4 text-sm font-semibold text-foreground\`,children:e}),(0,B.jsx)(\`nav\`,{className:\`min-h-0 flex-1 overflow-y-auto px-2 pb-3\`,children:t.map((e,t)=>(0,B.jsxs)(\`div\`,{className:\`pt-3 first:pt-2\`,children:[e.title&&(0,B.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,B.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,B.jsx)(\`span\`,{className:\`min-w-0 flex-1 truncate\`,children:e.label}),e.badge]},e.id))]},t))}),i&&(0,B.jsx)(\`div\`,{className:\`shrink-0 border-t border-border p-3\`,children:i})]})}function Th(){let[e,t]=(0,_.useState)(null);if((0,_.useEffect)(()=>{N.authConfig().then(t,()=>t({providers:[],inbox:!1,settings:null}))},[]),e===null)return(0,B.jsx)(qp,{});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}),U.error(e.message)}}return(0,B.jsx)(\`div\`,{className:\`h-full overflow-y-auto\`,children:(0,B.jsxs)(\`div\`,{className:\`mx-auto max-w-3xl px-8 py-8\`,children:[(0,B.jsx)(\`h1\`,{className:\`text-lg font-semibold text-foreground\`,children:\`Sign In / Providers\`}),(0,B.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,B.jsx)(\`h2\`,{className:\`mb-2 mt-7 text-sm font-medium text-foreground\`,children:\`User signups\`}),(0,B.jsxs)(\`div\`,{className:\`divide-y divide-border rounded-md border border-border bg-card\`,children:[(0,B.jsx)(Eh,{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,B.jsx)(Jp,{checked:n?!n.disableSignup:!0,onChange:e=>void r({disableSignup:!e}),disabled:!n})}),(0,B.jsx)(Eh,{title:\`Allow anonymous sign-ins\`,description:\`Enable signInAnonymously() — temporary users without credentials.\`,children:(0,B.jsx)(Jp,{checked:n?.anonymousUsers??!0,onChange:e=>void r({anonymousUsers:e}),disabled:!n})}),(0,B.jsx)(Eh,{title:\`Confirm email\`,description:\`Require users to verify their email address (via the emailed link or code) before they can sign in.\`,children:(0,B.jsx)(Jp,{checked:n?!n.autoconfirm:!1,onChange:e=>void r({autoconfirm:!e}),disabled:!n})}),(0,B.jsx)(Eh,{title:\`Minimum password length\`,description:\`Passwords shorter than this are rejected on signup and password change (4–72).\`,children:(0,B.jsx)(Oh,{value:n?.minPasswordLength??6,disabled:!n,onSave:e=>void r({minPasswordLength:e})})})]}),(0,B.jsx)(\`h2\`,{className:\`mb-2 mt-8 text-sm font-medium text-foreground\`,children:\`Auth methods\`}),(0,B.jsxs)(\`div\`,{className:\`divide-y divide-border rounded-md border border-border bg-card\`,children:[(0,B.jsx)(Dh,{icon:$e,name:\`Email\`,description:\`Email/password, OTP codes, magic links, and password recovery.\`,children:(0,B.jsx)(V,{variant:\`brand\`,children:\`Enabled\`})}),(0,B.jsx)(Dh,{icon:Ge,name:\`PKCE flows\`,description:\`OAuth and magic links support the PKCE flow out of the box.\`,children:(0,B.jsx)(V,{variant:\`brand\`,children:\`Enabled\`})}),(0,B.jsx)(Dh,{icon:jt,name:\`Anonymous\`,description:\`Temporary users without credentials — controlled by the toggle above.\`,children:n?.anonymousUsers===!1?(0,B.jsx)(V,{variant:\`neutral\`,children:\`Disabled\`}):(0,B.jsx)(V,{variant:\`brand\`,children:\`Enabled\`})})]}),(0,B.jsx)(\`h2\`,{className:\`mb-2 mt-8 text-sm font-medium text-foreground\`,children:\`OAuth providers\`}),e.providers.length>0?(0,B.jsx)(\`div\`,{className:\`divide-y divide-border rounded-md border border-border bg-card\`,children:e.providers.map(e=>(0,B.jsx)(Dh,{icon:Re,name:e,description:\`signInWithOAuth() with identity linking.\`,oauth:!0,children:(0,B.jsx)(Jp,{checked:!n?.disabledProviders.includes(e),disabled:!n,onChange:t=>{n&&r({disabledProviders:t?n.disabledProviders.filter(t=>t!==e):[...n.disabledProviders,e]})}})},e))}):(0,B.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,B.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`supabase/config.toml\`}),\` and restart — they appear here with a toggle.\`]}),(0,B.jsx)(\`h2\`,{className:\`mb-2 mt-8 text-sm font-medium text-foreground\`,children:\`Email delivery\`}),(0,B.jsxs)(\`div\`,{className:\`flex items-center gap-3 rounded-md border border-border bg-card p-4\`,children:[(0,B.jsx)(Ue,{size:16,className:\`shrink-0 text-muted-foreground\`}),(0,B.jsxs)(\`div\`,{className:\`min-w-0 flex-1\`,children:[(0,B.jsxs)(\`p\`,{className:\`text-[13px] text-foreground\`,children:[e.inbox?\`Local dev inbox\`:\`Custom mailer\`,\` \`,e.inbox&&(0,B.jsx)(V,{variant:\`brand\`,children:\`active\`})]}),(0,B.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,B.jsxs)(\`a\`,{href:\`\${ch()}/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,B.jsx)(De,{size:11})]})]}),n===null&&(0,B.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 Eh({title:e,description:t,children:n}){return(0,B.jsxs)(\`div\`,{className:\`flex items-center gap-4 p-4\`,children:[(0,B.jsxs)(\`div\`,{className:\`min-w-0 flex-1\`,children:[(0,B.jsx)(\`p\`,{className:\`text-[13px] text-foreground\`,children:e}),(0,B.jsx)(\`p\`,{className:\`mt-0.5 text-[11px] leading-relaxed text-muted-foreground/80\`,children:t})]}),(0,B.jsx)(\`div\`,{className:\`shrink-0\`,children:n})]})}function Dh({icon:e,name:t,description:n,oauth:r,children:i}){return(0,B.jsxs)(\`div\`,{className:\`flex items-center gap-3 p-4\`,children:[(0,B.jsx)(e,{size:16,className:\`shrink-0 text-muted-foreground\`}),(0,B.jsxs)(\`div\`,{className:\`min-w-0 flex-1\`,children:[(0,B.jsxs)(\`p\`,{className:\`flex items-center gap-2 text-[13px] capitalize text-foreground\`,children:[t,r&&(0,B.jsx)(V,{variant:\`blue\`,children:\`oauth\`})]}),(0,B.jsx)(\`p\`,{className:\`text-[11px] text-muted-foreground/80\`,children:n})]}),(0,B.jsx)(\`div\`,{className:\`shrink-0\`,children:i})]})}function Oh({value:e,disabled:t,onSave:n}){let[r,i]=(0,_.useState)(String(e));(0,_.useEffect)(()=>i(String(e)),[e]);function a(){let t=parseInt(r,10);if(!Number.isFinite(t)||t<4||t>72){i(String(e));return}t!==e&&n(t)}return(0,B.jsx)(Y,{mono:!0,className:\`w-16 text-center\`,value:r,disabled:t,onChange:e=>i(e.target.value.replace(/[^0-9]/g,\`\`)),onBlur:a,onKeyDown:e=>e.key===\`Enter\`&&e.target.blur()})}function kh({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),U.success(\`User deleted\`),n()}catch(e){U.error(e.message)}}async function u(){if(e.email)try{await N.sendMagicLink(e.email),U.success(\`Magic link sent — check /inbox in dev\`)}catch(e){U.error(e.message)}}return(0,B.jsxs)(Kp,{open:!0,onClose:t,width:\`w-[480px]\`,title:(0,B.jsxs)(\`span\`,{className:\`flex items-center gap-2\`,children:[(0,B.jsx)(\`span\`,{className:\`truncate\`,children:e.email||(e.is_anonymous?\`Anonymous user\`:e.id.slice(0,12))}),e.is_anonymous&&(0,B.jsx)(V,{variant:\`neutral\`,children:\`anon\`})]}),footer:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(H,{variant:\`danger\`,onClick:()=>c(!0),children:[(0,B.jsx)(Ot,{size:13}),\` Delete user\`]}),(0,B.jsx)(Gp,{asChild:!0,children:(0,B.jsx)(H,{variant:\`outline\`,className:\`ml-auto\`,children:\`Done\`})})]}),children:[(0,B.jsx)(Qp,{tabs:[{id:\`overview\`,label:\`Overview\`},{id:\`json\`,label:\`Raw JSON\`}],active:r,onSelect:i}),r===\`overview\`&&(0,B.jsxs)(\`div\`,{className:\`mt-4 space-y-5\`,children:[(0,B.jsx)(\`div\`,{children:[[\`User UID\`,e.id,!0],[\`Email\`,e.email??\`—\`,!1],[\`Created at\`,(0,B.jsx)(Km,{value:e.created_at}),!1],[\`Updated at\`,(0,B.jsx)(Km,{value:e.updated_at}),!1],[\`Confirmation sent at\`,(0,B.jsx)(Km,{value:e.confirmation_sent_at}),!1],[\`Confirmed at\`,(0,B.jsx)(Km,{value:e.email_confirmed_at}),!1],[\`Last signed in\`,(0,B.jsx)(Km,{value:e.last_sign_in_at}),!1]].map(([e,t,n])=>(0,B.jsxs)(\`div\`,{className:\`flex items-center justify-between gap-4 border-b border-border/60 py-2 text-[13px] last:border-0\`,children:[(0,B.jsx)(\`span\`,{className:\`shrink-0 text-muted-foreground\`,children:e}),(0,B.jsxs)(\`span\`,{className:\`flex min-w-0 items-center gap-1 font-mono text-foreground/90\`,children:[(0,B.jsx)(\`span\`,{className:\`truncate\`,children:t}),n&&(0,B.jsx)(Qn,{value:String(t),label:e,iconSize:11})]})]},e))}),(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(\`p\`,{className:\`mb-2 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/60\`,children:\`Provider information\`}),(0,B.jsxs)(\`div\`,{className:\`rounded-md border border-border bg-card p-3.5\`,children:[(0,B.jsxs)(\`div\`,{className:\`flex items-center gap-2\`,children:[(0,B.jsx)(\`span\`,{className:\`text-[13px] font-medium capitalize text-foreground\`,children:e.app_metadata?.provider??(e.is_anonymous?\`anonymous\`:\`email\`)}),(0,B.jsx)(V,{variant:\`brand\`,children:\`enabled\`})]}),(0,B.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,B.jsxs)(\`div\`,{children:[(0,B.jsx)(\`p\`,{className:\`mb-2 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/60\`,children:\`Actions\`}),(0,B.jsx)(\`div\`,{className:\`space-y-2\`,children:!e.is_anonymous&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Ah,{icon:Ge,title:\`Reset password\`,description:\`Set a new password for the user directly.\`,action:(0,B.jsx)(H,{variant:\`outline\`,size:\`xs\`,onClick:()=>o(!0),children:\`Reset password\`})}),(0,B.jsx)(Ah,{icon:$e,title:\`Send magic link\`,description:\`Send a passwordless sign-in link to the user.\`,action:(0,B.jsx)(H,{variant:\`outline\`,size:\`xs\`,onClick:()=>void u(),disabled:!e.email,children:\`Send magic link\`})})]})})]})]}),r===\`json\`&&(0,B.jsx)(\`div\`,{className:\`mt-4\`,children:(0,B.jsx)(er,{value:JSON.stringify(e,null,2),lang:\`js\`,readOnly:!0,minLines:10,maxLines:400})}),a&&(0,B.jsx)(jh,{user:e,onClose:()=>o(!1),onDone:()=>{o(!1),U.success(\`Password updated\`)}}),s&&(0,B.jsx)(go,{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 Ah({icon:e,title:t,description:n,action:r}){return(0,B.jsxs)(\`div\`,{className:\`flex items-center gap-3 rounded-md border border-border bg-card p-3.5\`,children:[(0,B.jsx)(e,{size:15,className:\`shrink-0 text-muted-foreground\`}),(0,B.jsxs)(\`div\`,{className:\`min-w-0 flex-1\`,children:[(0,B.jsx)(\`p\`,{className:\`text-[13px] text-foreground\`,children:t}),(0,B.jsx)(\`p\`,{className:\`text-[11px] text-muted-foreground/80\`,children:n})]}),r]})}function jh({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,B.jsx)(ho,{open:!0,onClose:t,title:\`Reset password · \${e.email||e.id.slice(0,8)}\`,children:(0,B.jsxs)(\`div\`,{className:\`space-y-3\`,children:[(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(X,{children:\`New password (min 6 characters)\`}),(0,B.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,B.jsx)(\`p\`,{className:\`text-xs text-destructive\`,children:a}),(0,B.jsxs)(\`div\`,{className:\`flex justify-end gap-2\`,children:[(0,B.jsx)(H,{variant:\`outline\`,onClick:t,children:\`Cancel\`}),(0,B.jsx)(H,{onClick:()=>void l(),disabled:s||r.length<6,children:s?\`Saving…\`:\`Update password\`})]})]})})}var Mh=50;function Nh(e){return e.app_metadata?.provider||(e.is_anonymous?\`anonymous\`:\`email\`)}function Ph({provider:e}){return e===\`email\`?(0,B.jsx)($e,{size:12,className:\`text-muted-foreground\`}):e===\`anonymous\`?(0,B.jsx)(jt,{size:12,className:\`text-muted-foreground\`}):(0,B.jsx)(Re,{size:12,className:\`text-muted-foreground\`})}function Fh(){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,B.jsx)(qp,{});let g=Math.max(1,Math.ceil(h.length/Mh)),v=h.slice(o*Mh,(o+1)*Mh);return(0,B.jsxs)(\`div\`,{className:\`flex h-full\`,children:[(0,B.jsxs)(\`div\`,{className:\`flex min-w-0 flex-1 flex-col\`,children:[(0,B.jsxs)(\`div\`,{className:\`flex shrink-0 items-center gap-2 border-b border-border px-4 py-2.5\`,children:[(0,B.jsx)(\`h1\`,{className:\`text-sm font-semibold text-foreground\`,children:\`Users\`}),(0,B.jsx)(V,{variant:\`neutral\`,children:e.length}),(0,B.jsxs)(\`div\`,{className:\`relative ml-2 w-64\`,children:[(0,B.jsx)(_t,{size:13,className:\`pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground/60\`}),(0,B.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,B.jsx)(Up,{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,B.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-1.5\`,children:[(0,B.jsx)(H,{variant:\`ghost\`,size:\`iconXs\`,title:\`Refresh\`,onClick:m,children:(0,B.jsx)(ht,{size:13})}),(0,B.jsxs)(Zd,{children:[(0,B.jsx)(Qd,{asChild:!0,children:(0,B.jsxs)(H,{size:\`xs\`,children:[(0,B.jsx)(pt,{size:12}),\` Add user \`,(0,B.jsx)(pe,{size:11})]})}),(0,B.jsxs)(tf,{align:\`end\`,children:[(0,B.jsxs)(nf,{onSelect:()=>d(!0),children:[(0,B.jsx)(Ge,{size:13}),\` Create with password\`]}),(0,B.jsxs)(nf,{onSelect:()=>p(!0),children:[(0,B.jsx)($e,{size:13}),\` Invite via magic link\`]})]})]})]})]}),(0,B.jsxs)(\`div\`,{className:\`min-h-0 flex-1 overflow-auto\`,children:[(0,B.jsxs)(Yp,{children:[(0,B.jsx)(Xp,{children:(0,B.jsxs)(\`tr\`,{children:[(0,B.jsx)(Z,{children:\`Email\`}),(0,B.jsx)(Z,{children:\`UID\`}),(0,B.jsx)(Z,{children:\`Provider\`}),(0,B.jsx)(Z,{children:\`Created\`}),(0,B.jsx)(Z,{children:\`Last sign in\`})]})}),(0,B.jsx)(\`tbody\`,{children:v.map(e=>{let t=Nh(e);return(0,B.jsxs)(Zp,{className:\`cursor-pointer\`,onClick:()=>l(e),children:[(0,B.jsx)(Q,{className:\`text-foreground/90\`,children:(0,B.jsxs)(\`span\`,{className:\`flex items-center gap-2\`,children:[e.email||(0,B.jsx)(\`span\`,{className:\`italic text-muted-foreground/60\`,children:e.is_anonymous?\`anonymous\`:\`—\`}),e.is_anonymous&&(0,B.jsx)(V,{variant:\`neutral\`,children:\`anon\`}),e.email&&!e.email_confirmed_at&&(0,B.jsx)(V,{variant:\`amber\`,children:\`unverified\`})]})}),(0,B.jsxs)(Q,{className:\`font-mono text-[11px] text-muted-foreground/80\`,children:[e.id.slice(0,8),\`…\`]}),(0,B.jsx)(Q,{children:(0,B.jsxs)(\`span\`,{className:\`flex items-center gap-1.5 text-muted-foreground\`,children:[(0,B.jsx)(Ph,{provider:t}),t]})}),(0,B.jsx)(Q,{className:\`text-muted-foreground\`,children:(0,B.jsx)(Km,{value:e.created_at,format:\`date\`})}),(0,B.jsx)(Q,{className:\`text-muted-foreground\`,children:(0,B.jsx)(Km,{value:e.last_sign_in_at})})]},e.id)})})]}),v.length===0&&(0,B.jsx)(cf,{children:e.length===0?\`No users yet — add one or invite via magic link.\`:\`No match.\`})]}),(0,B.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,B.jsxs)(\`span\`,{children:[h.length.toLocaleString(),\` user\`,h.length===1?\`\`:\`s\`]}),g>1&&(0,B.jsxs)(\`span\`,{className:\`ml-auto flex items-center gap-2\`,children:[(0,B.jsx)(H,{variant:\`ghost\`,size:\`xs\`,disabled:o===0,onClick:()=>s(e=>e-1),children:\`Prev\`}),\`Page \`,o+1,\` of \`,g,(0,B.jsx)(H,{variant:\`ghost\`,size:\`xs\`,disabled:o+1>=g,onClick:()=>s(e=>e+1),children:\`Next\`})]})]})]}),c&&(0,B.jsx)(kh,{user:c,onClose:()=>l(null),onChanged:()=>{m(),l(null)}}),u&&(0,B.jsx)(Ih,{onClose:()=>d(!1),onDone:()=>{d(!1),m()}}),f&&(0,B.jsx)(Lh,{onClose:()=>p(!1),onDone:()=>{p(!1),m()}})]})}function Ih({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}),U.success(\`Created \${n}\`),t()}catch(e){s(e.message),l(!1)}}return(0,B.jsx)(ho,{open:!0,onClose:e,title:\`Create user\`,children:(0,B.jsxs)(\`div\`,{className:\`space-y-3\`,children:[(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(X,{children:\`Email\`}),(0,B.jsx)(Y,{value:n,autoFocus:!0,placeholder:\`user@example.com\`,onChange:e=>r(e.target.value)})]}),(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(X,{children:\`Password (optional — leave empty for passwordless)\`}),(0,B.jsx)(Y,{type:\`password\`,value:i,onChange:e=>a(e.target.value)})]}),o&&(0,B.jsx)(\`p\`,{className:\`text-xs text-destructive\`,children:o}),(0,B.jsxs)(\`div\`,{className:\`flex justify-end gap-2\`,children:[(0,B.jsx)(H,{variant:\`outline\`,onClick:e,children:\`Cancel\`}),(0,B.jsx)(H,{onClick:()=>void u(),disabled:c||!n.includes(\`@\`),children:c?\`Creating…\`:\`Create user\`})]})]})})}function Lh({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),U.success(\`Magic link sent to \${n} — check /inbox in dev\`),t()}catch(e){a(e.message),s(!1)}}return(0,B.jsx)(ho,{open:!0,onClose:e,title:\`Invite via magic link\`,children:(0,B.jsxs)(\`div\`,{className:\`space-y-3\`,children:[(0,B.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,B.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`/inbox\`}),\`.\`]}),(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(X,{children:\`Email\`}),(0,B.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,B.jsx)(\`p\`,{className:\`text-xs text-destructive\`,children:i}),(0,B.jsxs)(\`div\`,{className:\`flex justify-end gap-2\`,children:[(0,B.jsx)(H,{variant:\`outline\`,onClick:e,children:\`Cancel\`}),(0,B.jsx)(H,{onClick:()=>void c(),disabled:o||!n.includes(\`@\`),children:o?\`Sending…\`:\`Send invite\`})]})]})})}var Rh=[{id:\`users\`,label:\`Users\`,group:\`Manage\`,component:Fh},{id:\`providers\`,label:\`Sign In / Providers\`,group:\`Configuration\`,component:Th}];function zh(){let{section:e}=qt(),t=Rh.some(t=>t.id===e)?e:\`users\`,n=Rh.find(e=>e.id===t).component;return(0,B.jsxs)(\`div\`,{className:\`flex h-full\`,children:[(0,B.jsx)(wh,{title:\`Authentication\`,active:t,onSelect:e=>z(\`auth\`,e),groups:[{title:\`Manage\`,items:[{id:\`users\`,label:\`Users\`}]},{title:\`Configuration\`,items:[{id:\`providers\`,label:\`Sign In / Providers\`}]}]}),(0,B.jsx)(\`div\`,{className:\`min-w-0 flex-1 overflow-hidden\`,children:(0,B.jsx)(n,{})})]})}var Bh=\`tinbase_db_schema\`,Vh=localStorage.getItem(Bh)||\`public\`,Hh=new Set;function Uh(){return[(0,_.useSyncExternalStore)(e=>(Hh.add(e),()=>Hh.delete(e)),()=>Vh),Wh]}function Wh(e){Vh=e,localStorage.setItem(Bh,e),Hh.forEach(e=>e())}function Gh(e,t){let n=e=>\`"\`+e.replace(/"/g,\`""\`)+\`"\`;return e===\`public\`?n(t):\`\${n(e)}.\${n(t)}\`}var Kh=new Set([\`auth\`,\`storage\`,\`realtime\`,\`vault\`,\`cron\`,\`pgmq\`,\`net\`,\`extensions\`,\`graphql\`,\`supabase_migrations\`,\`supabase_functions\`,\`information_schema\`]);function qh(e){return Kh.has(e)||e.startsWith(\`pg_\`)}function Jh({className:e=\`w-44 shrink-0\`,size:t}){let[n,r]=Uh(),[i,a]=(0,_.useState)([n]);return(0,_.useEffect)(()=>{N.schemas().then(e=>{a(e),e.includes(n)||Wh(e.includes(\`public\`)?\`public\`:e[0]??\`public\`)},()=>{})},[]),(0,B.jsx)(Up,{className:e,size:t,mono:!0,value:n,onValueChange:r,options:i.map(e=>({value:e,label:(0,B.jsxs)(\`span\`,{className:\`inline-flex items-center gap-1.5\`,children:[(0,B.jsx)(\`span\`,{className:\`font-sans text-muted-foreground/70\`,children:\`schema \`}),e,qh(e)&&(0,B.jsx)(Xe,{size:10,className:\`text-muted-foreground/60\`})]})}))})}function Yh({title:e,description:t,search:n,onSearch:r,onRefresh:i,actions:a,schemaPicker:o,filters:s}){return(0,B.jsxs)(\`div\`,{className:\`border-b border-border px-6 pb-4 pt-5\`,children:[(0,B.jsxs)(\`div\`,{className:\`flex items-start justify-between gap-4\`,children:[(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(\`h1\`,{className:\`text-lg font-semibold text-foreground\`,children:e}),(0,B.jsx)(\`p\`,{className:\`mt-0.5 text-[13px] text-muted-foreground/80\`,children:t})]}),(0,B.jsxs)(\`div\`,{className:\`flex shrink-0 items-center gap-1.5 pt-1\`,children:[i&&(0,B.jsx)(H,{variant:\`ghost\`,size:\`iconXs\`,title:\`Refresh\`,onClick:i,children:(0,B.jsx)(ht,{size:13})}),a]})]}),(r||o||s)&&(0,B.jsxs)(\`div\`,{className:\`mt-3 flex items-center gap-2\`,children:[o&&(0,B.jsx)(Jh,{}),r&&(0,B.jsxs)(\`div\`,{className:\`relative w-full max-w-xs\`,children:[(0,B.jsx)(_t,{size:13,className:\`pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground/60\`}),(0,B.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 Xh=e=>\`"\`+e.replace(/"/g,\`""\`)+\`"\`,Zh=e=>\`'\`+e.replace(/'/g,\`''\`)+\`'\`;function Qh(){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(\${Zh(e.jobname??String(e.jobid))})\`);if(!t.ok){U.error(t.error??\`Unschedule failed\`);return}U.success(\`Unscheduled \${e.jobname??e.jobid}\`),await u()}return e===null?(0,B.jsx)(qp,{}):(0,B.jsxs)(\`div\`,{className:\`flex h-full flex-col\`,children:[(0,B.jsx)(Yh,{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,B.jsxs)(H,{size:\`xs\`,onClick:()=>s(!0),children:[(0,B.jsx)(pt,{size:12}),\` Schedule job\`]})}),i&&(0,B.jsx)(df,{message:i}),(0,B.jsxs)(\`div\`,{className:\`min-h-0 flex-1 overflow-y-auto\`,children:[(0,B.jsxs)(Yp,{children:[(0,B.jsx)(Xp,{children:(0,B.jsxs)(\`tr\`,{children:[(0,B.jsx)(Z,{children:\`Name\`}),(0,B.jsx)(Z,{children:\`Schedule\`}),(0,B.jsx)(Z,{children:\`Command\`}),(0,B.jsx)(Z,{children:\`Status\`}),(0,B.jsx)(Z,{className:\`w-12\`})]})}),(0,B.jsx)(\`tbody\`,{children:e.map(e=>(0,B.jsxs)(Zp,{children:[(0,B.jsx)(Q,{className:\`font-mono text-foreground/90\`,children:e.jobname??\`#\${e.jobid}\`}),(0,B.jsx)(Q,{className:\`font-mono text-brand\`,children:e.schedule}),(0,B.jsx)(Q,{className:\`max-w-90 truncate font-mono text-[11px] text-muted-foreground/80\`,title:e.command,children:e.command}),(0,B.jsx)(Q,{children:e.active?(0,B.jsx)(V,{variant:\`brand\`,children:\`active\`}):(0,B.jsx)(V,{variant:\`neutral\`,children:\`inactive\`})}),(0,B.jsx)(Q,{children:(0,B.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,B.jsx)(Ot,{size:13})})})]},e.jobid))})]}),e.length===0&&(0,B.jsxs)(cf,{children:[\`No jobs scheduled. \`,(0,B.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`select cron.schedule('name', '*/5 * * * *', 'select 1')\`}),\` \`,\`also works from SQL.\`]}),n.length>0&&(0,B.jsxs)(B.Fragment,{children:[(0,B.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,B.jsxs)(Yp,{children:[(0,B.jsx)(Xp,{children:(0,B.jsxs)(\`tr\`,{children:[(0,B.jsx)(Z,{children:\`Job\`}),(0,B.jsx)(Z,{children:\`Status\`}),(0,B.jsx)(Z,{children:\`Started\`}),(0,B.jsx)(Z,{children:\`Message\`})]})}),(0,B.jsx)(\`tbody\`,{children:n.map((t,n)=>(0,B.jsxs)(Zp,{children:[(0,B.jsx)(Q,{className:\`font-mono text-muted-foreground\`,children:e.find(e=>e.jobid===t.jobid)?.jobname??\`#\${t.jobid}\`}),(0,B.jsx)(Q,{children:t.status===\`succeeded\`?(0,B.jsx)(V,{variant:\`brand\`,children:\`succeeded\`}):(0,B.jsx)(V,{variant:\`red\`,children:t.status})}),(0,B.jsx)(Q,{className:\`text-muted-foreground\`,children:(0,B.jsx)(Km,{value:t.start_time})}),(0,B.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,B.jsx)($h,{onClose:()=>s(!1),onDone:async()=>{s(!1),await u()}}),c&&(0,B.jsx)(go,{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 $h({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(\${Zh(n.trim())}, \${Zh(i.trim())}, \${Zh(o)})\`);if(!e.ok){l(e.error??\`Schedule failed\`),d(!1);return}U.success(\`Scheduled \${n.trim()}\`),await t()}return(0,B.jsx)(Kp,{open:!0,onClose:e,width:\`w-140\`,title:\`Schedule a new job\`,footer:(0,B.jsxs)(B.Fragment,{children:[c&&(0,B.jsx)(\`p\`,{className:\`min-w-0 truncate text-xs text-destructive\`,children:c}),(0,B.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-2\`,children:[(0,B.jsx)(Gp,{asChild:!0,children:(0,B.jsx)(H,{variant:\`outline\`,children:\`Cancel\`})}),(0,B.jsx)(H,{onClick:()=>void f(),disabled:u,children:u?\`Scheduling…\`:\`Schedule job\`})]})]}),children:(0,B.jsxs)(\`div\`,{className:\`space-y-3\`,children:[(0,B.jsxs)(\`div\`,{className:\`grid grid-cols-2 gap-3\`,children:[(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(X,{children:\`Name\`}),(0,B.jsx)(Y,{mono:!0,value:n,autoFocus:!0,placeholder:\`cleanup\`,onChange:e=>r(e.target.value)})]}),(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(X,{children:\`Schedule — cron (UTC) or "N seconds"\`}),(0,B.jsx)(Y,{mono:!0,value:i,placeholder:\`*/5 * * * *\`,onChange:e=>a(e.target.value)})]})]}),(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(X,{children:\`SQL command\`}),(0,B.jsx)(nr,{lang:\`sql\`,className:\`h-40\`,value:o,onChange:s,onCmdEnter:()=>void f()})]})]})})}var eg=/^[a-z_][a-z0-9_-]{0,46}$/i;function tg(){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)(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,
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(!eg.test(e.name))continue;let t=await N.sql(\`select count(*)::int as depth from pgmq.\${Xh(\`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(!eg.test(e.name)){U.error(\`Invalid queue name\`);return}let t=await N.sql(\`delete from pgmq.\${Xh(\`q_\`+e.name)}\`);if(!t.ok){U.error(t.error??\`Purge failed\`);return}U.success(\`Purged queue \${e.name}\`),await f()}return e===null?(0,B.jsx)(qp,{}):(0,B.jsxs)(\`div\`,{className:\`flex h-full flex-col\`,children:[(0,B.jsx)(Yh,{title:\`Queues\`,description:\`pgmq-compatible message queues — send/read/pop from SQL or supabase.schema('pgmq').rpc(…).\`,onRefresh:()=>void f(),actions:(0,B.jsxs)(H,{size:\`xs\`,onClick:()=>a(!0),children:[(0,B.jsx)(pt,{size:12}),\` New queue\`]})}),n&&(0,B.jsx)(df,{message:n}),(0,B.jsxs)(\`div\`,{className:\`min-h-0 flex-1 overflow-auto\`,children:[(0,B.jsxs)(Yp,{children:[(0,B.jsx)(Xp,{children:(0,B.jsxs)(\`tr\`,{children:[(0,B.jsx)(Z,{children:\`Queue\`}),(0,B.jsx)(Z,{children:\`Depth\`}),(0,B.jsx)(Z,{className:\`w-28\`})]})}),(0,B.jsx)(\`tbody\`,{children:e.map(e=>(0,B.jsxs)(Zp,{children:[(0,B.jsx)(Q,{className:\`font-mono text-foreground/90\`,children:e.name}),(0,B.jsx)(Q,{className:\`tabular-nums text-muted-foreground\`,children:e.depth}),(0,B.jsx)(Q,{children:(0,B.jsxs)(\`div\`,{className:\`flex justify-end gap-0.5 opacity-0 group-hover:opacity-100\`,children:[(0,B.jsx)(\`button\`,{className:\`p-1 text-muted-foreground/80 hover:text-foreground\`,title:\`Peek messages\`,onClick:()=>l(e),children:(0,B.jsx)(ke,{size:13})}),(0,B.jsx)(\`button\`,{className:\`p-1 text-muted-foreground/80 hover:text-foreground\`,title:\`Send test message\`,onClick:()=>s(e),children:(0,B.jsx)(vt,{size:13})}),(0,B.jsx)(\`button\`,{className:\`p-1 text-muted-foreground/80 hover:text-destructive\`,title:\`Purge queue\`,onClick:()=>d(e),children:(0,B.jsx)(Ot,{size:13})})]})})]},e.name))})]}),e.length===0&&(0,B.jsxs)(cf,{children:[\`No queues yet. Create one here or via\`,\` \`,(0,B.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`select pgmq.create('jobs')\`}),\`.\`]})]}),i&&(0,B.jsx)(ng,{onClose:()=>a(!1),onDone:async()=>{a(!1),await f()}}),o&&(0,B.jsx)(rg,{queue:o,onClose:()=>s(null),onDone:async()=>{s(null),await f()}}),c&&(0,B.jsx)(ig,{queue:c,onClose:()=>l(null)}),u&&(0,B.jsx)(go,{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 ng({onClose:e,onDone:t}){let[n,r]=(0,_.useState)(\`\`),[i,a]=(0,_.useState)(\`\`),[o,s]=(0,_.useState)(!1);async function c(){if(!eg.test(n))return a(\`Letters, digits, underscores and hyphens only.\`);s(!0),a(\`\`);let e=await N.sql(\`select pgmq.create(\${Zh(n)})\`);if(!e.ok){a(e.error??\`Create failed\`),s(!1);return}U.success(\`Created queue \${n}\`),await t()}return(0,B.jsx)(Kp,{open:!0,onClose:e,width:\`w-120\`,title:\`Create a new queue\`,footer:(0,B.jsxs)(B.Fragment,{children:[i&&(0,B.jsx)(\`p\`,{className:\`min-w-0 truncate text-xs text-destructive\`,children:i}),(0,B.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-2\`,children:[(0,B.jsx)(Gp,{asChild:!0,children:(0,B.jsx)(H,{variant:\`outline\`,children:\`Cancel\`})}),(0,B.jsx)(H,{onClick:()=>void c(),disabled:o||!n,children:o?\`Creating…\`:\`Create queue\`})]})]}),children:(0,B.jsx)(\`div\`,{className:\`space-y-3\`,children:(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(X,{children:\`Name\`}),(0,B.jsx)(Y,{mono:!0,value:n,autoFocus:!0,placeholder:\`jobs\`,onChange:e=>r(e.target.value),onKeyDown:e=>e.key===\`Enter\`&&void c()}),(0,B.jsx)(\`p\`,{className:\`mt-1 text-[11px] text-muted-foreground/60\`,children:\`Lowercase letters, digits and underscores.\`})]})})})}function rg({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(\${Zh(e.name)}, \${Zh(r)}::jsonb)\`);if(!t.ok){o(t.error??\`Send failed\`),c(!1);return}U.success(\`Sent to \${e.name}\`),await n()}return(0,B.jsx)(Kp,{open:!0,onClose:t,width:\`w-120\`,title:(0,B.jsxs)(\`span\`,{children:[\`Send message to\`,\` \`,(0,B.jsx)(\`code\`,{className:\`rounded bg-accent px-1.5 py-0.5 font-mono text-xs text-foreground\`,children:e.name})]}),footer:(0,B.jsxs)(B.Fragment,{children:[a&&(0,B.jsx)(\`p\`,{className:\`min-w-0 truncate text-xs text-destructive\`,children:a}),(0,B.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-2\`,children:[(0,B.jsx)(Gp,{asChild:!0,children:(0,B.jsx)(H,{variant:\`outline\`,children:\`Cancel\`})}),(0,B.jsx)(H,{onClick:()=>void l(),disabled:s,children:s?\`Sending…\`:\`Send message\`})]})]}),children:(0,B.jsx)(\`div\`,{className:\`space-y-3\`,children:(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(X,{children:\`Message (JSON)\`}),(0,B.jsx)($p,{rows:6,value:r,onChange:e=>i(e.target.value)})]})})})}function ig({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,B.jsx)(Kp,{open:!0,onClose:t,flush:!0,width:\`w-[620px]\`,title:(0,B.jsxs)(\`span\`,{children:[\`Messages in\`,\` \`,(0,B.jsx)(\`code\`,{className:\`rounded bg-accent px-1.5 py-0.5 font-mono text-xs text-foreground\`,children:e.name})]}),footer:(0,B.jsx)(Gp,{asChild:!0,children:(0,B.jsx)(H,{variant:\`outline\`,className:\`ml-auto\`,children:\`Done\`})}),children:n===null?(0,B.jsx)(\`div\`,{className:\`p-5\`,children:(0,B.jsx)(qp,{})}):n.length===0?(0,B.jsx)(cf,{children:\`Queue is empty.\`}):(0,B.jsx)(\`div\`,{className:\`h-full overflow-auto\`,children:(0,B.jsxs)(Yp,{children:[(0,B.jsx)(Xp,{children:(0,B.jsxs)(\`tr\`,{children:[(0,B.jsx)(Z,{children:\`id\`}),(0,B.jsx)(Z,{children:\`reads\`}),(0,B.jsx)(Z,{children:\`enqueued\`}),(0,B.jsx)(Z,{children:\`message\`})]})}),(0,B.jsx)(\`tbody\`,{children:n.map((e,t)=>(0,B.jsxs)(Zp,{children:[(0,B.jsx)(Q,{className:\`font-mono text-muted-foreground\`,children:String(e.msg_id)}),(0,B.jsx)(Q,{className:\`tabular-nums text-muted-foreground\`,children:String(e.read_ct)}),(0,B.jsx)(Q,{className:\`text-muted-foreground\`,children:(0,B.jsx)(Km,{value:e.enqueued_at})}),(0,B.jsx)(Q,{className:\`max-w-70 truncate font-mono text-[11px]\`,children:(0,B.jsx)(qm,{value:e.message})})]},t))})]})})})}function ag(){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,B.jsx)(qp,{}):(0,B.jsxs)(\`div\`,{className:\`flex h-full flex-col\`,children:[(0,B.jsx)(Yh,{title:\`Webhooks\`,description:\`Fire HTTP requests on table changes (CDC → HTTP) — configured via supabase/webhooks.json or createBackend({ webhooks }).\`,onRefresh:()=>void o()}),i&&(0,B.jsx)(df,{message:i}),(0,B.jsxs)(\`div\`,{className:\`min-h-0 flex-1 overflow-y-auto\`,children:[(0,B.jsxs)(Yp,{children:[(0,B.jsx)(Xp,{children:(0,B.jsxs)(\`tr\`,{children:[(0,B.jsx)(Z,{children:\`Table\`}),(0,B.jsx)(Z,{children:\`Events\`}),(0,B.jsx)(Z,{children:\`URL\`})]})}),(0,B.jsx)(\`tbody\`,{children:e.map((e,t)=>(0,B.jsxs)(Zp,{children:[(0,B.jsx)(Q,{className:\`font-mono text-foreground/90\`,children:e.table}),(0,B.jsx)(Q,{children:(0,B.jsx)(\`span\`,{className:\`flex gap-1\`,children:(e.events?.length?e.events:[\`INSERT\`,\`UPDATE\`,\`DELETE\`]).map(e=>(0,B.jsx)(V,{variant:\`blue\`,children:e},e))})}),(0,B.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,B.jsxs)(cf,{children:[\`No webhooks configured. Add \`,(0,B.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`supabase/webhooks.json\`}),\` —\`,\` \`,(0,B.jsxs)(\`code\`,{className:\`text-muted-foreground\`,children:[\`[\`,\`{ "table": "orders", "url": "https://…" }\`,\`]\`]}),\` — and restart.\`]}),(0,B.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,B.jsxs)(Yp,{children:[(0,B.jsx)(Xp,{children:(0,B.jsxs)(\`tr\`,{children:[(0,B.jsx)(Z,{children:\`id\`}),(0,B.jsx)(Z,{children:\`Status\`}),(0,B.jsx)(Z,{children:\`Error\`}),(0,B.jsx)(Z,{children:\`At\`})]})}),(0,B.jsx)(\`tbody\`,{children:n.map(e=>(0,B.jsxs)(Zp,{children:[(0,B.jsx)(Q,{className:\`font-mono text-muted-foreground\`,children:e.id}),(0,B.jsx)(Q,{children:e.timed_out?(0,B.jsx)(V,{variant:\`red\`,children:\`timeout\`}):e.status_code&&e.status_code<400?(0,B.jsx)(V,{variant:\`brand\`,children:e.status_code}):(0,B.jsx)(V,{variant:\`red\`,children:e.status_code??\`error\`})}),(0,B.jsx)(Q,{className:\`max-w-90 truncate font-mono text-[11px] text-muted-foreground/80\`,children:e.error_msg??\`—\`}),(0,B.jsx)(Q,{className:\`text-muted-foreground\`,children:(0,B.jsx)(Km,{value:e.created})})]},e.id))})]}),n.length===0&&(0,B.jsx)(cf,{children:\`No outbound requests recorded yet.\`})]})]})}var og=[{id:\`cron\`,label:\`Cron\`,component:Qh},{id:\`queues\`,label:\`Queues\`,component:tg},{id:\`webhooks\`,label:\`Webhooks\`,component:ag}];function sg(){let{section:e}=qt(),t=og.some(t=>t.id===e)?e:\`cron\`,n=og.find(e=>e.id===t).component;return(0,B.jsxs)(\`div\`,{className:\`flex h-full\`,children:[(0,B.jsx)(wh,{title:\`Automations\`,active:t,onSelect:e=>z(\`automations\`,e),groups:[{items:og.map(e=>({id:e.id,label:e.label}))}]}),(0,B.jsx)(\`div\`,{className:\`min-w-0 flex-1 overflow-hidden\`,children:(0,B.jsx)(n,{})})]})}function cg(){let[e]=Uh(),[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(!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,
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 = \${Zh(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:Lt(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 \${Gh(e,t.name)}\`);if(!n.ok){U.error(n.error??\`Drop failed — is the type still used by a column?\`);return}U.success(\`Dropped type \${t.name}\`),await p()}if(t===null)return(0,B.jsx)(qp,{});let h=t.filter(e=>e.name.toLowerCase().includes(a.toLowerCase()));return(0,B.jsxs)(\`div\`,{className:\`flex h-full flex-col\`,children:[(0,B.jsx)(Yh,{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,B.jsxs)(H,{size:\`xs\`,onClick:()=>c(!0),children:[(0,B.jsx)(pt,{size:12}),\` New type\`]})}),r&&(0,B.jsx)(df,{message:r}),(0,B.jsxs)(\`div\`,{className:\`min-h-0 flex-1 space-y-3 overflow-y-auto p-6\`,children:[h.map(e=>(0,B.jsxs)(\`div\`,{className:\`rounded-md border border-border bg-card p-4\`,children:[(0,B.jsxs)(\`div\`,{className:\`flex items-center gap-2\`,children:[(0,B.jsx)(\`span\`,{className:\`font-mono text-[13px] text-foreground\`,children:e.name}),(0,B.jsxs)(\`span\`,{className:\`text-[11px] text-muted-foreground/60\`,children:[e.values.length,\` values\`]}),e.comment&&(0,B.jsxs)(\`span\`,{className:\`truncate text-[11px] text-muted-foreground/60\`,title:e.comment,children:[\`— \`,e.comment]}),(0,B.jsxs)(\`div\`,{className:\`ml-auto flex gap-0.5\`,children:[(0,B.jsx)(H,{variant:\`ghost\`,size:\`iconXs\`,title:\`Edit type\`,onClick:()=>u(e),children:(0,B.jsx)(ct,{size:12})}),(0,B.jsx)(H,{variant:\`ghost\`,size:\`iconXs\`,title:\`Drop type\`,onClick:()=>f(e),children:(0,B.jsx)(Ot,{size:12,className:\`text-muted-foreground hover:text-destructive\`})})]})]}),(0,B.jsx)(\`div\`,{className:\`mt-2 flex flex-wrap gap-1.5\`,children:e.values.map(e=>(0,B.jsx)(V,{variant:\`outline\`,className:\`font-mono\`,children:e},e))})]},e.name)),h.length===0&&(0,B.jsx)(cf,{children:t.length===0?\`No enum types yet.\`:\`No match.\`})]}),s&&(0,B.jsx)(lg,{schema:e,onClose:()=>c(!1),onDone:async()=>{c(!1),await p()}}),l&&(0,B.jsx)(lg,{schema:e,existing:l,onClose:()=>u(null),onDone:async()=>{u(null),await p()}}),d&&(0,B.jsx)(go,{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 lg({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 \${Gh(e,a)} as enum (\${s.map(Zh).join(\`, \`)})\`)||o.trim()&&!await h(\`comment on type \${Gh(e,a)} is \${Zh(o.trim())}\`))return;U.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 \${Gh(e,l)} rename value \${Zh(t.values[r])} to \${Zh(n[r])}\`))return;if(a!==t.name){if(!await h(\`alter type \${Gh(e,l)} rename to \${Xh(a)}\`))return;l=a}for(let t of n.slice(m).filter(Boolean))if(!await h(\`alter type \${Gh(e,l)} add value if not exists \${Zh(t)}\`))return;if((o.trim()||null)!==(t.comment??null)){let t=o.trim()?Zh(o.trim()):\`null\`;if(!await h(\`comment on type \${Gh(e,l)} is \${t}\`))return}U.success(\`Updated type \${l}\`),await r()}return(0,B.jsx)(Kp,{open:!0,onClose:n,width:\`w-135\`,title:t?\`Edit type "\${t.name}"\`:\`Create a new enumerated type\`,footer:(0,B.jsxs)(B.Fragment,{children:[f&&(0,B.jsx)(\`p\`,{className:\`min-w-0 truncate text-xs text-destructive\`,children:f}),(0,B.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-2\`,children:[(0,B.jsx)(Gp,{asChild:!0,children:(0,B.jsx)(H,{variant:\`outline\`,children:\`Cancel\`})}),(0,B.jsx)(H,{onClick:()=>void g(),disabled:u,children:u?\`Saving…\`:t?\`Save changes\`:\`Create type\`})]})]}),children:(0,B.jsxs)(\`div\`,{className:\`space-y-3\`,children:[(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(X,{children:\`Name\`}),(0,B.jsx)(Y,{mono:!0,value:i,autoFocus:!t,placeholder:\`order_status\`,onChange:e=>a(e.target.value)})]}),(0,B.jsxs)(\`div\`,{children:[(0,B.jsxs)(X,{children:[\`Description \`,(0,B.jsx)(\`span\`,{className:\`font-normal text-muted-foreground/60\`,children:\`— optional\`})]}),(0,B.jsx)(Y,{value:o,onChange:e=>s(e.target.value)})]}),(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(X,{children:\`Values\`}),(0,B.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,B.jsx)(ge,{size:13,className:\`mt-px shrink-0\`}),(0,B.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,B.jsx)(\`div\`,{className:\`space-y-1.5\`,children:c.map((e,t)=>(0,B.jsxs)(\`div\`,{className:\`flex items-center gap-1.5\`,children:[(0,B.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,B.jsx)(H,{variant:\`ghost\`,size:\`iconXs\`,title:\`Remove\`,onClick:()=>l(e=>e.filter((e,n)=>n!==t)),children:(0,B.jsx)(Ot,{size:12,className:\`text-muted-foreground\`})})]},t))}),(0,B.jsxs)(H,{variant:\`outline\`,size:\`xs\`,className:\`mt-2\`,onClick:()=>l(e=>[...e,\`\`]),children:[(0,B.jsx)(pt,{size:12}),\` Add value\`]})]})]})})}function ug(){let[e]=Uh(),[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 \${Xh(e)}.\${Xh(t.name)}(\${t.args??\`\`})\`);if(!n.ok){U.error(n.error??\`Drop failed\`);return}U.success(\`Dropped function \${t.name}\`),h()}if(t===null)return(0,B.jsx)(qp,{});let y=t.filter(e=>e.name.toLowerCase().includes(r.toLowerCase())&&(!a||e.returns===a)&&(!s||s===\`definer\`==!!e.security_definer));return(0,B.jsxs)(\`div\`,{className:\`flex h-full flex-col\`,children:[(0,B.jsx)(Yh,{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,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Up,{className:\`w-36 shrink-0\`,value:a,onValueChange:o,placeholder:\`Return type\`,options:[{value:\`\`,label:\`All return types\`},...g.map(e=>({value:e}))]}),(0,B.jsx)(Up,{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,B.jsxs)(H,{size:\`xs\`,onClick:()=>f(!0),children:[(0,B.jsx)(pt,{size:12}),\` New function\`]})}),(0,B.jsxs)(\`div\`,{className:\`min-h-0 flex-1 overflow-auto\`,children:[(0,B.jsxs)(Yp,{children:[(0,B.jsx)(Xp,{children:(0,B.jsxs)(\`tr\`,{children:[(0,B.jsx)(Z,{children:\`Name\`}),(0,B.jsx)(Z,{children:\`Arguments\`}),(0,B.jsx)(Z,{children:\`Returns\`}),(0,B.jsx)(Z,{children:\`Language\`}),(0,B.jsx)(Z,{children:\`Security\`}),(0,B.jsx)(Z,{className:\`w-20\`})]})}),(0,B.jsx)(\`tbody\`,{children:y.map(e=>(0,B.jsxs)(Zp,{children:[(0,B.jsx)(Q,{className:\`font-mono text-foreground/90\`,children:e.name}),(0,B.jsx)(Q,{className:\`max-w-70 truncate font-mono text-[11px] text-muted-foreground/80\`,children:e.args||\`—\`}),(0,B.jsx)(Q,{className:\`font-mono text-muted-foreground\`,children:e.returns}),(0,B.jsx)(Q,{className:\`text-muted-foreground\`,children:e.language}),(0,B.jsx)(Q,{children:e.security_definer?(0,B.jsx)(V,{variant:\`amber\`,children:\`definer\`}):(0,B.jsx)(V,{variant:\`neutral\`,children:\`invoker\`})}),(0,B.jsx)(Q,{children:(0,B.jsxs)(\`div\`,{className:\`flex justify-end gap-0.5 opacity-0 group-hover:opacity-100\`,children:[(0,B.jsx)(\`button\`,{className:\`p-1 text-muted-foreground/80 hover:text-foreground\`,title:\`View source\`,onClick:()=>u(e),children:(0,B.jsx)(ke,{size:13})}),(0,B.jsx)(\`button\`,{className:\`p-1 text-muted-foreground/80 hover:text-destructive\`,title:\`Drop\`,onClick:()=>m(e),children:(0,B.jsx)(Ot,{size:13})})]})})]},e.name+e.args))})]}),y.length===0&&(0,B.jsx)(cf,{children:t.length===0?\`No user functions yet.\`:\`No match.\`})]}),l&&(0,B.jsx)(Kp,{open:!0,onClose:()=>u(null),width:\`w-[640px]\`,title:(0,B.jsxs)(\`span\`,{children:[\`Source of \`,(0,B.jsx)(\`code\`,{className:\`rounded bg-accent px-1.5 py-0.5 font-mono text-xs text-foreground\`,children:l.name})]}),footer:(0,B.jsx)(Gp,{asChild:!0,children:(0,B.jsx)(H,{variant:\`outline\`,className:\`ml-auto\`,children:\`Done\`})}),children:(0,B.jsx)(er,{value:l.body?.trim()??\`-- source unavailable\`,lang:\`sql\`,readOnly:!0,gutter:!0,minLines:6,maxLines:400})}),d&&(0,B.jsx)(mg,{schema:e,onDone:()=>{f(!1),h()},onClose:()=>f(!1)}),p&&(0,B.jsx)(go,{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 dg=[\`void\`,\`trigger\`,\`text\`,\`int4\`,\`int8\`,\`numeric\`,\`bool\`,\`uuid\`,\`jsonb\`,\`timestamptz\`,\`record\`],fg=[\`text\`,\`int4\`,\`int8\`,\`numeric\`,\`bool\`,\`uuid\`,\`jsonb\`,\`timestamptz\`,\`date\`],pg={plpgsql:\`begin
1516
+ where n.nspname = \${eg(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 \${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
1518
1518
 
1519
- end;\`,sql:\`select 1;\`};function mg({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)(pg.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})
1519
+ end;\`,sql:\`select 1;\`};function _g({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)(gg.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}U.success(\`Created function \${r.trim()}\`),t()}return(0,B.jsx)(Kp,{open:!0,onClose:n,width:\`w-160\`,title:\`Add a new function\`,footer:(0,B.jsxs)(B.Fragment,{children:[v&&(0,B.jsx)(\`p\`,{className:\`min-w-0 truncate text-xs text-destructive\`,children:v}),(0,B.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-2\`,children:[(0,B.jsx)(Gp,{asChild:!0,children:(0,B.jsx)(H,{variant:\`outline\`,children:\`Cancel\`})}),(0,B.jsx)(H,{onClick:()=>void T(),disabled:b||!r.trim(),children:b?\`Creating…\`:\`Create function\`})]})]}),children:(0,B.jsxs)(\`div\`,{className:\`space-y-3\`,children:[(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(X,{children:\`Schema\`}),(0,B.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,B.jsxs)(\`div\`,{className:\`grid grid-cols-2 gap-3\`,children:[(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(X,{children:\`Name of function\`}),(0,B.jsx)(Y,{mono:!0,value:r,autoFocus:!0,placeholder:\`my_function\`,onChange:e=>i(e.target.value.replace(/\\s/g,\`_\`))})]}),(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(X,{children:\`Return type\`}),(0,B.jsx)(Up,{mono:!0,value:s,onValueChange:c,options:dg.map(e=>({value:e}))})]})]}),(0,B.jsxs)(\`div\`,{children:[(0,B.jsxs)(X,{children:[\`Arguments \`,(0,B.jsx)(\`span\`,{className:\`font-normal text-muted-foreground/60\`,children:\`— referenced in the body by name\`})]}),(0,B.jsx)(\`div\`,{className:\`space-y-1.5\`,children:a.map((e,t)=>(0,B.jsxs)(\`div\`,{className:\`flex items-center gap-1.5\`,children:[(0,B.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,B.jsx)(Up,{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:fg.map(e=>({value:e}))}),(0,B.jsx)(H,{variant:\`ghost\`,size:\`iconXs\`,title:\`Remove\`,onClick:()=>o(e=>e.filter((e,n)=>n!==t)),children:(0,B.jsx)(Ot,{size:12,className:\`text-muted-foreground\`})})]},t))}),(0,B.jsxs)(H,{variant:\`outline\`,size:\`xs\`,className:\`mt-1.5\`,onClick:()=>o(e=>[...e,{name:\`\`,type:\`text\`}]),children:[(0,B.jsx)(pt,{size:12}),\` Add a new argument\`]})]}),(0,B.jsxs)(\`div\`,{children:[(0,B.jsxs)(X,{children:[\`Definition \`,(0,B.jsxs)(\`span\`,{className:\`font-normal text-muted-foreground/60\`,children:[\`— written in \`,l]})]}),(0,B.jsx)(nr,{lang:\`sql\`,className:\`h-44\`,value:d,onChange:f,onCmdEnter:()=>void T()})]}),(0,B.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,B.jsx)(Jp,{checked:h,onChange:()=>g(e=>!e)})]}),h&&(0,B.jsxs)(\`div\`,{className:\`space-y-3 rounded-md border border-border bg-card p-3\`,children:[(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(X,{children:\`Language\`}),(0,B.jsx)(Up,{mono:!0,value:l,onValueChange:e=>{u(e),f(t=>Object.values(pg).includes(t)?pg[e]:t)},options:[{value:\`plpgsql\`},{value:\`sql\`}]})]}),(0,B.jsxs)(\`label\`,{className:\`flex items-center gap-3 text-[13px] text-foreground/85\`,children:[(0,B.jsx)(Jp,{checked:p,onChange:m}),(0,B.jsxs)(\`span\`,{children:[\`SECURITY DEFINER \`,(0,B.jsx)(\`span\`,{className:\`text-[11px] text-muted-foreground/60\`,children:\`— runs with the owner's privileges (bypasses caller RLS)\`})]})]})]}),(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(X,{children:\`Preview of SQL statement\`}),(0,B.jsx)(er,{value:w,lang:\`sql\`,readOnly:!0,minLines:4,maxLines:10})]})]})})}function hg(){let[e]=Uh(),[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,
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)(lf,{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:mg.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)(lf,{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:hg.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(gg).includes(t)?gg[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 vg(){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=(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 = \${Zh(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 \${Xh(e)}.\${Xh(t.name)}\`);if(!n.ok){U.error(n.error??\`Drop failed\`);return}U.success(\`Dropped index \${t.name}\`),await d()}if(t===null)return(0,B.jsx)(qp,{});let p=t.filter(e=>(e.name+e.table).toLowerCase().includes(a.toLowerCase()));return(0,B.jsxs)(\`div\`,{className:\`flex h-full flex-col\`,children:[(0,B.jsx)(Yh,{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,B.jsxs)(H,{size:\`xs\`,onClick:()=>c(!0),children:[(0,B.jsx)(pt,{size:12}),\` New index\`]})}),r&&(0,B.jsx)(df,{message:r}),(0,B.jsxs)(\`div\`,{className:\`min-h-0 flex-1 overflow-auto\`,children:[(0,B.jsxs)(Yp,{children:[(0,B.jsx)(Xp,{children:(0,B.jsxs)(\`tr\`,{children:[(0,B.jsx)(Z,{children:\`Name\`}),(0,B.jsx)(Z,{children:\`Table\`}),(0,B.jsx)(Z,{children:\`Definition\`}),(0,B.jsx)(Z,{className:\`w-12\`})]})}),(0,B.jsx)(\`tbody\`,{children:p.map(e=>(0,B.jsxs)(Zp,{children:[(0,B.jsx)(Q,{className:\`font-mono text-foreground/90\`,children:e.name}),(0,B.jsx)(Q,{className:\`font-mono text-muted-foreground\`,children:e.table}),(0,B.jsx)(Q,{className:\`max-w-120 truncate font-mono text-[11px]\`,title:e.def,children:(0,B.jsx)(\`span\`,{className:\`text-muted-foreground/80\`,children:e.def})}),(0,B.jsx)(Q,{children:!e.constraint&&(0,B.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,B.jsx)(Ot,{size:13})})})]},e.name))})]}),p.length===0&&(0,B.jsx)(cf,{children:t.length===0?\`No indexes.\`:\`No match.\`})]}),s&&(0,B.jsx)(_g,{schema:e,onClose:()=>c(!1),onDone:async()=>{c(!1),await d()}}),l&&(0,B.jsx)(go,{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 gg=[\`btree\`,\`hash\`,\`gin\`,\`gist\`,\`brin\`];function _g({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}U.success(\`Index created on \${a}\`),await n()}return(0,B.jsx)(Kp,{open:!0,onClose:t,width:\`w-140\`,title:\`Create new index\`,footer:(0,B.jsxs)(B.Fragment,{children:[p&&(0,B.jsx)(\`p\`,{className:\`min-w-0 truncate text-xs text-destructive\`,children:p}),(0,B.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-2\`,children:[(0,B.jsx)(Gp,{asChild:!0,children:(0,B.jsx)(H,{variant:\`outline\`,children:\`Cancel\`})}),(0,B.jsx)(H,{onClick:()=>void b(),disabled:d||!a||s.length===0,children:d?\`Creating…\`:\`Create index\`})]})]}),children:(0,B.jsxs)(\`div\`,{className:\`space-y-3\`,children:[(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(X,{children:\`Schema\`}),(0,B.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,B.jsxs)(\`div\`,{className:\`grid grid-cols-2 gap-3\`,children:[(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(X,{children:\`Table\`}),(0,B.jsx)(Up,{mono:!0,value:a,onValueChange:e=>{o(e),c([])},placeholder:\`Pick a table…\`,options:r.map(e=>({value:e.name}))})]}),(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(X,{children:\`Index type\`}),(0,B.jsx)(Up,{mono:!0,value:l,onValueChange:u,options:gg.map(e=>({value:e}))})]})]}),(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(X,{children:\`Columns — click to add; order matters for btree\`}),(0,B.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,B.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,B.jsxs)(\`span\`,{className:\`tabular-nums\`,children:[t+1,\`.\`]}),e]},e)}),h.length===0&&(0,B.jsx)(\`span\`,{className:\`px-1 py-0.5 text-xs text-muted-foreground/60\`,children:\`No table selected.\`})]})]}),(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(X,{children:\`Preview of SQL statement\`}),(0,B.jsx)(er,{value:v,lang:\`sql\`,readOnly:!0,minLines:2,maxLines:6})]})]})})}function vg(){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,B.jsx)(qp,{});let a=e=>Array.isArray(e.statements)?e.statements.join(\`
1527
+ from pg_indexes i where i.schemaname = \${eg(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 \${$h(e)}.\${$h(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)(Qh,{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)(cf,{children:t.length===0?\`No indexes.\`:\`No match.\`})]}),s&&(0,z.jsx)(bg,{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 yg=[\`btree\`,\`hash\`,\`gin\`,\`gist\`,\`brin\`];function bg({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:yg.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 xg(){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,B.jsxs)(\`div\`,{className:\`flex h-full flex-col\`,children:[(0,B.jsx)(Yh,{title:\`Migrations\`,description:\`Applied migrations from supabase/migrations/*.sql — the same ledger the Supabase CLI uses.\`,onRefresh:()=>void i()}),(0,B.jsxs)(\`div\`,{className:\`min-h-0 flex-1 overflow-auto\`,children:[(0,B.jsxs)(Yp,{children:[(0,B.jsx)(Xp,{children:(0,B.jsxs)(\`tr\`,{children:[(0,B.jsx)(Z,{children:\`Version\`}),(0,B.jsx)(Z,{children:\`Name\`}),(0,B.jsx)(Z,{children:\`Applied\`}),(0,B.jsx)(Z,{className:\`w-12\`})]})}),(0,B.jsx)(\`tbody\`,{children:e.map(e=>(0,B.jsxs)(Zp,{children:[(0,B.jsx)(Q,{className:\`font-mono text-muted-foreground\`,children:e.version}),(0,B.jsx)(Q,{className:\`font-mono text-foreground/90\`,children:e.name||\`—\`}),(0,B.jsx)(Q,{className:\`text-muted-foreground\`,children:(0,B.jsx)(Km,{value:e.applied_at})}),(0,B.jsx)(Q,{children:a(e)&&(0,B.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,B.jsx)(ke,{size:13})})})]},e.version))})]}),e.length===0&&(0,B.jsxs)(cf,{children:[\`No migrations applied. Add SQL files under \`,(0,B.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`supabase/migrations/\`}),\` and restart.\`]})]}),n&&(0,B.jsx)(Kp,{open:!0,onClose:()=>r(null),width:\`w-[640px]\`,title:(0,B.jsxs)(\`span\`,{children:[\`Migration \`,(0,B.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,B.jsx)(Gp,{asChild:!0,children:(0,B.jsx)(H,{variant:\`outline\`,className:\`ml-auto\`,children:\`Done\`})}),children:(0,B.jsx)(er,{value:a(n)??\`-- SQL not recorded for this migration\`,lang:\`sql\`,readOnly:!0,gutter:!0,minLines:6,maxLines:500})})]})}var yg=[\`SELECT\`,\`INSERT\`,\`UPDATE\`,\`DELETE\`,\`ALL\`],bg=e=>e!==\`INSERT\`,xg=e=>e===\`INSERT\`||e===\`UPDATE\`||e===\`ALL\`,Sg={SELECT:\`brand\`,INSERT:\`amber\`,UPDATE:\`blue\`,DELETE:\`red\`,ALL:\`neutral\`},Cg=[{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,B.jsxs)(B.Fragment,{children:[\`Query across tables to build more advanced RLS rules. Assuming 2 tables called\`,\` \`,(0,B.jsx)(\`code\`,{className:\`rounded bg-accent px-1 text-[11px]\`,children:\`teams\`}),\` and\`,\` \`,(0,B.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,B.jsxs)(B.Fragment,{children:[\`Useful in a many-to-many relationship where you want to restrict access to the linking table. Use a\`,\` \`,(0,B.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 wg({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 P=m.length>0?m.join(\`, \`):\`public\`;function ee(e){l(e.title),p(e.command),h(e.roles),v(e.using??\`\`),b(e.check??\`\`),E(\`\`)}async function F(){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:P,using:bg(f)&&g.trim()||void 0,check:xg(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}U.success(\`Updated policy "\${c.trim()}"\`)}else await N.createPolicy(e),U.success(\`Created policy "\${c.trim()}"\`);await a(),i()}catch(e){E(e.message),w(!1)}}let I=Cg.filter(e=>e.title.toLowerCase().includes(x.toLowerCase()));return(0,B.jsx)(Kp,{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,B.jsxs)(B.Fragment,{children:[T&&(0,B.jsx)(\`p\`,{className:\`min-w-0 truncate text-xs text-destructive\`,children:T}),(0,B.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-2\`,children:[(0,B.jsx)(Gp,{asChild:!0,children:(0,B.jsx)(H,{variant:\`outline\`,children:\`Cancel\`})}),(0,B.jsx)(H,{onClick:()=>void F(),disabled:C||!c.trim(),children:C?\`Saving…\`:\`Save policy\`})]})]}),children:(0,B.jsxs)(\`div\`,{className:\`flex h-full\`,children:[(0,B.jsxs)(\`div\`,{className:\`flex min-w-0 flex-1 flex-col\`,children:[(0,B.jsxs)(\`div\`,{className:\`flex h-12 shrink-0 items-center gap-3 border-b border-border pl-3 pr-2\`,children:[(0,B.jsx)(Gp,{asChild:!0,children:(0,B.jsx)(\`button\`,{className:\`rounded p-1 text-muted-foreground/80 transition-colors hover:bg-accent hover:text-foreground\`,children:(0,B.jsx)(Ft,{size:16})})}),(0,B.jsx)(\`h2\`,{className:\`truncate text-[15px] font-medium text-foreground\`,children:r?(0,B.jsxs)(B.Fragment,{children:[\`Edit policy \`,(0,B.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,B.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,B.jsx)(at,{size:15}):(0,B.jsx)(ot,{size:15})})]}),(0,B.jsxs)(\`div\`,{className:\`min-h-0 flex-1 space-y-4 overflow-y-auto px-5 py-4\`,children:[(0,B.jsxs)(\`div\`,{className:\`grid grid-cols-2 gap-3\`,children:[(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(X,{children:\`Policy name\`}),(0,B.jsx)(Y,{value:c,autoFocus:!0,placeholder:\`Provide a name for your policy\`,onChange:e=>l(e.target.value)})]}),(0,B.jsxs)(\`div\`,{children:[(0,B.jsxs)(X,{children:[\`Table \`,(0,B.jsx)(Tg,{children:\`on\`})]}),e||r?(0,B.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,B.jsx)(Up,{mono:!0,value:o,onValueChange:s,placeholder:\`Pick a table…\`,options:(t??[]).map(e=>({value:e,label:\`\${n}.\${e}\`}))})]})]}),(0,B.jsxs)(\`div\`,{className:\`grid grid-cols-2 gap-3\`,children:[(0,B.jsxs)(\`div\`,{children:[(0,B.jsxs)(X,{children:[\`Policy behavior \`,(0,B.jsx)(Tg,{children:\`as\`})]}),(0,B.jsx)(Up,{value:u,onValueChange:e=>d(e),options:[{value:\`PERMISSIVE\`,label:\`Permissive\`},{value:\`RESTRICTIVE\`,label:\`Restrictive\`}]})]}),(0,B.jsxs)(\`div\`,{children:[(0,B.jsxs)(X,{children:[\`Target roles \`,(0,B.jsx)(Tg,{children:\`to\`})]}),(0,B.jsxs)(ff,{open:k,onOpenChange:A,className:\`max-h-56 w-full overflow-auto p-1.5\`,trigger:(0,B.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,B.jsx)(\`span\`,{className:\`truncate font-mono text-foreground\`,children:m.join(\`, \`)}):(0,B.jsx)(\`span\`,{className:\`truncate text-muted-foreground/60\`,children:\`Defaults to all (public) roles\`}),(0,B.jsx)(pe,{size:13,className:\`ml-auto shrink-0 text-muted-foreground/80\`})]}),children:[j.map(e=>(0,B.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,B.jsx)(Zt,{checked:m.includes(e),onChange:t=>h(n=>t?[...n,e]:n.filter(t=>t!==e))}),(0,B.jsx)(\`span\`,{className:\`font-mono\`,children:e})]},e)),m.length>0&&(0,B.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,B.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,B.jsxs)(\`div\`,{children:[(0,B.jsxs)(X,{children:[\`Policy command \`,(0,B.jsx)(Tg,{children:\`for\`})]}),(0,B.jsx)(\`div\`,{className:\`flex flex-wrap gap-1.5\`,children:yg.map(e=>{let t=f===e;return(0,B.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,B.jsx)(ve,{size:12,className:\`text-brand\`}):(0,B.jsx)(ye,{size:12,className:\`text-muted-foreground/60\`}),e]},e)})})]}),(0,B.jsx)(Eg,{name:c,schema:n,table:o,behavior:u,command:f,roleStr:P,usingExpr:bg(f)?g:null,checkExpr:xg(f)?y:null,onUsing:v,onCheck:b})]})]}),(0,B.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,B.jsxs)(\`div\`,{className:\`flex h-full w-85 flex-col border-l border-border bg-card\`,children:[(0,B.jsx)(\`div\`,{className:\`flex h-12 shrink-0 items-end border-b border-border px-4\`,children:(0,B.jsx)(\`span\`,{className:\`border-b-2 border-foreground pb-3 text-[13px] font-medium text-foreground\`,children:\`Templates\`})}),(0,B.jsx)(\`div\`,{className:\`shrink-0 border-b border-border p-3\`,children:(0,B.jsxs)(\`div\`,{className:\`relative\`,children:[(0,B.jsx)(_t,{size:13,className:\`pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground/60\`}),(0,B.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,B.jsxs)(\`div\`,{className:\`min-h-0 flex-1 space-y-2 overflow-y-auto p-3\`,children:[I.map(e=>(0,B.jsxs)(\`button\`,{onClick:()=>ee(e),className:\`w-full rounded-md border border-border bg-popover p-3 text-left transition-colors hover:border-muted-foreground\`,children:[(0,B.jsx)(V,{variant:Sg[e.command],children:e.command}),(0,B.jsx)(\`p\`,{className:\`mt-2 text-[13px] font-medium text-foreground\`,children:e.title}),(0,B.jsx)(\`p\`,{className:\`mt-1 text-xs leading-relaxed text-muted-foreground/80\`,children:e.description})]},e.title)),I.length===0&&(0,B.jsx)(\`p\`,{className:\`py-6 text-center text-xs text-muted-foreground/60\`,children:\`No matching template.\`})]})]})})]})})}function Tg({children:e}){return(0,B.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 Eg({name:e,schema:t,table:n,behavior:r,command:i,roleStr:a,usingExpr:o,checkExpr:s,onUsing:c,onCheck:l}){let u=e=>(0,B.jsx)(\`span\`,{className:\`text-info\`,children:e}),d=o!==null&&s===null,f=[{key:\`create\`,kind:\`static\`,content:(0,B.jsxs)(B.Fragment,{children:[u(\`create policy\`),\` \`,(0,B.jsxs)(\`span\`,{className:\`text-warning\`,children:[\`"\`,e||\`policy_name\`,\`"\`]})]})},{key:\`on\`,kind:\`static\`,content:(0,B.jsxs)(B.Fragment,{children:[u(\`on\`),\` "\`,t,\`"."\`,n,\`"\`]})},{key:\`as\`,kind:\`static\`,content:(0,B.jsxs)(B.Fragment,{children:[u(\`as\`),\` \`,r]})},{key:\`for\`,kind:\`static\`,content:(0,B.jsxs)(B.Fragment,{children:[u(\`for\`),\` \`,i]})},{key:\`to\`,kind:\`static\`,content:(0,B.jsxs)(B.Fragment,{children:[u(\`to\`),\` \`,a,o===null&&s===null?\`;\`:\`\`]})}];return o!==null&&f.push({key:\`using-open\`,kind:\`static\`,content:(0,B.jsxs)(B.Fragment,{children:[u(\`using\`),\` (\`]})},{key:\`using-expr\`,kind:\`expr\`,value:o,clause:\`using\`,onChange:c},{key:\`using-close\`,kind:\`static\`,content:(0,B.jsx)(B.Fragment,{children:d?\`);\`:\`)\`})}),s!==null&&f.push({key:\`check-open\`,kind:\`static\`,content:(0,B.jsxs)(B.Fragment,{children:[u(\`with check\`),\` (\`]})},{key:\`check-expr\`,kind:\`expr\`,value:s,clause:\`with check\`,onChange:l},{key:\`check-close\`,kind:\`static\`,content:(0,B.jsx)(B.Fragment,{children:\`);\`})}),(0,B.jsxs)(\`div\`,{className:\`overflow-hidden rounded-md border border-border bg-code font-mono text-[13px]\`,children:[(0,B.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,B.jsx)(Xe,{size:10}),\` Use options above to edit\`]}),(0,B.jsx)(\`div\`,{className:\`px-1 py-2\`,children:f.map((e,t)=>(0,B.jsxs)(\`div\`,{className:\`flex leading-6\`,children:[(0,B.jsx)(\`span\`,{className:\`w-8 shrink-0 select-none pr-3 text-right text-muted-foreground/60\`,children:t+1}),e.kind===\`static\`?(0,B.jsx)(\`span\`,{className:\`whitespace-pre\`,children:e.content}):(0,B.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 Dg(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 Og=e=>e.replace(/'/g,\`''\`),kg=(e,t)=>\`"\${e.replace(/"/g,\`""\`)}"."\${t.replace(/"/g,\`""\`)}"\`;async function Ag(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)(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
1530
1530
  from pg_class c join pg_namespace n on n.oid = c.relnamespace
1531
- where n.nspname = '\${Og(t)}' and c.relname = '\${Og(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 jg({table:e,schema:t=\`public\`,refreshKey:n,onChanged:r}){let[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(!1),c=(0,_.useCallback)(()=>{Ag(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,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(H,{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,B.jsx)(Ct,{size:12}),\`Add RLS policy\`,i&&(0,B.jsx)(\`span\`,{className:\`size-1.5 rounded-full \`+(i.enabled?u?\`bg-warning\`:\`bg-brand\`:\`bg-destructive\`)})]}),o&&(0,B.jsx)(Ng,{table:e,schema:t,onClose:()=>s(!1),onChanged:()=>{c(),r?.()}})]})}function Mg({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,
1531
+ where n.nspname = '\${jg(t)}' and c.relname = '\${jg(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 Pg({table:e,schema:t=\`public\`,refreshKey:n,onChanged:r}){let[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(!1),c=(0,_.useCallback)(()=>{Ng(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)(Ig,{table:e,schema:t,onClose:()=>s(!1),onChanged:()=>{c(),r?.()}})]})}function Fg({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 = '\${Og(t)}' and c.relname = '\${Og(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 \${kg(t,e)} set (security_invoker = \${n?\`on\`:\`off\`})\`);if(!i.ok){U.error(i.error??\`Failed to change view security\`);return}U.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?\`
1534
+ where n.nspname = '\${jg(t)}' and c.relname = '\${jg(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 \${Mg(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,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(ff,{open:o,onOpenChange:s,align:\`end\`,className:\`w-120 p-4\`,trigger:(0,B.jsxs)(H,{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,B.jsx)(Xe,{size:12}):(0,B.jsx)(Ze,{size:12}),m===!1?\`Security Definer view\`:\`Security Invoker view\`,m===!0&&(0,B.jsx)(\`span\`,{className:\`size-1.5 rounded-full bg-brand\`})]}),children:[(0,B.jsxs)(\`p\`,{className:\`flex items-center gap-2 text-[13px] font-medium text-foreground\`,children:[m===!1?(0,B.jsx)(Xe,{size:13,className:\`text-warning\`}):(0,B.jsx)(xt,{size:13,className:\`text-brand\`}),m===!1?\`Secure your view\`:\`This view is secured\`]}),m===!1?(0,B.jsxs)(B.Fragment,{children:[(0,B.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,B.jsxs)(\`p\`,{className:\`mt-2.5 text-[13px] leading-relaxed text-muted-foreground\`,children:[\`Since this view is in the \`,(0,B.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,B.jsx)(\`div\`,{className:\`mt-4\`,children:(0,B.jsx)(H,{onClick:()=>l(!0),children:\`Autofix\`})})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(\`p\`,{className:\`mt-2.5 text-[13px] leading-relaxed text-muted-foreground\`,children:[\`This view runs with \`,(0,B.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,B.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,B.jsxs)(ho,{open:!0,onClose:()=>l(!1),title:\`Confirm autofixing view security\`,width:\`w-235\`,children:[(0,B.jsxs)(\`div\`,{className:\`px-1 pt-1\`,children:[(0,B.jsxs)(\`p\`,{className:\`text-[13px] leading-relaxed text-muted-foreground\`,children:[\`Setting \`,(0,B.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,B.jsx)(\`div\`,{className:\`mt-4 grid grid-cols-2 gap-4\`,children:[[\`Existing query\`,h(!1)],[\`Updated query\`,h(!0)]].map(([e,t])=>(0,B.jsxs)(\`div\`,{className:\`overflow-hidden rounded-md border border-border bg-code\`,children:[(0,B.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,B.jsx)(\`div\`,{className:\`px-2 py-3\`,children:(0,B.jsx)(er,{value:t,lang:\`sql\`,readOnly:!0,minLines:g,maxLines:g})})]},e))})]}),(0,B.jsxs)(\`div\`,{className:\`-mx-4 -mb-4 mt-5 flex gap-3 border-t border-border px-4 py-3.5\`,children:[(0,B.jsx)(H,{variant:\`outline\`,className:\`h-9 flex-1\`,onClick:()=>l(!1),children:\`Cancel\`}),(0,B.jsx)(H,{className:\`h-9 flex-1\`,autoFocus:!0,onClick:()=>void p(!0),children:\`Confirm\`})]})]}),u&&(0,B.jsx)(go,{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 Ng({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 Ag(e,t))}catch(e){U.error(e.message)}},[e,t]);(0,_.useEffect)(()=>{m()},[m]);async function h(n){let i=await N.sql(\`alter table \${kg(t,e)} \${n?\`enable\`:\`disable\`} row level security\`);if(!i.ok){U.error(i.error??\`Failed to change RLS\`);return}U.success(\`RLS \${n?\`enabled\`:\`disabled\`} on \${e}\`),await m(),r?.()}async function g(n){try{await N.dropPolicy(e,n.name,t),U.success(\`Dropped policy \${n.name}\`),await m(),r?.()}catch(e){U.error(e.message)}}return(0,B.jsxs)(Kp,{open:!0,onClose:n,width:\`w-[560px]\`,title:(0,B.jsxs)(\`span\`,{children:[\`Row Level Security — \`,(0,B.jsx)(\`code\`,{className:\`rounded bg-accent px-1.5 py-0.5 font-mono text-xs text-foreground\`,children:e})]}),footer:(0,B.jsx)(Gp,{asChild:!0,children:(0,B.jsx)(H,{variant:\`outline\`,className:\`ml-auto\`,children:\`Done\`})}),children:[i?(0,B.jsxs)(\`div\`,{className:\`space-y-5\`,children:[(0,B.jsxs)(\`div\`,{className:\`flex items-center gap-3 rounded-md border border-border bg-card p-3.5\`,children:[i.enabled?(0,B.jsx)(xt,{size:16,className:\`text-brand\`}):(0,B.jsx)(St,{size:16,className:\`text-destructive\`}),(0,B.jsxs)(\`div\`,{className:\`min-w-0 flex-1\`,children:[(0,B.jsx)(\`p\`,{className:\`text-[13px] font-medium text-foreground\`,children:\`Enable Row Level Security\`}),(0,B.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,B.jsx)(Jp,{checked:i.enabled,onChange:e=>e?void h(!0):d(!0)})]}),i.enabled&&i.policies.length===0&&(0,B.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,B.jsx)(kt,{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,B.jsxs)(\`div\`,{children:[(0,B.jsxs)(\`div\`,{className:\`mb-2 flex items-center justify-between\`,children:[(0,B.jsxs)(\`p\`,{className:\`text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/80\`,children:[\`Policies \`,(0,B.jsx)(\`span\`,{className:\`text-muted-foreground/60\`,children:i.policies.length})]}),(0,B.jsxs)(H,{size:\`xs\`,onClick:()=>s(!0),children:[(0,B.jsx)(pt,{size:12}),\` Create policy\`]})]}),(0,B.jsxs)(\`div\`,{className:\`space-y-2\`,children:[i.policies.map(e=>(0,B.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,B.jsxs)(\`div\`,{className:\`flex items-center gap-2\`,children:[(0,B.jsx)(\`span\`,{className:\`truncate font-mono text-[13px] text-foreground\`,children:e.name}),(0,B.jsx)(V,{variant:\`blue\`,children:e.cmd}),String(e.permissive).toUpperCase()!==\`PERMISSIVE\`&&(0,B.jsx)(V,{variant:\`red\`,children:\`restrictive\`}),(0,B.jsx)(V,{variant:\`neutral\`,children:Array.isArray(e.roles)?e.roles.join(\`, \`):String(e.roles)}),(0,B.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,B.jsx)(Ot,{size:13})})]}),e.using_expr&&(0,B.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,B.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,B.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,B.jsx)(\`button\`,{className:\`text-brand hover:underline\`,onClick:()=>s(!0),children:\`Create policy\`})]})]})]})]}):(0,B.jsx)(qp,{}),o&&(0,B.jsx)(wg,{table:e,schema:t,onClose:()=>s(!1),onCreated:async()=>{await m(),r?.()}}),c&&(0,B.jsx)(wg,{table:e,schema:t,existing:Dg(c),onClose:()=>l(null),onCreated:async()=>{await m(),r?.()}}),u&&(0,B.jsx)(go,{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,B.jsx)(go,{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 Pg(){let[e]=Uh(),[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),U.success(\`Dropped policy \${e.name}\`),h()}catch(e){U.error(e.message)}}if(t===null)return(0,B.jsx)(qp,{});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,B.jsxs)(\`div\`,{className:\`flex h-full flex-col\`,children:[(0,B.jsx)(Yh,{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,B.jsxs)(H,{size:\`xs\`,onClick:()=>u(!0),children:[(0,B.jsx)(pt,{size:12}),\` New policy\`]})}),r&&(0,B.jsx)(df,{message:r}),(0,B.jsxs)(\`div\`,{className:\`min-h-0 flex-1 space-y-5 overflow-y-auto p-6\`,children:[[...y].map(([e,t])=>(0,B.jsxs)(\`div\`,{children:[(0,B.jsxs)(\`div\`,{className:\`mb-1.5 flex items-center gap-2\`,children:[(0,B.jsx)(xt,{size:13,className:\`text-brand\`}),(0,B.jsx)(\`span\`,{className:\`font-mono text-[13px] text-foreground/90\`,children:e}),(0,B.jsxs)(\`span\`,{className:\`text-[11px] text-muted-foreground/60\`,children:[t.length,\` \`,t.length===1?\`policy\`:\`policies\`]})]}),(0,B.jsx)(\`div\`,{className:\`space-y-2\`,children:t.map(e=>(0,B.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,B.jsxs)(\`div\`,{className:\`flex items-center gap-2\`,children:[(0,B.jsx)(\`span\`,{className:\`truncate font-mono text-[13px] text-foreground\`,children:e.name}),(0,B.jsx)(V,{variant:\`blue\`,children:e.cmd}),String(e.permissive).toUpperCase()!==\`PERMISSIVE\`&&(0,B.jsx)(V,{variant:\`red\`,children:\`restrictive\`}),(0,B.jsx)(V,{variant:\`neutral\`,children:Array.isArray(e.roles)?e.roles.join(\`, \`):String(e.roles)}),(0,B.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,B.jsx)(Ot,{size:13})})]}),e.using_expr&&(0,B.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,B.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,B.jsx)(cf,{children:t.length===0?\`No policies yet. Create one to start restricting access.\`:\`No match.\`})]}),l&&(0,B.jsx)(wg,{tables:a,schema:e,onClose:()=>u(!1),onCreated:async()=>h()}),d&&(0,B.jsx)(wg,{table:d.table,schema:e,existing:Dg(d),onClose:()=>f(null),onCreated:async()=>h()}),p&&(0,B.jsx)(go,{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 Fg=new Set([\`postgres\`,\`anon\`,\`authenticated\`,\`authenticator\`,\`service_role\`]),Ig=[{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 Lg(){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 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,
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 \${Xh(e.name)} \${t.sql(n)}\`);if(!r.ok){U.error(r.error??\`Failed to change privilege\`);return}U.success(\`\${e.name}: \${t.sql(n)}\`),await f()}async function m(e){let t=await N.sql(\`drop role \${Xh(e.name)}\`);if(!t.ok){U.error(t.error??\`Drop failed — the role may still own objects or have grants\`);return}U.success(\`Dropped role \${e.name}\`),await f()}if(e===null)return(0,B.jsx)(qp,{});let h=e.filter(e=>e.name.toLowerCase().includes(i.toLowerCase())),g=h.filter(e=>Fg.has(e.name)),v=h.filter(e=>!Fg.has(e.name)),y=e.reduce((e,t)=>e+t.connections,0),b=(e,t)=>{let n=o===e.name;return(0,B.jsxs)(\`div\`,{className:\`border-b border-border/60 last:border-b-0\`,children:[(0,B.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,B.jsx)(pe,{size:13,className:\`shrink-0 text-muted-foreground/60\`}):(0,B.jsx)(he,{size:13,className:\`shrink-0 text-muted-foreground/60\`}),(0,B.jsx)(\`span\`,{className:\`font-mono text-[13px] text-foreground\`,children:e.name}),(0,B.jsxs)(\`span\`,{className:\`text-[11px] text-muted-foreground/60\`,children:[\`(ID: \`,e.oid,\`)\`]}),e.super&&(0,B.jsx)(V,{variant:\`amber\`,children:\`superuser\`}),[\`anon\`,\`authenticated\`,\`service_role\`].includes(e.name)&&(0,B.jsx)(V,{variant:\`brand\`,children:\`api\`}),(0,B.jsxs)(\`span\`,{className:\`ml-auto flex items-center gap-1.5 text-[12px] text-muted-foreground\`,children:[e.connections>0&&(0,B.jsx)(\`span\`,{className:\`size-1.5 rounded-full bg-brand\`}),e.connections,\` connection\`,e.connections===1?\`\`:\`s\`]}),!t&&(0,B.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,B.jsx)(Ot,{size:13})})]}),n&&(0,B.jsxs)(\`div\`,{className:\`space-y-3 px-11 pb-4 pt-1\`,children:[Ig.map(n=>(0,B.jsxs)(\`label\`,{className:\`flex items-center gap-3 text-[13px] text-foreground/85 \`+(t?\`opacity-70\`:\`\`),children:[(0,B.jsx)(Jp,{checked:!!e[n.key],disabled:t,onChange:t=>void p(e,n,t)}),n.label]},n.key)),(0,B.jsxs)(\`label\`,{className:\`flex items-center gap-3 text-[13px] text-foreground/85 opacity-70\`,children:[(0,B.jsx)(Jp,{checked:e.super,disabled:!0}),\`User is a Superuser \`,(0,B.jsx)(\`span\`,{className:\`text-[11px] text-muted-foreground/60\`,children:\`— cannot be granted via the dashboard\`})]})]})]},e.name)};return(0,B.jsxs)(\`div\`,{className:\`flex h-full flex-col\`,children:[(0,B.jsx)(Yh,{title:\`Roles\`,description:\`Manage access control to your database through users, groups, and permissions.\`,search:i,onSearch:a,onRefresh:()=>void f(),filters:(0,B.jsxs)(\`span\`,{className:\`ml-auto shrink-0 text-[11px] text-muted-foreground/70\`,children:[\`Active connections \`,(0,B.jsx)(\`span\`,{className:\`tabular-nums text-foreground/80\`,children:y})]}),actions:(0,B.jsxs)(H,{size:\`xs\`,onClick:()=>l(!0),children:[(0,B.jsx)(pt,{size:12}),\` Add role\`]})}),n&&(0,B.jsx)(df,{message:n}),(0,B.jsxs)(\`div\`,{className:\`min-h-0 flex-1 space-y-5 overflow-y-auto p-6\`,children:[(0,B.jsxs)(\`div\`,{children:[(0,B.jsxs)(\`div\`,{className:\`mb-1.5 flex items-center gap-2\`,children:[(0,B.jsx)(\`p\`,{className:\`text-[13px] text-foreground/90\`,children:\`Roles managed by tinbase\`}),(0,B.jsx)(V,{variant:\`brand\`,children:\`PROTECTED\`})]}),(0,B.jsxs)(\`div\`,{className:\`rounded-md border border-border bg-card\`,children:[g.map(e=>b(e,!0)),g.length===0&&(0,B.jsx)(\`p\`,{className:\`px-4 py-3 text-xs text-muted-foreground/60\`,children:\`No match.\`})]})]}),(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(\`p\`,{className:\`mb-1.5 text-[13px] text-foreground/90\`,children:\`Custom roles\`}),(0,B.jsxs)(\`div\`,{className:\`rounded-md border border-border bg-card\`,children:[v.map(e=>b(e,!1)),v.length===0&&(0,B.jsxs)(cf,{children:[\`No custom roles yet —\`,\` \`,(0,B.jsx)(\`button\`,{className:\`text-brand hover:underline\`,onClick:()=>l(!0),children:\`add one\`}),\`.\`]})]})]})]}),c&&(0,B.jsx)(Rg,{onClose:()=>l(!1),onDone:async()=>{l(!1),await f()}}),u&&(0,B.jsx)(go,{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 Rg({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=Ig.map(e=>e.sql(!!i[e.key])).join(\` \`),r=await N.sql(\`create role \${Xh(n.trim())} \${e}\`);if(!r.ok){l(r.error??\`Create failed\`),s(!1);return}U.success(\`Created role \${n.trim()}\`),await t()}return(0,B.jsx)(Kp,{open:!0,onClose:e,width:\`w-135\`,title:\`Create a new role\`,footer:(0,B.jsxs)(B.Fragment,{children:[c&&(0,B.jsx)(\`p\`,{className:\`min-w-0 truncate text-xs text-destructive\`,children:c}),(0,B.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-2\`,children:[(0,B.jsx)(Gp,{asChild:!0,children:(0,B.jsx)(H,{variant:\`outline\`,children:\`Cancel\`})}),(0,B.jsx)(H,{onClick:()=>void u(),disabled:o||!n.trim(),children:o?\`Creating…\`:\`Create role\`})]})]}),children:(0,B.jsxs)(\`div\`,{className:\`space-y-4\`,children:[(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(X,{children:\`Name\`}),(0,B.jsx)(Y,{mono:!0,value:n,autoFocus:!0,onChange:e=>r(e.target.value)})]}),(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(X,{children:\`Role privileges\`}),(0,B.jsx)(\`div\`,{className:\`space-y-2.5\`,children:Ig.map(e=>(0,B.jsxs)(\`label\`,{className:\`flex items-center gap-3 text-[13px] text-foreground/85\`,children:[(0,B.jsx)(Jp,{checked:!!i[e.key],onChange:t=>a(n=>({...n,[e.key]:t}))}),e.label]},e.key))}),(0,B.jsxs)(\`div\`,{className:\`mt-3 border-t border-border pt-3\`,children:[(0,B.jsx)(\`p\`,{className:\`mb-2 text-[12px] font-medium text-foreground/80\`,children:\`These privileges cannot be granted via the dashboard:\`}),(0,B.jsxs)(\`label\`,{className:\`flex items-center gap-3 text-[13px] text-foreground/85 opacity-60\`,children:[(0,B.jsx)(Jp,{checked:!1,disabled:!0}),\`User is a Superuser\`]})]})]})]})})}function zg(){let[e]=Uh(),[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,
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 \${$h(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 \${$h(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=>Rg.has(e.name)),v=h.filter(e=>!Rg.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:[zg.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)(Qh,{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)(cf,{children:[\`No custom roles yet —\`,\` \`,(0,z.jsx)(\`button\`,{className:\`text-brand hover:underline\`,onClick:()=>l(!0),children:\`add one\`}),\`.\`]})]})]})]}),c&&(0,z.jsx)(Vg,{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 Vg({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=zg.map(e=>e.sql(!!i[e.key])).join(\` \`),r=await N.sql(\`create role \${$h(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)(lf,{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:zg.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 Hg(){let[e]=Kh(),[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 = \${Zh(e)} and p.tablename = c.relname) as policies
1544
+ (select count(*)::int from pg_policies p where p.schemaname = \${eg(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 = \${Zh(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,B.jsx)(qp,{});let c=t.filter(e=>e.name.toLowerCase().includes(a.toLowerCase())),l=qh(e);return(0,B.jsxs)(\`div\`,{className:\`flex h-full flex-col\`,children:[(0,B.jsx)(Yh,{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,B.jsx)(df,{message:r}),l&&(0,B.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,B.jsx)(Xe,{size:13,className:\`shrink-0\`}),(0,B.jsxs)(\`span\`,{children:[\`The \`,(0,B.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,B.jsxs)(\`div\`,{className:\`min-h-0 flex-1 overflow-auto\`,children:[(0,B.jsxs)(Yp,{children:[(0,B.jsx)(Xp,{children:(0,B.jsxs)(\`tr\`,{children:[(0,B.jsx)(Z,{children:\`Name\`}),(0,B.jsx)(Z,{children:\`Rows\`}),(0,B.jsx)(Z,{children:\`Size\`}),(0,B.jsx)(Z,{children:\`RLS\`}),(0,B.jsx)(Z,{children:\`Policies\`}),(0,B.jsx)(Z,{className:\`w-10\`})]})}),(0,B.jsx)(\`tbody\`,{children:c.map(e=>(0,B.jsxs)(Zp,{className:\`cursor-pointer\`,onClick:()=>z(\`table\`,e.name),children:[(0,B.jsx)(Q,{className:\`font-mono text-foreground/90\`,children:(0,B.jsxs)(\`span\`,{className:\`flex items-center gap-1.5\`,children:[e.view?(0,B.jsx)(ke,{size:12,className:\`shrink-0 text-muted-foreground/60\`}):(0,B.jsx)(Et,{size:12,className:\`shrink-0 text-muted-foreground/50\`}),e.name,e.view&&(0,B.jsx)(V,{variant:\`neutral\`,children:\`view\`}),!e.pk&&!e.view&&(0,B.jsx)(\`span\`,{title:\`No primary key\`,children:(0,B.jsx)(Ge,{size:11,className:\`text-warning\`})})]})}),(0,B.jsx)(Q,{className:\`tabular-nums text-muted-foreground\`,children:e.rows.toLocaleString()}),(0,B.jsx)(Q,{className:\`font-mono text-muted-foreground\`,children:e.view?\`—\`:e.size}),(0,B.jsx)(Q,{children:e.view?e.invoker?(0,B.jsx)(\`span\`,{title:\`security_invoker — the caller's RLS applies through this view\`,children:(0,B.jsx)(V,{variant:\`neutral\`,children:\`invoker\`})}):(0,B.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,B.jsx)(V,{variant:l?\`neutral\`:\`red\`,children:l?\`definer\`:\`unrestricted\`})}):e.rls?(0,B.jsx)(V,{variant:\`brand\`,children:\`enabled\`}):(0,B.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,B.jsx)(V,{variant:l?\`neutral\`:\`red\`,children:\`disabled\`})})}),(0,B.jsx)(Q,{className:\`tabular-nums text-muted-foreground\`,children:e.view?\`—\`:e.policies}),(0,B.jsx)(Q,{children:(0,B.jsx)(ue,{size:13,className:\`text-muted-foreground/60 opacity-0 group-hover:opacity-100\`})})]},e.name))})]}),c.length===0&&(0,B.jsx)(cf,{children:t.length===0?\`No tables yet.\`:\`No match.\`})]})]})}function Bg(){let[e]=Uh(),[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,
1546
+ where n.nspname = \${eg(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=Xh(e);return(0,z.jsxs)(\`div\`,{className:\`flex h-full flex-col\`,children:[(0,z.jsx)(Qh,{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)(cf,{children:t.length===0?\`No tables yet.\`:\`No match.\`})]})]})}function Ug(){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=(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 = \${Zh(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 \${Xh(e)}.\${Xh(t.table)} \${t.enabled?\`disable\`:\`enable\`} trigger \${Xh(t.name)}\`);if(!n.ok){U.error(n.error??\`Failed\`);return}U.success(\`\${t.enabled?\`Disabled\`:\`Enabled\`} \${t.name}\`),await d()}async function p(t){let n=await N.sql(\`drop trigger \${Xh(t.name)} on \${Xh(e)}.\${Xh(t.table)}\`);if(!n.ok){U.error(n.error??\`Drop failed\`);return}U.success(\`Dropped trigger \${t.name}\`),await d()}if(t===null)return(0,B.jsx)(qp,{});let m=t.filter(e=>(e.name+e.table).toLowerCase().includes(a.toLowerCase()));return(0,B.jsxs)(\`div\`,{className:\`flex h-full flex-col\`,children:[(0,B.jsx)(Yh,{title:\`Triggers\`,description:\`Functions that fire automatically on table events.\`,search:a,onSearch:o,onRefresh:()=>void d(),schemaPicker:!0,actions:(0,B.jsxs)(H,{size:\`xs\`,onClick:()=>c(!0),children:[(0,B.jsx)(pt,{size:12}),\` New trigger\`]})}),r&&(0,B.jsx)(df,{message:r}),(0,B.jsxs)(\`div\`,{className:\`min-h-0 flex-1 overflow-auto\`,children:[(0,B.jsxs)(Yp,{children:[(0,B.jsx)(Xp,{children:(0,B.jsxs)(\`tr\`,{children:[(0,B.jsx)(Z,{children:\`Name\`}),(0,B.jsx)(Z,{children:\`Table\`}),(0,B.jsx)(Z,{children:\`Fires\`}),(0,B.jsx)(Z,{children:\`Function\`}),(0,B.jsx)(Z,{children:\`Status\`}),(0,B.jsx)(Z,{className:\`w-20\`})]})}),(0,B.jsx)(\`tbody\`,{children:m.map(e=>(0,B.jsxs)(Zp,{children:[(0,B.jsx)(Q,{className:\`font-mono text-foreground/90\`,children:e.name}),(0,B.jsx)(Q,{className:\`font-mono text-muted-foreground\`,children:e.table}),(0,B.jsxs)(Q,{className:\`text-muted-foreground\`,children:[e.timing,\` \`,Lt(e.events).join(\` | \`)]}),(0,B.jsxs)(Q,{className:\`font-mono text-[11px] text-muted-foreground/80\`,children:[e.function,\`()\`]}),(0,B.jsx)(Q,{children:e.enabled?(0,B.jsx)(V,{variant:\`brand\`,children:\`enabled\`}):(0,B.jsx)(V,{variant:\`neutral\`,children:\`disabled\`})}),(0,B.jsx)(Q,{children:(0,B.jsxs)(\`div\`,{className:\`flex justify-end gap-0.5 opacity-0 group-hover:opacity-100\`,children:[(0,B.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,B.jsx)(st,{size:13}):(0,B.jsx)(dt,{size:13})}),(0,B.jsx)(\`button\`,{className:\`p-1 text-muted-foreground/80 hover:text-destructive\`,title:\`Drop\`,onClick:()=>u(e),children:(0,B.jsx)(Ot,{size:13})})]})})]},e.table+e.name))})]}),m.length===0&&(0,B.jsx)(cf,{children:t.length===0?\`No triggers.\`:\`No match.\`})]}),s&&(0,B.jsx)(Vg,{schema:e,onClose:()=>c(!1),onDone:async()=>{c(!1),await d()}}),l&&(0,B.jsx)(go,{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 Vg({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 \${Xh(r.trim())}
1559
- \${d.toLowerCase()} \${T.join(\` or \`)} on \${Gh(e,a)}
1557
+ where n.nspname = \${eg(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 \${$h(e)}.\${$h(t.table)} \${t.enabled?\`disable\`:\`enable\`} trigger \${$h(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 \${$h(t.name)} on \${$h(e)}.\${$h(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)(Qh,{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)(cf,{children:t.length===0?\`No triggers.\`:\`No match.\`})]}),s&&(0,z.jsx)(Wg,{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 Wg({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 \${$h(r.trim())}
1559
+ \${d.toLowerCase()} \${T.join(\` or \`)} on \${Jh(e,a)}
1560
1560
  for each \${p.toLowerCase()}
1561
- execute function \${Gh(e,h)}()\`,i=await N.sql(t);if(!i.ok){C(i.error??\`Create failed\`),x(!1);return}U.success(\`Created trigger \${r.trim()}\`),await n()}return(0,B.jsx)(Kp,{open:!0,onClose:t,width:\`w-140\`,title:\`Create a new database trigger\`,footer:(0,B.jsxs)(B.Fragment,{children:[S&&(0,B.jsx)(\`p\`,{className:\`min-w-0 truncate text-xs text-destructive\`,children:S}),(0,B.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-2\`,children:[(0,B.jsx)(Gp,{asChild:!0,children:(0,B.jsx)(H,{variant:\`outline\`,children:\`Cancel\`})}),(0,B.jsx)(H,{onClick:()=>void E(),disabled:b||!r.trim()||!a||T.length===0||!h,children:b?\`Creating…\`:\`Create trigger\`})]})]}),children:(0,B.jsxs)(\`div\`,{className:\`space-y-3\`,children:[(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(X,{children:\`Name of trigger\`}),(0,B.jsx)(Y,{mono:!0,value:r,autoFocus:!0,placeholder:\`set_updated_at\`,onChange:e=>i(e.target.value.replace(/\\s/g,\`_\`))}),(0,B.jsx)(\`p\`,{className:\`mt-1 text-[11px] text-muted-foreground/60\`,children:\`Do not use spaces/whitespace.\`})]}),(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(X,{children:\`Table\`}),(0,B.jsx)(Up,{mono:!0,value:a,onValueChange:o,placeholder:\`Pick a table…\`,options:s.map(t=>({value:t,label:\`\${e}.\${t}\`}))}),(0,B.jsx)(\`p\`,{className:\`mt-1 text-[11px] text-muted-foreground/60\`,children:\`The trigger watches for changes on this table.\`})]}),(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(X,{children:\`Events\`}),(0,B.jsx)(\`div\`,{className:\`space-y-1.5\`,children:[\`INSERT\`,\`UPDATE\`,\`DELETE\`].map(e=>(0,B.jsxs)(\`label\`,{className:\`flex cursor-pointer items-center gap-2 text-[13px] text-foreground/85\`,children:[(0,B.jsx)(Zt,{checked:l.has(e),onChange:()=>w(e)}),(0,B.jsx)(\`span\`,{className:\`font-mono\`,children:e})]},e))})]}),(0,B.jsxs)(\`div\`,{className:\`grid grid-cols-2 gap-3\`,children:[(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(X,{children:\`Trigger type\`}),(0,B.jsx)(Up,{value:d,onValueChange:e=>f(e),options:[{value:\`BEFORE\`,label:\`Before the event\`},{value:\`AFTER\`,label:\`After the event\`}]})]}),(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(X,{children:\`Orientation\`}),(0,B.jsx)(Up,{value:p,onValueChange:e=>m(e),options:[{value:\`ROW\`,label:\`Row\`},{value:\`STATEMENT\`,label:\`Statement\`}]})]})]}),(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(X,{children:\`Function to trigger\`}),v.length>0?(0,B.jsx)(Up,{mono:!0,value:h,onValueChange:g,placeholder:\`Choose a function…\`,options:v.map(e=>({value:e,label:\`\${e}()\`}))}):(0,B.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,B.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:e}),\` yet — create one under Functions with return type \`,(0,B.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`trigger\`}),\` first.\`]})]})]})})}var Hg=240,Ug=32,Wg=22,Gg=36,Kg=60,qg=e=>Ug+e.columns.length*Wg+6;function Jg(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=Kg;for(let r of t)a[r.name]={x:Kg+e*350,y:n},n+=qg(r)+Gg}return a}function Yg(){let[e]=Uh(),[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(Jg(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={...Jg(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+Ug+u*Wg+Wg/2,f=l.x+Hg/2<t.x+Hg/2,p={x:f?t.x:t.x+Hg,y:d},m={x:f?l.x+Hg:l.x,y:l.y+Ug/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+Hg/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,B.jsx)(qp,{}):(0,B.jsxs)(\`div\`,{className:\`flex h-full flex-col\`,children:[(0,B.jsxs)(\`div\`,{className:\`flex shrink-0 items-center gap-2 border-b border-border px-4 py-2.5\`,children:[(0,B.jsx)(\`h1\`,{className:\`mr-2 text-sm font-semibold text-foreground\`,children:\`Schema Visualizer\`}),(0,B.jsx)(Jh,{}),(0,B.jsxs)(\`div\`,{className:\`relative w-56\`,children:[(0,B.jsx)(_t,{size:13,className:\`pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground/60\`}),(0,B.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,B.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,B.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,B.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-1.5\`,children:[(0,B.jsx)(H,{variant:\`ghost\`,size:\`iconXs\`,title:\`Zoom out\`,onClick:()=>b(1/1.2),children:(0,B.jsx)(tt,{size:13})}),(0,B.jsxs)(\`span\`,{className:\`w-10 text-center text-[11px] tabular-nums text-muted-foreground\`,children:[Math.round(s*100),\`%\`]}),(0,B.jsx)(H,{variant:\`ghost\`,size:\`iconXs\`,title:\`Zoom in\`,onClick:()=>b(1.2),children:(0,B.jsx)(pt,{size:13})}),(0,B.jsxs)(H,{variant:\`outline\`,size:\`xs\`,onClick:()=>{i(Jg(t)),o({x:0,y:0})},children:[(0,B.jsx)(Ke,{size:12}),\` Auto layout\`]})]})]}),t.length===0?(0,B.jsx)(cf,{children:\`No tables in this schema yet — create one in the table editor or SQL editor.\`}):(0,B.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,B.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,B.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,B.jsxs)(\`g\`,{children:[(0,B.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,B.jsx)(\`circle\`,{cx:e.from.x,cy:e.from.y,r:2.5,fill:\`var(--color-muted-foreground)\`,fillOpacity:.7}),(0,B.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,B.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:Hg},children:[(0,B.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,B.jsx)(Et,{size:12,className:\`shrink-0 text-muted-foreground\`}),(0,B.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:()=>z(\`table\`,e.name),children:e.name}),(0,B.jsx)(\`span\`,{className:\`text-[10px] tabular-nums text-muted-foreground/60\`,children:e.rowCount.toLocaleString()})]}),(0,B.jsx)(\`div\`,{className:\`py-0.5\`,children:e.columns.map(e=>(0,B.jsxs)(\`div\`,{className:\`flex items-center gap-1.5 px-2.5\`,style:{height:Wg},children:[e.isPrimaryKey?(0,B.jsx)(Ge,{size:9,className:\`shrink-0 text-warning\`}):(0,B.jsx)(we,{size:8,className:\`shrink-0 \`+(e.nullable?\`text-muted-foreground/50\`:\`fill-muted-foreground/60 text-muted-foreground/60\`)}),(0,B.jsx)(\`span\`,{className:\`min-w-0 flex-1 truncate font-mono text-[11px] text-foreground/85\`,children:e.name}),(0,B.jsx)(\`span\`,{className:\`shrink-0 font-mono text-[10px] text-muted-foreground/50\`,children:e.type})]},e.name))})]},e.name):null})]}),(0,B.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,B.jsxs)(\`span\`,{className:\`flex items-center gap-1.5\`,children:[(0,B.jsx)(Ge,{size:10,className:\`text-warning\`}),\` Primary key\`]}),(0,B.jsxs)(\`span\`,{className:\`flex items-center gap-1.5\`,children:[(0,B.jsx)(we,{size:9,className:\`text-muted-foreground/50\`}),\` Nullable\`]}),(0,B.jsxs)(\`span\`,{className:\`flex items-center gap-1.5\`,children:[(0,B.jsx)(we,{size:9,className:\`fill-muted-foreground/60 text-muted-foreground/60\`}),\` Non-nullable\`]})]})]})]})}var Xg=[{id:\`visualizer\`,label:\`Schema Visualizer\`,component:Yg},{id:\`tables\`,label:\`Tables\`,component:zg},{id:\`functions\`,label:\`Functions\`,component:ug},{id:\`triggers\`,label:\`Triggers\`,component:Bg},{id:\`enums\`,label:\`Enumerated Types\`,component:cg},{id:\`indexes\`,label:\`Indexes\`,component:hg},{id:\`migrations\`,label:\`Migrations\`,component:vg},{id:\`policies\`,label:\`Policies\`,component:Pg},{id:\`roles\`,label:\`Roles\`,component:Lg}];function Zg(){let{section:e}=qt(),t=Xg.some(t=>t.id===e)?e:\`visualizer\`,n=Xg.find(e=>e.id===t).component;return(0,B.jsxs)(\`div\`,{className:\`flex h-full\`,children:[(0,B.jsx)(wh,{title:\`Database\`,active:t,onSelect:e=>z(\`database\`,e),groups:[{title:\`Database Management\`,items:Xg.slice(0,7).map(e=>({id:e.id,label:e.label}))},{title:\`Access Control\`,items:Xg.slice(7).map(e=>({id:e.id,label:e.label}))}]}),(0,B.jsx)(\`div\`,{className:\`min-w-0 flex-1 overflow-y-auto\`,children:(0,B.jsx)(n,{})})]})}function Qg({name:e,onClose:t}){let[n,r]=(0,_.useState)(\`POST\`),[i,a]=(0,_.useState)(\`service_role\`),[o,s]=(0,_.useState)(\`{
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)(\`{
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(\`\${ch()}/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,B.jsx)(Kp,{open:!0,onClose:t,width:\`w-[560px]\`,title:(0,B.jsxs)(\`span\`,{children:[\`Invoke \`,(0,B.jsx)(\`code\`,{className:\`rounded bg-accent px-1.5 py-0.5 font-mono text-xs text-foreground\`,children:e})]}),footer:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Gp,{asChild:!0,children:(0,B.jsx)(H,{variant:\`outline\`,children:\`Close\`})}),(0,B.jsxs)(H,{className:\`ml-auto\`,onClick:()=>void f(),disabled:u,children:[(0,B.jsx)(dt,{size:12}),\` \`,u?\`Invoking…\`:\`Invoke\`]})]}),children:(0,B.jsxs)(\`div\`,{className:\`space-y-4\`,children:[(0,B.jsxs)(\`div\`,{className:\`grid grid-cols-2 gap-3\`,children:[(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(X,{children:\`Method\`}),(0,B.jsx)(Up,{value:n,onValueChange:r,options:[\`POST\`,\`GET\`,\`PUT\`,\`PATCH\`,\`DELETE\`].map(e=>({value:e}))})]}),(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(X,{children:\`Authorization\`}),(0,B.jsx)(Up,{value:i,onValueChange:e=>a(e),options:[{value:\`service_role\`,label:\`service_role key\`},{value:\`anon\`,label:\`anon key\`}]})]})]}),n!==\`GET\`&&(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(X,{children:\`Request body (JSON)\`}),(0,B.jsx)(nr,{lang:\`js\`,className:\`h-32\`,value:o,onChange:s,onCmdEnter:()=>void f()})]}),u&&(0,B.jsx)(qp,{}),c&&(0,B.jsxs)(\`div\`,{children:[(0,B.jsxs)(\`div\`,{className:\`mb-2 flex items-center gap-3 text-[13px]\`,children:[(0,B.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,B.jsxs)(\`span\`,{className:\`text-muted-foreground/80\`,children:[c.ms,\` ms\`]})]}),(0,B.jsx)(er,{value:c.body||\`(empty body)\`,lang:\`js\`,readOnly:!0,minLines:4,maxLines:200}),c.headers.length>0&&(0,B.jsxs)(\`details\`,{className:\`mt-2\`,children:[(0,B.jsxs)(\`summary\`,{className:\`cursor-pointer text-xs text-muted-foreground hover:text-foreground\`,children:[\`Response headers (\`,c.headers.length,\`)\`]}),(0,B.jsx)(\`div\`,{className:\`mt-1.5 space-y-0.5 font-mono text-[11px] text-muted-foreground\`,children:c.headers.map(([e,t])=>(0,B.jsxs)(\`div\`,{className:\`truncate\`,children:[(0,B.jsx)(\`span\`,{className:\`text-foreground/70\`,children:e}),\`: \`,t]},e))})]})]})]})})}var $g=[\`functions\`,\`secrets\`,\`settings\`];function e_(){let{section:e}=qt(),t=$g.includes(e)?e:\`functions\`;return(0,B.jsxs)(\`div\`,{className:\`flex h-full\`,children:[(0,B.jsx)(wh,{title:\`Edge Functions\`,active:t,onSelect:e=>z(\`functions\`,e),groups:[{title:\`Manage\`,items:[{id:\`functions\`,label:\`Functions\`}]},{title:\`Configuration\`,items:[{id:\`secrets\`,label:\`Secrets\`},{id:\`settings\`,label:\`Settings\`}]}]}),(0,B.jsxs)(\`div\`,{className:\`min-w-0 flex-1 overflow-y-auto\`,children:[t===\`functions\`&&(0,B.jsx)(t_,{}),t===\`secrets\`&&(0,B.jsx)(r_,{}),t===\`settings\`&&(0,B.jsx)(o_,{})]})]})}function t_(){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,B.jsx)(qp,{}):(0,B.jsxs)(\`div\`,{className:\`flex h-full flex-col\`,children:[(0,B.jsx)(\`div\`,{className:\`border-b border-border px-6 pb-4 pt-5\`,children:(0,B.jsxs)(\`div\`,{className:\`flex items-start justify-between\`,children:[(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(\`h1\`,{className:\`text-lg font-semibold text-foreground\`,children:\`Functions\`}),(0,B.jsxs)(\`p\`,{className:\`mt-0.5 text-[13px] text-muted-foreground/80\`,children:[(0,B.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`Deno.serve\`}),\` / export-default handlers loaded from\`,\` \`,(0,B.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`supabase/functions/<name>/index.ts\`}),\` — running in-process.\`]})]}),(0,B.jsx)(H,{variant:\`ghost\`,size:\`iconXs\`,title:\`Refresh\`,onClick:i,children:(0,B.jsx)(ht,{size:13})})]})}),(0,B.jsxs)(\`div\`,{className:\`min-h-0 flex-1 overflow-auto\`,children:[e.length===0?(0,B.jsx)(\`div\`,{className:\`flex h-full items-center justify-center\`,children:(0,B.jsxs)(\`div\`,{className:\`max-w-md rounded-lg border border-dashed border-border px-10 py-8 text-center\`,children:[(0,B.jsx)(It,{size:20,className:\`mx-auto text-muted-foreground/60\`}),(0,B.jsx)(\`p\`,{className:\`mt-3 text-sm font-medium text-foreground\`,children:\`No functions loaded\`}),(0,B.jsxs)(\`p\`,{className:\`mt-1 text-xs leading-relaxed text-muted-foreground/80\`,children:[\`Create \`,(0,B.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`supabase/functions/hello/index.ts\`}),\` with a\`,\` \`,(0,B.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`Deno.serve(handler)\`}),\` and restart tinbase — it appears here and is served at \`,(0,B.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`/functions/v1/hello\`}),\`.\`]})]})}):(0,B.jsxs)(Yp,{children:[(0,B.jsx)(Xp,{children:(0,B.jsxs)(\`tr\`,{children:[(0,B.jsx)(Z,{children:\`Name\`}),(0,B.jsx)(Z,{children:\`URL\`}),(0,B.jsx)(Z,{className:\`w-24\`})]})}),(0,B.jsx)(\`tbody\`,{children:e.map(e=>{let t=\`\${ch()}/functions/v1/\${e}\`;return(0,B.jsxs)(Zp,{children:[(0,B.jsx)(Q,{className:\`font-mono text-foreground/90\`,children:e}),(0,B.jsx)(Q,{children:(0,B.jsxs)(\`span\`,{className:\`flex items-center gap-1 font-mono text-[12px] text-muted-foreground\`,children:[(0,B.jsx)(\`span\`,{className:\`truncate\`,children:t}),(0,B.jsx)(Qn,{value:t,label:\`\${e} URL\`,iconSize:11})]})}),(0,B.jsx)(Q,{children:(0,B.jsxs)(H,{variant:\`outline\`,size:\`xs\`,onClick:()=>r(e),children:[(0,B.jsx)(dt,{size:11}),\` Invoke\`]})})]},e)})})]}),e.length>0&&(0,B.jsx)(cf,{children:\`Invoke runs the function through the real HTTP path with the key/role you pick.\`})]}),n&&(0,B.jsx)(Qg,{name:n,onClose:()=>r(null)})]})}var n_={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 r_(){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,B.jsx)(qp,{});let a=n.trim()?e.custom.filter(e=>e.name.toLowerCase().includes(n.trim().toLowerCase())):e.custom;return(0,B.jsxs)(bh,{title:\`Edge Function Secrets\`,children:[(0,B.jsx)(a_,{existing:new Set([...e.builtins,...e.custom.map(e=>e.name)]),onSaved:i}),(0,B.jsxs)(xh,{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,B.jsxs)(\`div\`,{className:\`mb-3 flex items-center justify-between gap-3\`,children:[(0,B.jsxs)(\`p\`,{className:\`text-xs text-muted-foreground/70\`,children:[e.custom.length,\` secret\`,e.custom.length===1?\`\`:\`s\`]}),e.custom.length>0&&(0,B.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,B.jsx)(\`p\`,{className:\`py-6 text-xs text-muted-foreground/60\`,children:\`No custom secrets yet. Add one above.\`}):(0,B.jsxs)(Yp,{children:[(0,B.jsx)(Xp,{children:(0,B.jsxs)(\`tr\`,{children:[(0,B.jsx)(Z,{children:\`Name\`}),(0,B.jsxs)(Z,{children:[\`Digest \`,(0,B.jsx)(V,{variant:\`neutral\`,children:\`SHA256\`})]}),(0,B.jsx)(Z,{className:\`w-10\`})]})}),(0,B.jsxs)(\`tbody\`,{children:[a.map(e=>(0,B.jsx)(i_,{secret:e,onChanged:i},e.name)),a.length===0&&(0,B.jsx)(\`tr\`,{children:(0,B.jsxs)(Q,{colSpan:3,className:\`py-6 text-center text-xs text-muted-foreground/60\`,children:[\`No secret matches “\`,n,\`”.\`]})})]})]})]}),(0,B.jsx)(xh,{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,B.jsx)(Sh,{label:e,description:n_[e]??\`Provided by tinbase.\`,children:(0,B.jsx)(V,{variant:\`neutral\`,children:\`built-in\`})},e))})]})}function i_({secret:e,onChanged:t}){let[n,r]=(0,_.useState)(!1),i=async()=>{try{await N.deleteSecret(e.name),U.success(\`Deleted \${e.name}\`),t()}catch(t){U.error(t instanceof Error?t.message:\`Failed to delete \${e.name}\`)}finally{r(!1)}};return(0,B.jsxs)(Zp,{children:[(0,B.jsx)(Q,{children:(0,B.jsx)(V,{variant:\`neutral\`,children:e.name})}),(0,B.jsx)(Q,{children:(0,B.jsxs)(\`span\`,{className:\`flex items-center gap-1 font-mono text-[12px] text-muted-foreground\`,children:[(0,B.jsxs)(\`span\`,{className:\`truncate\`,title:e.digest,children:[e.digest.slice(0,48),\`…\`]}),(0,B.jsx)(Qn,{value:e.digest,label:\`\${e.name} digest\`,iconSize:11})]})}),(0,B.jsx)(Q,{children:(0,B.jsxs)(Zd,{children:[(0,B.jsx)(Qd,{asChild:!0,children:(0,B.jsx)(H,{variant:\`ghost\`,size:\`iconXs\`,title:\`Actions\`,children:(0,B.jsx)(Ee,{size:13})})}),(0,B.jsx)(tf,{children:(0,B.jsxs)(nf,{danger:!0,onSelect:()=>r(!0),children:[(0,B.jsx)(Ot,{size:13}),\` Delete secret\`]})})]})}),n&&(0,B.jsx)(go,{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 a_({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 U.error(\`Invalid name "\${n}" — letters, digits, underscores.\`);if(e.has(n)&&[\`SUPABASE_URL\`,\`SUPABASE_ANON_KEY\`,\`SUPABASE_SERVICE_ROLE_KEY\`].includes(n))return U.error(\`"\${n}" is built-in and can't be changed.\`);i[n]=t.value}}if(Object.keys(i).length===0)return U.error(\`Enter at least one named secret.\`);a(!0);try{await N.putSecrets(i),U.success(\`Saved \${Object.keys(i).length} secret\${Object.keys(i).length===1?\`\`:\`s\`}\`),r([{name:\`\`,value:\`\`}]),t()}catch(e){U.error(e instanceof Error?e.message:\`Failed to save secrets\`)}finally{a(!1)}};return(0,B.jsx)(xh,{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,B.jsxs)(\`div\`,{className:\`space-y-3\`,children:[n.map((e,t)=>(0,B.jsxs)(\`div\`,{className:\`grid grid-cols-[minmax(0,1fr)_minmax(0,1.6fr)_auto] items-start gap-3\`,children:[(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(X,{children:\`Name\`}),(0,B.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,B.jsxs)(\`div\`,{children:[(0,B.jsx)(X,{children:\`Value\`}),(0,B.jsx)($p,{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,B.jsx)(H,{variant:\`ghost\`,size:\`iconXs\`,title:\`Remove row\`,className:\`mt-6\`,onClick:()=>r(e=>e.filter((e,n)=>n!==t)),children:(0,B.jsx)(Ot,{size:13})})]},t)),(0,B.jsxs)(\`div\`,{className:\`flex items-center justify-between border-t border-border pt-3\`,children:[(0,B.jsxs)(H,{variant:\`outline\`,size:\`xs\`,onClick:()=>r(e=>[...e,{name:\`\`,value:\`\`}]),children:[(0,B.jsx)(pt,{size:12}),\` Add another\`]}),(0,B.jsx)(H,{size:\`sm\`,onClick:()=>void s(),disabled:i,children:i?\`Saving…\`:\`Save\`})]})]})})}function o_(){let e=({children:e})=>(0,B.jsx)(\`code\`,{className:\`rounded bg-code px-1 py-px font-mono text-foreground/90\`,children:e});return(0,B.jsxs)(bh,{title:\`Edge Function Settings\`,children:[(0,B.jsxs)(xh,{title:\`Runtime\`,description:\`How functions execute on this instance.\`,children:[(0,B.jsx)(Sh,{label:\`Engine\`,description:\`In-process Deno shim — no containers, no cold starts.\`,children:(0,B.jsxs)(\`span\`,{className:\`text-[13px] text-muted-foreground\`,children:[(0,B.jsx)(e,{children:\`Deno.serve\`}),\`, \`,(0,B.jsx)(e,{children:\`Deno.env\`}),\`, fetch, WebCrypto\`]})}),(0,B.jsx)(Sh,{label:\`Loading\`,description:\`Functions are discovered at boot; restart tinbase to pick up new or changed code.\`,children:(0,B.jsx)(\`span\`,{className:\`text-[13px] text-muted-foreground\`,children:(0,B.jsx)(e,{children:\`supabase/functions/<name>/index.ts\`})})}),(0,B.jsx)(Sh,{label:\`Invocation\`,description:\`Every HTTP method, CORS pre-handled.\`,children:(0,B.jsx)(\`span\`,{className:\`text-[13px] text-muted-foreground\`,children:(0,B.jsx)(e,{children:\`/functions/v1/<name>\`})})})]}),(0,B.jsxs)(xh,{title:\`Security\`,description:\`What a function sees on each request.\`,children:[(0,B.jsx)(Sh,{label:\`JWT verification\`,description:(0,B.jsxs)(B.Fragment,{children:[\`The \`,(0,B.jsx)(e,{children:\`Authorization\`}),\` header is passed through as-is — verify the JWT inside the function (or trust the gateway key), matching \`,(0,B.jsx)(e,{children:\`verify_jwt\`}),\`-off Supabase functions.\`]}),children:(0,B.jsx)(V,{variant:\`neutral\`,children:\`pass-through\`})}),(0,B.jsx)(Sh,{label:\`Secrets\`,description:\`Injected from supabase/functions/.env plus the built-in SUPABASE_* vars.\`,children:(0,B.jsx)(H,{variant:\`outline\`,size:\`xs\`,onClick:()=>z(\`functions\`,\`secrets\`),children:\`View secrets\`})}),(0,B.jsx)(Sh,{label:\`Database access\`,description:(0,B.jsxs)(B.Fragment,{children:[\`Use supabase-js with \`,(0,B.jsx)(e,{children:\`SUPABASE_URL\`}),\` and a key from env — requests loop back through the same backend in-process.\`]}),children:(0,B.jsx)(V,{variant:\`brand\`,children:\`in-process\`})})]})]})}function s_(){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=ch(),p=Zn(f,\`API URL\`);if((0,_.useEffect)(()=>{Promise.allSettled([N.stats(),N.tables(),N.migrations(),N.logs(),Zm()]).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,B.jsx)(qp,{});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,B.jsx)(\`div\`,{className:\`h-full overflow-y-auto\`,children:(0,B.jsxs)(\`div\`,{className:\`mx-auto w-full max-w-7xl space-y-12 px-10 py-12\`,children:[(0,B.jsxs)(\`div\`,{children:[(0,B.jsxs)(\`div\`,{className:\`flex items-center gap-3\`,children:[(0,B.jsx)(\`h1\`,{className:\`text-3xl font-semibold text-foreground\`,children:\`tinbase\`}),(0,B.jsxs)(V,{variant:\`brand\`,children:[(0,B.jsx)(\`span\`,{className:\`inline-block size-1.5 rounded-full bg-brand\`}),\` \`,\`Healthy\`]})]}),(0,B.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,B.jsx)(fe,{size:11,className:\`text-brand\`}):(0,B.jsx)(xe,{size:11,className:\`opacity-0 transition-opacity group-hover:opacity-100\`})]}),(0,B.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,B.jsx)(c_,{icon:oe,label:\`Status\`,value:\`Healthy\`,accent:!0}),(0,B.jsx)(c_,{icon:Ce,label:\`Database size\`,value:e?.dbSize??\`—\`}),(0,B.jsx)(c_,{icon:It,label:\`Version\`,value:e?.version??\`—\`}),(0,B.jsx)(c_,{icon:Ae,label:\`Last migration\`,value:h?h.name??h.version:\`No migrations\`,sub:h?(0,B.jsx)(Km,{value:h.applied_at}):void 0}),(0,B.jsx)(c_,{icon:Et,label:\`Tables\`,value:\`\${e?.tables??0}\`,sub:\`\${m.toLocaleString()} total rows\`}),(0,B.jsx)(c_,{icon:Ge,label:\`Auth users\`,value:\`\${e?.users??0}\`})]})]}),(0,B.jsx)(l_,{title:\`At a glance\`,children:(0,B.jsxs)(\`div\`,{className:\`grid grid-cols-2 gap-4 lg:grid-cols-4\`,children:[(0,B.jsx)(d_,{icon:Et,label:\`Table Editor\`,value:e?.tables??0,sub:\`\${m.toLocaleString()} rows\`,onClick:()=>z(\`table\`)}),(0,B.jsx)(d_,{icon:Ge,label:\`Authentication\`,value:e?.users??0,sub:\`users\`,onClick:()=>z(\`auth\`)}),(0,B.jsx)(d_,{icon:ze,label:\`Storage\`,value:e?.buckets??0,sub:\`\${e?.objects??0} objects\`,onClick:()=>z(\`storage\`)}),(0,B.jsx)(d_,{icon:gt,label:\`Logs\`,value:o.length,sub:v>0?\`\${v} errors\`:\`no errors\`,danger:v>0,onClick:()=>z(\`logs\`)})]})}),(0,B.jsx)(l_,{title:\`Advisor\`,action:c.length>0?(0,B.jsxs)(\`button\`,{className:\`text-xs text-brand hover:underline\`,onClick:$m,children:[\`View all \`,c.length]}):void 0,children:c.length===0?(0,B.jsxs)(\`div\`,{className:\`flex items-center gap-3 rounded-lg border border-border bg-card p-5 text-[13px] text-muted-foreground\`,children:[(0,B.jsx)(fe,{size:15,className:\`text-brand\`}),\` No advisor findings — security and performance checks all pass.\`]}):(0,B.jsx)(\`div\`,{className:\`overflow-hidden rounded-lg border border-border bg-card\`,children:c.slice(0,6).map(e=>(0,B.jsxs)(\`button\`,{onClick:$m,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,B.jsx)(bt,{size:14,className:e.level===\`critical\`?\`text-destructive\`:e.level===\`warning\`?\`text-warning\`:\`text-muted-foreground/70\`}),(0,B.jsx)(\`span\`,{className:\`shrink-0 text-[13px] text-foreground/90\`,children:e.title}),(0,B.jsx)(\`span\`,{className:\`truncate font-mono text-xs text-muted-foreground\`,children:e.entity}),(0,B.jsx)(le,{size:12,className:\`ml-auto shrink-0 text-muted-foreground/60\`})]},e.id))})}),(0,B.jsxs)(\`div\`,{className:\`grid gap-5 lg:grid-cols-2\`,children:[(0,B.jsx)(u_,{title:\`Recent migrations\`,onMore:()=>z(\`database\`,\`migrations\`),children:i.length===0?(0,B.jsxs)(\`p\`,{className:\`px-4 py-6 text-center text-xs text-muted-foreground/60\`,children:[\`No migrations applied. Add SQL files under\`,\` \`,(0,B.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`supabase/migrations/\`}),\`.\`]}):i.slice(-6).reverse().map(e=>(0,B.jsxs)(\`div\`,{className:\`flex items-center gap-3 border-b border-border/60 px-4 py-2 last:border-0\`,children:[(0,B.jsx)(\`span\`,{className:\`font-mono text-xs text-muted-foreground/80\`,children:e.version}),(0,B.jsx)(\`span\`,{className:\`truncate text-[13px] text-foreground/80\`,children:e.name??\`—\`}),(0,B.jsx)(\`span\`,{className:\`ml-auto shrink-0 text-[11px] text-muted-foreground/60\`,children:(0,B.jsx)(Km,{value:e.applied_at})})]},e.version))}),(0,B.jsx)(u_,{title:\`Recent logs\`,onMore:()=>z(\`logs\`),children:g.length===0?(0,B.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,B.jsxs)(\`div\`,{className:\`flex items-center gap-2.5 border-b border-border/60 px-4 py-2 last:border-0\`,children:[(0,B.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,B.jsx)(\`span\`,{className:\`truncate font-mono text-xs text-muted-foreground\`,children:e.msg}),(0,B.jsx)(\`span\`,{className:\`ml-auto shrink-0 text-[11px] text-muted-foreground/60\`,children:(0,B.jsx)(Km,{value:e.ts,format:\`time\`})})]},t))})]}),(0,B.jsx)(l_,{title:\`Get connected\`,children:(0,B.jsxs)(\`div\`,{className:\`rounded-lg border border-border bg-card p-6\`,children:[(0,B.jsxs)(\`p\`,{className:\`text-[13px] text-muted-foreground/80\`,children:[\`Every tinbase service is a\`,\` \`,(0,B.jsx)(\`span\`,{className:\`text-foreground/80\`,children:\`(Request) ⇒ Response\`}),\` \`,\`fetch handler — run the whole backend in-process, or point\`,\` \`,(0,B.jsx)(\`span\`,{className:\`text-foreground/80\`,children:\`supabase-js\`}),\` at this server (URL + keys under\`,\` \`,(0,B.jsx)(\`span\`,{className:\`text-foreground/80\`,children:\`Connect\`}),\`).\`]}),(0,B.jsx)(\`div\`,{className:\`mt-3\`,children:(0,B.jsx)(tr,{code:lh(),lang:\`js\`})})]})})]})})}function c_({icon:e,label:t,value:n,sub:r,accent:i}){return(0,B.jsxs)(\`div\`,{className:\`flex items-start gap-3.5\`,children:[(0,B.jsx)(\`div\`,{className:\`flex size-11 shrink-0 items-center justify-center rounded-md border border-border bg-card\`,children:(0,B.jsx)(e,{size:17,className:i?\`text-brand\`:\`text-muted-foreground/80\`})}),(0,B.jsxs)(\`div\`,{className:\`min-w-0\`,children:[(0,B.jsx)(\`p\`,{className:\`text-[11px] font-semibold uppercase tracking-wider text-muted-foreground/80\`,children:t}),(0,B.jsx)(\`p\`,{className:\`mt-0.5 truncate text-sm \`+(i?\`text-brand\`:\`text-foreground\`),children:n}),r&&(0,B.jsx)(\`p\`,{className:\`truncate text-xs text-muted-foreground/60\`,children:r})]})]})}function l_({title:e,action:t,children:n}){return(0,B.jsxs)(\`div\`,{children:[(0,B.jsxs)(\`div\`,{className:\`mb-4 flex items-center justify-between gap-4\`,children:[(0,B.jsx)(\`h2\`,{className:\`text-base font-medium text-foreground\`,children:e}),t]}),n]})}function u_({title:e,onMore:t,children:n}){return(0,B.jsxs)(\`div\`,{className:\`overflow-hidden rounded-lg border border-border bg-card\`,children:[(0,B.jsxs)(\`div\`,{className:\`flex items-center justify-between border-b border-border px-4 py-2.5\`,children:[(0,B.jsx)(\`h3\`,{className:\`text-[13px] font-medium text-foreground\`,children:e}),t&&(0,B.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,B.jsx)(le,{size:11})]})]}),(0,B.jsx)(\`div\`,{children:n})]})}function d_({icon:e,label:t,value:n,sub:r,danger:i,onClick:a}){return(0,B.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,B.jsxs)(\`div\`,{className:\`flex items-center gap-2 text-muted-foreground/80\`,children:[(0,B.jsx)(e,{size:13}),(0,B.jsx)(\`span\`,{className:\`text-[11px] font-medium uppercase tracking-wide\`,children:t}),(0,B.jsx)(le,{size:12,className:\`ml-auto opacity-0 transition-opacity group-hover:opacity-100\`})]}),(0,B.jsx)(\`p\`,{className:\`mt-3 text-3xl font-semibold text-foreground\`,children:n.toLocaleString()}),(0,B.jsx)(\`p\`,{className:\`mt-1 text-[13px] \`+(i?\`text-destructive\`:\`text-muted-foreground/80\`),children:r})]})}function f_(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 p_(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 m_=/^([A-Z]+)\\s+(\\S+)\\s+→\\s+(\\d{3})\\b/;function h_(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 g_(e){let t=m_.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:h_(r,e.msg)}}var __=e=>e===null?null:\`\${Math.floor(e/100)}xx\`,v_=[{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 y_(){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(g_),[e]),C=(0,_.useMemo)(()=>{let e=v_.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=__(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||__(e.status)!==null&&f.has(__(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,B.jsx)(qp,{}):(0,B.jsxs)(\`div\`,{className:\`flex h-full\`,children:[(0,B.jsxs)(mf,{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,B.jsxs)(\`div\`,{className:\`flex items-center justify-between px-4 pb-1 pt-4\`,children:[(0,B.jsx)(\`span\`,{className:\`text-sm font-semibold text-foreground\`,children:\`Logs\`}),E>0&&(0,B.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,B.jsx)(Ft,{size:10}),\` Clear (\`,E,\`)\`]})]}),(0,B.jsx)(x_,{title:\`Time range\`,children:v_.map(e=>(0,B.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,B.jsxs)(x_,{title:\`Service\`,children:[[...w.svc.entries()].sort((e,t)=>t[1]-e[1]).map(([e,t])=>(0,B.jsx)(S_,{label:e,count:t,checked:o.has(e),onToggle:()=>s(b_(o,e))},e)),w.svc.size===0&&(0,B.jsx)(\`p\`,{className:\`px-2 py-1 text-[11px] text-muted-foreground/50\`,children:\`No entries\`})]}),(0,B.jsx)(x_,{title:\`Level\`,children:[\`info\`,\`warn\`,\`error\`].map(e=>(0,B.jsx)(S_,{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(b_(c,e))},e))}),(0,B.jsxs)(x_,{title:\`Method\`,children:[[\`GET\`,\`POST\`,\`PATCH\`,\`PUT\`,\`DELETE\`,\`OPTIONS\`].filter(e=>w.mth.has(e)).map(e=>(0,B.jsx)(S_,{label:e,mono:!0,count:w.mth.get(e),checked:u.has(e),onToggle:()=>d(b_(u,e))},e)),w.mth.size===0&&(0,B.jsx)(\`p\`,{className:\`px-2 py-1 text-[11px] text-muted-foreground/50\`,children:\`No requests\`})]}),(0,B.jsxs)(x_,{title:\`Status\`,children:[[\`2xx\`,\`3xx\`,\`4xx\`,\`5xx\`].filter(e=>w.sts.has(e)).map(e=>(0,B.jsx)(S_,{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(b_(f,e))},e)),w.sts.size===0&&(0,B.jsx)(\`p\`,{className:\`px-2 py-1 text-[11px] text-muted-foreground/50\`,children:\`No responses\`})]})]}),(0,B.jsxs)(\`div\`,{className:\`flex min-w-0 flex-1 flex-col\`,children:[(0,B.jsxs)(\`div\`,{className:\`flex shrink-0 items-center gap-2 border-b border-border px-3 py-2\`,children:[(0,B.jsxs)(\`div\`,{className:\`relative min-w-0 flex-1 max-w-md\`,children:[(0,B.jsx)(_t,{size:13,className:\`pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground/60\`}),(0,B.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,B.jsxs)(\`span\`,{className:\`text-[11px] tabular-nums text-muted-foreground/70\`,children:[T.length.toLocaleString(),\` event\`,T.length===1?\`\`:\`s\`]}),(0,B.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-1.5\`,children:[(0,B.jsx)(H,{variant:n?\`outline\`:\`ghost\`,size:\`xs\`,onClick:()=>r(e=>!e),children:n?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(st,{size:12}),\` Live \`,(0,B.jsx)(\`span\`,{className:\`size-1.5 animate-pulse rounded-full bg-brand\`})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(dt,{size:12}),\` Paused\`]})}),(0,B.jsx)(H,{variant:\`ghost\`,size:\`iconXs\`,title:\`Refresh\`,onClick:()=>void x(),children:(0,B.jsx)(ht,{size:13})}),(0,B.jsxs)(Zd,{children:[(0,B.jsx)(Qd,{asChild:!0,children:(0,B.jsxs)(H,{variant:\`ghost\`,size:\`xs\`,title:\`Download logs\`,children:[(0,B.jsx)(Te,{size:13}),\` \`,(0,B.jsx)(pe,{size:10})]})}),(0,B.jsxs)(tf,{align:\`end\`,children:[(0,B.jsx)(nf,{onSelect:()=>p_(\`tinbase-logs.txt\`,\`text/plain\`,T.map(e=>\`\${e.ts} \${e.level.toUpperCase()} \${e.msg}\`).join(\`
1565
- \`)),children:\`Download .txt\`}),(0,B.jsx)(nf,{onSelect:()=>p_(\`tinbase-logs.json\`,\`application/json\`,JSON.stringify(T,null,2)),children:\`Download .json\`})]})]}),(0,B.jsx)(H,{variant:\`ghost\`,size:\`iconXs\`,title:\`Clear logs\`,onClick:()=>b(!0),children:(0,B.jsx)(Ot,{size:13})})]})]}),(0,B.jsx)(C_,{entries:C}),(0,B.jsx)(\`div\`,{className:\`min-h-0 flex-1 overflow-auto\`,children:T.length===0?(0,B.jsx)(cf,{children:S.length===0?\`No logs yet. Make a request or trigger an email/webhook.\`:\`No entries match the filters.\`}):(0,B.jsxs)(\`table\`,{className:\`w-full border-collapse font-mono text-[12px]\`,children:[(0,B.jsx)(\`thead\`,{className:\`sticky top-0 z-10 bg-background\`,children:(0,B.jsxs)(\`tr\`,{className:\`border-b border-border text-left text-[10px] uppercase tracking-wider text-muted-foreground/60\`,children:[(0,B.jsx)(\`th\`,{className:\`w-24 px-3 py-1.5 font-medium\`,children:\`Time\`}),(0,B.jsx)(\`th\`,{className:\`w-16 px-2 py-1.5 font-medium\`,children:\`Level\`}),(0,B.jsx)(\`th\`,{className:\`w-20 px-2 py-1.5 font-medium\`,children:\`Service\`}),(0,B.jsx)(\`th\`,{className:\`w-16 px-2 py-1.5 font-medium\`,children:\`Method\`}),(0,B.jsx)(\`th\`,{className:\`w-12 px-2 py-1.5 font-medium\`,children:\`Status\`}),(0,B.jsx)(\`th\`,{className:\`px-2 py-1.5 font-medium\`,children:\`Event\`})]})}),(0,B.jsx)(\`tbody\`,{children:T.map((e,t)=>(0,B.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,B.jsx)(\`td\`,{className:\`whitespace-nowrap px-3 py-1 text-muted-foreground/70\`,children:(0,B.jsx)(Km,{value:e.ts,format:\`time\`})}),(0,B.jsx)(\`td\`,{className:\`px-2 py-1\`,children:(0,B.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,B.jsx)(\`td\`,{className:\`px-2 py-1 text-muted-foreground/80\`,children:e.service}),(0,B.jsx)(\`td\`,{className:\`px-2 py-1 text-foreground/70\`,children:e.method??\`\`}),(0,B.jsx)(\`td\`,{className:\`px-2 py-1\`,children:e.status!==null&&(0,B.jsx)(\`span\`,{className:e.status>=500?\`text-destructive\`:e.status>=400?\`text-warning\`:\`text-brand\`,children:e.status})}),(0,B.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,B.jsx)(O_,{entry:g,onClose:()=>v(null)}),y&&(0,B.jsx)(go,{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 b_(e,t){let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n}function x_({title:e,children:t}){return(0,B.jsxs)(\`div\`,{className:\`px-2 pt-3\`,children:[(0,B.jsx)(\`p\`,{className:\`px-2 pb-1 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/60\`,children:e}),t]})}function S_({label:e,count:t,checked:n,onToggle:r,dot:i,mono:a}){return(0,B.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,B.jsx)(Zt,{checked:n,onChange:r}),i&&(0,B.jsx)(\`span\`,{className:\`size-1.5 shrink-0 rounded-full \${i}\`}),(0,B.jsx)(\`span\`,{className:\`min-w-0 flex-1 truncate \`+(a?\`font-mono\`:\`\`),children:e}),(0,B.jsx)(\`span\`,{className:\`tabular-nums text-muted-foreground/50\`,children:t.toLocaleString()})]})}function C_({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,B.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,B.jsx)(\`div\`,{className:\`flex min-w-0 flex-1 flex-col justify-end self-stretch\`,title:\`\${r} events\`,children:r>0&&(0,B.jsxs)(\`div\`,{className:\`flex w-full flex-col overflow-hidden rounded-sm\`,style:{height:\`\${i}%\`},children:[e.err>0&&(0,B.jsx)(\`div\`,{className:\`w-full bg-destructive/70\`,style:{flexGrow:e.err}}),(0,B.jsx)(\`div\`,{className:\`w-full bg-brand/40\`,style:{flexGrow:e.ok}})]})},n)})}):null}var w_={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 T_(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 E_({label:e,copy:t,children:n}){return(0,B.jsxs)(\`div\`,{className:\`group flex items-start gap-3 rounded px-1 py-1 -mx-1 hover:bg-accent/40\`,children:[(0,B.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,B.jsx)(\`span\`,{className:\`min-w-0 flex-1 text-right text-[12.5px] text-foreground/90\`,children:n}),t!==void 0&&(0,B.jsx)(\`span\`,{className:\`shrink-0 opacity-0 transition-opacity group-hover:opacity-100\`,children:(0,B.jsx)(Qn,{value:t,label:e})})]})}function D_({title:e,children:t}){return(0,B.jsxs)(\`div\`,{children:[(0,B.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,B.jsx)(\`div\`,{className:\`space-y-0.5\`,children:t})]})}function O_({entry:e,onClose:t}){let n=new Date(e.ts),[r,i]=(e.path??\`\`).split(\`?\`),a=Intl.DateTimeFormat().resolvedOptions().timeZone;return(0,B.jsxs)(mf,{id:\`logs-detail\`,side:\`right\`,defaultSize:400,min:300,max:640,className:\`flex flex-col border-l border-border bg-card\`,children:[(0,B.jsxs)(\`div\`,{className:\`flex shrink-0 items-center justify-between border-b border-border px-4 py-2.5\`,children:[(0,B.jsx)(\`span\`,{className:\`text-[13px] font-medium text-foreground\`,children:\`Event details\`}),(0,B.jsxs)(\`div\`,{className:\`flex items-center gap-1\`,children:[(0,B.jsx)(Qn,{value:JSON.stringify(e,null,2),label:\`Event JSON\`}),(0,B.jsx)(\`button\`,{className:\`rounded p-1 text-muted-foreground hover:bg-accent hover:text-foreground\`,onClick:t,children:(0,B.jsx)(Ft,{size:14})})]})]}),(0,B.jsxs)(\`div\`,{className:\`min-h-0 flex-1 space-y-5 overflow-y-auto p-4\`,children:[(0,B.jsxs)(D_,{title:\`Event\`,children:[(0,B.jsx)(E_,{label:\`Timestamp\`,copy:e.ts,children:(0,B.jsx)(\`span\`,{className:\`font-mono text-[12px]\`,children:e.ts})}),(0,B.jsx)(E_,{label:\`Local\`,children:(0,B.jsx)(\`span\`,{className:\`font-mono text-[12px]\`,title:a,children:n.toLocaleString()})}),(0,B.jsx)(E_,{label:\`Relative\`,children:T_(e.ts)}),(0,B.jsx)(E_,{label:\`Level\`,children:(0,B.jsx)(V,{variant:e.level===\`error\`?\`red\`:e.level===\`warn\`?\`amber\`:\`neutral\`,children:e.level})}),(0,B.jsx)(E_,{label:\`Service\`,copy:e.service,children:e.service})]}),e.method&&(0,B.jsxs)(D_,{title:\`Request\`,children:[(0,B.jsx)(E_,{label:\`Method\`,copy:e.method,children:(0,B.jsx)(\`span\`,{className:\`font-mono text-[12px]\`,children:e.method})}),(0,B.jsx)(E_,{label:\`Path\`,copy:r,children:(0,B.jsx)(\`span\`,{className:\`break-all font-mono text-[12px]\`,children:r})}),i&&(0,B.jsx)(E_,{label:\`Query\`,copy:i,children:(0,B.jsx)(\`span\`,{className:\`break-all font-mono text-[11px] text-muted-foreground\`,children:i})}),e.status!==null&&(0,B.jsx)(E_,{label:\`Status\`,copy:String(e.status),children:(0,B.jsxs)(\`span\`,{className:\`inline-flex items-center gap-1.5\`,children:[(0,B.jsx)(V,{variant:e.status>=500?\`red\`:e.status>=400?\`amber\`:\`brand\`,children:e.status}),w_[e.status]&&(0,B.jsx)(\`span\`,{className:\`text-[11px] text-muted-foreground\`,children:w_[e.status]})]})})]}),(0,B.jsx)(D_,{title:\`Message\`,children:(0,B.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,B.jsx)(D_,{title:\`Raw JSON\`,children:(0,B.jsx)(\`div\`,{className:\`overflow-hidden rounded-md border border-border bg-code px-1 py-2\`,children:(0,B.jsx)(er,{value:JSON.stringify(e,null,2),lang:\`js\`,readOnly:!0,minLines:6,maxLines:16})})})]})]})}var k_=25e3;function A_(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()})},k_)},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 j_=[\`inspector\`,\`policies\`,\`settings\`];function M_(){let{section:e}=qt(),t=j_.includes(e)?e:\`inspector\`;return(0,B.jsxs)(\`div\`,{className:\`flex h-full\`,children:[(0,B.jsx)(wh,{title:\`Realtime\`,active:t,onSelect:e=>z(\`realtime\`,e),groups:[{title:\`Tools\`,items:[{id:\`inspector\`,label:\`Inspector\`}]},{title:\`Configuration\`,items:[{id:\`policies\`,label:\`Policies\`},{id:\`settings\`,label:\`Settings\`}]}]}),(0,B.jsxs)(\`div\`,{className:\`min-w-0 flex-1 overflow-y-auto\`,children:[t===\`inspector\`&&(0,B.jsx)(I_,{}),t===\`policies\`&&(0,B.jsx)(L_,{}),t===\`settings\`&&(0,B.jsx)(R_,{})]})]})}function N_(e){return e.event===\`broadcast\`?\`broadcast\`:e.event===\`postgres_changes\`?\`postgres\`:e.event.startsWith(\`presence\`)?\`presence\`:\`system\`}var P_={broadcast:\`brand\`,postgres:\`blue\`,presence:\`amber\`,system:\`neutral\`},F_={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 I_(){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=A_({baseUrl:ch(),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 U.error(\`Join a channel first\`);let e;try{e=g.trim()?JSON.parse(g):{}}catch{return U.error(\`Payload is not valid JSON\`)}y.current.sendBroadcast(m.trim()||\`test\`,e)}let T=u.filter(e=>f.size===0||f.has(N_(e))),E=F_[c];return(0,B.jsxs)(\`div\`,{className:\`flex h-full flex-col\`,children:[(0,B.jsxs)(\`div\`,{className:\`flex shrink-0 flex-wrap items-end gap-3 border-b border-border px-4 py-3\`,children:[(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(X,{children:\`Channel\`}),(0,B.jsx)(Y,{mono:!0,className:\`w-44\`,value:e,disabled:b,onChange:e=>t(e.target.value)})]}),(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(X,{children:\`Join as\`}),(0,B.jsx)(Up,{className:\`w-36\`,value:n,disabled:b,onValueChange:e=>r(e),options:[{value:\`service_role\`,label:\`service_role\`},{value:\`anon\`,label:\`anon\`}]})]}),(0,B.jsxs)(\`label\`,{className:\`flex cursor-pointer items-center gap-2 pb-2 text-[13px] text-foreground/80\`,children:[(0,B.jsx)(Zt,{checked:i,disabled:b,onChange:a}),\`postgres_changes\`]}),i&&(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(X,{children:\`Table (empty = all public)\`}),(0,B.jsx)(Y,{mono:!0,className:\`w-40\`,value:o,disabled:b,placeholder:\`*\`,onChange:e=>s(e.target.value)})]}),(0,B.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-2 pb-0.5\`,children:[(0,B.jsxs)(V,{variant:E.variant,children:[(0,B.jsx)(mt,{size:10}),\` \`,E.label]}),b?(0,B.jsxs)(H,{variant:\`outline\`,size:\`xs\`,onClick:C,children:[(0,B.jsx)(Tt,{size:11}),\` Leave\`]}):(0,B.jsxs)(H,{size:\`xs\`,onClick:()=>void S(),children:[(0,B.jsx)(dt,{size:11}),\` Join channel\`]})]})]}),(0,B.jsxs)(\`div\`,{className:\`flex shrink-0 items-end gap-3 border-b border-border bg-card px-4 py-2.5\`,children:[(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(X,{children:\`Broadcast event\`}),(0,B.jsx)(Y,{mono:!0,className:\`w-36\`,value:m,onChange:e=>h(e.target.value)})]}),(0,B.jsxs)(\`div\`,{className:\`min-w-0 flex-1\`,children:[(0,B.jsx)(X,{children:\`Payload (JSON)\`}),(0,B.jsx)(Y,{mono:!0,value:g,onChange:e=>v(e.target.value),onKeyDown:e=>e.key===\`Enter\`&&w()})]}),(0,B.jsxs)(H,{size:\`xs\`,className:\`mb-0.5\`,onClick:w,disabled:c!==\`joined\`,children:[(0,B.jsx)(vt,{size:11}),\` Send\`]})]}),(0,B.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,B.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,B.jsxs)(\`span\`,{className:\`ml-auto text-xs text-muted-foreground/60\`,children:[u.length,\` messages\`]}),(0,B.jsx)(H,{variant:\`ghost\`,size:\`iconXs\`,title:\`Clear feed\`,onClick:()=>d([]),children:(0,B.jsx)(Ot,{size:13})})]}),(0,B.jsx)(\`div\`,{className:\`min-h-0 flex-1 overflow-auto p-2\`,children:T.length===0?(0,B.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=N_(e);return(0,B.jsxs)(\`details\`,{className:\`group rounded px-2 py-1 hover:bg-accent/40\`,children:[(0,B.jsxs)(\`summary\`,{className:\`flex cursor-pointer list-none items-center gap-2.5 text-[12.5px]\`,children:[e.dir===\`out\`?(0,B.jsx)(de,{size:11,className:\`shrink-0 text-brand\`}):(0,B.jsx)(ce,{size:11,className:\`shrink-0 text-info\`}),(0,B.jsx)(\`span\`,{className:\`shrink-0 font-mono text-muted-foreground/60\`,children:(0,B.jsx)(Km,{value:e.ts,format:\`time\`})}),(0,B.jsx)(V,{variant:P_[n],children:n}),(0,B.jsx)(\`span\`,{className:\`truncate font-mono text-foreground/80\`,children:e.event})]}),(0,B.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 L_(){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,B.jsx)(qp,{}):(0,B.jsxs)(\`div\`,{className:\`mx-auto max-w-3xl px-8 py-8\`,children:[(0,B.jsxs)(\`div\`,{className:\`flex items-start justify-between gap-4\`,children:[(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(\`h1\`,{className:\`text-lg font-semibold text-foreground\`,children:\`Policies\`}),(0,B.jsxs)(\`p\`,{className:\`mt-0.5 text-[13px] text-muted-foreground/80\`,children:[\`RLS on \`,(0,B.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`realtime.messages\`}),\` authorizes channels: SELECT gates receiving broadcast/presence, INSERT gates sending. Use \`,(0,B.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`realtime.topic()\`}),\` in expressions to scope a policy to specific channels.\`]})]}),(0,B.jsxs)(H,{size:\`xs\`,className:\`shrink-0\`,onClick:()=>r(!0),children:[(0,B.jsx)(pt,{size:12}),\` New policy\`]})]}),(0,B.jsxs)(\`div\`,{className:\`mt-6 space-y-2\`,children:[e.map(e=>(0,B.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,B.jsxs)(\`div\`,{className:\`flex items-center gap-2\`,children:[(0,B.jsx)(\`span\`,{className:\`truncate font-mono text-[13px] text-foreground\`,children:e.name}),(0,B.jsx)(V,{variant:\`blue\`,children:e.cmd}),(0,B.jsx)(V,{variant:\`neutral\`,children:Array.isArray(e.roles)?e.roles.join(\`, \`):String(e.roles)}),(0,B.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,B.jsx)(Ot,{size:13})})]}),e.using_expr&&(0,B.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,B.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,B.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,B.jsx)(wg,{table:\`messages\`,schema:\`realtime\`,onClose:()=>r(!1),onCreated:async()=>c()}),i&&(0,B.jsx)(wg,{table:\`messages\`,schema:\`realtime\`,existing:Dg(i),onClose:()=>a(null),onCreated:async()=>c()}),o&&(0,B.jsx)(go,{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=>U.error(e.message))},onClose:()=>s(null)})]})}function R_(){let e=\`\${ch().replace(/^http/,\`ws\`)}/realtime/v1/websocket?apikey=<anon key>&vsn=1.0.0\`,t=({children:e})=>(0,B.jsx)(\`code\`,{className:\`rounded bg-code px-1 py-px font-mono text-foreground/90\`,children:e});return(0,B.jsxs)(bh,{title:\`Realtime Settings\`,children:[(0,B.jsxs)(xh,{title:\`Connection\`,description:\`How clients reach the Realtime engine.\`,children:[(0,B.jsx)(Sh,{label:\`WebSocket endpoint\`,description:\`supabase-js connects here automatically from the project URL.\`,wide:!0,children:(0,B.jsxs)(\`div\`,{className:\`flex items-center gap-1.5\`,children:[(0,B.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,B.jsx)(Qn,{value:e,label:\`WebSocket URL\`})]})}),(0,B.jsxs)(Sh,{label:\`Protocol\`,description:\`The exact wire format supabase-js's RealtimeClient speaks.\`,children:[(0,B.jsx)(Ch,{label:\`Format\`,value:\`Phoenix v1 JSON\`}),(0,B.jsx)(Ch,{label:\`Heartbeat\`,value:\`every 25s\`})]})]}),(0,B.jsxs)(xh,{title:\`Features\`,description:\`What channels can carry on this instance.\`,children:[(0,B.jsx)(Sh,{label:\`postgres_changes\`,description:\`Change-data-capture on every table — INSERT / UPDATE / DELETE, filterable by schema and table.\`,children:(0,B.jsx)(V,{variant:\`brand\`,children:\`Enabled\`})}),(0,B.jsx)(Sh,{label:\`Broadcast\`,description:(0,B.jsxs)(B.Fragment,{children:[\`Client-to-client messages; \`,(0,B.jsx)(t,{children:\`self: true\`}),\` echoes back to the sender.\`]}),children:(0,B.jsx)(V,{variant:\`brand\`,children:\`Enabled\`})}),(0,B.jsx)(Sh,{label:\`Presence\`,description:\`Join/leave state tracking per channel.\`,children:(0,B.jsx)(V,{variant:\`brand\`,children:\`Enabled\`})})]}),(0,B.jsx)(xh,{title:\`Authorization\`,description:\`Who may join, read, and send on private channels.\`,children:(0,B.jsx)(Sh,{label:\`Channel policies\`,description:(0,B.jsxs)(B.Fragment,{children:[\`RLS on \`,(0,B.jsx)(t,{children:\`realtime.messages\`}),\`: SELECT gates receiving broadcast/presence, INSERT gates sending. Scope with \`,(0,B.jsx)(t,{children:\`realtime.topic()\`}),\`.\`]}),children:(0,B.jsx)(H,{variant:\`outline\`,size:\`xs\`,onClick:()=>z(\`realtime\`,\`policies\`),children:\`Manage policies\`})})})]})}function z_(){let[e,t]=(0,_.useState)(\`\`),n=ch();return(0,_.useEffect)(()=>{N.keys().then(e=>t(e.anonKey??\`\`),()=>t(\`\`))},[]),(0,B.jsxs)(xh,{title:\`API keys\`,description:\`Long-lived JWTs signed with the project's JWT secret. Rotating the secret invalidates both.\`,children:[(0,B.jsx)(Sh,{label:\`Project URL\`,description:\`Point supabase-js (or any HTTP client) here.\`,children:(0,B.jsxs)(\`div\`,{className:\`flex items-center gap-2\`,children:[(0,B.jsx)(Y,{mono:!0,readOnly:!0,value:n}),(0,B.jsx)(Qn,{value:n,label:\`API URL\`,variant:\`outline\`,size:\`icon\`,iconSize:13})]})}),(0,B.jsx)(Sh,{label:\`anon key\`,description:\`Safe for browsers — Row Level Security applies to every request.\`,children:(0,B.jsx)(uf,{bare:!0,label:\`anon key\`,hint:\`\`,value:e})}),(0,B.jsx)(Sh,{label:\`service_role key\`,description:(0,B.jsx)(\`span\`,{className:\`text-destructive/80\`,children:\`Server-side only — bypasses Row Level Security.\`}),children:(0,B.jsx)(uf,{bare:!0,label:\`service_role key\`,hint:\`\`,value:x(),danger:!0})}),(0,B.jsx)(Sh,{label:\`CLI\`,description:\`Keys are also printed on startup.\`,children:(0,B.jsx)(\`code\`,{className:\`rounded bg-code px-2 py-1 font-mono text-xs text-foreground/90\`,children:\`tinbase keys\`})})]})}function B_(){let[e,t]=dn(),[n,r]=mn();return(0,B.jsxs)(xh,{title:\`Appearance\`,description:\`Preferences are stored in this browser and apply instantly.\`,children:[(0,B.jsx)(Sh,{label:\`Theme\`,description:\`Choose your interface color theme. System follows your OS preference.\`,wide:!0,children:(0,B.jsx)(J_,{value:e,onChange:t})}),(0,B.jsx)(Sh,{label:\`Sidebar\`,description:\`How the navigation sidebar behaves.\`,wide:!0,children:(0,B.jsx)(W_,{value:n,onChange:r})})]})}var V_=[{value:\`expanded\`,label:\`Expanded\`},{value:\`collapsed\`,label:\`Collapsed\`},{value:\`hover\`,label:\`Expand on hover\`}];function H_({label:e}){return(0,B.jsxs)(\`div\`,{className:\`flex items-center gap-1.5\`,children:[(0,B.jsx)(\`div\`,{className:\`size-1.5 shrink-0 rounded-full bg-muted-foreground/60\`}),e&&(0,B.jsx)(\`div\`,{className:\`h-1 flex-1 rounded-full bg-muted-foreground/25\`})]})}function U_({variant:e}){return(0,B.jsxs)(\`div\`,{className:\`absolute inset-0 flex\`,children:[(0,B.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,B.jsx)(H_,{label:e===\`expanded\`},t))}),e===\`hover\`&&(0,B.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,B.jsx)(H_,{label:!0},e))}),(0,B.jsx)(\`div\`,{className:\`flex-1 bg-card\`})]})}function W_({value:e,onChange:t}){return(0,B.jsx)(\`div\`,{className:\`grid max-w-2xl grid-cols-1 gap-4 sm:grid-cols-3\`,children:V_.map(n=>{let r=e===n.value;return(0,B.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,B.jsx)(\`div\`,{className:\`relative flex-1 overflow-hidden\`,children:(0,B.jsx)(U_,{variant:n.value})}),(0,B.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 G_={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 K_({variant:e}){let t=G_[e];return(0,B.jsxs)(\`div\`,{className:\`absolute inset-0 flex gap-2 p-3\`,style:{background:t.bg},children:[(0,B.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,B.jsxs)(\`div\`,{className:\`flex items-center gap-1\`,children:[(0,B.jsx)(\`div\`,{className:\`h-1.5 w-2/3 rounded-full\`,style:{background:t.line}}),(0,B.jsx)(\`div\`,{className:\`ml-auto size-2 rounded-full\`,style:{background:t.line}})]}),[80,60,70,50].map((e,n)=>(0,B.jsx)(\`div\`,{className:\`h-1.5 rounded-full\`,style:{width:\`\${e}%\`,background:t.block}},n))]}),(0,B.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,B.jsxs)(\`div\`,{className:\`flex items-center gap-1.5\`,children:[(0,B.jsx)(\`div\`,{className:\`size-2.5 rounded-full\`,style:{background:t.block}}),(0,B.jsx)(\`div\`,{className:\`h-1.5 w-1/3 rounded-full\`,style:{background:t.line}}),(0,B.jsx)(\`div\`,{className:\`h-1.5 w-1/4 rounded-full\`,style:{background:t.block}})]}),(0,B.jsx)(\`div\`,{className:\`h-1.5 w-3/4 rounded-full\`,style:{background:t.block}}),(0,B.jsx)(\`div\`,{className:\`mt-auto h-1/2 w-full rounded-sm\`,style:{background:t.block}})]})]})}var q_=[{value:\`light\`,label:\`Light\`},{value:\`dark\`,label:\`Dark\`},{value:\`system\`,label:\`System\`}];function J_({value:e,onChange:t}){return(0,B.jsx)(\`div\`,{className:\`grid max-w-2xl grid-cols-1 gap-4 sm:grid-cols-3\`,children:q_.map(n=>{let r=e===n.value;return(0,B.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,B.jsx)(\`div\`,{className:\`relative flex-1 overflow-hidden\`,children:n.value===\`system\`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(K_,{variant:\`light\`}),(0,B.jsx)(\`div\`,{className:\`absolute inset-0\`,style:{clipPath:\`polygon(100% 0, 100% 100%, 0 100%)\`},children:(0,B.jsx)(K_,{variant:\`dark\`})})]}):(0,B.jsx)(K_,{variant:n.value})}),(0,B.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_=({children:e})=>(0,B.jsx)(\`code\`,{className:\`rounded bg-code px-1 py-px font-mono text-foreground/90\`,children:e});function X_(){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,B.jsx)(qp,{}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(xh,{title:\`Instance\`,description:\`One process — embedded Postgres, no Docker.\`,children:[(0,B.jsx)(Sh,{label:\`Status\`,description:\`Whether the admin API responds.\`,children:n?(0,B.jsx)(V,{variant:\`brand\`,children:\`Healthy\`}):(0,B.jsx)(V,{variant:\`red\`,children:\`Unreachable\`})}),(0,B.jsxs)(Sh,{label:\`Database\`,description:\`Engine version and current on-disk size.\`,children:[(0,B.jsx)(Ch,{label:\`Postgres\`,value:e?.version??\`—\`}),(0,B.jsx)(Ch,{label:\`Size\`,value:e?.dbSize??\`—\`}),(0,B.jsx)(Ch,{label:\`Tables (public)\`,value:e?.tables??\`—\`}),(0,B.jsx)(Ch,{label:\`Applied migrations\`,value:e?.migrations??\`—\`})]}),(0,B.jsxs)(Sh,{label:\`Services\`,description:\`Counts across auth and storage.\`,children:[(0,B.jsx)(Ch,{label:\`Auth users\`,value:e?.users??\`—\`}),(0,B.jsx)(Ch,{label:\`Buckets\`,value:e?.buckets??\`—\`}),(0,B.jsx)(Ch,{label:\`Objects\`,value:e?.objects??\`—\`})]})]}),(0,B.jsx)(xh,{title:\`Data locations\`,description:\`Configured by CLI flags when starting tinbase.\`,children:(0,B.jsx)(Sh,{label:\`On disk\`,description:\`Where this project's data lives, relative to the project directory.\`,children:(0,B.jsxs)(\`div\`,{className:\`space-y-1.5 text-xs leading-relaxed text-muted-foreground\`,children:[(0,B.jsxs)(\`p\`,{children:[\`Database: \`,(0,B.jsx)(Y_,{children:\`.tinbase/db\`}),\` (PGlite) or \`,(0,B.jsx)(Y_,{children:\`.tinbase/pgdata\`}),\` (native)\`]}),(0,B.jsxs)(\`p\`,{children:[\`Storage objects: \`,(0,B.jsx)(Y_,{children:\`.tinbase/storage\`})]}),(0,B.jsxs)(\`p\`,{children:[\`Override with \`,(0,B.jsx)(Y_,{children:\`--data-dir\`}),\` / \`,(0,B.jsx)(Y_,{children:\`--storage-dir\`}),\` · wipe + reseed with \`,(0,B.jsx)(Y_,{children:\`tinbase db reset\`})]})]})})})]})}var Z_=({children:e})=>(0,B.jsx)(\`code\`,{className:\`rounded bg-code px-1 py-px font-mono text-foreground/90\`,children:e});function Q_(){return(0,B.jsxs)(xh,{title:\`JWT keys\`,description:\`All tokens — anon key, service_role key, and user sessions — are HS256 JWTs signed with one secret.\`,children:[(0,B.jsx)(Sh,{label:\`Secret\`,description:\`Never exposed over the API. Configured where tinbase starts.\`,children:(0,B.jsxs)(\`div\`,{className:\`space-y-1.5 text-xs leading-relaxed text-muted-foreground\`,children:[(0,B.jsxs)(\`p\`,{children:[(0,B.jsx)(Z_,{children:\`TINBASE_JWT_SECRET\`}),\` environment variable, or the \`,(0,B.jsx)(Z_,{children:\`--jwt-secret\`}),\` CLI flag.\`]}),(0,B.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,B.jsx)(Sh,{label:\`Rotation\`,description:\`Rotating the secret invalidates every existing token.\`,children:(0,B.jsxs)(\`ol\`,{className:\`list-inside list-decimal space-y-1.5 text-xs leading-relaxed text-muted-foreground\`,children:[(0,B.jsxs)(\`li\`,{children:[\`Restart with the new secret: \`,(0,B.jsx)(Z_,{children:\`TINBASE_JWT_SECRET=… tinbase start\`})]}),(0,B.jsxs)(\`li\`,{children:[\`Grab the re-derived keys from the startup banner or \`,(0,B.jsx)(Z_,{children:\`tinbase keys\`})]}),(0,B.jsx)(\`li\`,{children:\`Update every client using the old keys — and sign back in to this studio\`})]})})]})}var $_=[{id:\`general\`,label:\`General\`,component:B_},{id:\`infrastructure\`,label:\`Infrastructure\`,component:X_},{id:\`api-keys\`,label:\`API Keys\`,component:z_},{id:\`jwt\`,label:\`JWT Keys\`,component:Q_}];function ev(){let{section:e}=qt(),t=$_.some(t=>t.id===e)?e:\`general\`,n=$_.find(e=>e.id===t).component;return(0,B.jsxs)(\`div\`,{className:\`flex h-full\`,children:[(0,B.jsx)(wh,{title:\`Project Settings\`,active:t,onSelect:e=>z(\`settings\`,e),groups:[{items:$_.map(e=>({id:e.id,label:e.label}))}]}),(0,B.jsx)(\`div\`,{className:\`min-w-0 flex-1 overflow-y-auto\`,children:(0,B.jsxs)(\`div\`,{className:\`mx-auto max-w-4xl px-10 py-8\`,children:[(0,B.jsx)(\`h1\`,{className:\`border-b border-border pb-4 text-xl font-semibold text-foreground\`,children:$_.find(e=>e.id===t).label}),(0,B.jsx)(n,{})]})})]})}var tv=[{kind:\`postgres\`,icon:Ce,title:\`Postgres\`,sub:\`Superuser\`,blurb:\`Full admin access — the service_role, which bypasses all Row Level Security (RLS) policies.\`},{kind:\`anon\`,icon:jt,title:\`Anonymous\`,sub:\`Not logged in\`,blurb:\`The anon key — what an unauthenticated visitor sees. RLS policies apply.\`},{kind:\`authenticated\`,icon:Mt,title:\`Authenticated\`,sub:\`Specific logged in user\`,blurb:\`Impersonate a real user — auth.uid() resolves to them. RLS policies apply.\`}];function nv({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){U.error(e.message)}}let c=e.kind===\`authenticated\`?e.email??e.sub.slice(0,8):e.kind,l=tv.find(t=>t.kind===e.kind);return(0,B.jsxs)(ff,{open:r,onOpenChange:i,align:n,className:\`w-105 p-3\`,trigger:(0,B.jsxs)(H,{variant:\`outline\`,size:\`xs\`,onClick:()=>i(e=>!e),children:[\`Role \`,(0,B.jsx)(\`span\`,{className:\`font-mono \`+(e.kind===\`postgres\`?\`text-foreground\`:\`text-brand\`),children:c}),(0,B.jsx)(pe,{size:11})]}),children:[(0,B.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,B.jsx)(\`div\`,{className:\`grid grid-cols-3 gap-2\`,children:tv.map(t=>{let n=t.icon,r=e.kind===t.kind;return(0,B.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,B.jsx)(\`span\`,{className:\`absolute right-2 top-2 flex size-4 items-center justify-center rounded-full bg-foreground text-background\`,children:(0,B.jsx)(fe,{size:10,strokeWidth:3})}),(0,B.jsx)(n,{size:15,className:\`text-muted-foreground\`}),(0,B.jsx)(\`p\`,{className:\`mt-2 text-[13px] font-medium text-foreground\`,children:t.title}),(0,B.jsx)(\`p\`,{className:\`text-[11px] text-muted-foreground/80\`,children:t.sub})]},t.kind)})}),(0,B.jsx)(\`div\`,{className:\`mt-2\`,children:(0,B.jsx)(Up,{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,B.jsxs)(\`p\`,{className:\`mt-3 border-t border-border pt-2.5 text-[11px] leading-relaxed text-muted-foreground/80\`,children:[(0,B.jsx)(\`span\`,{className:\`font-medium text-foreground/80\`,children:l.title}),e.kind===\`postgres\`&&(0,B.jsx)(\`span\`,{className:\`ml-1.5 rounded border border-input px-1 py-px text-[9px] uppercase text-muted-foreground/80\`,children:\`default\`}),(0,B.jsx)(\`br\`,{}),l.blurb]})]})}function rv({result:e}){if(!e)return(0,B.jsx)(cf,{children:\`Run a query to see results. ⌘⏎ / Ctrl+⏎\`});if(!e.ok)return(0,B.jsxs)(\`div\`,{className:\`m-4 rounded-md border border-destructive/30 bg-destructive/10 p-3 text-[13px] text-destructive\`,children:[(0,B.jsx)(\`div\`,{className:\`font-mono\`,children:e.error}),e.code&&(0,B.jsxs)(\`div\`,{className:\`mt-1 text-xs text-destructive/70\`,children:[\`SQLSTATE \`,e.code]}),e.detail&&(0,B.jsx)(\`div\`,{className:\`mt-1 text-xs text-muted-foreground\`,children:e.detail}),e.hint&&(0,B.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,B.jsxs)(cf,{children:[\`Statement executed\`,e.affectedRows==null?\`\`:\` · \${e.affectedRows} rows affected\`,\`.\`]}):(0,B.jsxs)(\`div\`,{className:\`flex h-full min-h-0 flex-col\`,children:[(0,B.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,B.jsxs)(\`span\`,{children:[e.rowCount,\` row\`,e.rowCount===1?\`\`:\`s\`,\` · \`,e.ms,\` ms\`]}),(0,B.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-1\`,children:[(0,B.jsxs)(H,{variant:\`ghost\`,size:\`xs\`,onClick:()=>p_(\`results.csv\`,\`text/csv\`,f_(n,t)),children:[(0,B.jsx)(Te,{size:12}),\` CSV\`]}),(0,B.jsxs)(H,{variant:\`ghost\`,size:\`xs\`,onClick:()=>p_(\`results.json\`,\`application/json\`,JSON.stringify(t,null,2)),children:[(0,B.jsx)(Te,{size:12}),\` JSON\`]}),(0,B.jsx)(Qn,{variant:\`ghost\`,size:\`xs\`,label:\`results as JSON\`,value:()=>JSON.stringify(t,null,2),children:\`Copy\`})]})]}),(0,B.jsx)(\`div\`,{className:\`min-h-0 flex-1 overflow-auto\`,children:(0,B.jsxs)(Yp,{children:[(0,B.jsx)(Xp,{children:(0,B.jsx)(\`tr\`,{children:n.map(e=>(0,B.jsx)(Z,{className:\`font-mono text-foreground/80\`,children:e},e))})}),(0,B.jsx)(\`tbody\`,{children:t.map((e,t)=>(0,B.jsx)(Zp,{children:n.map(t=>(0,B.jsx)(Q,{className:\`max-w-90 cursor-cell truncate font-mono text-foreground/80\`,title:Jm(e[t])??\`Double-click to copy\`,onDoubleClick:()=>{let n=e[t];Xn(n==null?\`\`:typeof n==\`object\`?JSON.stringify(n):String(n),t)},children:(0,B.jsx)(qm,{value:e[t]})},t))},t))})]})})]})}var iv=\`tinbase_sql_queries\`,av=\`tinbase_sql_tabs\`,ov=\`tinbase_sql_history\`,sv=50;function cv(e,t){try{let n=localStorage.getItem(e);return n?JSON.parse(n):t}catch{return t}}function lv(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{}}var uv=()=>cv(iv,[]),dv=e=>lv(iv,e),fv=()=>cv(av,{tabs:[],active:null}),pv=(e,t)=>lv(av,{tabs:e,active:t}),mv=()=>cv(ov,[]);function hv(e){let t=[e,...mv()].slice(0,sv);return lv(ov,t),t}function gv(){return lv(ov,[]),[]}var _v=()=>crypto.randomUUID();function vv(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 yv(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 bv=/\\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 xv(e){return e.replace(bv,e=>\`\\n\${e.toUpperCase()}\`).replace(/^\\n/,\`\`).replace(/\\n{2,}/g,\`
1566
- \`).trim()}var Sv=!1;function Cv(e){Sv||(Sv=!0,an.default.require(\`ace/ext/language_tools\`).addCompleter({getCompletions:(t,n,r,i,a)=>{a(null,e().map(e=>({...e,score:500})))}}))}function wv(){let[e,t]=(0,_.useState)(uv),[n,r]=(0,_.useState)(\`\`),[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(null),c=fv(),[l,u]=(0,_.useState)(c.tabs.length?c.tabs:[{id:_v(),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)(mv),[T,E]=(0,_.useState)(!1),[D,O]=(0,_.useState)(!1),k=(0,_.useRef)([]);(0,_.useEffect)(()=>{Cv(()=>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)(()=>pv(l,p?.id??null),[l,p]);let A=(0,_.useCallback)(e=>{t(e),dv(e)},[]);if(!p)return(0,B.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 P(e){u(t=>t.map(t=>t.id===d?{...t,sql:e}:t))}function ee(e=\`\`,t=null){let n={id:_v(),queryId:t,sql:e};u(e=>[...e,n]),f(n.id),b(null)}function F(e){u(t=>{let n=t.filter(t=>t.id!==e);if(n.length===0){let e={id:_v(),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 I(e){let t=l.find(t=>t.queryId===e.id);t?f(t.id):ee(e.sql,e.id)}function te(t){let n=j(p);if(n)A(e.map(e=>e.id===n.id?{...e,sql:p.sql,updatedAt:Date.now()}:e)),U.success(\`Saved "\${n.name}"\`);else if(t){let n={id:_v(),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)),U.success(\`Saved "\${t}"\`)}else O(!0)}async function ne(){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(yv(e,g),t);b(n),w(hv({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 re=n.toLowerCase(),ie=e.filter(e=>e.name.toLowerCase().includes(re)||e.sql.toLowerCase().includes(re)),ae=ie.filter(e=>e.favorite),L=ie.filter(e=>!e.favorite);return(0,B.jsxs)(\`div\`,{className:\`flex h-full\`,children:[(0,B.jsxs)(mf,{id:\`sql-saved\`,side:\`left\`,defaultSize:240,min:200,max:400,className:\`flex flex-col border-r border-border bg-card\`,children:[(0,B.jsx)(\`div\`,{className:\`px-4 pb-1 pt-4 text-sm font-semibold text-foreground\`,children:\`SQL Editor\`}),(0,B.jsxs)(\`div\`,{className:\`space-y-1.5 px-2 pb-2 pt-1\`,children:[(0,B.jsxs)(H,{variant:\`outline\`,size:\`xs\`,className:\`w-full\`,onClick:()=>ee(),children:[(0,B.jsx)(pt,{size:12}),\` New query\`]}),(0,B.jsxs)(\`div\`,{className:\`relative\`,children:[(0,B.jsx)(_t,{size:13,className:\`pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground/60\`}),(0,B.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,B.jsxs)(\`div\`,{className:\`min-h-0 flex-1 overflow-y-auto pb-2\`,children:[ae.length>0&&(0,B.jsx)(Tv,{title:\`Favorites\`,items:ae,onOpen:I,onRename:a,onDelete:s,onFav:t=>A(e.map(e=>e.id===t.id?{...e,favorite:!e.favorite}:e))}),(0,B.jsx)(Tv,{title:\`Saved (\${L.length})\`,items:L,onOpen:I,onRename:a,onDelete:s,onFav:t=>A(e.map(e=>e.id===t.id?{...e,favorite:!e.favorite}:e))}),ie.length===0&&(0,B.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,B.jsxs)(\`div\`,{className:\`flex min-w-0 flex-1 flex-col\`,children:[(0,B.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,B.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,B.jsx)(\`span\`,{className:\`max-w-40 truncate\`,children:vv(e.sql,j(e))}),M(e)&&(0,B.jsx)(\`span\`,{className:\`size-1.5 shrink-0 rounded-full bg-brand\`,title:\`Unsaved changes\`}),(0,B.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(),F(e.id)},children:(0,B.jsx)(Ft,{size:11})})]},e.id)),(0,B.jsx)(\`button\`,{className:\`ml-1 rounded p-1 text-muted-foreground/80 hover:bg-accent hover:text-foreground\`,title:\`New tab\`,onClick:()=>ee(),children:(0,B.jsx)(pt,{size:13})})]}),(0,B.jsxs)(\`div\`,{className:\`flex shrink-0 items-center gap-1.5 border-b border-border px-3 py-1.5\`,children:[(0,B.jsx)(nv,{align:\`start\`,value:m,onChange:e=>h(e)}),(0,B.jsx)(Up,{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,B.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-1.5\`,children:[(0,B.jsxs)(ff,{open:T,onOpenChange:E,align:\`end\`,className:\`max-h-96 w-105 overflow-y-auto p-1.5\`,trigger:(0,B.jsxs)(H,{variant:\`ghost\`,size:\`xs\`,onClick:()=>E(e=>!e),children:[(0,B.jsx)(Ve,{size:12}),\` History\`]}),children:[C.length===0&&(0,B.jsx)(\`p\`,{className:\`px-3 py-4 text-center text-xs text-muted-foreground/60\`,children:\`No runs yet.\`}),C.map((e,t)=>(0,B.jsxs)(\`button\`,{className:\`block w-full rounded px-2.5 py-1.5 text-left hover:bg-accent\`,onClick:()=>{ee(e.sql),E(!1)},children:[(0,B.jsx)(\`span\`,{className:\`block truncate font-mono text-xs text-foreground/80\`,children:e.sql}),(0,B.jsxs)(\`span\`,{className:\`text-[10px] text-muted-foreground/60\`,children:[(0,B.jsx)(Km,{value:e.ts,format:\`time\`}),\` · \`,e.ok?\`\${e.rows??0} rows · \${e.ms} ms\`:\`error\`]})]},t)),C.length>0&&(0,B.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(gv()),children:\`Clear history\`})]}),(0,B.jsxs)(H,{variant:\`ghost\`,size:\`xs\`,title:\`Format query\`,onClick:()=>P(xv(p.sql)),children:[(0,B.jsx)(Nt,{size:12}),\` Format\`]}),(0,B.jsx)(H,{variant:\`outline\`,size:\`xs\`,onClick:()=>te(),disabled:!p.sql.trim(),children:j(p)?\`Save\`:\`Save as…\`}),(0,B.jsxs)(H,{size:\`xs\`,onClick:()=>void ne(),disabled:x||!p.sql.trim(),children:[(0,B.jsx)(dt,{size:12}),\` \`,x?\`Running…\`:\`Run\`,\` \`,(0,B.jsx)(lf,{children:\`⌘⏎\`})]})]})]}),(0,B.jsx)(\`div\`,{className:\`min-h-0 flex-1 p-3 pb-0\`,children:(0,B.jsx)(nr,{lang:\`sql\`,className:\`h-full\`,value:p.sql,onChange:P,onCmdEnter:()=>void ne(),placeholder:\`select * from … (⌘⏎ to run)\`})}),(0,B.jsx)(mf,{id:\`sql-results\`,axis:\`y\`,side:\`right\`,defaultSize:300,min:140,max:640,className:\`overflow-hidden border-t border-border\`,children:(0,B.jsx)(rv,{result:y})})]}),i&&(0,B.jsx)(Ev,{query:i,onClose:()=>a(null),onSave:t=>{A(e.map(e=>e.id===i.id?{...e,name:t}:e)),a(null)}}),D&&(0,B.jsx)(Dv,{suggested:vv(p.sql,null),onClose:()=>O(!1),onSave:e=>{te(e),O(!1)}}),o&&(0,B.jsx)(go,{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 Tv({title:e,items:t,onOpen:n,onRename:r,onDelete:i,onFav:a}){return(0,B.jsxs)(\`div\`,{className:\`pt-2\`,children:[(0,B.jsx)(\`p\`,{className:\`px-4 pb-1 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/60\`,children:e}),t.map(e=>(0,B.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,B.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,B.jsx)(Be,{size:10,className:\`shrink-0 fill-brand text-brand\`}),(0,B.jsx)(\`span\`,{className:\`truncate\`,children:e.name})]}),(0,B.jsxs)(Zd,{children:[(0,B.jsx)(Qd,{asChild:!0,children:(0,B.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,B.jsx)(Ee,{size:12})})}),(0,B.jsxs)(tf,{align:\`start\`,children:[(0,B.jsxs)(nf,{onSelect:()=>a(e),children:[(0,B.jsx)(Be,{size:13}),\` \`,e.favorite?\`Unfavorite\`:\`Favorite\`]}),(0,B.jsxs)(nf,{onSelect:()=>r(e),children:[(0,B.jsx)(ct,{size:13}),\` Rename\`]}),(0,B.jsx)(of,{}),(0,B.jsxs)(nf,{danger:!0,onSelect:()=>i(e),children:[(0,B.jsx)(Ot,{size:13}),\` Delete\`]})]})]})]},e.id))]})}function Ev({query:e,onClose:t,onSave:n}){let[r,i]=(0,_.useState)(e.name);return(0,B.jsx)(ho,{open:!0,onClose:t,title:\`Rename query\`,children:(0,B.jsxs)(\`div\`,{className:\`space-y-3\`,children:[(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(X,{children:\`Name\`}),(0,B.jsx)(Y,{value:r,autoFocus:!0,onChange:e=>i(e.target.value),onKeyDown:e=>e.key===\`Enter\`&&r.trim()&&n(r.trim())})]}),(0,B.jsxs)(\`div\`,{className:\`flex justify-end gap-2\`,children:[(0,B.jsx)(H,{variant:\`outline\`,onClick:t,children:\`Cancel\`}),(0,B.jsx)(H,{onClick:()=>n(r.trim()),disabled:!r.trim(),children:\`Rename\`})]})]})})}function Dv({suggested:e,onClose:t,onSave:n}){let[r,i]=(0,_.useState)(e===\`Untitled query\`?\`\`:e);return(0,B.jsx)(ho,{open:!0,onClose:t,title:\`Save query\`,children:(0,B.jsxs)(\`div\`,{className:\`space-y-3\`,children:[(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(X,{children:\`Name\`}),(0,B.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,B.jsxs)(\`div\`,{className:\`flex justify-end gap-2\`,children:[(0,B.jsx)(H,{variant:\`outline\`,onClick:t,children:\`Cancel\`}),(0,B.jsx)(H,{onClick:()=>n(r.trim()),disabled:!r.trim(),children:\`Save\`})]})]})})}function Ov({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\`),U.success(\`Dropped policy \${e.name}\`),l()}catch(e){U.error(e.message)}}if(t===null)return(0,B.jsx)(qp,{});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,B.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,B.jsxs)(\`div\`,{className:\`flex items-center gap-2\`,children:[(0,B.jsx)(\`span\`,{className:\`truncate font-mono text-[13px] text-foreground\`,children:e.name}),(0,B.jsx)(V,{variant:\`blue\`,children:e.cmd}),String(e.permissive).toUpperCase()!==\`PERMISSIVE\`&&(0,B.jsx)(V,{variant:\`red\`,children:\`restrictive\`}),(0,B.jsx)(V,{variant:\`neutral\`,children:Array.isArray(e.roles)?e.roles.join(\`, \`):String(e.roles)}),(0,B.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,B.jsx)(Ot,{size:13})})]}),e.using_expr&&(0,B.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,B.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,B.jsxs)(\`div\`,{className:\`h-full overflow-y-auto px-6 py-5\`,children:[(0,B.jsxs)(\`div\`,{className:\`flex max-w-2xl items-start justify-between gap-4\`,children:[(0,B.jsxs)(\`p\`,{className:\`text-xs text-muted-foreground/80\`,children:[\`Object access is controlled by RLS policies on \`,(0,B.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,B.jsxs)(\`code\`,{className:\`text-muted-foreground\`,children:[\`bucket_id = '\`,e??\`name\`,\`'\`]}),\`.\`]}),(0,B.jsxs)(H,{size:\`xs\`,className:\`shrink-0\`,onClick:()=>i(!0),children:[(0,B.jsx)(pt,{size:12}),\` New policy\`]})]}),(0,B.jsxs)(\`div\`,{className:\`mt-4 max-w-2xl space-y-5\`,children:[e&&(0,B.jsxs)(\`div\`,{children:[(0,B.jsxs)(\`p\`,{className:\`mb-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/60\`,children:[\`Policies for \`,e,\` \`,(0,B.jsx)(\`span\`,{className:\`text-muted-foreground/40\`,children:f.length})]}),(0,B.jsxs)(\`div\`,{className:\`space-y-2\`,children:[f.map(m),f.length===0&&(0,B.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,B.jsxs)(\`div\`,{children:[e&&(0,B.jsxs)(\`p\`,{className:\`mb-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/60\`,children:[\`Other policies on storage.objects \`,(0,B.jsx)(\`span\`,{className:\`text-muted-foreground/40\`,children:p.length})]}),(0,B.jsxs)(\`div\`,{className:\`space-y-2\`,children:[p.map(m),t.length===0&&(0,B.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,B.jsx)(wg,{table:\`objects\`,schema:\`storage\`,onClose:()=>i(!1),onCreated:async()=>l()}),a&&(0,B.jsx)(wg,{table:\`objects\`,schema:\`storage\`,existing:Dg(a),onClose:()=>o(null),onCreated:async()=>l()}),s&&(0,B.jsx)(go,{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 kv=e=>e==null?\`Unlimited\`:e<1024*1024?\`\${(e/1024).toFixed(0)} KB\`:\`\${(e/1024/1024).toFixed(0)} MB\`;function Av({bucket:e,onDelete:t}){return(0,B.jsxs)(\`div\`,{className:\`h-full overflow-y-auto px-6 py-5\`,children:[(0,B.jsxs)(\`div\`,{className:\`max-w-2xl divide-y divide-border/70\`,children:[(0,B.jsx)(jv,{label:\`Visibility\`,description:\`Public buckets serve objects without authentication.\`,children:e.public?(0,B.jsx)(V,{variant:\`brand\`,children:\`public\`}):(0,B.jsx)(V,{variant:\`neutral\`,children:\`private\`})}),(0,B.jsx)(jv,{label:\`File size limit\`,description:\`Uploads above the limit are rejected.\`,children:(0,B.jsx)(\`span\`,{className:\`font-mono text-[13px] text-foreground/90\`,children:kv(e.file_size_limit)})}),(0,B.jsx)(jv,{label:\`Allowed MIME types\`,description:\`Empty means every type is accepted.\`,children:e.allowed_mime_types?.length?(0,B.jsx)(\`div\`,{className:\`flex flex-wrap gap-1.5\`,children:e.allowed_mime_types.map(e=>(0,B.jsx)(V,{variant:\`outline\`,className:\`font-mono\`,children:e},e))}):(0,B.jsx)(\`span\`,{className:\`text-[13px] text-muted-foreground\`,children:\`Any\`})}),(0,B.jsx)(jv,{label:\`Created\`,description:\`\`,children:(0,B.jsx)(\`span\`,{className:\`font-mono text-[13px] text-foreground/90\`,children:(0,B.jsx)(Km,{value:e.created_at})})}),(0,B.jsx)(jv,{label:\`Delete bucket\`,description:\`The bucket must be empty. This cannot be undone.\`,children:(0,B.jsxs)(H,{variant:\`danger\`,size:\`xs\`,onClick:t,children:[(0,B.jsx)(Ot,{size:12}),\` Delete bucket\`]})})]}),(0,B.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,B.jsx)(\`code\`,{children:\`supabase-js\`}),\`'s\`,\` \`,(0,B.jsx)(\`code\`,{className:\`text-muted-foreground\`,children:\`updateBucket\`}),\`).\`]})]})}function jv({label:e,description:t,children:n}){return(0,B.jsxs)(\`div\`,{className:\`flex flex-col gap-3 py-5 sm:flex-row sm:items-start sm:gap-10\`,children:[(0,B.jsxs)(\`div\`,{className:\`w-56 shrink-0\`,children:[(0,B.jsx)(\`p\`,{className:\`text-[13px] font-medium text-foreground\`,children:e}),t&&(0,B.jsx)(\`p\`,{className:\`mt-1 text-xs leading-relaxed text-muted-foreground/80\`,children:t})]}),(0,B.jsx)(\`div\`,{className:\`min-w-0 flex-1 pt-0.5\`,children:n})]})}var Mv=e=>e.id===null&&!e.metadata;function Nv(e){return e==null?\`—\`:e<1024?\`\${e} B\`:e<1024*1024?\`\${(e/1024).toFixed(1)} KB\`:\`\${(e/1024/1024).toFixed(1)} MB\`}function Pv({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){U.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){U.error(\`\${r.name}: \${e.message}\`)}U.success(\`Uploaded \${n.length} file\${n.length===1?\`\`:\`s\`}\`),await m()}async function v(){try{await N.removeObjects(e.id,[...a]),U.success(\`Deleted \${a.size} object\${a.size===1?\`\`:\`s\`}\`),o(new Set),await m()}catch(e){U.error(e.message)}}async function y(t){let n=h(t);if(e.public)await Xn(\`\${ch()}/storage/v1/object/public/\${e.id}/\${n}\`,\`Public URL\`);else try{await Xn(await N.signUrl(e.id,n,3600),\`Signed URL (1h)\`)}catch(e){U.error(e.message)}}if(r===null)return(0,B.jsx)(qp,{});let b=t?t.split(\`/\`):[],x=r.filter(e=>!Mv(e)).map(h),S=x.length>0&&x.every(e=>a.has(e));return(0,B.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,B.jsxs)(\`div\`,{className:\`flex min-w-0 flex-1 flex-col\`,children:[(0,B.jsxs)(\`div\`,{className:\`flex shrink-0 items-center gap-1 border-b border-border px-4 py-2 text-[13px]\`,children:[(0,B.jsxs)(\`button\`,{className:\`flex items-center gap-1 text-muted-foreground hover:text-foreground\`,onClick:()=>n(\`\`),children:[(0,B.jsx)(He,{size:12}),\` \`,e.id]}),b.map((e,t)=>(0,B.jsxs)(\`span\`,{className:\`flex items-center gap-1\`,children:[(0,B.jsx)(he,{size:11,className:\`text-muted-foreground/60\`}),(0,B.jsx)(\`button\`,{className:\`font-mono text-muted-foreground hover:text-foreground\`,onClick:()=>n(b.slice(0,t+1).join(\`/\`)),children:e})]},t)),(0,B.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-1.5\`,children:[a.size>0&&(0,B.jsxs)(H,{variant:\`dangerSolid\`,size:\`xs\`,onClick:()=>u(!0),children:[(0,B.jsx)(Ot,{size:12}),\` Delete \`,a.size]}),(0,B.jsx)(H,{variant:\`ghost\`,size:\`iconXs\`,title:\`Refresh\`,onClick:()=>void m(),children:(0,B.jsx)(ht,{size:13})}),(0,B.jsx)(\`input\`,{ref:p,type:\`file\`,multiple:!0,className:\`hidden\`,onChange:e=>e.target.files&&void g(e.target.files)}),(0,B.jsxs)(H,{size:\`xs\`,onClick:()=>p.current?.click(),children:[(0,B.jsx)(At,{size:12}),\` Upload\`]})]})]}),(0,B.jsxs)(\`div\`,{className:\`min-h-0 flex-1 overflow-auto\`,children:[(0,B.jsxs)(Yp,{children:[(0,B.jsx)(Xp,{children:(0,B.jsxs)(\`tr\`,{children:[(0,B.jsx)(Z,{className:\`w-10\`,children:(0,B.jsx)(Zt,{checked:S,indeterminate:!S&&x.some(e=>a.has(e)),disabled:x.length===0,onChange:e=>o(e?new Set(x):new Set)})}),(0,B.jsx)(Z,{children:\`Name\`}),(0,B.jsx)(Z,{children:\`Size\`}),(0,B.jsx)(Z,{children:\`Type\`}),(0,B.jsx)(Z,{children:\`Modified\`}),(0,B.jsx)(Z,{className:\`w-16\`})]})}),(0,B.jsx)(\`tbody\`,{children:r.map(t=>{let r=Mv(t),i=h(t);return(0,B.jsxs)(Zp,{className:\`cursor-pointer\`,onClick:()=>r?n(i):c(t),children:[(0,B.jsx)(Q,{onClick:e=>e.stopPropagation(),children:!r&&(0,B.jsx)(Zt,{checked:a.has(i),onChange:e=>o(t=>{let n=new Set(t);return e?n.add(i):n.delete(i),n})})}),(0,B.jsx)(Q,{className:\`font-mono text-foreground/90\`,children:(0,B.jsxs)(\`span\`,{className:\`flex items-center gap-2\`,children:[r?(0,B.jsx)(Fe,{size:13,className:\`text-info\`}):(0,B.jsx)(Me,{size:13,className:\`text-muted-foreground/70\`}),t.name]})}),(0,B.jsx)(Q,{className:\`text-muted-foreground\`,children:r?\`—\`:Nv(t.metadata?.size)}),(0,B.jsx)(Q,{className:\`text-muted-foreground\`,children:r?\`folder\`:t.metadata?.mimetype??\`—\`}),(0,B.jsx)(Q,{className:\`text-muted-foreground\`,children:(0,B.jsx)(Km,{value:t.updated_at})}),(0,B.jsx)(Q,{onClick:e=>e.stopPropagation(),children:!r&&(0,B.jsxs)(\`div\`,{className:\`flex justify-end gap-0.5 opacity-0 group-hover:opacity-100\`,children:[(0,B.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,B.jsx)(Je,{size:13})}),(0,B.jsx)(\`button\`,{className:\`p-1 text-muted-foreground/80 hover:text-destructive\`,title:\`Delete\`,onClick:()=>{o(new Set([i])),u(!0)},children:(0,B.jsx)(Ot,{size:13})})]})})]},t.name)})})]}),r.length===0&&(0,B.jsxs)(cf,{children:[\`Empty\`,t?\` folder\`:\` bucket\`,\` — drop files here or hit Upload.\`]})]})]}),s&&(0,B.jsx)(Fv,{bucket:e,path:h(s),entry:s,onClose:()=>c(null),onCopyUrl:()=>void y(s)}),d&&(0,B.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,B.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,B.jsx)(go,{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 Fv({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,B.jsxs)(mf,{id:\`storage-preview\`,side:\`right\`,defaultSize:320,min:260,max:560,className:\`flex flex-col border-l border-border bg-card\`,children:[(0,B.jsxs)(\`div\`,{className:\`flex items-center justify-between border-b border-border px-4 py-2.5\`,children:[(0,B.jsx)(\`span\`,{className:\`truncate font-mono text-[13px] text-foreground\`,children:n.name}),(0,B.jsx)(\`button\`,{className:\`text-muted-foreground/80 hover:text-foreground\`,onClick:r,children:\`✕\`})]}),(0,B.jsxs)(\`div\`,{className:\`min-h-0 flex-1 overflow-y-auto p-4\`,children:[u&&(a?(0,B.jsx)(\`img\`,{src:a,alt:n.name,className:\`max-h-64 w-full rounded-md border border-border object-contain\`}):s?(0,B.jsx)(\`p\`,{className:\`text-xs text-destructive\`,children:\`Preview failed.\`}):(0,B.jsx)(\`div\`,{className:\`h-40 animate-pulse rounded-md bg-accent\`})),d&&f!==null&&(0,B.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,B.jsxs)(\`p\`,{className:\`text-xs text-muted-foreground/80\`,children:[\`No inline preview for \`,l||\`this type\`,\`.\`]}),(0,B.jsxs)(\`div\`,{className:\`mt-4 space-y-1.5 text-[13px]\`,children:[(0,B.jsxs)(\`div\`,{className:\`flex justify-between gap-4\`,children:[(0,B.jsx)(\`span\`,{className:\`text-muted-foreground\`,children:\`Size\`}),(0,B.jsx)(\`span\`,{className:\`font-mono text-foreground/90\`,children:Nv(n.metadata?.size)})]}),(0,B.jsxs)(\`div\`,{className:\`flex justify-between gap-4\`,children:[(0,B.jsx)(\`span\`,{className:\`text-muted-foreground\`,children:\`Type\`}),(0,B.jsx)(\`span\`,{className:\`truncate font-mono text-foreground/90\`,children:l||\`—\`})]}),(0,B.jsxs)(\`div\`,{className:\`flex justify-between gap-4\`,children:[(0,B.jsx)(\`span\`,{className:\`text-muted-foreground\`,children:\`Path\`}),(0,B.jsx)(\`span\`,{className:\`truncate font-mono text-foreground/90\`,title:t,children:t})]})]}),(0,B.jsxs)(H,{variant:\`outline\`,size:\`xs\`,className:\`mt-4 w-full\`,onClick:i,children:[(0,B.jsx)(Je,{size:12}),\` \`,e.public?\`Copy public URL\`:\`Copy signed URL (1h)\`]})]})]})}function Iv(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(\`files\`),[i,a]=(0,_.useState)(!1),[o,s]=(0,_.useState)(null),{section:c}=qt(),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,B.jsx)(qp,{});let u=e.find(e=>e.id===c)??null;!u&&e.length>0&&c===null&&z(\`storage\`,e[0].id,{replace:!0});async function d(e){try{await N.deleteBucket(e.id),U.success(\`Deleted bucket \${e.id}\`),z(\`storage\`,(await l())[0]?.id??null,{replace:!0})}catch(e){U.error(e.message)}}return(0,B.jsxs)(\`div\`,{className:\`flex h-full\`,children:[(0,B.jsxs)(mf,{id:\`storage-rail\`,side:\`left\`,defaultSize:224,min:180,max:360,className:\`flex flex-col border-r border-border bg-card\`,children:[(0,B.jsx)(\`div\`,{className:\`px-4 pb-1 pt-4 text-sm font-semibold text-foreground\`,children:\`Storage\`}),(0,B.jsx)(\`div\`,{className:\`px-2 pb-2 pt-1\`,children:(0,B.jsxs)(H,{variant:\`outline\`,size:\`xs\`,className:\`w-full\`,onClick:()=>a(!0),children:[(0,B.jsx)(pt,{size:12}),\` New bucket\`]})}),(0,B.jsxs)(\`div\`,{className:\`min-h-0 flex-1 overflow-y-auto px-2 pb-3\`,children:[e.map(e=>(0,B.jsxs)(\`button\`,{onClick:()=>z(\`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,B.jsx)(\`span\`,{className:\`min-w-0 flex-1 truncate font-mono\`,children:e.id}),e.public&&(0,B.jsx)(V,{variant:\`brand\`,children:\`public\`})]},e.id)),e.length===0&&(0,B.jsx)(\`p\`,{className:\`px-3 py-4 text-center text-xs text-muted-foreground/60\`,children:\`No buckets yet.\`})]})]}),(0,B.jsx)(\`div\`,{className:\`flex min-w-0 flex-1 flex-col\`,children:u?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(\`div\`,{className:\`shrink-0 px-6 pt-5\`,children:[(0,B.jsxs)(\`div\`,{className:\`flex items-center gap-2\`,children:[(0,B.jsx)(\`h1\`,{className:\`font-mono text-lg font-semibold text-foreground\`,children:u.id}),u.public&&(0,B.jsx)(V,{variant:\`brand\`,children:\`public\`})]}),(0,B.jsx)(\`div\`,{className:\`mt-3\`,children:(0,B.jsx)(Qp,{tabs:[{id:\`files\`,label:\`Files\`},{id:\`settings\`,label:\`Settings\`},{id:\`policies\`,label:\`Policies\`}],active:n,onSelect:r})})]}),(0,B.jsxs)(\`div\`,{className:\`min-h-0 flex-1\`,children:[n===\`files\`&&(0,B.jsx)(Pv,{bucket:u}),n===\`settings\`&&(0,B.jsx)(Av,{bucket:u,onDelete:()=>s(u)}),n===\`policies\`&&(0,B.jsx)(Ov,{bucket:u.id})]})]}):(0,B.jsx)(\`div\`,{className:\`flex flex-1 items-center justify-center\`,children:(0,B.jsxs)(\`div\`,{className:\`rounded-lg border border-dashed border-border px-16 py-12 text-center\`,children:[(0,B.jsx)(Pe,{size:22,className:\`mx-auto text-muted-foreground/60\`}),(0,B.jsx)(\`p\`,{className:\`mt-3 text-sm font-medium text-foreground\`,children:\`Create a file bucket\`}),(0,B.jsx)(\`p\`,{className:\`mt-1 text-xs text-muted-foreground/80\`,children:\`Store images, videos, documents, and any other file type.\`}),(0,B.jsxs)(H,{size:\`xs\`,className:\`mt-4\`,onClick:()=>a(!0),children:[(0,B.jsx)(pt,{size:12}),\` New bucket\`]})]})})}),i&&(0,B.jsx)(Lv,{onClose:()=>a(!1),onDone:async e=>{a(!1),await l(),z(\`storage\`,e,{replace:!0})}}),o&&(0,B.jsx)(go,{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 Lv({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}),U.success(\`Created bucket \${n}\`),await t(n)}catch(e){s(e.message),l(!1)}}return(0,B.jsx)(ho,{open:!0,onClose:e,title:\`New bucket\`,children:(0,B.jsxs)(\`div\`,{className:\`space-y-3\`,children:[(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(X,{children:\`Name — lowercase, no spaces\`}),(0,B.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,B.jsxs)(\`label\`,{className:\`flex cursor-pointer items-center gap-2 text-[13px] text-foreground/80\`,children:[(0,B.jsx)(Zt,{checked:i,onChange:a}),\`Public bucket — objects readable without auth\`]}),o&&(0,B.jsx)(\`p\`,{className:\`text-xs text-destructive\`,children:o}),(0,B.jsxs)(\`div\`,{className:\`flex justify-end gap-2\`,children:[(0,B.jsx)(H,{variant:\`outline\`,onClick:e,children:\`Cancel\`}),(0,B.jsx)(H,{onClick:()=>void u(),disabled:c||!n,children:c?\`Creating…\`:\`Create bucket\`})]})]})})}var Rv=[{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}],zv=[\`Comparison\`,\`Pattern matching\`,\`Lists\`,\`Null\`],Bv=new Set([\`text\`,\`varchar\`,\`bpchar\`,\`char\`,\`name\`,\`citext\`]);function Vv(e,t){let n=e.filter(e=>Bv.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 Hv(e,t){let n=[];for(let r of t)if(r.column===\`*\`){let t=Vv(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 Uv(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 Wv(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 Gv(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 Kv(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 qv(e){if(e==null)return;let t=typeof e==\`object\`?JSON.stringify(e):String(e);return t.length>40?t:void 0}function Jv({value:e}){return e==null?(0,B.jsx)(\`span\`,{className:\`select-none text-muted-foreground/60\`,children:\`NULL\`}):e===\`\`?(0,B.jsx)(\`span\`,{className:\`select-none italic text-muted-foreground/60\`,children:\`empty\`}):typeof e==\`boolean\`?(0,B.jsx)(\`span\`,{className:\`text-info\`,children:String(e)}):typeof e==\`object\`?(0,B.jsx)(\`span\`,{className:\`text-warning/90\`,children:JSON.stringify(e)}):(0,B.jsx)(B.Fragment,{children:String(e)})}function Yv(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 Xv({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?Gv(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,hn.createPortal)((0,B.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,B.jsx)(\`div\`,{className:\`max-h-64 overflow-y-auto p-1\`,children:T.map(e=>(0,B.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,B.jsx)(fe,{size:12,className:\`ml-auto shrink-0\`})]},e))}):g?(0,B.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,B.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,B.jsxs)(\`div\`,{className:\`border-t border-border px-2.5 py-2 font-mono text-[11px]\`,children:[(0,B.jsx)(\`p\`,{className:\`mb-1 font-sans text-muted-foreground/80\`,children:\`Formatted value:\`}),s===\`\`?(0,B.jsx)(\`p\`,{className:\`text-muted-foreground/60\`,children:e.nullable?\`NULL\`:\`empty\`}):b?(0,B.jsxs)(\`div\`,{className:\`space-y-0.5\`,children:[(0,B.jsxs)(\`div\`,{className:\`flex justify-between gap-4\`,children:[(0,B.jsx)(\`span\`,{className:\`text-muted-foreground/80\`,children:\`UTC\`}),(0,B.jsx)(\`span\`,{className:\`text-foreground/80\`,children:y.toISOString().replace(\`T\`,\` \`).slice(0,19)})]}),(0,B.jsxs)(\`div\`,{className:\`flex justify-between gap-4\`,children:[(0,B.jsx)(\`span\`,{className:\`truncate text-muted-foreground/80\`,children:x}),(0,B.jsx)(\`span\`,{className:\`shrink-0 text-foreground/80\`,children:y.toLocaleString()})]}),(0,B.jsxs)(\`div\`,{className:\`flex justify-between gap-4\`,children:[(0,B.jsx)(\`span\`,{className:\`text-muted-foreground/80\`,children:\`Relative\`}),(0,B.jsx)(\`span\`,{className:\`text-foreground/80\`,children:Yv(y)})]})]}):(0,B.jsx)(\`p\`,{className:\`text-destructive\`,children:\`Invalid date\`})]}),(0,B.jsxs)(\`div\`,{className:\`border-t border-border p-1.5\`,children:[(0,B.jsxs)(\`div\`,{className:\`flex items-center gap-1\`,children:[(0,B.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,B.jsx)(lf,{children:\`↵\`}),\` Save changes\`]}),h&&(0,B.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(Wv(e.type)),children:[(0,B.jsx)(be,{size:11}),\` Set to NOW\`]})]}),(0,B.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,B.jsx)(lf,{children:\`Esc\`}),\` Cancel changes\`]})]})]}),document.body)}var Zv=e=>e.replace(/'/g,\`''\`);async function Qv(e,t){let n=Zv(e),r=Zv(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 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 g_(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 __=/^([A-Z]+)\\s+(\\S+)\\s+→\\s+(\\d{3})\\b/;function v_(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 y_(e){let t=__.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:v_(r,e.msg)}}var b_=e=>e===null?null:\`\${Math.floor(e/100)}xx\`,x_=[{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 S_(){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(y_),[e]),C=(0,_.useMemo)(()=>{let e=x_.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=b_(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||b_(e.status)!==null&&f.has(b_(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)(w_,{title:\`Time range\`,children:x_.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)(w_,{title:\`Service\`,children:[[...w.svc.entries()].sort((e,t)=>t[1]-e[1]).map(([e,t])=>(0,z.jsx)(T_,{label:e,count:t,checked:o.has(e),onToggle:()=>s(C_(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)(w_,{title:\`Level\`,children:[\`info\`,\`warn\`,\`error\`].map(e=>(0,z.jsx)(T_,{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(C_(c,e))},e))}),(0,z.jsxs)(w_,{title:\`Method\`,children:[[\`GET\`,\`POST\`,\`PATCH\`,\`PUT\`,\`DELETE\`,\`OPTIONS\`].filter(e=>w.mth.has(e)).map(e=>(0,z.jsx)(T_,{label:e,mono:!0,count:w.mth.get(e),checked:u.has(e),onToggle:()=>d(C_(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)(w_,{title:\`Status\`,children:[[\`2xx\`,\`3xx\`,\`4xx\`,\`5xx\`].filter(e=>w.sts.has(e)).map(e=>(0,z.jsx)(T_,{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(C_(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)(Zd,{children:[(0,z.jsx)(Qd,{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)(tf,{align:\`end\`,children:[(0,z.jsx)(nf,{onSelect:()=>g_(\`tinbase-logs.txt\`,\`text/plain\`,T.map(e=>\`\${e.ts} \${e.level.toUpperCase()} \${e.msg}\`).join(\`
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
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 $v({schema:e=\`public\`,table:t,refreshKey:n}){let[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(\`\`);return(0,_.useEffect)(()=>{i(null),o(\`\`),Qv(e,t).then(i,e=>o(e.message))},[e,t,n]),a?(0,B.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,B.jsx)(\`span\`,{className:\`ml-1 text-destructive\`,children:a})]}):r===null?(0,B.jsx)(\`div\`,{className:\`flex-1\`,children:(0,B.jsx)(qp,{})}):(0,B.jsxs)(\`div\`,{className:\`min-h-0 flex-1 overflow-auto\`,children:[(0,B.jsxs)(\`div\`,{className:\`flex items-center justify-between px-5 pb-1 pt-4\`,children:[(0,B.jsxs)(\`h2\`,{className:\`text-sm text-foreground/80\`,children:[\`SQL definition of \`,(0,B.jsx)(\`code\`,{className:\`rounded bg-accent px-1.5 py-0.5 font-mono text-xs text-foreground\`,children:t}),\` \`,(0,B.jsx)(\`span\`,{className:\`text-xs text-muted-foreground/60\`,children:\`(read only)\`})]}),(0,B.jsx)(Qn,{value:r,label:\`Definition\`,variant:\`outline\`,size:\`xs\`,children:\`Copy\`})]}),(0,B.jsx)(\`div\`,{className:\`px-3 pb-4\`,children:(0,B.jsx)(er,{value:r,lang:\`sql\`,readOnly:!0,gutter:!0,minLines:4,maxLines:500})})]})}var ey=e=>e.target.split(\`.\`).pop(),ty=e=>e.target===\`auth.users\`;function ny(e,t){return e?e.columns.filter(e=>!t.targetColumns.includes(e.name)&&Bv.has(e.type)).slice(0,2).map(e=>e.name):[]}async function ry(e,t,n){if(ty(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=Vv(t.columns,n.search);e&&r.push(e)}let i=n.perPage??100;return N.rows(ey(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 iy({fk:e,value:t,anchor:n,tables:r,onClose:i,onOpenTable:a}){let o=r.find(t=>t.name===ey(e)),[s,c]=(0,_.useState)(void 0);(0,_.useEffect)(()=>{ry(e,o,{exact:t}).then(({rows:e})=>c(e[0]??null),()=>c(null))},[e,o,t]);let l=ty(e)?\`id\`:e.targetColumns[0],u=ty(e)?[\`email\`]:ny(o,e),d=t=>ty(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,hn.createPortal)((0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(\`div\`,{className:\`fixed inset-0 z-[70]\`,onClick:i}),(0,B.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,B.jsxs)(\`p\`,{className:\`border-b border-border px-3 py-2 text-xs text-muted-foreground\`,children:[\`Referencing record from \`,(0,B.jsx)(\`code\`,{className:\`font-mono text-foreground\`,children:e.target}),\`:\`]}),s===void 0?(0,B.jsx)(qp,{}):s===null?(0,B.jsx)(\`p\`,{className:\`px-3 py-4 text-center text-xs text-muted-foreground/60\`,children:\`No matching record found.\`}):(0,B.jsxs)(\`table\`,{className:\`w-full border-collapse text-[13px]\`,children:[(0,B.jsx)(\`thead\`,{children:(0,B.jsx)(\`tr\`,{children:[l,...u].map((e,t)=>(0,B.jsx)(\`th\`,{className:\`border-b border-r border-border px-3 py-1.5 text-left font-normal last:border-r-0\`,children:(0,B.jsxs)(\`span\`,{className:\`flex items-center gap-1.5\`,children:[t===0&&(0,B.jsx)(Ge,{size:10,className:\`text-brand\`}),(0,B.jsx)(\`span\`,{className:\`font-mono font-medium text-foreground\`,children:e}),(0,B.jsx)(\`span\`,{className:\`text-[11px] text-muted-foreground/60\`,children:d(e)})]})},e))})}),(0,B.jsx)(\`tbody\`,{children:(0,B.jsx)(\`tr\`,{children:[l,...u].map(e=>(0,B.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,B.jsx)(Jv,{value:s[e]})},e))})})]}),!ty(e)&&(0,B.jsx)(\`div\`,{className:\`flex justify-end border-t border-border px-2 py-1.5\`,children:(0,B.jsx)(H,{variant:\`outline\`,size:\`xs\`,onClick:()=>a(ey(e)),children:\`Open table\`})})]})]}),document.body)}function ay({fk:e,tables:t,currentKey:n,onPick:r,onClose:i}){let a=t.find(t=>t.name===ey(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=ty(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(\`\`),ry(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,B.jsx)(Kp,{open:!0,onClose:i,flush:!0,width:\`w-[640px]\`,title:(0,B.jsxs)(\`span\`,{children:[\`Select a record to reference from\`,\` \`,(0,B.jsx)(\`code\`,{className:\`rounded bg-accent px-1.5 py-0.5 font-mono text-xs text-foreground\`,children:e.target})]}),footer:(0,B.jsxs)(B.Fragment,{children:[(0,B.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,B.jsxs)(\`span\`,{className:\`flex items-center gap-1\`,children:[(0,B.jsx)(H,{variant:\`outline\`,size:\`xs\`,disabled:c===0,onClick:()=>l(e=>e-1),children:\`Prev\`}),(0,B.jsx)(H,{variant:\`outline\`,size:\`xs\`,disabled:c+1>=b,onClick:()=>l(e=>e+1),children:\`Next\`})]}),(0,B.jsx)(Gp,{asChild:!0,children:(0,B.jsx)(H,{variant:\`outline\`,className:\`ml-auto\`,children:\`Cancel\`})})]}),children:(0,B.jsxs)(\`div\`,{className:\`flex h-full flex-col\`,children:[(0,B.jsxs)(\`div\`,{className:\`relative border-b border-border\`,children:[(0,B.jsx)(_t,{size:13,className:\`pointer-events-none absolute left-4 top-1/2 -translate-y-1/2 text-muted-foreground/60\`}),(0,B.jsx)(\`input\`,{autoFocus:!0,value:o,onChange:e=>{s(e.target.value),l(0)},placeholder:\`Search \${ey(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,B.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,B.jsx)(ht,{size:13})})]}),(0,B.jsxs)(\`div\`,{className:\`min-h-0 flex-1 overflow-auto\`,children:[m&&(0,B.jsx)(\`p\`,{className:\`px-4 py-3 text-xs text-destructive\`,children:m}),!m&&u===null&&(0,B.jsx)(qp,{}),!m&&u!==null&&u.length===0&&(0,B.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,B.jsxs)(\`table\`,{className:\`w-full border-collapse text-[13px]\`,children:[(0,B.jsx)(\`thead\`,{className:\`sticky top-0 z-10 bg-card\`,children:(0,B.jsx)(\`tr\`,{children:v.map((t,n)=>(0,B.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,B.jsxs)(\`span\`,{className:\`flex items-center gap-1.5\`,children:[n<e.targetColumns.length&&(0,B.jsx)(Ge,{size:10,className:\`text-brand\`}),(0,B.jsx)(\`span\`,{className:\`font-mono font-medium text-foreground\`,children:t})]})},t))})}),(0,B.jsx)(\`tbody\`,{children:u.map((t,a)=>(0,B.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,B.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,B.jsx)(Jv,{value:t[e]})},e))},a))})]})]})]})})}function oy({fk:e,value:t,disabled:n,placeholder:r,onOpen:i}){return(0,B.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,B.jsx)(\`span\`,{className:\`truncate\`,children:t}):(0,B.jsx)(\`span\`,{className:\`text-muted-foreground/60\`,children:n?\`NULL\`:r}),(0,B.jsxs)(\`span\`,{className:\`ml-auto flex shrink-0 items-center gap-1 font-sans text-[11px] text-muted-foreground/80\`,children:[e.target,\` \`,(0,B.jsx)(ue,{size:11})]})]})}var sy=1;function cy({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:sy++}]),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,B.jsxs)(\`div\`,{className:\`relative min-w-0 flex-1\`,children:[(0,B.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,B.jsx)(_t,{size:13,className:\`shrink-0 text-muted-foreground/60\`}),t.map(e=>{let r=Rv.find(t=>t.op===e.op);return(0,B.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,B.jsxs)(\`span\`,{className:\`truncate text-foreground/80\`,children:[\`search \`,(0,B.jsxs)(\`span\`,{className:\`text-brand\`,children:[\`“\`,e.value,\`”\`]})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(\`span\`,{className:\`font-mono text-foreground\`,children:e.column}),(0,B.jsx)(\`span\`,{className:\`text-muted-foreground/80\`,children:r?.sym??e.op}),!r?.noValue&&(0,B.jsx)(\`span\`,{className:\`truncate text-brand\`,children:e.value})]}),(0,B.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,B.jsx)(Ft,{size:11})})]},e.id)}),s?.column&&(0,B.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,B.jsx)(\`span\`,{className:\`font-mono text-foreground\`,children:s.column}),s.op&&(0,B.jsx)(\`span\`,{className:\`text-brand\`,children:s.op.sym})]}),(0,B.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,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(\`div\`,{className:\`fixed inset-0 z-40\`,onClick:()=>i(!1)}),(0,B.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?zv.map(e=>{let t=Rv.filter(t=>t.group===e&&t.label.toLowerCase().includes(a.toLowerCase()));return t.length===0?null:(0,B.jsxs)(\`div\`,{children:[(0,B.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,B.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,B.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,B.jsxs)(B.Fragment,{children:[p&&(0,B.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,B.jsx)(_t,{size:13,className:\`text-muted-foreground/80\`}),\`Search all text columns for \`,(0,B.jsxs)(\`span\`,{className:\`text-brand\`,children:[\`“\`,a.trim(),\`”\`]})]}),f.map((e,t)=>{let n=t+ +!!p;return(0,B.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,B.jsx)(\`span\`,{className:\`font-mono text-foreground\`,children:e.name}),(0,B.jsx)(\`span\`,{className:\`ml-auto text-[11px] text-muted-foreground/60\`,children:e.type})]},e.name)}),f.length===0&&!p&&(0,B.jsx)(\`p\`,{className:\`px-3 py-2 text-xs text-muted-foreground/80\`,children:\`No matching column.\`})]})})]})]})}function ly({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 \${Gh(t,e)} rename column "\${n}" to "\${o.replace(/"/g,\`""\`)}"\`);if(c(!1),!s.ok){U.error(s.error??\`Rename failed\`);return}U.success(\`Renamed \${n} → \${o}\`),await i()}return(0,B.jsx)(ho,{open:!0,onClose:r,title:\`Rename column "\${n}"\`,children:(0,B.jsxs)(\`div\`,{className:\`space-y-3\`,children:[(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(X,{children:\`New name\`}),(0,B.jsx)(Y,{mono:!0,value:a,autoFocus:!0,onChange:e=>o(e.target.value),onKeyDown:e=>e.key===\`Enter\`&&void l()})]}),(0,B.jsxs)(\`div\`,{className:\`flex justify-end gap-2\`,children:[(0,B.jsx)(H,{variant:\`outline\`,onClick:r,children:\`Cancel\`}),(0,B.jsx)(H,{onClick:()=>void l(),disabled:s||!a.trim(),children:s?\`Renaming…\`:\`Rename\`})]})]})})}var uy=e=>\`"\`+e.replace(/"/g,\`""\`)+\`"\`;async function dy(e){let t=await N.sql(e);return t.ok?null:t.error??\`Statement failed\`}var fy=\`create table new_table (
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 (
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 py({schema:e=\`public\`,onClose:t,onDone:n}){let[r,i]=(0,_.useState)(e===\`public\`?fy:fy.replace(\`create table \`,\`create table \${uy(e)}.\`)),[a,o]=(0,_.useState)(\`\`),[s,c]=(0,_.useState)(!1);async function l(){c(!0),o(\`\`);let e=await dy(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();U.success(\`Created table\${a?\` \${a}\`:\`\`}\`),await n(a??void 0),t()}return(0,B.jsx)(ho,{open:!0,onClose:t,title:\`New table\`,wide:!0,children:(0,B.jsxs)(\`div\`,{className:\`space-y-3\`,children:[(0,B.jsx)(\`p\`,{className:\`text-xs text-muted-foreground/80\`,children:\`Define the table in SQL — full Postgres DDL is supported (constraints, references, checks…).\`}),(0,B.jsx)(nr,{lang:\`sql\`,className:\`h-56\`,value:r,onChange:i,onCmdEnter:()=>void l()}),a&&(0,B.jsx)(\`p\`,{className:\`rounded border border-destructive/30 bg-destructive/10 px-3 py-2 text-xs text-destructive\`,children:a}),(0,B.jsxs)(\`div\`,{className:\`flex justify-end gap-2\`,children:[(0,B.jsx)(H,{variant:\`outline\`,onClick:t,children:\`Cancel\`}),(0,B.jsx)(H,{onClick:()=>void l(),disabled:s||!r.trim(),children:s?\`Creating…\`:\`Create table\`})]})]})})}var my=[\`text\`,\`int8\`,\`int4\`,\`numeric\`,\`float8\`,\`bool\`,\`uuid\`,\`timestamptz\`,\`date\`,\`jsonb\`];function hy({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 \${Gh(t,e)} add column \${uy(i.trim())} \${o}\`;c||(a+=\` not null\`),u.trim()&&(a+=\` default \${u.trim()}\`);let s=await dy(a);if(s){h(s),p(!1);return}U.success(\`Added column \${i.trim()}\`),await r(),n()}return(0,B.jsx)(ho,{open:!0,onClose:n,title:\`Add column to "\${e}"\`,children:(0,B.jsxs)(\`div\`,{className:\`space-y-3\`,children:[(0,B.jsxs)(\`div\`,{className:\`grid grid-cols-2 gap-3\`,children:[(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(X,{children:\`Name\`}),(0,B.jsx)(Y,{mono:!0,value:i,autoFocus:!0,placeholder:\`status\`,onChange:e=>a(e.target.value)})]}),(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(X,{children:\`Type\`}),(0,B.jsx)(Up,{mono:!0,value:o,onValueChange:s,options:my.map(e=>({value:e}))})]})]}),(0,B.jsxs)(\`label\`,{className:\`flex cursor-pointer items-center gap-2 text-[13px] text-foreground/80\`,children:[(0,B.jsx)(Zt,{checked:c,onChange:l}),\`Nullable\`]}),(0,B.jsxs)(\`div\`,{children:[(0,B.jsxs)(X,{children:[\`Default \`,(0,B.jsx)(\`span\`,{className:\`font-normal text-muted-foreground/60\`,children:\`— raw SQL expression, e.g. now() or 'draft'\`})]}),(0,B.jsx)(Y,{mono:!0,value:u,placeholder:\`(none)\`,onChange:e=>d(e.target.value),onKeyDown:e=>e.key===\`Enter\`&&void g()})]}),m&&(0,B.jsx)(\`p\`,{className:\`rounded border border-destructive/30 bg-destructive/10 px-3 py-2 text-xs text-destructive\`,children:m}),(0,B.jsxs)(\`div\`,{className:\`flex justify-end gap-2\`,children:[(0,B.jsx)(H,{variant:\`outline\`,onClick:n,children:\`Cancel\`}),(0,B.jsx)(H,{onClick:()=>void g(),disabled:f||!i.trim(),children:f?\`Adding…\`:\`Add column\`})]})]})})}function gy({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 dy(\`alter table \${Gh(t,e)} rename to \${uy(a)}\`);if(s(!1),o){U.error(o);return}U.success(\`Renamed \${e} → \${a}\`),await r(a),n()}return(0,B.jsx)(ho,{open:!0,onClose:n,title:\`Rename table "\${e}"\`,children:(0,B.jsxs)(\`div\`,{className:\`space-y-3\`,children:[(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(X,{children:\`New name\`}),(0,B.jsx)(Y,{mono:!0,value:i,autoFocus:!0,onChange:e=>a(e.target.value),onKeyDown:e=>e.key===\`Enter\`&&void c()})]}),(0,B.jsxs)(\`div\`,{className:\`flex justify-end gap-2\`,children:[(0,B.jsx)(H,{variant:\`outline\`,onClick:n,children:\`Cancel\`}),(0,B.jsx)(H,{onClick:()=>void c(),disabled:o||!i.trim(),children:o?\`Renaming…\`:\`Rename\`})]})]})})}function _y({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 dy(\`create table \${Gh(t,a)} (like \${Gh(t,e)} including all)\`);if(s){d(s),l(!1);return}if(o){let n=await dy(\`insert into \${Gh(t,a)} select * from \${Gh(t,e)}\`);if(n){d(\`Table created, but copying rows failed: \${n}\`),l(!1),await r(a);return}}U.success(\`Duplicated \${e} → \${a}\`),await r(a),n()}return(0,B.jsx)(ho,{open:!0,onClose:n,title:\`Duplicate table "\${e}"\`,children:(0,B.jsxs)(\`div\`,{className:\`space-y-3\`,children:[(0,B.jsxs)(\`div\`,{children:[(0,B.jsx)(X,{children:\`New table name\`}),(0,B.jsx)(Y,{mono:!0,value:i,autoFocus:!0,onChange:e=>a(e.target.value),onKeyDown:e=>e.key===\`Enter\`&&void f()})]}),(0,B.jsxs)(\`label\`,{className:\`flex cursor-pointer items-center gap-2 text-[13px] text-foreground/80\`,children:[(0,B.jsx)(Zt,{checked:o,onChange:s}),\`Copy the rows too\`]}),(0,B.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,B.jsx)(\`p\`,{className:\`rounded border border-destructive/30 bg-destructive/10 px-3 py-2 text-xs text-destructive\`,children:u}),(0,B.jsxs)(\`div\`,{className:\`flex justify-end gap-2\`,children:[(0,B.jsx)(H,{variant:\`outline\`,onClick:n,children:\`Cancel\`}),(0,B.jsx)(H,{onClick:()=>void f(),disabled:c||!i.trim(),children:c?\`Duplicating…\`:\`Duplicate\`})]})]})})}function vy({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 dy(\`drop table \${Gh(t,e)}\${i?\` cascade\`:\`\`}\`);if(a){l(a),s(!1);return}U.success(\`Dropped table \${e}\`),await r(),n()}return(0,B.jsx)(ho,{open:!0,onClose:n,title:\`Delete table "\${e}"?\`,children:(0,B.jsxs)(\`div\`,{className:\`space-y-3\`,children:[(0,B.jsxs)(\`div\`,{className:\`flex items-start gap-3\`,children:[(0,B.jsx)(\`div\`,{className:\`flex size-8 shrink-0 items-center justify-center rounded-full bg-destructive/15\`,children:(0,B.jsx)(kt,{size:15,className:\`text-destructive\`})}),(0,B.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,B.jsxs)(\`label\`,{className:\`flex cursor-pointer items-center gap-2 text-[13px] text-foreground/80\`,children:[(0,B.jsx)(Zt,{checked:i,onChange:a}),\`Also drop dependent objects (CASCADE)\`]}),c&&(0,B.jsx)(\`p\`,{className:\`rounded border border-destructive/30 bg-destructive/10 px-3 py-2 text-xs text-destructive\`,children:c}),(0,B.jsxs)(\`div\`,{className:\`flex justify-end gap-2\`,children:[(0,B.jsx)(H,{variant:\`outline\`,onClick:n,children:\`Cancel\`}),(0,B.jsx)(H,{variant:\`dangerSolid\`,onClick:()=>void u(),disabled:o,children:o?\`Deleting…\`:\`Delete table\`})]})]})})}function yy({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
1588
+ );\`;function gy({schema:e=\`public\`,onClose:t,onDone:n}){let[r,i]=(0,_.useState)(e===\`public\`?hy:hy.replace(\`create table \`,\`create table \${py(e)}.\`)),[a,o]=(0,_.useState)(\`\`),[s,c]=(0,_.useState)(!1);async function l(){c(!0),o(\`\`);let e=await my(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 _y=[\`text\`,\`int8\`,\`int4\`,\`numeric\`,\`float8\`,\`bool\`,\`uuid\`,\`timestamptz\`,\`date\`,\`jsonb\`];function vy({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 \${Jh(t,e)} add column \${py(i.trim())} \${o}\`;c||(a+=\` not null\`),u.trim()&&(a+=\` default \${u.trim()}\`);let s=await my(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)(lf,{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:_y.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)(lf,{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 yy({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 my(\`alter table \${Jh(t,e)} rename to \${py(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)(lf,{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 by({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 my(\`create table \${Jh(t,a)} (like \${Jh(t,e)} including all)\`);if(s){d(s),l(!1);return}if(o){let n=await my(\`insert into \${Jh(t,a)} select * from \${Jh(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)(lf,{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 xy({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 my(\`drop table \${Jh(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 Sy({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]=Kv(n,t.type)}try{await o(e)}catch(e){x(e.message),C(!1)}}return(0,B.jsxs)(Kp,{open:!0,onClose:a,title:(0,B.jsxs)(\`span\`,{children:[i?\`View row from \`:r?\`Insert row into \`:\`Update row from \`,(0,B.jsx)(\`code\`,{className:\`rounded bg-accent px-1.5 py-0.5 font-mono text-xs text-foreground\`,children:e.name})]}),footer:i?(0,B.jsx)(Gp,{asChild:!0,children:(0,B.jsx)(H,{variant:\`outline\`,className:\`ml-auto\`,children:\`Close\`})}):(0,B.jsxs)(B.Fragment,{children:[!r&&s&&(0,B.jsxs)(H,{variant:\`danger\`,onClick:()=>y(!0),children:[(0,B.jsx)(Ot,{size:13}),\` Delete row\`]}),(0,B.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-2\`,children:[(0,B.jsxs)(\`span\`,{className:\`mr-1 hidden items-center gap-1 text-[11px] text-muted-foreground/60 sm:flex\`,children:[(0,B.jsx)(lf,{children:\`Ctrl\`}),\`+\`,(0,B.jsx)(lf,{children:\`↵\`}),\` to save\`]}),(0,B.jsx)(Gp,{asChild:!0,children:(0,B.jsx)(H,{variant:\`outline\`,children:\`Cancel\`})}),(0,B.jsx)(H,{onClick:()=>void O(),disabled:S,children:S?\`Saving…\`:r?\`Insert row\`:\`Save changes\`})]})]}),children:[(0,B.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,B.jsxs)(\`p\`,{className:\`rounded-md border border-border bg-card px-3 py-2 text-[11px] text-muted-foreground/80\`,children:[\`Primary key\`,\` \`,(0,B.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,B.jsxs)(\`div\`,{children:[(0,B.jsxs)(\`div\`,{className:\`mb-1 flex items-center gap-1.5\`,children:[(0,B.jsx)(X,{children:(0,B.jsx)(\`span\`,{className:\`font-mono text-foreground/80\`,children:t.name})}),(0,B.jsx)(\`span\`,{className:\`mb-1 text-[11px] text-muted-foreground/60\`,children:t.type}),t.isPrimaryKey&&(0,B.jsxs)(V,{variant:\`amber\`,className:\`mb-1\`,children:[c&&(0,B.jsx)(Xe,{size:9}),\` PK\`]}),o&&!c&&(0,B.jsx)(V,{variant:\`red\`,className:\`mb-1\`,children:\`required\`}),!c&&(0,B.jsxs)(\`span\`,{className:\`mb-1 ml-auto flex items-center gap-1\`,children:[s&&!a&&(0,B.jsx)(by,{label:\`now\`,onClick:()=>E(t.name,Wv(t.type))}),t.type===\`uuid\`&&!n&&!a&&(0,B.jsx)(by,{label:\`generate\`,onClick:()=>E(t.name,crypto.randomUUID())}),t.nullable&&t.type!==\`bool\`&&(0,B.jsx)(by,{label:\`NULL\`,active:a,onClick:()=>D(t.name)})]})]}),c?(0,B.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,B.jsx)(Xe,{size:11,className:\`shrink-0 text-muted-foreground/60\`}),(0,B.jsx)(\`span\`,{className:\`truncate\`,children:l[t.name]||\`NULL\`})]}):n?(0,B.jsx)(oy,{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,B.jsx)(xy,{col:t,enums:w,value:a?\`\`:l[t.name]??\`\`,disabled:a,onChange:e=>E(t.name,e)})]},t.name)}),b&&(0,B.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,B.jsx)(go,{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,B.jsx)(ay,{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 by({label:e,active:t,onClick:n}){return(0,B.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 xy({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,B.jsx)(Up,{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,B.jsx)(Up,{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,B.jsx)($p,{rows:4,value:n,disabled:r,placeholder:a||\`{ }\`,onChange:e=>i(e.target.value)}):e.type===\`text\`?(0,B.jsx)($p,{rows:n.length>80||n.includes(\`
1591
- \`)?4:2,value:n,disabled:r,placeholder:a,onChange:e=>i(e.target.value)}):(0,B.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 Sy({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,
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]=Yv(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)(Cy,{label:\`now\`,onClick:()=>E(t.name,qv(t.type))}),t.type===\`uuid\`&&!n&&!a&&(0,z.jsx)(Cy,{label:\`generate\`,onClick:()=>E(t.name,crypto.randomUUID())}),t.nullable&&t.type!==\`bool\`&&(0,z.jsx)(Cy,{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)(ly,{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)(wy,{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)(cy,{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 Cy({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 wy({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)(lf,{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 Ty({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 Xn(await Qv(t,e),\`\${e} schema\`)}catch(e){U.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\`)p_(\`\${e}.json\`,\`application/json\`,JSON.stringify(r,null,2));else{let t=r[0]?Object.keys(r[0]):[];p_(\`\${e}.csv\`,\`text/csv\`,f_(t,r))}i>r.length?U(\`Exported the first \${r.length.toLocaleString()} of \${i.toLocaleString()} rows\`):U.success(\`Exported \${r.length.toLocaleString()} rows\`)}catch(e){U.error(e.message)}}let g=e.filter(e=>e.name.toLowerCase().includes(c.toLowerCase()));return(0,B.jsxs)(mf,{id:\`table-editor-rail\`,side:\`left\`,defaultSize:240,min:200,max:420,className:\`flex flex-col border-r border-border bg-card\`,children:[(0,B.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,B.jsx)(\`span\`,{className:\`text-muted-foreground/60\`,children:e.length})]}),(0,B.jsxs)(\`div\`,{className:\`space-y-1.5 px-2 pb-2\`,children:[(0,B.jsx)(Jh,{className:\`w-full\`}),!n&&(0,B.jsxs)(H,{variant:\`outline\`,size:\`xs\`,className:\`w-full\`,onClick:()=>d({kind:\`new\`}),children:[(0,B.jsx)(pt,{size:12}),\` New table\`]}),(0,B.jsxs)(\`div\`,{className:\`relative\`,children:[(0,B.jsx)(_t,{size:13,className:\`pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground/60\`}),(0,B.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,B.jsxs)(\`div\`,{className:\`flex-1 overflow-auto pb-2\`,children:[g.map(e=>{let t=!n&&f[e.name]===!0;return(0,B.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,B.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,B.jsx)(\`span\`,{title:\`View (read-only)\`,children:(0,B.jsx)(ke,{size:12,className:\`shrink-0 text-muted-foreground/60\`})}):(0,B.jsx)(Et,{size:12,className:\`shrink-0 text-muted-foreground/50\`}),(0,B.jsx)(\`span\`,{className:\`truncate font-mono\`,children:e.name}),t&&(0,B.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,B.jsx)(\`span\`,{className:\`shrink-0 text-[11px] text-muted-foreground/60 group-hover:hidden\`,children:e.rowCount}),(0,B.jsxs)(Zd,{children:[(0,B.jsx)(Qd,{asChild:!0,children:(0,B.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,B.jsx)(Ee,{size:13})})}),(0,B.jsxs)(tf,{align:\`start\`,children:[(0,B.jsxs)(nf,{onSelect:()=>void Xn(e.name,\`"\${e.name}"\`),children:[(0,B.jsx)(xe,{size:13}),\` Copy name\`]}),!e.isView&&(0,B.jsxs)(nf,{onSelect:()=>void m(e.name),children:[(0,B.jsx)(je,{size:13}),\` Copy table schema\`]}),(0,B.jsx)(of,{}),!e.isView&&!n&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(nf,{onSelect:()=>d({kind:\`rename\`,table:e.name}),children:[(0,B.jsx)(ct,{size:13}),\` Rename table\`]}),(0,B.jsxs)(nf,{onSelect:()=>d({kind:\`duplicate\`,table:e.name}),children:[(0,B.jsx)(Ne,{size:13}),\` Duplicate table\`]}),(0,B.jsxs)(nf,{onSelect:()=>o(e.name),children:[(0,B.jsx)(xt,{size:13}),\` View policies\`]})]}),(0,B.jsxs)($d,{children:[(0,B.jsxs)(rf,{children:[(0,B.jsx)(Te,{size:13}),\` Export data\`]}),(0,B.jsxs)(af,{children:[(0,B.jsx)(nf,{onSelect:()=>void h(e.name,\`csv\`),children:\`Export as CSV\`}),(0,B.jsx)(nf,{onSelect:()=>void h(e.name,\`json\`),children:\`Export as JSON\`})]})]}),!e.isView&&!n&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(of,{}),(0,B.jsxs)(nf,{danger:!0,onSelect:()=>d({kind:\`delete\`,table:e.name}),children:[(0,B.jsx)(Ot,{size:13}),\` Delete table\`]})]})]})]})]},e.name)}),g.length===0&&(0,B.jsx)(cf,{children:e.length===0?\`No tables yet — create one.\`:\`No match.\`})]}),u?.kind===\`new\`&&(0,B.jsx)(py,{schema:t,onClose:()=>d(null),onDone:async e=>{await a(),e&&i(e)}}),u?.kind===\`rename\`&&(0,B.jsx)(gy,{table:u.table,schema:t,onClose:()=>d(null),onDone:async e=>{await a(),i(e)}}),u?.kind===\`duplicate\`&&(0,B.jsx)(_y,{table:u.table,schema:t,onClose:()=>d(null),onDone:async e=>{await a(),i(e)}}),u?.kind===\`delete\`&&(0,B.jsx)(vy,{table:u.table,schema:t,onClose:()=>d(null),onDone:a})]})}function Cy(){let[e]=Uh(),[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,P]=(0,_.useState)(null),[ee,F]=(0,_.useState)(!1),[I,te]=(0,_.useState)(null),[ne,re]=(0,_.useState)(!1),[ie,ae]=(0,_.useState)(null),[L,oe]=(0,_.useState)(!1),[ue,fe]=(0,_.useState)(null),[ge,_e]=(0,_.useState)(null),[ve,ye]=(0,_.useState)(null),[be,Se]=(0,_.useState)(!1),[Ce,we]=(0,_.useState)(\`data\`),[De,Ae]=(0,_.useState)({kind:\`postgres\`}),[je,Me]=(0,_.useState)(null),[Ne,Pe]=(0,_.useState)(0),Fe=(0,_.useCallback)(()=>Pe(e=>e+1),[]),R=t.find(e=>e.name===r)||null,Le=qh(e),Re=!!R&&R.primaryKey.length>0&&!R.isView&&!Le,[ze,Be]=(0,_.useState)({});(0,_.useEffect)(()=>{N.sql(\`select t.typname as name, e.enumlabel as label
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 ty(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\`)g_(\`\${e}.json\`,\`application/json\`,JSON.stringify(r,null,2));else{let t=r[0]?Object.keys(r[0]):[];g_(\`\${e}.csv\`,\`text/csv\`,h_(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)(Zh,{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)(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 data-[state=open]:bg-muted data-[state=open]:text-foreground\`,title:\`Table actions\`,children:(0,z.jsx)(De,{size:13})})}),(0,z.jsxs)(tf,{align:\`start\`,children:[(0,z.jsxs)(nf,{onSelect:()=>void Qn(e.name,\`"\${e.name}"\`),children:[(0,z.jsx)(Se,{size:13}),\` Copy name\`]}),!e.isView&&(0,z.jsxs)(nf,{onSelect:()=>void m(e.name),children:[(0,z.jsx)(Me,{size:13}),\` Copy table schema\`]}),(0,z.jsx)(of,{}),!e.isView&&!n&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(nf,{onSelect:()=>d({kind:\`rename\`,table:e.name}),children:[(0,z.jsx)(lt,{size:13}),\` Rename table\`]}),(0,z.jsxs)(nf,{onSelect:()=>d({kind:\`duplicate\`,table:e.name}),children:[(0,z.jsx)(Pe,{size:13}),\` Duplicate table\`]}),(0,z.jsxs)(nf,{onSelect:()=>o(e.name),children:[(0,z.jsx)(St,{size:13}),\` View policies\`]})]}),(0,z.jsxs)($d,{children:[(0,z.jsxs)(rf,{children:[(0,z.jsx)(Ee,{size:13}),\` Export data\`]}),(0,z.jsxs)(af,{children:[(0,z.jsx)(nf,{onSelect:()=>void h(e.name,\`csv\`),children:\`Export as CSV\`}),(0,z.jsx)(nf,{onSelect:()=>void h(e.name,\`json\`),children:\`Export as JSON\`})]})]}),!e.isView&&!n&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(of,{}),(0,z.jsxs)(nf,{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)(cf,{children:e.length===0?\`No tables yet — create one.\`:\`No match.\`})]}),u?.kind===\`new\`&&(0,z.jsx)(gy,{schema:t,onClose:()=>d(null),onDone:async e=>{await a(),e&&i(e)}}),u?.kind===\`rename\`&&(0,z.jsx)(yy,{table:u.table,schema:t,onClose:()=>d(null),onDone:async e=>{await a(),i(e)}}),u?.kind===\`duplicate\`&&(0,z.jsx)(by,{table:u.table,schema:t,onClose:()=>d(null),onDone:async e=>{await a(),i(e)}}),u?.kind===\`delete\`&&(0,z.jsx)(xy,{table:u.table,schema:t,onClose:()=>d(null),onDone:a})]})}function Ey(){let[e]=Kh(),[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=Xh(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);Be(t)}).catch(()=>{})},[e]);let Ve=(0,_.useMemo)(()=>R?R.columns.filter(e=>!S.has(e.name)):[],[R,S]),He=(0,_.useMemo)(()=>Ve.filter(e=>w.has(e.name)),[Ve,w]),Ue=(0,_.useCallback)(e=>D[e.name]??Uv(e),[D]),We=(0,_.useCallback)(e=>R?.foreignKeys.find(t=>t.columns.includes(e)),[R]),Ke=(0,_.useCallback)(e=>{if(!w.has(e))return null;let t=56;for(let n of He){if(n.name===e)return t;t+=Ue(n)}return t},[w,He,Ue]),qe=qt(),Ze=qe.tab===\`table\`?qe.section:null,Qe=(0,_.useRef)(Ze);Qe.current=Ze;let $e=(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=Qe.current;return n&&t.some(e=>e.name===n)?n:t[0]?.name??null})}catch(e){U.error(e.message)}},[e]);(0,_.useEffect)(()=>{i(null),n([]),o(!0),$e().finally(()=>o(!1))},[$e]),(0,_.useEffect)(()=>{Ze&&Ze!==r&&t.some(e=>e.name===Ze)&&i(Ze)},[Ze,t]),(0,_.useEffect)(()=>{!r||qe.tab!==\`table\`||qe.section===r||Ze&&t.some(e=>e.name===Ze)||z(\`table\`,r,{replace:!0})},[r,t]);let tt=(0,_.useRef)(0),nt=(0,_.useCallback)(async()=>{if(!r||!R)return;let t=++tt.current;f(!0);try{let n=v.length>0?v.map(e=>\`\${e.column}.\${e.dir}\`).join(\`,\`):R.primaryKey[0]?\`\${R.primaryKey[0]}.asc\`:void 0,{rows:i,total:a}=await N.rows(r,{limit:h,offset:p*h,order:n,schema:e,filters:Hv(R.columns,b)});if(t!==tt.current)return;c(i),u(a)}catch(e){t===tt.current&&U.error(e.message)}finally{t===tt.current&&f(!1)}},[r,R,p,h,v,b,De,Ne,e]);(0,_.useEffect)(()=>()=>T(null),[]),(0,_.useEffect)(()=>{nt()},[nt]),(0,_.useEffect)(()=>{c([]),u(0),m(0),y([]),x([]),A(new Set),C(new Set),E(new Set),O({}),fe(null),_e(null),ye(null),P(null),j.current=null},[r,e]),(0,_.useEffect)(()=>{m(0),A(new Set)},[b,h]),(0,_.useEffect)(()=>{if(!R)return;let e=new Set(R.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)},[R]);let rt=(0,_.useCallback)(e=>JSON.stringify(R.primaryKey.map(t=>e[t])),[R]),it=(0,_.useCallback)(e=>{let t={};for(let n of R.primaryKey)t[n]=e[n];return t},[R]);function at(e,t,n){A(r=>{let i=new Set(r),a=e=>{let n=rt(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 ot=(0,_.useMemo)(()=>Re?s.map(e=>rt(e)):[],[s,rt,Re]),st=ot.length>0&&ot.every(e=>k.has(e)),dt=ot.some(e=>k.has(e)),ft=(0,_.useMemo)(()=>Re?s.filter(e=>k.has(rt(e))):[],[s,k,rt,Re]),mt=(0,_.useCallback)(async()=>{if(!(!R||k.size===0))try{let t=[...k].map(e=>JSON.parse(e));if(R.primaryKey.length===1)await N.deleteRows(R.name,R.primaryKey[0],t.map(e=>e[0]),e);else for(let n of t){let t={};R.primaryKey.forEach((e,r)=>t[e]=n[r]),await N.deleteRow(R.name,t,e)}U.success(\`Deleted \${k.size} row(s)\`),A(new Set),await nt(),await $e()}catch(e){U.error(e.message)}},[R,k,nt,$e]);function gt(e){let t=Ve.map(e=>e.name);e===\`json\`?p_(\`\${r}-page\${p+1}.json\`,\`application/json\`,JSON.stringify(s,null,2)):p_(\`\${r}-page\${p+1}.csv\`,\`text/csv\`,f_(t,s))}function _t(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 vt(e,t,n){if(!Re)return;if(t.isPrimaryKey)return U(\`Primary key columns are locked — use the SQL editor to change keys\`);let r=We(t.name);if(r)return ye({row:e,fk:r,col:t.name});let i=n.getBoundingClientRect();fe({key:rt(e),col:t.name,rect:{top:i.top,left:i.left,width:i.width,height:i.height}})}async function yt(t,n){try{let i=await N.updateRow(r,it(t),n,e),a=Array.isArray(i)?i[0]:null;c(e=>e.map(e=>e===t?a??{...e,...n}:e)),U.success(\`Row updated\`)}catch(e){U.error(e.message)}}async function bt(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:Kv(i,n.type);try{let i=await N.updateRow(r,it(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)),U.success(\`Row updated\`)}catch(e){U.error(e.message),fe(null);return}}if(a!==0&&ue){let e=Ve.findIndex(e=>e.name===n.name),t=a,r=Ve[e+t],i=ue.rect.left,o=n;for(;r&&(r.isPrimaryKey||We(r.name));)i+=a===1?Ue(o):-Ue(r),o=r,t+=a,r=Ve[e+t];if(r)return i+=a===1?Ue(o):-Ue(r),fe({key:rt(l),col:r.name,rect:{...ue.rect,left:i,width:Ue(r)}})}fe(null)}async function xt(t){if(!r)return;let n=await N.sql(\`alter table \${Gh(e,r)} drop column "\${t}"\`);if(!n.ok)return U.error(n.error??\`Failed to drop column\`);U.success(\`Dropped column \${t}\`),await $e()}let[St,Ct]=(0,_.useState)(null);(0,_.useEffect)(()=>Ct(null),[r,p,s.length,Ve.length]),(0,_.useEffect)(()=>{let e=e=>{let t=e.target;if(!(M||ee||I||ue||t.closest(\`input, textarea, select, [role="dialog"]\`))){if(St&&Re){let t=(t,n)=>{e.preventDefault();let r=Math.max(0,Math.min(s.length-1,St.r+t)),i=Math.max(0,Math.min(Ve.length-1,St.c+n));Ct({r,c:i}),document.querySelector(\`[data-cell="\${r}:\${Ve[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[St.r],r=Ve[St.c];if(n&&r&&e.key===\`Enter\`){e.preventDefault();let t=document.querySelector(\`[data-cell="\${St.r}:\${r.name}"]\`);t&&vt(n,r,t);return}if(n&&r&&(e.key===\`Delete\`||e.key===\`Backspace\`)&&!r.isPrimaryKey&&!We(r.name)&&r.nullable&&n[r.name]!==null){e.preventDefault(),bt(n,r,\`\`,0);return}if(e.key===\`Escape\`){Ct(null);return}}e.key===\`Escape\`&&A(new Set),e.key===\`Delete\`&&k.size>0&&re(!0)}};return window.addEventListener(\`keydown\`,e),()=>window.removeEventListener(\`keydown\`,e)},[k,M,ee,I,ue,St,s,Ve,Re]);let wt=(0,_.useRef)(null);if((0,_.useEffect)(()=>{let e=e=>{let t=wt.current;t&&O(n=>({...n,[t.col]:Math.max(72,t.startW+(e.clientX-t.startX))}))},t=()=>wt.current=null;return window.addEventListener(\`mousemove\`,e),window.addEventListener(\`mouseup\`,t),()=>{window.removeEventListener(\`mousemove\`,e),window.removeEventListener(\`mouseup\`,t)}},[]),a)return(0,B.jsx)(qp,{});let Tt=Math.max(1,Math.ceil(l/h)),Et=56+Ve.reduce((e,t)=>e+Ue(t),0)+40;return(0,B.jsxs)(\`div\`,{className:\`flex h-full\`,children:[(0,B.jsx)(Sy,{tables:t,schema:e,managed:Le,active:r,onSelect:i,onTablesChanged:$e,onOpenPolicies:Me,refreshKey:Ne}),(0,B.jsx)(\`div\`,{className:\`flex min-w-0 flex-1 flex-col\`,children:R?(0,B.jsxs)(B.Fragment,{children:[Ce===\`definition\`?(0,B.jsx)($v,{table:R.name,schema:e,refreshKey:R}):(0,B.jsxs)(B.Fragment,{children:[k.size>0?(0,B.jsxs)(\`div\`,{className:\`flex h-11.5 shrink-0 items-center gap-3 border-b border-border bg-brand/10 px-3\`,children:[(0,B.jsx)(Zt,{checked:st,indeterminate:!st&&dt,onChange:e=>A(e?new Set(ot):new Set)}),(0,B.jsxs)(\`span\`,{className:\`text-[13px] text-foreground\`,children:[(0,B.jsx)(\`span\`,{className:\`font-semibold text-brand\`,children:k.size}),\` row\`,k.size===1?\`\`:\`s\`,\` selected\`]}),(0,B.jsx)(\`div\`,{className:\`mx-1 h-4 w-px bg-muted\`}),(0,B.jsx)(Qn,{variant:\`outline\`,size:\`xs\`,label:\`rows as JSON\`,value:()=>JSON.stringify(ft,null,2),children:\`Copy JSON\`}),(0,B.jsx)(Qn,{variant:\`outline\`,size:\`xs\`,label:\`rows as CSV\`,value:()=>f_(Ve.map(e=>e.name),ft),children:\`Copy CSV\`}),(0,B.jsxs)(H,{variant:\`dangerSolid\`,size:\`xs\`,onClick:()=>re(!0),children:[(0,B.jsx)(Ot,{size:12}),\` Delete \`,k.size]}),(0,B.jsxs)(\`span\`,{className:\`ml-1 hidden items-center gap-1 text-[11px] text-muted-foreground/80 lg:flex\`,children:[(0,B.jsx)(lf,{children:\`Del\`}),\` delete · \`,(0,B.jsx)(lf,{children:\`Esc\`}),\` clear\`]}),(0,B.jsx)(\`button\`,{className:\`ml-auto p-1 text-muted-foreground/80 hover:text-foreground\`,onClick:()=>A(new Set),children:(0,B.jsx)(Ft,{size:15})})]}):(0,B.jsxs)(\`div\`,{className:\`flex h-11.5 shrink-0 items-center gap-2 border-b border-border px-3\`,children:[(0,B.jsx)(cy,{columns:R.columns,filters:b,onChange:x}),(0,B.jsxs)(\`div\`,{className:\`ml-auto flex items-center gap-1.5\`,children:[!Le&&(R.isView?(0,B.jsx)(Mg,{view:R.name,schema:e,refreshKey:Ne,onChanged:Fe},R.name):(0,B.jsx)(jg,{table:R.name,schema:e,refreshKey:Ne,onChanged:Fe},R.name)),(0,B.jsx)(nv,{value:De,onChange:(e,t)=>{T(t),Ae(e),A(new Set)}}),(0,B.jsxs)(ff,{open:be,onOpenChange:Se,align:\`end\`,className:\`w-60 p-1.5\`,trigger:(0,B.jsx)(H,{variant:\`outline\`,size:\`iconXs\`,title:\`View options\`,onClick:()=>Se(e=>!e),children:(0,B.jsx)(Ee,{size:13})}),children:[(0,B.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,B.jsx)(\`div\`,{className:\`max-h-56 overflow-auto\`,children:R.columns.map(e=>(0,B.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,B.jsx)(Zt,{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,B.jsx)(\`span\`,{className:\`truncate font-mono\`,children:e.name}),(0,B.jsx)(\`span\`,{className:\`ml-auto text-[11px] text-muted-foreground/60\`,children:e.type})]},e.name))}),S.size>0&&(0,B.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,B.jsx)(\`div\`,{className:\`my-1 h-px bg-accent\`}),(0,B.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,B.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:()=>{gt(e),Se(!1)},children:[(0,B.jsx)(Te,{size:13,className:\`text-muted-foreground/80\`}),\` Export as \`,e.toUpperCase()]},e))]}),(0,B.jsx)(H,{variant:\`ghost\`,size:\`iconXs\`,title:\`Refresh\`,onClick:()=>void nt(),children:(0,B.jsx)(ht,{size:13,className:d?\`animate-spin\`:\`\`})}),!R.isView&&!Le&&(0,B.jsxs)(H,{size:\`xs\`,onClick:()=>F(!0),children:[(0,B.jsx)(pt,{size:13}),\` Insert\`]})]})]}),!Re&&(Le?(0,B.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,B.jsx)(Xe,{size:13,className:\`shrink-0\`}),(0,B.jsxs)(\`span\`,{children:[\`The \`,(0,B.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.\`]})]}):R?.isView?(0,B.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,B.jsx)(ke,{size:13,className:\`shrink-0\`}),(0,B.jsx)(\`span\`,{children:\`This is a view — computed from other tables, so it's read-only. Edit the underlying tables instead.\`})]}):(0,B.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,B.jsx)(kt,{size:13,className:\`shrink-0\`}),(0,B.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,B.jsxs)(\`div\`,{className:\`min-h-0 flex-1 overflow-auto transition-opacity \`+(d?\`opacity-60\`:\`\`),children:[(0,B.jsxs)(\`table\`,{className:\`border-collapse text-[13px]\`,style:{width:Math.max(Et,0),tableLayout:\`fixed\`},children:[(0,B.jsxs)(\`colgroup\`,{children:[(0,B.jsx)(\`col\`,{style:{width:56}}),Ve.map(e=>(0,B.jsx)(\`col\`,{style:{width:Ue(e)}},e.name)),(0,B.jsx)(\`col\`,{style:{width:40}})]}),(0,B.jsx)(\`thead\`,{children:(0,B.jsxs)(\`tr\`,{children:[(0,B.jsx)(\`th\`,{className:\`sticky left-0 top-0 z-30 border-b border-r border-border bg-card px-0\`,children:(0,B.jsx)(\`div\`,{className:\`flex h-8.5 items-center gap-1.5 pl-3\`,children:(0,B.jsx)(Zt,{checked:st,indeterminate:!st&&dt,disabled:!Re,title:Re?void 0:\`Table has no primary key\`,onChange:e=>A(e?new Set(ot):new Set)})})}),Ve.map(e=>{let t=v.findIndex(t=>t.column===e.name),n=t>=0?v[t]:null,r=Ke(e.name),i=We(e.name);return(0,B.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,B.jsxs)(\`div\`,{className:\`flex h-8.5 items-center gap-1.5 pl-3 pr-1\`,children:[e.isPrimaryKey&&(0,B.jsx)(Ge,{size:11,className:\`shrink-0 text-warning\`}),i&&(0,B.jsx)(\`span\`,{title:\`foreign key → \${i.target}.\${i.targetColumns.join(\`,\`)}\`,children:(0,B.jsx)(Je,{size:11,className:\`shrink-0 text-info\`})}),(0,B.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=>_t(e.name,t.shiftKey),children:e.name}),(0,B.jsx)(\`span\`,{className:\`shrink-0 text-[11px] text-muted-foreground/60\`,children:e.type}),n&&(0,B.jsxs)(\`span\`,{className:\`flex shrink-0 items-center text-brand\`,children:[n.dir===\`asc\`?(0,B.jsx)(de,{size:11}):(0,B.jsx)(ce,{size:11}),v.length>1&&(0,B.jsx)(\`span\`,{className:\`text-[10px]\`,children:t+1})]}),(0,B.jsxs)(Zd,{children:[(0,B.jsx)(Qd,{asChild:!0,children:(0,B.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,B.jsx)(pe,{size:13})})}),(0,B.jsxs)(tf,{children:[(0,B.jsxs)(nf,{onSelect:()=>y([{column:e.name,dir:\`asc\`}]),children:[(0,B.jsx)(de,{size:13}),\` Sort ascending\`]}),(0,B.jsxs)(nf,{onSelect:()=>y([{column:e.name,dir:\`desc\`}]),children:[(0,B.jsx)(ce,{size:13}),\` Sort descending\`]}),(0,B.jsxs)(nf,{onSelect:()=>y(t=>t.filter(t=>t.column!==e.name)),disabled:!n,children:[(0,B.jsx)(se,{size:13}),\` Clear sort\`]}),(0,B.jsx)(of,{}),(0,B.jsxs)(nf,{onSelect:()=>void Xn(e.name,\`"\${e.name}"\`),children:[(0,B.jsx)(xe,{size:13}),\` Copy name\`]}),(0,B.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,B.jsx)(ut,{size:13}):(0,B.jsx)(lt,{size:13}),w.has(e.name)?\`Unfreeze column\`:\`Freeze column\`]}),(0,B.jsxs)(nf,{onSelect:()=>C(t=>new Set(t).add(e.name)),children:[(0,B.jsx)(Oe,{size:13}),\` Hide column\`]}),(0,B.jsx)(of,{}),(0,B.jsxs)(nf,{onSelect:()=>te(e.name),children:[(0,B.jsx)(ct,{size:13}),\` Rename column\`]}),(0,B.jsxs)(nf,{danger:!0,onSelect:()=>ae(e.name),children:[(0,B.jsx)(Ot,{size:13}),\` Delete column\`]})]})]})]}),(0,B.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(),wt.current={col:e.name,startX:t.clientX,startW:Ue(e)}}})]},e.name)}),(0,B.jsx)(\`th\`,{className:\`sticky top-0 z-20 border-b border-border bg-card p-0\`,children:(0,B.jsx)(\`button\`,{title:\`Add column\`,onClick:()=>oe(!0),className:\`flex h-8.5 w-10 items-center justify-center text-muted-foreground/60 transition-colors hover:text-foreground\`,children:(0,B.jsx)(pt,{size:13})})})]})}),(0,B.jsx)(\`tbody\`,{children:s.map((e,t)=>{let n=Re?rt(e):String(t),i=Re&&k.has(n),a=i?\`bg-selected\`:\`bg-background group-hover:bg-popover\`;return(0,B.jsxs)(\`tr\`,{className:\`group\`,children:[(0,B.jsx)(\`td\`,{className:\`sticky left-0 z-10 border-b border-r border-border/70 px-0 \`+a,children:(0,B.jsxs)(\`div\`,{className:\`flex h-8.5 items-center gap-1.5 pl-3\`,children:[(0,B.jsx)(Zt,{checked:i,disabled:!Re,onChange:(e,n)=>at(t,e,n.shiftKey)}),(0,B.jsx)(\`button\`,{title:Re?\`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:()=>P(e),children:(0,B.jsx)(et,{size:11})})]})}),Ve.map((r,i)=>{let o=Ke(r.name),s=Re&&ue?.key===n&&ue.col===r.name,c=St?.r===t&&St.c===i,l=We(r.name),u=e[r.name]!==null&&e[r.name]!==void 0;return(0,B.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:qv(e[r.name]),onClick:()=>Re&&Ct({r:t,c:i}),onDoubleClick:t=>!s&&vt(e,r,t.currentTarget),children:[(0,B.jsx)(Jv,{value:e[r.name]}),l&&u&&(0,B.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();_e({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,B.jsx)(le,{size:11})}),s&&(0,B.jsx)(Xv,{col:r,value:e[r.name],anchor:ue.rect,enumValues:ze[r.type],onCancel:()=>fe(null),onCommit:(t,n)=>void bt(e,r,t,n)})]},r.name)}),(0,B.jsx)(\`td\`,{className:\`border-b border-border/70 \`+a})]},\`\${r}:\${t}\`)})})]}),s.length===0&&!d&&(0,B.jsx)(\`div\`,{className:\`flex flex-col items-center gap-3 py-20 text-[13px] text-muted-foreground/80\`,children:b.length>0?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Ie,{size:20,className:\`text-muted-foreground/40\`}),\`No rows match the current filters.\`,(0,B.jsx)(H,{variant:\`outline\`,size:\`xs\`,onClick:()=>x([]),children:\`Clear filters\`})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Ye,{size:20,className:\`text-muted-foreground/40\`}),R.isView?\`This view returns no rows.\`:\`This table is empty.\`,!R.isView&&!Le&&(0,B.jsxs)(H,{size:\`xs\`,onClick:()=>F(!0),children:[(0,B.jsx)(pt,{size:13}),\` Insert your first row\`]})]})})]})]}),(0,B.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:[Ce===\`data\`&&(0,B.jsxs)(\`div\`,{className:\`flex items-center gap-1\`,children:[(0,B.jsx)(H,{variant:\`ghost\`,size:\`iconXs\`,disabled:p===0,onClick:()=>m(e=>e-1),children:(0,B.jsx)(me,{size:13})}),(0,B.jsx)(\`span\`,{children:\`Page\`}),(0,B.jsx)(\`input\`,{type:\`number\`,min:1,max:Tt,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),Tt-1))},onBlur:e=>{let t=parseInt(e.target.value,10);Number.isNaN(t)||m(Math.min(Math.max(t-1,0),Tt-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,B.jsxs)(\`span\`,{children:[\`of \`,Tt]}),(0,B.jsx)(H,{variant:\`ghost\`,size:\`iconXs\`,disabled:p+1>=Tt,onClick:()=>m(e=>e+1),children:(0,B.jsx)(he,{size:13})})]}),Ce===\`data\`&&(0,B.jsx)(\`div\`,{className:\`w-27.5 shrink-0\`,children:(0,B.jsx)(Up,{value:String(h),onValueChange:e=>g(parseInt(e,10)),options:[25,50,100,500].map(e=>({value:String(e),label:\`\${e} rows\`}))})}),(0,B.jsx)(\`span\`,{className:\`ml-auto\`,children:Ce===\`data\`&&(0,B.jsxs)(B.Fragment,{children:[l.toLocaleString(),\` record\`,l===1?\`\`:\`s\`,k.size>0&&(0,B.jsxs)(B.Fragment,{children:[\` · \`,(0,B.jsxs)(\`span\`,{className:\`text-brand\`,children:[k.size,\` selected\`]})]})]})}),(0,B.jsx)(\`div\`,{className:\`flex overflow-hidden rounded-md border border-input\`,children:[\`data\`,\`definition\`].map(e=>(0,B.jsx)(\`button\`,{onClick:()=>we(e),className:\`px-2.5 py-1 text-[11px] font-medium capitalize transition-colors \`+(Ce===e?\`bg-muted text-foreground\`:\`text-muted-foreground/80 hover:text-foreground\`),children:e},e))})]})]}):(0,B.jsx)(cf,{children:\`Select a table.\`})}),M&&R&&(0,B.jsx)(yy,{table:R,tables:t,initial:M,readOnly:!Re,onClose:()=>P(null),onSave:async t=>{await N.updateRow(r,it(M),t,e),U.success(\`Row updated\`),P(null),await nt()},onDelete:async()=>{await N.deleteRow(r,it(M),e),U.success(\`Row deleted\`),P(null),await nt(),await $e()}}),ee&&R&&(0,B.jsx)(yy,{table:R,tables:t,initial:{},isNew:!0,onClose:()=>F(!1),onSave:async t=>{await N.insertRow(r,t,e),U.success(\`Row inserted\`),F(!1),await nt(),await $e()}}),je&&(0,B.jsx)(Ng,{table:je,schema:e,onClose:()=>Me(null),onChanged:Fe}),ge&&(0,B.jsx)(iy,{fk:ge.fk,value:ge.value,anchor:ge.rect,tables:t,onClose:()=>_e(null),onOpenTable:e=>{_e(null),i(e)}}),ve&&(0,B.jsx)(ay,{fk:ve.fk,tables:t,currentKey:ve.row[ve.col],onClose:()=>ye(null),onPick:e=>{yt(ve.row,e),ye(null)}}),I&&r&&(0,B.jsx)(ly,{table:r,schema:e,column:I,onClose:()=>te(null),onDone:async()=>{te(null),await $e()}}),L&&r&&(0,B.jsx)(hy,{table:r,schema:e,onClose:()=>oe(!1),onDone:async()=>{await $e()}}),ne&&R&&(0,B.jsx)(go,{open:!0,danger:!0,title:\`Delete \${k.size} selected row\${k.size===1?\`\`:\`s\`}?\`,description:\`Rows will be permanently deleted from "\${R.name}". This cannot be undone.\`,confirmLabel:\`Delete \${k.size} row\${k.size===1?\`\`:\`s\`}\`,onConfirm:()=>void mt(),onClose:()=>re(!1)}),ie&&r&&(0,B.jsx)(go,{open:!0,danger:!0,title:\`Drop column "\${ie}"?\`,description:\`The column and all data in it will be permanently removed from "\${r}".\`,confirmLabel:\`Drop column\`,onConfirm:()=>void xt(ie),onClose:()=>ae(null)})]})}function wy(){let[e,t]=(0,_.useState)(!!x()),{tab:n}=qt();return(0,_.useEffect)(()=>{x()&&N.ping().catch(e=>{e instanceof A&&(e.status===401||e.status===403)&&(C(),t(!1))})},[]),e?(0,B.jsxs)(\`div\`,{className:\`flex h-full flex-col\`,children:[(0,B.jsx)(Yn,{}),(0,B.jsx)(sh,{}),(0,B.jsx)(ih,{}),(0,B.jsx)(dh,{onLogout:()=>{C(),t(!1)}}),(0,B.jsxs)(\`div\`,{className:\`flex min-h-0 flex-1\`,children:[(0,B.jsx)(_h,{tab:n,onTab:e=>z(e)}),(0,B.jsxs)(\`main\`,{className:\`min-w-0 flex-1 overflow-hidden\`,children:[n===\`home\`&&(0,B.jsx)(s_,{}),n===\`table\`&&(0,B.jsx)(Cy,{}),n===\`sql\`&&(0,B.jsx)(wv,{}),n===\`database\`&&(0,B.jsx)(Zg,{}),n===\`auth\`&&(0,B.jsx)(zh,{}),n===\`storage\`&&(0,B.jsx)(Iv,{}),n===\`functions\`&&(0,B.jsx)(e_,{}),n===\`realtime\`&&(0,B.jsx)(M_,{}),n===\`automations\`&&(0,B.jsx)(sg,{}),n===\`logs\`&&(0,B.jsx)(y_,{}),n===\`settings\`&&(0,B.jsx)(ev,{})]})]})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(ph,{onOk:()=>t(!0)}),(0,B.jsx)(Yn,{})]})}(0,v.createRoot)(document.getElementById(\`root\`)).render((0,B.jsx)(_.StrictMode,{children:(0,B.jsx)(wy,{})}));</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]??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>
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>