@clef-sh/ui 0.1.14-beta.95 → 0.1.15-beta.97

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.
@@ -0,0 +1,26 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),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.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.provider`),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.iterator;function p(e){return typeof e!=`object`||!e?null:(e=f&&e[f]||e[`@@iterator`],typeof e==`function`?e:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,g={};function _(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}_.prototype.isReactComponent={},_.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`setState(...): takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function v(){}v.prototype=_.prototype;function y(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}var b=y.prototype=new v;b.constructor=y,h(b,_.prototype),b.isPureReactComponent=!0;var x=Array.isArray,S=Object.prototype.hasOwnProperty,C={current:null},w={key:!0,ref:!0,__self:!0,__source:!0};function T(e,n,r){var i,a={},o=null,s=null;if(n!=null)for(i in n.ref!==void 0&&(s=n.ref),n.key!==void 0&&(o=``+n.key),n)S.call(n,i)&&!w.hasOwnProperty(i)&&(a[i]=n[i]);var c=arguments.length-2;if(c===1)a.children=r;else if(1<c){for(var l=Array(c),u=0;u<c;u++)l[u]=arguments[u+2];a.children=l}if(e&&e.defaultProps)for(i in c=e.defaultProps,c)a[i]===void 0&&(a[i]=c[i]);return{$$typeof:t,type:e,key:o,ref:s,props:a,_owner:C.current}}function E(e,n){return{$$typeof:t,type:e.type,key:n,ref:e.ref,props:e.props,_owner:e._owner}}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function O(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var k=/\/+/g;function A(e,t){return typeof e==`object`&&e&&e.key!=null?O(``+e.key):t.toString(36)}function j(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`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0}}if(c)return c=e,o=o(c),e=a===``?`.`+A(c,0):a,x(o)?(i=``,e!=null&&(i=e.replace(k,`$&/`)+`/`),j(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=E(o,i+(!o.key||c&&c.key===o.key?``:(``+o.key).replace(k,`$&/`)+`/`)+e)),r.push(o)),1;if(c=0,a=a===``?`.`:a+`:`,x(e))for(var l=0;l<e.length;l++){s=e[l];var u=a+A(s,l);c+=j(s,r,i,u,o)}else if(u=p(e),typeof u==`function`)for(e=u.call(e),l=0;!(s=e.next()).done;)s=s.value,u=a+A(s,l++),c+=j(s,r,i,u,o);else if(s===`object`)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 M(e,t,n){if(e==null)return e;var r=[],i=0;return j(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function N(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={current:null},F={transition:null},I={ReactCurrentDispatcher:P,ReactCurrentBatchConfig:F,ReactCurrentOwner:C};function L(){throw Error(`act(...) is not supported in production builds of React.`)}e.Children={map:M,forEach:function(e,t,n){M(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return M(e,function(){t++}),t},toArray:function(e){return M(e,function(e){return e})||[]},only:function(e){if(!D(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}},e.Component=_,e.Fragment=r,e.Profiler=a,e.PureComponent=y,e.StrictMode=i,e.Suspense=l,e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=I,e.act=L,e.cloneElement=function(e,n,r){if(e==null)throw Error(`React.cloneElement(...): The argument must be a React element, but you passed `+e+`.`);var i=h({},e.props),a=e.key,o=e.ref,s=e._owner;if(n!=null){if(n.ref!==void 0&&(o=n.ref,s=C.current),n.key!==void 0&&(a=``+n.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(l in n)S.call(n,l)&&!w.hasOwnProperty(l)&&(i[l]=n[l]===void 0&&c!==void 0?c[l]:n[l])}var l=arguments.length-2;if(l===1)i.children=r;else if(1<l){c=Array(l);for(var u=0;u<l;u++)c[u]=arguments[u+2];i.children=c}return{$$typeof:t,type:e.type,key:a,ref:o,props:i,_owner:s}},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:o,_context:e},e.Consumer=e},e.createElement=T,e.createFactory=function(e){var t=T.bind(null,e);return t.type=e,t},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=D,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:N}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=F.transition;F.transition={};try{e()}finally{F.transition=t}},e.unstable_act=L,e.useCallback=function(e,t){return P.current.useCallback(e,t)},e.useContext=function(e){return P.current.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e){return P.current.useDeferredValue(e)},e.useEffect=function(e,t){return P.current.useEffect(e,t)},e.useId=function(){return P.current.useId()},e.useImperativeHandle=function(e,t,n){return P.current.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return P.current.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return P.current.useLayoutEffect(e,t)},e.useMemo=function(e,t){return P.current.useMemo(e,t)},e.useReducer=function(e,t,n){return P.current.useReducer(e,t,n)},e.useRef=function(e){return P.current.useRef(e)},e.useState=function(e){return P.current.useState(e)},e.useSyncExternalStore=function(e,t,n){return P.current.useSyncExternalStore(e,t,n)},e.useTransition=function(){return P.current.useTransition()},e.version=`18.3.1`})),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(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=typeof setTimeout==`function`?setTimeout:null,_=typeof clearTimeout==`function`?clearTimeout:null,v=typeof setImmediate<`u`?setImmediate:null;typeof navigator<`u`&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(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 b(e){if(h=!1,y(e),!m)if(n(c)!==null)m=!0,M(x);else{var t=n(l);t!==null&&N(b,t.startTime-e)}}function x(t,i){m=!1,h&&(h=!1,_(w),w=-1),p=!0;var a=f;try{for(y(i),d=n(c);d!==null&&(!(d.expirationTime>i)||t&&!D());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=i);i=e.unstable_now(),typeof s==`function`?d.callback=s:d===n(c)&&r(c),y(i)}else r(c);d=n(c)}if(d!==null)var u=!0;else{var g=n(l);g!==null&&N(b,g.startTime-i),u=!1}return u}finally{d=null,f=a,p=!1}}var S=!1,C=null,w=-1,T=5,E=-1;function D(){return!(e.unstable_now()-E<T)}function O(){if(C!==null){var t=e.unstable_now();E=t;var n=!0;try{n=C(!0,t)}finally{n?k():(S=!1,C=null)}}else S=!1}var k;if(typeof v==`function`)k=function(){v(O)};else if(typeof MessageChannel<`u`){var A=new MessageChannel,j=A.port2;A.port1.onmessage=O,k=function(){j.postMessage(null)}}else k=function(){g(O,0)};function M(e){C=e,S||(S=!0,k())}function N(t,n){w=g(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_continueExecution=function(){m||p||(m=!0,M(x))},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`):T=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},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_pauseExecution=function(){},e.unstable_requestPaint=function(){},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?(_(w),w=-1):h=!0,N(b,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,M(x))),r},e.unstable_shouldYield=D,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(),n=f();function r(e){for(var t=`https://reactjs.org/docs/error-decoder.html?invariant=`+e,n=1;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n]);return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}var i=new Set,a={};function o(e,t){s(e,t),s(e+`Capture`,t)}function s(e,t){for(a[e]=t,e=0;e<t.length;e++)i.add(t[e])}var c=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),l=Object.prototype.hasOwnProperty,d=/^[: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]*$/,p={},m={};function h(e){return l.call(m,e)?!0:l.call(p,e)?!1:d.test(e)?m[e]=!0:(p[e]=!0,!1)}function g(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case`function`:case`symbol`:return!0;case`boolean`:return r?!1:n===null?(e=e.toLowerCase().slice(0,5),e!==`data-`&&e!==`aria-`):!n.acceptsBooleans;default:return!1}}function _(e,t,n,r){if(t==null||g(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function v(e,t,n,r,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var y={};`children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style`.split(` `).forEach(function(e){y[e]=new v(e,0,!1,e,null,!1,!1)}),[[`acceptCharset`,`accept-charset`],[`className`,`class`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`]].forEach(function(e){var t=e[0];y[t]=new v(t,1,!1,e[1],null,!1,!1)}),[`contentEditable`,`draggable`,`spellCheck`,`value`].forEach(function(e){y[e]=new v(e,2,!1,e.toLowerCase(),null,!1,!1)}),[`autoReverse`,`externalResourcesRequired`,`focusable`,`preserveAlpha`].forEach(function(e){y[e]=new v(e,2,!1,e,null,!1,!1)}),`allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope`.split(` `).forEach(function(e){y[e]=new v(e,3,!1,e.toLowerCase(),null,!1,!1)}),[`checked`,`multiple`,`muted`,`selected`].forEach(function(e){y[e]=new v(e,3,!0,e,null,!1,!1)}),[`capture`,`download`].forEach(function(e){y[e]=new v(e,4,!1,e,null,!1,!1)}),[`cols`,`rows`,`size`,`span`].forEach(function(e){y[e]=new v(e,6,!1,e,null,!1,!1)}),[`rowSpan`,`start`].forEach(function(e){y[e]=new v(e,5,!1,e.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function x(e){return e[1].toUpperCase()}`accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height`.split(` `).forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,null,!1,!1)}),`xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type`.split(` `).forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,`http://www.w3.org/1999/xlink`,!1,!1)}),[`xml:base`,`xml:lang`,`xml:space`].forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,`http://www.w3.org/XML/1998/namespace`,!1,!1)}),[`tabIndex`,`crossOrigin`].forEach(function(e){y[e]=new v(e,1,!1,e.toLowerCase(),null,!1,!1)}),y.xlinkHref=new v(`xlinkHref`,1,!1,`xlink:href`,`http://www.w3.org/1999/xlink`,!0,!1),[`src`,`href`,`action`,`formAction`].forEach(function(e){y[e]=new v(e,1,!1,e.toLowerCase(),null,!0,!0)});function S(e,t,n,r){var i=y.hasOwnProperty(t)?y[t]:null;(i===null?r||!(2<t.length)||t[0]!==`o`&&t[0]!==`O`||t[1]!==`n`&&t[1]!==`N`:i.type!==0)&&(_(t,n,i,r)&&(n=null),r||i===null?h(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,``+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:``:n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&!0===n?``:``+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var C=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,w=Symbol.for(`react.element`),T=Symbol.for(`react.portal`),E=Symbol.for(`react.fragment`),D=Symbol.for(`react.strict_mode`),O=Symbol.for(`react.profiler`),k=Symbol.for(`react.provider`),A=Symbol.for(`react.context`),j=Symbol.for(`react.forward_ref`),M=Symbol.for(`react.suspense`),N=Symbol.for(`react.suspense_list`),P=Symbol.for(`react.memo`),F=Symbol.for(`react.lazy`),I=Symbol.for(`react.offscreen`),L=Symbol.iterator;function ee(e){return typeof e!=`object`||!e?null:(e=L&&e[L]||e[`@@iterator`],typeof e==`function`?e:null)}var R=Object.assign,te;function ne(e){if(te===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);te=t&&t[1]||``}return`
2
+ `+te+e}var re=!1;function ie(e,t){if(!e||re)return``;re=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&typeof t.stack==`string`){for(var i=t.stack.split(`
3
+ `),a=r.stack.split(`
4
+ `),o=i.length-1,s=a.length-1;1<=o&&0<=s&&i[o]!==a[s];)s--;for(;1<=o&&0<=s;o--,s--)if(i[o]!==a[s]){if(o!==1||s!==1)do if(o--,s--,0>s||i[o]!==a[s]){var c=`
5
+ `+i[o].replace(` at new `,` at `);return e.displayName&&c.includes(`<anonymous>`)&&(c=c.replace(`<anonymous>`,e.displayName)),c}while(1<=o&&0<=s);break}}}finally{re=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:``)?ne(e):``}function ae(e){switch(e.tag){case 5:return ne(e.type);case 16:return ne(`Lazy`);case 13:return ne(`Suspense`);case 19:return ne(`SuspenseList`);case 0:case 2:case 15:return e=ie(e.type,!1),e;case 11:return e=ie(e.type.render,!1),e;case 1:return e=ie(e.type,!0),e;default:return``}}function oe(e){if(e==null)return null;if(typeof e==`function`)return e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case E:return`Fragment`;case T:return`Portal`;case O:return`Profiler`;case D:return`StrictMode`;case M:return`Suspense`;case N:return`SuspenseList`}if(typeof e==`object`)switch(e.$$typeof){case A:return(e.displayName||`Context`)+`.Consumer`;case k:return(e._context.displayName||`Context`)+`.Provider`;case j:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case P:return t=e.displayName||null,t===null?oe(e.type)||`Memo`:t;case F:t=e._payload,e=e._init;try{return oe(e(t))}catch{}}return null}function se(e){var t=e.type;switch(e.tag){case 24:return`Cache`;case 9:return(t.displayName||`Context`)+`.Consumer`;case 10:return(t._context.displayName||`Context`)+`.Provider`;case 18:return`DehydratedFragment`;case 11:return e=t.render,e=e.displayName||e.name||``,t.displayName||(e===``?`ForwardRef`:`ForwardRef(`+e+`)`);case 7:return`Fragment`;case 5:return t;case 4:return`Portal`;case 3:return`Root`;case 6:return`Text`;case 16:return oe(t);case 8:return t===D?`StrictMode`:`Mode`;case 22:return`Offscreen`;case 12:return`Profiler`;case 21:return`Scope`;case 13:return`Suspense`;case 19:return`SuspenseList`;case 25:return`TracingMarker`;case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t==`function`)return t.displayName||t.name||null;if(typeof t==`string`)return t}return null}function ce(e){switch(typeof e){case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function le(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function ue(e){var t=le(e)?`checked`:`value`,n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=``+e[t];if(!e.hasOwnProperty(t)&&n!==void 0&&typeof n.get==`function`&&typeof n.set==`function`){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function de(e){e._valueTracker||=ue(e)}function fe(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=le(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function pe(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function me(e,t){var n=t.checked;return R({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function he(e,t){var n=t.defaultValue==null?``:t.defaultValue,r=t.checked==null?t.defaultChecked:t.checked;n=ce(t.value==null?n:t.value),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type===`checkbox`||t.type===`radio`?t.checked!=null:t.value!=null}}function ge(e,t){t=t.checked,t!=null&&S(e,`checked`,t,!1)}function _e(e,t){ge(e,t);var n=ce(t.value),r=t.type;if(n!=null)r===`number`?(n===0&&e.value===``||e.value!=n)&&(e.value=``+n):e.value!==``+n&&(e.value=``+n);else if(r===`submit`||r===`reset`){e.removeAttribute(`value`);return}t.hasOwnProperty(`value`)?ye(e,t.type,n):t.hasOwnProperty(`defaultValue`)&&ye(e,t.type,ce(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function ve(e,t,n){if(t.hasOwnProperty(`value`)||t.hasOwnProperty(`defaultValue`)){var r=t.type;if(!(r!==`submit`&&r!==`reset`||t.value!==void 0&&t.value!==null))return;t=``+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==``&&(e.name=``),e.defaultChecked=!!e._wrapperState.initialChecked,n!==``&&(e.name=n)}function ye(e,t,n){(t!==`number`||pe(e.ownerDocument)!==e)&&(n==null?e.defaultValue=``+e._wrapperState.initialValue:e.defaultValue!==``+n&&(e.defaultValue=``+n))}var z=Array.isArray;function be(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=``+ce(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 xe(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(r(91));return R({},t,{value:void 0,defaultValue:void 0,children:``+e._wrapperState.initialValue})}function Se(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(r(92));if(z(n)){if(1<n.length)throw Error(r(93));n=n[0]}t=n}t??=``,n=t}e._wrapperState={initialValue:ce(n)}}function Ce(e,t){var n=ce(t.value),r=ce(t.defaultValue);n!=null&&(n=``+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=``+r)}function we(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==``&&t!==null&&(e.value=t)}function Te(e){switch(e){case`svg`:return`http://www.w3.org/2000/svg`;case`math`:return`http://www.w3.org/1998/Math/MathML`;default:return`http://www.w3.org/1999/xhtml`}}function Ee(e,t){return e==null||e===`http://www.w3.org/1999/xhtml`?Te(t):e===`http://www.w3.org/2000/svg`&&t===`foreignObject`?`http://www.w3.org/1999/xhtml`:e}var De,Oe=function(e){return typeof MSApp<`u`&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!==`http://www.w3.org/2000/svg`||`innerHTML`in e)e.innerHTML=t;else{for(De||=document.createElement(`div`),De.innerHTML=`<svg>`+t.valueOf().toString()+`</svg>`,t=De.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ke(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ae={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},je=[`Webkit`,`ms`,`Moz`,`O`];Object.keys(Ae).forEach(function(e){je.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ae[t]=Ae[e]})});function Me(e,t,n){return t==null||typeof t==`boolean`||t===``?``:n||typeof t!=`number`||t===0||Ae.hasOwnProperty(e)&&Ae[e]?(``+t).trim():t+`px`}function Ne(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=n.indexOf(`--`)===0,i=Me(n,t[n],r);n===`float`&&(n=`cssFloat`),r?e.setProperty(n,i):e[n]=i}}var Pe=R({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Fe(e,t){if(t){if(Pe[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(r(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(r(60));if(typeof t.dangerouslySetInnerHTML!=`object`||!(`__html`in t.dangerouslySetInnerHTML))throw Error(r(61))}if(t.style!=null&&typeof t.style!=`object`)throw Error(r(62))}}function Ie(e,t){if(e.indexOf(`-`)===-1)return typeof t.is==`string`;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var Le=null;function Re(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ze=null,Be=null,Ve=null;function He(e){if(e=Bi(e)){if(typeof ze!=`function`)throw Error(r(280));var t=e.stateNode;t&&(t=Hi(t),ze(e.stateNode,e.type,t))}}function Ue(e){Be?Ve?Ve.push(e):Ve=[e]:Be=e}function We(){if(Be){var e=Be,t=Ve;if(Ve=Be=null,He(e),t)for(e=0;e<t.length;e++)He(t[e])}}function Ge(e,t){return e(t)}function Ke(){}var qe=!1;function Je(e,t,n){if(qe)return e(t,n);qe=!0;try{return Ge(e,t,n)}finally{qe=!1,(Be!==null||Ve!==null)&&(Ke(),We())}}function Ye(e,t){var n=e.stateNode;if(n===null)return null;var i=Hi(n);if(i===null)return null;n=i[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`:(i=!i.disabled)||(e=e.type,i=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!i;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(r(231,t,typeof n));return n}var Xe=!1;if(c)try{var Ze={};Object.defineProperty(Ze,`passive`,{get:function(){Xe=!0}}),window.addEventListener(`test`,Ze,Ze),window.removeEventListener(`test`,Ze,Ze)}catch{Xe=!1}function Qe(e,t,n,r,i,a,o,s,c){var l=Array.prototype.slice.call(arguments,3);try{t.apply(n,l)}catch(e){this.onError(e)}}var $e=!1,et=null,tt=!1,nt=null,rt={onError:function(e){$e=!0,et=e}};function it(e,t,n,r,i,a,o,s,c){$e=!1,et=null,Qe.apply(rt,arguments)}function at(e,t,n,i,a,o,s,c,l){if(it.apply(this,arguments),$e){if($e){var u=et;$e=!1,et=null}else throw Error(r(198));tt||(tt=!0,nt=u)}}function ot(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 st(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 ct(e){if(ot(e)!==e)throw Error(r(188))}function lt(e){var t=e.alternate;if(!t){if(t=ot(e),t===null)throw Error(r(188));return t===e?e:null}for(var n=e,i=t;;){var a=n.return;if(a===null)break;var o=a.alternate;if(o===null){if(i=a.return,i!==null){n=i;continue}break}if(a.child===o.child){for(o=a.child;o;){if(o===n)return ct(a),e;if(o===i)return ct(a),t;o=o.sibling}throw Error(r(188))}if(n.return!==i.return)n=a,i=o;else{for(var s=!1,c=a.child;c;){if(c===n){s=!0,n=a,i=o;break}if(c===i){s=!0,i=a,n=o;break}c=c.sibling}if(!s){for(c=o.child;c;){if(c===n){s=!0,n=o,i=a;break}if(c===i){s=!0,i=o,n=a;break}c=c.sibling}if(!s)throw Error(r(189))}}if(n.alternate!==i)throw Error(r(190))}if(n.tag!==3)throw Error(r(188));return n.stateNode.current===n?e:t}function ut(e){return e=lt(e),e===null?null:dt(e)}function dt(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=dt(e);if(t!==null)return t;e=e.sibling}return null}var ft=n.unstable_scheduleCallback,pt=n.unstable_cancelCallback,mt=n.unstable_shouldYield,ht=n.unstable_requestPaint,B=n.unstable_now,gt=n.unstable_getCurrentPriorityLevel,_t=n.unstable_ImmediatePriority,vt=n.unstable_UserBlockingPriority,yt=n.unstable_NormalPriority,bt=n.unstable_LowPriority,xt=n.unstable_IdlePriority,St=null,Ct=null;function wt(e){if(Ct&&typeof Ct.onCommitFiberRoot==`function`)try{Ct.onCommitFiberRoot(St,e,void 0,(e.current.flags&128)==128)}catch{}}var Tt=Math.clz32?Math.clz32:Ot,Et=Math.log,Dt=Math.LN2;function Ot(e){return e>>>=0,e===0?32:31-(Et(e)/Dt|0)|0}var kt=64,At=4194304;function jt(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Mt(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var s=o&~i;s===0?(a&=o,a!==0&&(r=jt(a))):r=jt(s)}else o=n&~i,o===0?a!==0&&(r=jt(a)):r=jt(o);if(r===0)return 0;if(t!==0&&t!==r&&(t&i)===0&&(i=r&-r,a=t&-t,i>=a||i===16&&a&4194240))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Tt(t),i=1<<n,r|=e[n],t&=~i;return r}function Nt(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Pt(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-Tt(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Nt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}}function Ft(e){return e=e.pendingLanes&-1073741825,e===0?e&1073741824?1073741824:0:e}function It(){var e=kt;return kt<<=1,!(kt&4194240)&&(kt=64),e}function Lt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Rt(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Tt(t),e[t]=n}function zt(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-Tt(n),a=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~a}}function Bt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Tt(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var V=0;function Vt(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Ht,Ut,Wt,Gt,Kt,qt=!1,Jt=[],Yt=null,Xt=null,Zt=null,Qt=new Map,$t=new Map,en=[],tn=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit`.split(` `);function nn(e,t){switch(e){case`focusin`:case`focusout`:Yt=null;break;case`dragenter`:case`dragleave`:Xt=null;break;case`mouseover`:case`mouseout`:Zt=null;break;case`pointerover`:case`pointerout`:Qt.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:$t.delete(t.pointerId)}}function rn(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=Bi(t),t!==null&&Ut(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function an(e,t,n,r,i){switch(t){case`focusin`:return Yt=rn(Yt,e,t,n,r,i),!0;case`dragenter`:return Xt=rn(Xt,e,t,n,r,i),!0;case`mouseover`:return Zt=rn(Zt,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Qt.set(a,rn(Qt.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,$t.set(a,rn($t.get(a)||null,e,t,n,r,i)),!0}return!1}function on(e){var t=zi(e.target);if(t!==null){var n=ot(t);if(n!==null){if(t=n.tag,t===13){if(t=st(n),t!==null){e.blockedOn=t,Kt(e.priority,function(){Wt(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 sn(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=vn(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Le=r,n.target.dispatchEvent(r),Le=null}else return t=Bi(n),t!==null&&Ut(t),e.blockedOn=n,!1;t.shift()}return!0}function cn(e,t,n){sn(e)&&n.delete(t)}function ln(){qt=!1,Yt!==null&&sn(Yt)&&(Yt=null),Xt!==null&&sn(Xt)&&(Xt=null),Zt!==null&&sn(Zt)&&(Zt=null),Qt.forEach(cn),$t.forEach(cn)}function un(e,t){e.blockedOn===t&&(e.blockedOn=null,qt||(qt=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,ln)))}function dn(e){function t(t){return un(t,e)}if(0<Jt.length){un(Jt[0],e);for(var n=1;n<Jt.length;n++){var r=Jt[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Yt!==null&&un(Yt,e),Xt!==null&&un(Xt,e),Zt!==null&&un(Zt,e),Qt.forEach(t),$t.forEach(t),n=0;n<en.length;n++)r=en[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<en.length&&(n=en[0],n.blockedOn===null);)on(n),n.blockedOn===null&&en.shift()}var fn=C.ReactCurrentBatchConfig,pn=!0;function mn(e,t,n,r){var i=V,a=fn.transition;fn.transition=null;try{V=1,gn(e,t,n,r)}finally{V=i,fn.transition=a}}function hn(e,t,n,r){var i=V,a=fn.transition;fn.transition=null;try{V=4,gn(e,t,n,r)}finally{V=i,fn.transition=a}}function gn(e,t,n,r){if(pn){var i=vn(e,t,n,r);if(i===null)di(e,t,r,_n,n),nn(e,r);else if(an(i,e,t,n,r))r.stopPropagation();else if(nn(e,r),t&4&&-1<tn.indexOf(e)){for(;i!==null;){var a=Bi(i);if(a!==null&&Ht(a),a=vn(e,t,n,r),a===null&&di(e,t,r,_n,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else di(e,t,r,null,n)}}var _n=null;function vn(e,t,n,r){if(_n=null,e=Re(r),e=zi(e),e!==null)if(t=ot(e),t===null)e=null;else if(n=t.tag,n===13){if(e=st(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 _n=e,null}function yn(e){switch(e){case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 1;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`toggle`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 4;case`message`:switch(gt()){case _t:return 1;case vt:return 4;case yt:case bt:return 16;case xt:return 536870912;default:return 16}default:return 16}}var bn=null,xn=null,Sn=null;function Cn(){if(Sn)return Sn;var e,t=xn,n=t.length,r,i=`value`in bn?bn.value:bn.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 Sn=i.slice(e,1<r?1-r:void 0)}function wn(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 Tn(){return!0}function En(){return!1}function Dn(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)?Tn:En,this.isPropagationStopped=En,this}return R(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=Tn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Tn)},persist:function(){},isPersistent:Tn}),t}var On={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},kn=Dn(On),An=R({},On,{view:0,detail:0}),jn=Dn(An),Mn,Nn,Pn,Fn=R({},An,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Kn,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!==Pn&&(Pn&&e.type===`mousemove`?(Mn=e.screenX-Pn.screenX,Nn=e.screenY-Pn.screenY):Nn=Mn=0,Pn=e),Mn)},movementY:function(e){return`movementY`in e?e.movementY:Nn}}),In=Dn(Fn),Ln=Dn(R({},Fn,{dataTransfer:0})),Rn=Dn(R({},An,{relatedTarget:0})),zn=Dn(R({},On,{animationName:0,elapsedTime:0,pseudoElement:0})),Bn=Dn(R({},On,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Vn=Dn(R({},On,{data:0})),Hn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Un={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`},Wn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Gn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Wn[e])?!!t[e]:!1}function Kn(){return Gn}var qn=Dn(R({},An,{key:function(e){if(e.key){var t=Hn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=wn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Un[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Kn,charCode:function(e){return e.type===`keypress`?wn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?wn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Jn=Dn(R({},Fn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Yn=Dn(R({},An,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Kn})),Xn=Dn(R({},On,{propertyName:0,elapsedTime:0,pseudoElement:0})),Zn=Dn(R({},Fn,{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})),Qn=[9,13,27,32],$n=c&&`CompositionEvent`in window,er=null;c&&`documentMode`in document&&(er=document.documentMode);var tr=c&&`TextEvent`in window&&!er,nr=c&&(!$n||er&&8<er&&11>=er),rr=` `,ir=!1;function ar(e,t){switch(e){case`keyup`:return Qn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function or(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var sr=!1;function cr(e,t){switch(e){case`compositionend`:return or(t);case`keypress`:return t.which===32?(ir=!0,rr):null;case`textInput`:return e=t.data,e===rr&&ir?null:e;default:return null}}function lr(e,t){if(sr)return e===`compositionend`||!$n&&ar(e,t)?(e=Cn(),Sn=xn=bn=null,sr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return nr&&t.locale!==`ko`?null:t.data;default:return null}}var ur={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 dr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!ur[e.type]:t===`textarea`}function fr(e,t,n,r){Ue(r),t=pi(t,`onChange`),0<t.length&&(n=new kn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var pr=null,mr=null;function hr(e){oi(e,0)}function gr(e){if(fe(Vi(e)))return e}function _r(e,t){if(e===`change`)return t}var vr=!1;if(c){var yr;if(c){var br=`oninput`in document;if(!br){var xr=document.createElement(`div`);xr.setAttribute(`oninput`,`return;`),br=typeof xr.oninput==`function`}yr=br}else yr=!1;vr=yr&&(!document.documentMode||9<document.documentMode)}function Sr(){pr&&(pr.detachEvent(`onpropertychange`,Cr),mr=pr=null)}function Cr(e){if(e.propertyName===`value`&&gr(mr)){var t=[];fr(t,mr,e,Re(e)),Je(hr,t)}}function wr(e,t,n){e===`focusin`?(Sr(),pr=t,mr=n,pr.attachEvent(`onpropertychange`,Cr)):e===`focusout`&&Sr()}function Tr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return gr(mr)}function Er(e,t){if(e===`click`)return gr(t)}function Dr(e,t){if(e===`input`||e===`change`)return gr(t)}function Or(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var kr=typeof Object.is==`function`?Object.is:Or;function Ar(e,t){if(kr(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(!l.call(t,i)||!kr(e[i],t[i]))return!1}return!0}function jr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Mr(e,t){var n=jr(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=jr(n)}}function Nr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Nr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Pr(){for(var e=window,t=pe();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=pe(e.document)}return t}function Fr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}function Ir(e){var t=Pr(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Nr(n.ownerDocument.documentElement,n)){if(r!==null&&Fr(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),`selectionStart`in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=Mr(n,a);var o=Mr(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus==`function`&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Lr=c&&`documentMode`in document&&11>=document.documentMode,Rr=null,zr=null,Br=null,Vr=!1;function Hr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Vr||Rr==null||Rr!==pe(r)||(r=Rr,`selectionStart`in r&&Fr(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}),Br&&Ar(Br,r)||(Br=r,r=pi(zr,`onSelect`),0<r.length&&(t=new kn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Rr)))}function Ur(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Wr={animationend:Ur(`Animation`,`AnimationEnd`),animationiteration:Ur(`Animation`,`AnimationIteration`),animationstart:Ur(`Animation`,`AnimationStart`),transitionend:Ur(`Transition`,`TransitionEnd`)},Gr={},Kr={};c&&(Kr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Wr.animationend.animation,delete Wr.animationiteration.animation,delete Wr.animationstart.animation),`TransitionEvent`in window||delete Wr.transitionend.transition);function qr(e){if(Gr[e])return Gr[e];if(!Wr[e])return e;var t=Wr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Kr)return Gr[e]=t[n];return e}var Jr=qr(`animationend`),Yr=qr(`animationiteration`),Xr=qr(`animationstart`),Zr=qr(`transitionend`),Qr=new Map,$r=`abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);function ei(e,t){Qr.set(e,t),o(t,[e])}for(var ti=0;ti<$r.length;ti++){var ni=$r[ti];ei(ni.toLowerCase(),`on`+(ni[0].toUpperCase()+ni.slice(1)))}ei(Jr,`onAnimationEnd`),ei(Yr,`onAnimationIteration`),ei(Xr,`onAnimationStart`),ei(`dblclick`,`onDoubleClick`),ei(`focusin`,`onFocus`),ei(`focusout`,`onBlur`),ei(Zr,`onTransitionEnd`),s(`onMouseEnter`,[`mouseout`,`mouseover`]),s(`onMouseLeave`,[`mouseout`,`mouseover`]),s(`onPointerEnter`,[`pointerout`,`pointerover`]),s(`onPointerLeave`,[`pointerout`,`pointerover`]),o(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),o(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),o(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),o(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),o(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),o(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var ri=`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(` `),ii=new Set(`cancel close invalid load scroll toggle`.split(` `).concat(ri));function ai(e,t,n){var r=e.type||`unknown-event`;e.currentTarget=n,at(r,t,void 0,e),e.currentTarget=null}function oi(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;ai(i,s,l),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;ai(i,s,l),a=c}}}if(tt)throw e=nt,tt=!1,nt=null,e}function H(e,t){var n=t[Ii];n===void 0&&(n=t[Ii]=new Set);var r=e+`__bubble`;n.has(r)||(ui(t,e,2,!1),n.add(r))}function si(e,t,n){var r=0;t&&(r|=4),ui(n,e,r,t)}var ci=`_reactListening`+Math.random().toString(36).slice(2);function li(e){if(!e[ci]){e[ci]=!0,i.forEach(function(t){t!==`selectionchange`&&(ii.has(t)||si(t,!1,e),si(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ci]||(t[ci]=!0,si(`selectionchange`,!1,t))}}function ui(e,t,n,r){switch(yn(t)){case 1:var i=mn;break;case 4:i=hn;break;default:i=gn}n=i.bind(null,t,n,e),i=void 0,!Xe||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 di(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i||s.nodeType===8&&s.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;o=o.return}for(;s!==null;){if(o=zi(s),o===null)return;if(c=o.tag,c===5||c===6){r=a=o;continue a}s=s.parentNode}}r=r.return}Je(function(){var r=a,i=Re(n),o=[];a:{var s=Qr.get(e);if(s!==void 0){var c=kn,l=e;switch(e){case`keypress`:if(wn(n)===0)break a;case`keydown`:case`keyup`:c=qn;break;case`focusin`:l=`focus`,c=Rn;break;case`focusout`:l=`blur`,c=Rn;break;case`beforeblur`:case`afterblur`:c=Rn;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`:c=In;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:c=Ln;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:c=Yn;break;case Jr:case Yr:case Xr:c=zn;break;case Zr:c=Xn;break;case`scroll`:c=jn;break;case`wheel`:c=Zn;break;case`copy`:case`cut`:case`paste`:c=Bn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:c=Jn}var u=(t&4)!=0,d=!u&&e===`scroll`,f=u?s===null?null:s+`Capture`:s;u=[];for(var p=r,m;p!==null;){m=p;var h=m.stateNode;if(m.tag===5&&h!==null&&(m=h,f!==null&&(h=Ye(p,f),h!=null&&u.push(fi(p,h,m)))),d)break;p=p.return}0<u.length&&(s=new c(s,l,null,n,i),o.push({event:s,listeners:u}))}}if(!(t&7)){a:{if(s=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,s&&n!==Le&&(l=n.relatedTarget||n.fromElement)&&(zi(l)||l[Fi]))break a;if((c||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?zi(l):null,l!==null&&(d=ot(l),l!==d||l.tag!==5&&l.tag!==6)&&(l=null)):(c=null,l=r),c!==l)){if(u=In,h=`onMouseLeave`,f=`onMouseEnter`,p=`mouse`,(e===`pointerout`||e===`pointerover`)&&(u=Jn,h=`onPointerLeave`,f=`onPointerEnter`,p=`pointer`),d=c==null?s:Vi(c),m=l==null?s:Vi(l),s=new u(h,p+`leave`,c,n,i),s.target=d,s.relatedTarget=m,h=null,zi(i)===r&&(u=new u(f,p+`enter`,l,n,i),u.target=m,u.relatedTarget=d,h=u),d=h,c&&l)b:{for(u=c,f=l,p=0,m=u;m;m=mi(m))p++;for(m=0,h=f;h;h=mi(h))m++;for(;0<p-m;)u=mi(u),p--;for(;0<m-p;)f=mi(f),m--;for(;p--;){if(u===f||f!==null&&u===f.alternate)break b;u=mi(u),f=mi(f)}u=null}else u=null;c!==null&&hi(o,s,c,u,!1),l!==null&&d!==null&&hi(o,d,l,u,!0)}}a:{if(s=r?Vi(r):window,c=s.nodeName&&s.nodeName.toLowerCase(),c===`select`||c===`input`&&s.type===`file`)var g=_r;else if(dr(s))if(vr)g=Dr;else{g=Tr;var _=wr}else (c=s.nodeName)&&c.toLowerCase()===`input`&&(s.type===`checkbox`||s.type===`radio`)&&(g=Er);if(g&&=g(e,r)){fr(o,g,n,i);break a}_&&_(e,s,r),e===`focusout`&&(_=s._wrapperState)&&_.controlled&&s.type===`number`&&ye(s,`number`,s.value)}switch(_=r?Vi(r):window,e){case`focusin`:(dr(_)||_.contentEditable===`true`)&&(Rr=_,zr=r,Br=null);break;case`focusout`:Br=zr=Rr=null;break;case`mousedown`:Vr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Vr=!1,Hr(o,n,i);break;case`selectionchange`:if(Lr)break;case`keydown`:case`keyup`:Hr(o,n,i)}var v;if($n)b:{switch(e){case`compositionstart`:var y=`onCompositionStart`;break b;case`compositionend`:y=`onCompositionEnd`;break b;case`compositionupdate`:y=`onCompositionUpdate`;break b}y=void 0}else sr?ar(e,n)&&(y=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(y=`onCompositionStart`);y&&(nr&&n.locale!==`ko`&&(sr||y!==`onCompositionStart`?y===`onCompositionEnd`&&sr&&(v=Cn()):(bn=i,xn=`value`in bn?bn.value:bn.textContent,sr=!0)),_=pi(r,y),0<_.length&&(y=new Vn(y,e,null,n,i),o.push({event:y,listeners:_}),v?y.data=v:(v=or(n),v!==null&&(y.data=v)))),(v=tr?cr(e,n):lr(e,n))&&(r=pi(r,`onBeforeInput`),0<r.length&&(i=new Vn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:i,listeners:r}),i.data=v))}oi(o,t)})}function fi(e,t,n){return{instance:e,listener:t,currentTarget:n}}function pi(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=Ye(e,n),a!=null&&r.unshift(fi(e,a,i)),a=Ye(e,t),a!=null&&r.push(fi(e,a,i))),e=e.return}return r}function mi(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function hi(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(c!==null&&c===r)break;s.tag===5&&l!==null&&(s=l,i?(c=Ye(n,a),c!=null&&o.unshift(fi(n,c,s))):i||(c=Ye(n,a),c!=null&&o.push(fi(n,c,s)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var gi=/\r\n?/g,_i=/\u0000|\uFFFD/g;function vi(e){return(typeof e==`string`?e:``+e).replace(gi,`
6
+ `).replace(_i,``)}function yi(e,t,n){if(t=vi(t),vi(e)!==t&&n)throw Error(r(425))}function bi(){}var xi=null,Si=null;function Ci(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var wi=typeof setTimeout==`function`?setTimeout:void 0,Ti=typeof clearTimeout==`function`?clearTimeout:void 0,Ei=typeof Promise==`function`?Promise:void 0,Di=typeof queueMicrotask==`function`?queueMicrotask:Ei===void 0?wi:function(e){return Ei.resolve(null).then(e).catch(Oi)};function Oi(e){setTimeout(function(){throw e})}function ki(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===`/$`){if(r===0){e.removeChild(i),dn(t);return}r--}else n!==`$`&&n!==`$?`&&n!==`$!`||r++;n=i}while(n);dn(t)}function Ai(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`)break;if(t===`/$`)return null}}return e}function ji(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`){if(t===0)return e;t--}else n===`/$`&&t++}e=e.previousSibling}return null}var Mi=Math.random().toString(36).slice(2),Ni=`__reactFiber$`+Mi,Pi=`__reactProps$`+Mi,Fi=`__reactContainer$`+Mi,Ii=`__reactEvents$`+Mi,Li=`__reactListeners$`+Mi,Ri=`__reactHandles$`+Mi;function zi(e){var t=e[Ni];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Fi]||n[Ni]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ji(e);e!==null;){if(n=e[Ni])return n;e=ji(e)}return t}e=n,n=e.parentNode}return null}function Bi(e){return e=e[Ni]||e[Fi],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Vi(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(r(33))}function Hi(e){return e[Pi]||null}var Ui=[],Wi=-1;function Gi(e){return{current:e}}function U(e){0>Wi||(e.current=Ui[Wi],Ui[Wi]=null,Wi--)}function W(e,t){Wi++,Ui[Wi]=e.current,e.current=t}var Ki={},qi=Gi(Ki),Ji=Gi(!1),Yi=Ki;function Xi(e,t){var n=e.type.contextTypes;if(!n)return Ki;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Zi(e){return e=e.childContextTypes,e!=null}function Qi(){U(Ji),U(qi)}function $i(e,t,n){if(qi.current!==Ki)throw Error(r(168));W(qi,t),W(Ji,n)}function ea(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!=`function`)return n;for(var a in i=i.getChildContext(),i)if(!(a in t))throw Error(r(108,se(e)||`Unknown`,a));return R({},n,i)}function ta(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ki,Yi=qi.current,W(qi,e),W(Ji,Ji.current),!0}function na(e,t,n){var i=e.stateNode;if(!i)throw Error(r(169));n?(e=ea(e,t,Yi),i.__reactInternalMemoizedMergedChildContext=e,U(Ji),U(qi),W(qi,e)):U(Ji),W(Ji,n)}var ra=null,ia=!1,aa=!1;function oa(e){ra===null?ra=[e]:ra.push(e)}function sa(e){ia=!0,oa(e)}function ca(){if(!aa&&ra!==null){aa=!0;var e=0,t=V;try{var n=ra;for(V=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}ra=null,ia=!1}catch(t){throw ra!==null&&(ra=ra.slice(e+1)),ft(_t,ca),t}finally{V=t,aa=!1}}return null}var la=[],ua=0,da=null,fa=0,pa=[],ma=0,ha=null,ga=1,_a=``;function va(e,t){la[ua++]=fa,la[ua++]=da,da=e,fa=t}function ya(e,t,n){pa[ma++]=ga,pa[ma++]=_a,pa[ma++]=ha,ha=e;var r=ga;e=_a;var i=32-Tt(r)-1;r&=~(1<<i),n+=1;var a=32-Tt(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,ga=1<<32-Tt(t)+i|n<<i|r,_a=a+e}else ga=1<<a|n<<i|r,_a=e}function ba(e){e.return!==null&&(va(e,1),ya(e,1,0))}function xa(e){for(;e===da;)da=la[--ua],la[ua]=null,fa=la[--ua],la[ua]=null;for(;e===ha;)ha=pa[--ma],pa[ma]=null,_a=pa[--ma],pa[ma]=null,ga=pa[--ma],pa[ma]=null}var Sa=null,Ca=null,G=!1,wa=null;function Ta(e,t){var n=Kl(5,null,null,0);n.elementType=`DELETED`,n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Ea(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t===null?!1:(e.stateNode=t,Sa=e,Ca=Ai(t.firstChild),!0);case 6:return t=e.pendingProps===``||t.nodeType!==3?null:t,t===null?!1:(e.stateNode=t,Sa=e,Ca=null,!0);case 13:return t=t.nodeType===8?t:null,t===null?!1:(n=ha===null?null:{id:ga,overflow:_a},e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Kl(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Sa=e,Ca=null,!0);default:return!1}}function Da(e){return(e.mode&1)!=0&&(e.flags&128)==0}function Oa(e){if(G){var t=Ca;if(t){var n=t;if(!Ea(e,t)){if(Da(e))throw Error(r(418));t=Ai(n.nextSibling);var i=Sa;t&&Ea(e,t)?Ta(i,n):(e.flags=e.flags&-4097|2,G=!1,Sa=e)}}else{if(Da(e))throw Error(r(418));e.flags=e.flags&-4097|2,G=!1,Sa=e}}}function ka(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Sa=e}function Aa(e){if(e!==Sa)return!1;if(!G)return ka(e),G=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!==`head`&&t!==`body`&&!Ci(e.type,e.memoizedProps)),t&&=Ca){if(Da(e))throw ja(),Error(r(418));for(;t;)Ta(e,t),t=Ai(t.nextSibling)}if(ka(e),e.tag===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(r(317));a:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`){if(t===0){Ca=Ai(e.nextSibling);break a}t--}else n!==`$`&&n!==`$!`&&n!==`$?`||t++}e=e.nextSibling}Ca=null}}else Ca=Sa?Ai(e.stateNode.nextSibling):null;return!0}function ja(){for(var e=Ca;e;)e=Ai(e.nextSibling)}function Ma(){Ca=Sa=null,G=!1}function Na(e){wa===null?wa=[e]:wa.push(e)}var Pa=C.ReactCurrentBatchConfig;function Fa(e,t,n){if(e=n.ref,e!==null&&typeof e!=`function`&&typeof e!=`object`){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(r(309));var i=n.stateNode}if(!i)throw Error(r(147,e));var a=i,o=``+e;return t!==null&&t.ref!==null&&typeof t.ref==`function`&&t.ref._stringRef===o?t.ref:(t=function(e){var t=a.refs;e===null?delete t[o]:t[o]=e},t._stringRef=o,t)}if(typeof e!=`string`)throw Error(r(284));if(!n._owner)throw Error(r(290,e))}return e}function Ia(e,t){throw e=Object.prototype.toString.call(t),Error(r(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e))}function La(e){var t=e._init;return t(e._payload)}function Ra(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 i(e,t){for(e=new Map;t!==null;)t.key===null?e.set(t.index,t):e.set(t.key,t),t=t.sibling;return e}function a(e,t){return e=Yl(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|=2,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=2),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=$l(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===E?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===F&&La(i)===t.type)?(r=a(t,n.props),r.ref=Fa(e,t,n),r.return=e,r):(r=Xl(n.type,n.key,n.props,null,e.mode,r),r.ref=Fa(e,t,n),r.return=e,r)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=eu(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=Zl(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`)return t=$l(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case w:return n=Xl(t.type,t.key,t.props,null,e.mode,n),n.ref=Fa(e,null,t),n.return=e,n;case T:return t=eu(t,e.mode,n),t.return=e,t;case F:var r=t._init;return f(e,r(t._payload),n)}if(z(t)||ee(t))return t=Zl(t,e.mode,n,null),t.return=e,t;Ia(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`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case w:return n.key===i?l(e,t,n,r):null;case T:return n.key===i?u(e,t,n,r):null;case F:return i=n._init,p(e,t,i(n._payload),r)}if(z(n)||ee(n))return i===null?d(e,t,n,r,null):null;Ia(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case w:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case T:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case F:var a=r._init;return m(e,t,n,a(r._payload),i)}if(z(r)||ee(r))return e=e.get(n)||null,d(t,e,r,i,null);Ia(t,r)}return null}function h(r,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(r,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(r,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(r,d),G&&va(r,h),l;if(d===null){for(;h<s.length;h++)d=f(r,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return G&&va(r,h),l}for(d=i(r,d);h<s.length;h++)g=m(d,r,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(r,e)}),G&&va(r,h),l}function g(a,s,c,l){var u=ee(c);if(typeof u!=`function`)throw Error(r(150));if(c=u.call(c),c==null)throw Error(r(151));for(var d=u=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&&va(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&&va(a,g),u}for(h=i(a,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&&va(a,g),u}function _(e,r,i,o){if(typeof i==`object`&&i&&i.type===E&&i.key===null&&(i=i.props.children),typeof i==`object`&&i){switch(i.$$typeof){case w:a:{for(var c=i.key,l=r;l!==null;){if(l.key===c){if(c=i.type,c===E){if(l.tag===7){n(e,l.sibling),r=a(l,i.props.children),r.return=e,e=r;break a}}else if(l.elementType===c||typeof c==`object`&&c&&c.$$typeof===F&&La(c)===l.type){n(e,l.sibling),r=a(l,i.props),r.ref=Fa(e,l,i),r.return=e,e=r;break a}n(e,l);break}else t(e,l);l=l.sibling}i.type===E?(r=Zl(i.props.children,e.mode,o,i.key),r.return=e,e=r):(o=Xl(i.type,i.key,i.props,null,e.mode,o),o.ref=Fa(e,r,i),o.return=e,e=o)}return s(e);case T:a:{for(l=i.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===i.containerInfo&&r.stateNode.implementation===i.implementation){n(e,r.sibling),r=a(r,i.children||[]),r.return=e,e=r;break a}else{n(e,r);break}else t(e,r);r=r.sibling}r=eu(i,e.mode,o),r.return=e,e=r}return s(e);case F:return l=i._init,_(e,r,l(i._payload),o)}if(z(i))return h(e,r,i,o);if(ee(i))return g(e,r,i,o);Ia(e,i)}return typeof i==`string`&&i!==``||typeof i==`number`?(i=``+i,r!==null&&r.tag===6?(n(e,r.sibling),r=a(r,i),r.return=e,e=r):(n(e,r),r=$l(i,e.mode,o),r.return=e,e=r),s(e)):n(e,r)}return _}var za=Ra(!0),Ba=Ra(!1),Va=Gi(null),Ha=null,Ua=null,Wa=null;function Ga(){Wa=Ua=Ha=null}function Ka(e){var t=Va.current;U(Va),e._currentValue=t}function qa(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 Ja(e,t){Ha=e,Wa=Ua=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Fs=!0),e.firstContext=null)}function Ya(e){var t=e._currentValue;if(Wa!==e)if(e={context:e,memoizedValue:t,next:null},Ua===null){if(Ha===null)throw Error(r(308));Ua=e,Ha.dependencies={lanes:0,firstContext:e}}else Ua=Ua.next=e;return t}var Xa=null;function Za(e){Xa===null?Xa=[e]:Xa.push(e)}function Qa(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Za(t)):(n.next=i.next,i.next=n),t.interleaved=n,$a(e,r)}function $a(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var eo=!1;function to(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function no(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function ro(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function io(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,X&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,$a(e,n)}return i=r.interleaved,i===null?(t.next=t,Za(r)):(t.next=i.next,i.next=t),r.interleaved=t,$a(e,n)}function ao(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194240)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Bt(e,n)}}function oo(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={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,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,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function so(e,t,n,r){var i=e.updateQueue;eo=!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,p=s.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});a:{var m=e,h=s;switch(f=t,p=n,h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(p,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(p,d,f):m,f==null)break a;d=R({},d,f);break a;case 2:eo=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else p={eventTime: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;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(1);if(u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);Yc|=o,e.lanes=o,e.memoizedState=d}}function co(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var i=e[t],a=i.callback;if(a!==null){if(i.callback=null,i=n,typeof a!=`function`)throw Error(r(191,a));a.call(i)}}}var lo={},uo=Gi(lo),fo=Gi(lo),po=Gi(lo);function mo(e){if(e===lo)throw Error(r(174));return e}function ho(e,t){switch(W(po,t),W(fo,e),W(uo,lo),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ee(null,``);break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Ee(t,e)}U(uo),W(uo,t)}function go(){U(uo),U(fo),U(po)}function _o(e){mo(po.current);var t=mo(uo.current),n=Ee(t,e.type);t!==n&&(W(fo,e),W(uo,n))}function vo(e){fo.current===e&&(U(uo),U(fo))}var K=Gi(0);function yo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data===`$?`||n.data===`$!`))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var bo=[];function xo(){for(var e=0;e<bo.length;e++)bo[e]._workInProgressVersionPrimary=null;bo.length=0}var So=C.ReactCurrentDispatcher,Co=C.ReactCurrentBatchConfig,wo=0,q=null,J=null,To=null,Eo=!1,Do=!1,Oo=0,ko=0;function Ao(){throw Error(r(321))}function jo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!kr(e[n],t[n]))return!1;return!0}function Mo(e,t,n,i,a,o){if(wo=o,q=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,So.current=e===null||e.memoizedState===null?hs:gs,e=n(i,a),Do){o=0;do{if(Do=!1,Oo=0,25<=o)throw Error(r(301));o+=1,To=J=null,t.updateQueue=null,So.current=_s,e=n(i,a)}while(Do)}if(So.current=ms,t=J!==null&&J.next!==null,wo=0,To=J=q=null,Eo=!1,t)throw Error(r(300));return e}function No(){var e=Oo!==0;return Oo=0,e}function Po(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return To===null?q.memoizedState=To=e:To=To.next=e,To}function Fo(){if(J===null){var e=q.alternate;e=e===null?null:e.memoizedState}else e=J.next;var t=To===null?q.memoizedState:To.next;if(t!==null)To=t,J=e;else{if(e===null)throw Error(r(310));J=e,e={memoizedState:J.memoizedState,baseState:J.baseState,baseQueue:J.baseQueue,queue:J.queue,next:null},To===null?q.memoizedState=To=e:To=To.next=e}return To}function Io(e,t){return typeof t==`function`?t(e):t}function Lo(e){var t=Fo(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var i=J,a=i.baseQueue,o=n.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}i.baseQueue=a=o,n.pending=null}if(a!==null){o=a.next,i=i.baseState;var c=s=null,l=null,u=o;do{var d=u.lane;if((wo&d)===d)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),i=u.hasEagerState?u.eagerState:e(i,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(c=l=f,s=i):l=l.next=f,q.lanes|=d,Yc|=d}u=u.next}while(u!==null&&u!==o);l===null?s=i:l.next=c,kr(i,t.memoizedState)||(Fs=!0),t.memoizedState=i,t.baseState=s,t.baseQueue=l,n.lastRenderedState=i}if(e=n.interleaved,e!==null){a=e;do o=a.lane,q.lanes|=o,Yc|=o,a=a.next;while(a!==e)}else a===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Ro(e){var t=Fo(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var i=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);kr(o,t.memoizedState)||(Fs=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,i]}function zo(){}function Bo(e,t){var n=q,i=Fo(),a=t(),o=!kr(i.memoizedState,a);if(o&&(i.memoizedState=a,Fs=!0),i=i.queue,Qo(Uo.bind(null,n,i,e),[e]),i.getSnapshot!==t||o||To!==null&&To.memoizedState.tag&1){if(n.flags|=2048,qo(9,Ho.bind(null,n,i,a,t),void 0,null),Wc===null)throw Error(r(349));wo&30||Vo(n,t,a)}return a}function Vo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=q.updateQueue,t===null?(t={lastEffect:null,stores:null},q.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ho(e,t,n,r){t.value=n,t.getSnapshot=r,Wo(t)&&Go(e)}function Uo(e,t,n){return n(function(){Wo(t)&&Go(e)})}function Wo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!kr(e,n)}catch{return!0}}function Go(e){var t=$a(e,1);t!==null&&hl(t,e,1,-1)}function Ko(e){var t=Po();return typeof e==`function`&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Io,lastRenderedState:e},t.queue=e,e=e.dispatch=us.bind(null,q,e),[t.memoizedState,e]}function qo(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=q.updateQueue,t===null?(t={lastEffect:null,stores:null},q.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Jo(){return Fo().memoizedState}function Yo(e,t,n,r){var i=Po();q.flags|=e,i.memoizedState=qo(1|t,n,void 0,r===void 0?null:r)}function Xo(e,t,n,r){var i=Fo();r=r===void 0?null:r;var a=void 0;if(J!==null){var o=J.memoizedState;if(a=o.destroy,r!==null&&jo(r,o.deps)){i.memoizedState=qo(t,n,a,r);return}}q.flags|=e,i.memoizedState=qo(1|t,n,a,r)}function Zo(e,t){return Yo(8390656,8,e,t)}function Qo(e,t){return Xo(2048,8,e,t)}function $o(e,t){return Xo(4,2,e,t)}function es(e,t){return Xo(4,4,e,t)}function ts(e,t){if(typeof t==`function`)return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ns(e,t,n){return n=n==null?null:n.concat([e]),Xo(4,4,ts.bind(null,t,e),n)}function rs(){}function is(e,t){var n=Fo();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&jo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function as(e,t){var n=Fo();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&jo(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function os(e,t,n){return wo&21?(kr(n,t)||(n=It(),q.lanes|=n,Yc|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Fs=!0),e.memoizedState=n)}function ss(e,t){var n=V;V=n!==0&&4>n?n:4,e(!0);var r=Co.transition;Co.transition={};try{e(!1),t()}finally{V=n,Co.transition=r}}function cs(){return Fo().memoizedState}function ls(e,t,n){var r=ml(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},ds(e))fs(t,n);else if(n=Qa(e,t,n,r),n!==null){var i=pl();hl(n,e,r,i),ps(n,t,r)}}function us(e,t,n){var r=ml(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(ds(e))fs(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,kr(s,o)){var c=t.interleaved;c===null?(i.next=i,Za(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}n=Qa(e,t,i,r),n!==null&&(i=pl(),hl(n,e,r,i),ps(n,t,r))}}function ds(e){var t=e.alternate;return e===q||t!==null&&t===q}function fs(e,t){Do=Eo=!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&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Bt(e,n)}}var ms={readContext:Ya,useCallback:Ao,useContext:Ao,useEffect:Ao,useImperativeHandle:Ao,useInsertionEffect:Ao,useLayoutEffect:Ao,useMemo:Ao,useReducer:Ao,useRef:Ao,useState:Ao,useDebugValue:Ao,useDeferredValue:Ao,useTransition:Ao,useMutableSource:Ao,useSyncExternalStore:Ao,useId:Ao,unstable_isNewReconciler:!1},hs={readContext:Ya,useCallback:function(e,t){return Po().memoizedState=[e,t===void 0?null:t],e},useContext:Ya,useEffect:Zo,useImperativeHandle:function(e,t,n){return n=n==null?null:n.concat([e]),Yo(4194308,4,ts.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Yo(4194308,4,e,t)},useInsertionEffect:function(e,t){return Yo(4,2,e,t)},useMemo:function(e,t){var n=Po();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Po();return t=n===void 0?t:n(t),r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=ls.bind(null,q,e),[r.memoizedState,e]},useRef:function(e){var t=Po();return e={current:e},t.memoizedState=e},useState:Ko,useDebugValue:rs,useDeferredValue:function(e){return Po().memoizedState=e},useTransition:function(){var e=Ko(!1),t=e[0];return e=ss.bind(null,e[1]),Po().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=q,a=Po();if(G){if(n===void 0)throw Error(r(407));n=n()}else{if(n=t(),Wc===null)throw Error(r(349));wo&30||Vo(i,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Zo(Uo.bind(null,i,o,e),[e]),i.flags|=2048,qo(9,Ho.bind(null,i,o,n,t),void 0,null),n},useId:function(){var e=Po(),t=Wc.identifierPrefix;if(G){var n=_a,r=ga;n=(r&~(1<<32-Tt(r)-1)).toString(32)+n,t=`:`+t+`R`+n,n=Oo++,0<n&&(t+=`H`+n.toString(32)),t+=`:`}else n=ko++,t=`:`+t+`r`+n.toString(32)+`:`;return e.memoizedState=t},unstable_isNewReconciler:!1},gs={readContext:Ya,useCallback:is,useContext:Ya,useEffect:Qo,useImperativeHandle:ns,useInsertionEffect:$o,useLayoutEffect:es,useMemo:as,useReducer:Lo,useRef:Jo,useState:function(){return Lo(Io)},useDebugValue:rs,useDeferredValue:function(e){return os(Fo(),J.memoizedState,e)},useTransition:function(){return[Lo(Io)[0],Fo().memoizedState]},useMutableSource:zo,useSyncExternalStore:Bo,useId:cs,unstable_isNewReconciler:!1},_s={readContext:Ya,useCallback:is,useContext:Ya,useEffect:Qo,useImperativeHandle:ns,useInsertionEffect:$o,useLayoutEffect:es,useMemo:as,useReducer:Ro,useRef:Jo,useState:function(){return Ro(Io)},useDebugValue:rs,useDeferredValue:function(e){var t=Fo();return J===null?t.memoizedState=e:os(t,J.memoizedState,e)},useTransition:function(){return[Ro(Io)[0],Fo().memoizedState]},useMutableSource:zo,useSyncExternalStore:Bo,useId:cs,unstable_isNewReconciler:!1};function vs(e,t){if(e&&e.defaultProps){for(var n in t=R({},t),e=e.defaultProps,e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function ys(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:R({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var bs={isMounted:function(e){return(e=e._reactInternals)?ot(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=pl(),i=ml(e),a=ro(r,i);a.payload=t,n!=null&&(a.callback=n),t=io(e,a,i),t!==null&&(hl(t,e,i,r),ao(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=pl(),i=ml(e),a=ro(r,i);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=io(e,a,i),t!==null&&(hl(t,e,i,r),ao(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=pl(),r=ml(e),i=ro(n,r);i.tag=2,t!=null&&(i.callback=t),t=io(e,i,r),t!==null&&(hl(t,e,r,n),ao(t,e,r))}};function xs(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?!Ar(n,r)||!Ar(i,a):!0}function Ss(e,t,n){var r=!1,i=Ki,a=t.contextType;return typeof a==`object`&&a?a=Ya(a):(i=Zi(t)?Yi:qi.current,r=t.contextTypes,a=(r=r!=null)?Xi(e,i):Ki),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=bs,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function Cs(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 ws(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},to(e);var a=t.contextType;typeof a==`object`&&a?i.context=Ya(a):(a=Zi(t)?Yi:qi.current,i.context=Xi(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a==`function`&&(ys(e,t,a,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps==`function`||typeof i.getSnapshotBeforeUpdate==`function`||typeof i.UNSAFE_componentWillMount!=`function`&&typeof i.componentWillMount!=`function`||(t=i.state,typeof i.componentWillMount==`function`&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount==`function`&&i.UNSAFE_componentWillMount(),t!==i.state&&bs.enqueueReplaceState(i,i.state,null),so(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount==`function`&&(e.flags|=4194308)}function Ts(e,t){try{var n=``,r=t;do n+=ae(r),r=r.return;while(r);var i=n}catch(e){i=`
7
+ Error generating stack: `+e.message+`
8
+ `+e.stack}return{value:e,source:t,stack:i,digest:null}}function Es(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Ds(e,t){try{console.error(t.value)}catch(e){setTimeout(function(){throw e})}}var Os=typeof WeakMap==`function`?WeakMap:Map;function ks(e,t,n){n=ro(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){rl||(rl=!0,il=r),Ds(e,t)},n}function As(e,t,n){n=ro(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r==`function`){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){Ds(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch==`function`&&(n.callback=function(){Ds(e,t),typeof r!=`function`&&(al===null?al=new Set([this]):al.add(this));var n=t.stack;this.componentDidCatch(t.value,{componentStack:n===null?``:n})}),n}function js(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Os;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)||(i.add(n),e=zl.bind(null,e,t,n),t.then(e,e))}function Ms(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t===null?!0:t.dehydrated!==null),t)return e;e=e.return}while(e!==null);return null}function Ns(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=ro(-1,1),t.tag=2,io(n,t,1))),n.lanes|=1),e)}var Ps=C.ReactCurrentOwner,Fs=!1;function Is(e,t,n,r){t.child=e===null?Ba(t,null,n,r):za(t,e.child,n,r)}function Ls(e,t,n,r,i){n=n.render;var a=t.ref;return Ja(t,i),r=Mo(e,t,n,r,a,i),n=No(),e!==null&&!Fs?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,rc(e,t,i)):(G&&n&&ba(t),t.flags|=1,Is(e,t,r,i),t.child)}function Rs(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ql(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,zs(e,t,a,r,i)):(e=Xl(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,(e.lanes&i)===0){var o=a.memoizedProps;if(n=n.compare,n=n===null?Ar:n,n(o,r)&&e.ref===t.ref)return rc(e,t,i)}return t.flags|=1,e=Yl(a,r),e.ref=t.ref,e.return=t,t.child=e}function zs(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Ar(a,r)&&e.ref===t.ref)if(Fs=!1,t.pendingProps=r=a,(e.lanes&i)!==0)e.flags&131072&&(Fs=!0);else return t.lanes=e.lanes,rc(e,t,i)}return Hs(e,t,n,r,i)}function Bs(e,t,n){var r=t.pendingProps,i=r.children,a=e===null?null:e.memoizedState;if(r.mode===`hidden`)if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},W(qc,Kc),Kc|=n;else{if(!(n&1073741824))return e=a===null?n:a.baseLanes|n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,W(qc,Kc),Kc|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a===null?n:a.baseLanes,W(qc,Kc),Kc|=r}else a===null?r=n:(r=a.baseLanes|n,t.memoizedState=null),W(qc,Kc),Kc|=r;return Is(e,t,i,n),t.child}function Vs(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Hs(e,t,n,r,i){var a=Zi(n)?Yi:qi.current;return a=Xi(t,a),Ja(t,i),n=Mo(e,t,n,r,a,i),r=No(),e!==null&&!Fs?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,rc(e,t,i)):(G&&r&&ba(t),t.flags|=1,Is(e,t,n,i),t.child)}function Us(e,t,n,r,i){if(Zi(n)){var a=!0;ta(t)}else a=!1;if(Ja(t,i),t.stateNode===null)nc(e,t),Ss(t,n,r),ws(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,s=t.memoizedProps;o.props=s;var c=o.context,l=n.contextType;typeof l==`object`&&l?l=Ya(l):(l=Zi(n)?Yi:qi.current,l=Xi(t,l));var u=n.getDerivedStateFromProps,d=typeof u==`function`||typeof o.getSnapshotBeforeUpdate==`function`;d||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==r||c!==l)&&Cs(t,o,r,l),eo=!1;var f=t.memoizedState;o.state=f,so(t,r,o,i),c=t.memoizedState,s!==r||f!==c||Ji.current||eo?(typeof u==`function`&&(ys(t,n,u,r),c=t.memoizedState),(s=eo||xs(t,n,s,r,f,c,l))?(d||typeof o.UNSAFE_componentWillMount!=`function`&&typeof o.componentWillMount!=`function`||(typeof o.componentWillMount==`function`&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount==`function`&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount==`function`&&(t.flags|=4194308)):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),o.props=r,o.state=c,o.context=l,r=s):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,no(e,t),s=t.memoizedProps,l=t.type===t.elementType?s:vs(t.type,s),o.props=l,d=t.pendingProps,f=o.context,c=n.contextType,typeof c==`object`&&c?c=Ya(c):(c=Zi(n)?Yi:qi.current,c=Xi(t,c));var p=n.getDerivedStateFromProps;(u=typeof p==`function`||typeof o.getSnapshotBeforeUpdate==`function`)||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==d||f!==c)&&Cs(t,o,r,c),eo=!1,f=t.memoizedState,o.state=f,so(t,r,o,i);var m=t.memoizedState;s!==d||f!==m||Ji.current||eo?(typeof p==`function`&&(ys(t,n,p,r),m=t.memoizedState),(l=eo||xs(t,n,l,r,f,m,c)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!=`function`&&typeof o.componentWillUpdate!=`function`||(typeof o.componentWillUpdate==`function`&&o.componentWillUpdate(r,m,c),typeof o.UNSAFE_componentWillUpdate==`function`&&o.UNSAFE_componentWillUpdate(r,m,c)),typeof o.componentDidUpdate==`function`&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=c,r=l):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Ws(e,t,n,r,a,i)}function Ws(e,t,n,r,i,a){Vs(e,t);var o=(t.flags&128)!=0;if(!r&&!o)return i&&na(t,n,!1),rc(e,t,a);r=t.stateNode,Ps.current=t;var s=o&&typeof n.getDerivedStateFromError!=`function`?null:r.render();return t.flags|=1,e!==null&&o?(t.child=za(t,e.child,null,a),t.child=za(t,null,s,a)):Is(e,t,s,a),t.memoizedState=r.state,i&&na(t,n,!0),t.child}function Gs(e){var t=e.stateNode;t.pendingContext?$i(e,t.pendingContext,t.pendingContext!==t.context):t.context&&$i(e,t.context,!1),ho(e,t.containerInfo)}function Ks(e,t,n,r,i){return Ma(),Na(i),t.flags|=256,Is(e,t,n,r),t.child}var qs={dehydrated:null,treeContext:null,retryLane:0};function Js(e){return{baseLanes:e,cachePool:null,transitions:null}}function Ys(e,t,n){var r=t.pendingProps,i=K.current,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(i&2)!=0),s?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),W(K,i&1),e===null)return Oa(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data===`$!`?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,a?(r=t.mode,a=t.child,o={mode:`hidden`,children:o},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=Ql(o,r,0,null),e=Zl(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Js(n),t.memoizedState=qs,e):Xs(t,o));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return Qs(e,t,o,r,s,i,n);if(a){a=r.fallback,o=t.mode,i=e.child,s=i.sibling;var c={mode:`hidden`,children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=Yl(i,c),r.subtreeFlags=i.subtreeFlags&14680064),s===null?(a=Zl(a,o,n,null),a.flags|=2):a=Yl(s,a),a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,o=e.child.memoizedState,o=o===null?Js(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=qs,r}return a=e.child,e=a.sibling,r=Yl(a,{mode:`visible`,children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Xs(e,t){return t=Ql({mode:`visible`,children:t},e.mode,0,null),t.return=e,e.child=t}function Zs(e,t,n,r){return r!==null&&Na(r),za(t,e.child,null,n),e=Xs(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Qs(e,t,n,i,a,o,s){if(n)return t.flags&256?(t.flags&=-257,i=Es(Error(r(422))),Zs(e,t,s,i)):t.memoizedState===null?(o=i.fallback,a=t.mode,i=Ql({mode:`visible`,children:i.children},a,0,null),o=Zl(o,a,s,null),o.flags|=2,i.return=t,o.return=t,i.sibling=o,t.child=i,t.mode&1&&za(t,e.child,null,s),t.child.memoizedState=Js(s),t.memoizedState=qs,o):(t.child=e.child,t.flags|=128,null);if(!(t.mode&1))return Zs(e,t,s,null);if(a.data===`$!`){if(i=a.nextSibling&&a.nextSibling.dataset,i)var c=i.dgst;return i=c,o=Error(r(419)),i=Es(o,i,void 0),Zs(e,t,s,i)}if(c=(s&e.childLanes)!==0,Fs||c){if(i=Wc,i!==null){switch(s&-s){case 4:a=2;break;case 16:a=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}a=(a&(i.suspendedLanes|s))===0?a:0,a!==0&&a!==o.retryLane&&(o.retryLane=a,$a(e,a),hl(i,e,a,-1))}return kl(),i=Es(Error(r(421))),Zs(e,t,s,i)}return a.data===`$?`?(t.flags|=128,t.child=e.child,t=Vl.bind(null,e),a._reactRetry=t,null):(e=o.treeContext,Ca=Ai(a.nextSibling),Sa=t,G=!0,wa=null,e!==null&&(pa[ma++]=ga,pa[ma++]=_a,pa[ma++]=ha,ga=e.id,_a=e.overflow,ha=t),t=Xs(t,i.children),t.flags|=4096,t)}function $s(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),qa(e.return,t,n)}function ec(e,t,n,r,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function tc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(Is(e,t,r.children,n),r=K.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&$s(e,n,t);else if(e.tag===19)$s(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}r&=1}if(W(K,r),!(t.mode&1))t.memoizedState=null;else switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&yo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),ec(t,!1,i,n,a);break;case`backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&yo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}ec(t,!0,n,null,a);break;case`together`:ec(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function nc(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function rc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Yc|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(r(153));if(t.child!==null){for(e=t.child,n=Yl(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Yl(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function ic(e,t,n){switch(t.tag){case 3:Gs(t),Ma();break;case 5:_o(t);break;case 1:Zi(t.type)&&ta(t);break;case 4:ho(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;W(Va,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(W(K,K.current&1),e=rc(e,t,n),e===null?null:e.sibling):Ys(e,t,n):(W(K,K.current&1),t.flags|=128,null);W(K,K.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){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),W(K,K.current),r)break;return null;case 22:case 23:return t.lanes=0,Bs(e,t,n)}return rc(e,t,n)}var ac=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},oc=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,mo(uo.current);var o=null;switch(n){case`input`:i=me(e,i),r=me(e,r),o=[];break;case`select`:i=R({},i,{value:void 0}),r=R({},r,{value:void 0}),o=[];break;case`textarea`:i=xe(e,i),r=xe(e,r),o=[];break;default:typeof i.onClick!=`function`&&typeof r.onClick==`function`&&(e.onclick=bi)}Fe(n,r);var s;for(u in n=null,i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u===`style`){var c=i[u];for(s in c)c.hasOwnProperty(s)&&(n||={},n[s]=``)}else u!==`dangerouslySetInnerHTML`&&u!==`children`&&u!==`suppressContentEditableWarning`&&u!==`suppressHydrationWarning`&&u!==`autoFocus`&&(a.hasOwnProperty(u)?o||=[]:(o||=[]).push(u,null));for(u in r){var l=r[u];if(c=i?.[u],r.hasOwnProperty(u)&&l!==c&&(l!=null||c!=null))if(u===`style`)if(c){for(s in c)!c.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||={},n[s]=``);for(s in l)l.hasOwnProperty(s)&&c[s]!==l[s]&&(n||={},n[s]=l[s])}else n||(o||=[],o.push(u,n)),n=l;else u===`dangerouslySetInnerHTML`?(l=l?l.__html:void 0,c=c?c.__html:void 0,l!=null&&c!==l&&(o||=[]).push(u,l)):u===`children`?typeof l!=`string`&&typeof l!=`number`||(o||=[]).push(u,``+l):u!==`suppressContentEditableWarning`&&u!==`suppressHydrationWarning`&&(a.hasOwnProperty(u)?(l!=null&&u===`onScroll`&&H(`scroll`,e),o||c===l||(o=[])):(o||=[]).push(u,l))}n&&(o||=[]).push(`style`,n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}},sc=function(e,t,n,r){n!==r&&(t.flags|=4)};function cc(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 lc(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&14680064,r|=i.flags&14680064,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 uc(e,t,n){var i=t.pendingProps;switch(xa(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return lc(t),null;case 1:return Zi(t.type)&&Qi(),lc(t),null;case 3:return i=t.stateNode,go(),U(Ji),U(qi),xo(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Aa(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,wa!==null&&(yl(wa),wa=null))),lc(t),null;case 5:vo(t);var o=mo(po.current);if(n=t.type,e!==null&&t.stateNode!=null)oc(e,t,n,i,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(r(166));return lc(t),null}if(e=mo(uo.current),Aa(t)){i=t.stateNode,n=t.type;var s=t.memoizedProps;switch(i[Ni]=t,i[Pi]=s,e=(t.mode&1)!=0,n){case`dialog`:H(`cancel`,i),H(`close`,i);break;case`iframe`:case`object`:case`embed`:H(`load`,i);break;case`video`:case`audio`:for(o=0;o<ri.length;o++)H(ri[o],i);break;case`source`:H(`error`,i);break;case`img`:case`image`:case`link`:H(`error`,i),H(`load`,i);break;case`details`:H(`toggle`,i);break;case`input`:he(i,s),H(`invalid`,i);break;case`select`:i._wrapperState={wasMultiple:!!s.multiple},H(`invalid`,i);break;case`textarea`:Se(i,s),H(`invalid`,i)}for(var c in Fe(n,s),o=null,s)if(s.hasOwnProperty(c)){var l=s[c];c===`children`?typeof l==`string`?i.textContent!==l&&(!0!==s.suppressHydrationWarning&&yi(i.textContent,l,e),o=[`children`,l]):typeof l==`number`&&i.textContent!==``+l&&(!0!==s.suppressHydrationWarning&&yi(i.textContent,l,e),o=[`children`,``+l]):a.hasOwnProperty(c)&&l!=null&&c===`onScroll`&&H(`scroll`,i)}switch(n){case`input`:de(i),ve(i,s,!0);break;case`textarea`:de(i),we(i);break;case`select`:case`option`:break;default:typeof s.onClick==`function`&&(i.onclick=bi)}i=o,t.updateQueue=i,i!==null&&(t.flags|=4)}else{c=o.nodeType===9?o:o.ownerDocument,e===`http://www.w3.org/1999/xhtml`&&(e=Te(n)),e===`http://www.w3.org/1999/xhtml`?n===`script`?(e=c.createElement(`div`),e.innerHTML=`<script><\/script>`,e=e.removeChild(e.firstChild)):typeof i.is==`string`?e=c.createElement(n,{is:i.is}):(e=c.createElement(n),n===`select`&&(c=e,i.multiple?c.multiple=!0:i.size&&(c.size=i.size))):e=c.createElementNS(e,n),e[Ni]=t,e[Pi]=i,ac(e,t,!1,!1),t.stateNode=e;a:{switch(c=Ie(n,i),n){case`dialog`:H(`cancel`,e),H(`close`,e),o=i;break;case`iframe`:case`object`:case`embed`:H(`load`,e),o=i;break;case`video`:case`audio`:for(o=0;o<ri.length;o++)H(ri[o],e);o=i;break;case`source`:H(`error`,e),o=i;break;case`img`:case`image`:case`link`:H(`error`,e),H(`load`,e),o=i;break;case`details`:H(`toggle`,e),o=i;break;case`input`:he(e,i),o=me(e,i),H(`invalid`,e);break;case`option`:o=i;break;case`select`:e._wrapperState={wasMultiple:!!i.multiple},o=R({},i,{value:void 0}),H(`invalid`,e);break;case`textarea`:Se(e,i),o=xe(e,i),H(`invalid`,e);break;default:o=i}for(s in Fe(n,o),l=o,l)if(l.hasOwnProperty(s)){var u=l[s];s===`style`?Ne(e,u):s===`dangerouslySetInnerHTML`?(u=u?u.__html:void 0,u!=null&&Oe(e,u)):s===`children`?typeof u==`string`?(n!==`textarea`||u!==``)&&ke(e,u):typeof u==`number`&&ke(e,``+u):s!==`suppressContentEditableWarning`&&s!==`suppressHydrationWarning`&&s!==`autoFocus`&&(a.hasOwnProperty(s)?u!=null&&s===`onScroll`&&H(`scroll`,e):u!=null&&S(e,s,u,c))}switch(n){case`input`:de(e),ve(e,i,!1);break;case`textarea`:de(e),we(e);break;case`option`:i.value!=null&&e.setAttribute(`value`,``+ce(i.value));break;case`select`:e.multiple=!!i.multiple,s=i.value,s==null?i.defaultValue!=null&&be(e,!!i.multiple,i.defaultValue,!0):be(e,!!i.multiple,s,!1);break;default:typeof o.onClick==`function`&&(e.onclick=bi)}switch(n){case`button`:case`input`:case`select`:case`textarea`:i=!!i.autoFocus;break a;case`img`:i=!0;break a;default:i=!1}}i&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return lc(t),null;case 6:if(e&&t.stateNode!=null)sc(e,t,e.memoizedProps,i);else{if(typeof i!=`string`&&t.stateNode===null)throw Error(r(166));if(n=mo(po.current),mo(uo.current),Aa(t)){if(i=t.stateNode,n=t.memoizedProps,i[Ni]=t,(s=i.nodeValue!==n)&&(e=Sa,e!==null))switch(e.tag){case 3:yi(i.nodeValue,n,(e.mode&1)!=0);break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&yi(i.nodeValue,n,(e.mode&1)!=0)}s&&(t.flags|=4)}else i=(n.nodeType===9?n:n.ownerDocument).createTextNode(i),i[Ni]=t,t.stateNode=i}return lc(t),null;case 13:if(U(K),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(G&&Ca!==null&&t.mode&1&&!(t.flags&128))ja(),Ma(),t.flags|=98560,s=!1;else if(s=Aa(t),i!==null&&i.dehydrated!==null){if(e===null){if(!s)throw Error(r(318));if(s=t.memoizedState,s=s===null?null:s.dehydrated,!s)throw Error(r(317));s[Ni]=t}else Ma(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;lc(t),s=!1}else wa!==null&&(yl(wa),wa=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(i=i!==null,i!==(e!==null&&e.memoizedState!==null)&&i&&(t.child.flags|=8192,t.mode&1&&(e===null||K.current&1?Q===0&&(Q=3):kl())),t.updateQueue!==null&&(t.flags|=4),lc(t),null);case 4:return go(),e===null&&li(t.stateNode.containerInfo),lc(t),null;case 10:return Ka(t.type._context),lc(t),null;case 17:return Zi(t.type)&&Qi(),lc(t),null;case 19:if(U(K),s=t.memoizedState,s===null)return lc(t),null;if(i=(t.flags&128)!=0,c=s.rendering,c===null)if(i)cc(s,!1);else{if(Q!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(c=yo(e),c!==null){for(t.flags|=128,cc(s,!1),i=c.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=n,n=t.child;n!==null;)s=n,e=i,s.flags&=14680066,c=s.alternate,c===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=c.childLanes,s.lanes=c.lanes,s.child=c.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=c.memoizedProps,s.memoizedState=c.memoizedState,s.updateQueue=c.updateQueue,s.type=c.type,e=c.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return W(K,K.current&1|2),t.child}e=e.sibling}s.tail!==null&&B()>tl&&(t.flags|=128,i=!0,cc(s,!1),t.lanes=4194304)}else{if(!i)if(e=yo(c),e!==null){if(t.flags|=128,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),cc(s,!0),s.tail===null&&s.tailMode===`hidden`&&!c.alternate&&!G)return lc(t),null}else 2*B()-s.renderingStartTime>tl&&n!==1073741824&&(t.flags|=128,i=!0,cc(s,!1),t.lanes=4194304);s.isBackwards?(c.sibling=t.child,t.child=c):(n=s.last,n===null?t.child=c:n.sibling=c,s.last=c)}return s.tail===null?(lc(t),null):(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=B(),t.sibling=null,n=K.current,W(K,i?n&1|2:n&1),t);case 22:case 23:return Tl(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?Kc&1073741824&&(lc(t),t.subtreeFlags&6&&(t.flags|=8192)):lc(t),null;case 24:return null;case 25:return null}throw Error(r(156,t.tag))}function dc(e,t){switch(xa(t),t.tag){case 1:return Zi(t.type)&&Qi(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return go(),U(Ji),U(qi),xo(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return vo(t),null;case 13:if(U(K),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));Ma()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return U(K),null;case 4:return go(),null;case 10:return Ka(t.type._context),null;case 22:case 23:return Tl(),null;case 24:return null;default:return null}}var fc=!1,pc=!1,mc=typeof WeakSet==`function`?WeakSet:Set,Y=null;function hc(e,t){var n=e.ref;if(n!==null)if(typeof n==`function`)try{n(null)}catch(n){$(e,t,n)}else n.current=null}function gc(e,t,n){try{n()}catch(n){$(e,t,n)}}var _c=!1;function vc(e,t){if(xi=pn,e=Pr(),Fr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.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||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===i&&(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(Si={focusedElem:e,selectionRange:n},pn=!1,Y=t;Y!==null;)if(t=Y,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,Y=e;else for(;Y!==null;){t=Y;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var g=h.memoizedProps,_=h.memoizedState,v=t.stateNode;v.__reactInternalSnapshotBeforeUpdate=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:vs(t.type,g),_)}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent=``:y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(e){$(t,t.return,e)}if(e=t.sibling,e!==null){e.return=t.return,Y=e;break}Y=t.return}return h=_c,_c=!1,h}function yc(e,t,n){var r=t.updateQueue;if(r=r===null?null:r.lastEffect,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&gc(t,n,a)}i=i.next}while(i!==r)}}function bc(e,t){if(t=t.updateQueue,t=t===null?null:t.lastEffect,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function xc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t==`function`?t(e):t.current=e}}function Sc(e){var t=e.alternate;t!==null&&(e.alternate=null,Sc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ni],delete t[Pi],delete t[Ii],delete t[Li],delete t[Ri])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Cc(e){return e.tag===5||e.tag===3||e.tag===4}function wc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Cc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Tc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=bi));else if(r!==4&&(e=e.child,e!==null))for(Tc(e,t,n),e=e.sibling;e!==null;)Tc(e,t,n),e=e.sibling}function Ec(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Ec(e,t,n),e=e.sibling;e!==null;)Ec(e,t,n),e=e.sibling}var Dc=null,Oc=!1;function kc(e,t,n){for(n=n.child;n!==null;)Ac(e,t,n),n=n.sibling}function Ac(e,t,n){if(Ct&&typeof Ct.onCommitFiberUnmount==`function`)try{Ct.onCommitFiberUnmount(St,n)}catch{}switch(n.tag){case 5:pc||hc(n,t);case 6:var r=Dc,i=Oc;Dc=null,kc(e,t,n),Dc=r,Oc=i,Dc!==null&&(Oc?(e=Dc,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Dc.removeChild(n.stateNode));break;case 18:Dc!==null&&(Oc?(e=Dc,n=n.stateNode,e.nodeType===8?ki(e.parentNode,n):e.nodeType===1&&ki(e,n),dn(e)):ki(Dc,n.stateNode));break;case 4:r=Dc,i=Oc,Dc=n.stateNode.containerInfo,Oc=!0,kc(e,t,n),Dc=r,Oc=i;break;case 0:case 11:case 14:case 15:if(!pc&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&gc(n,t,o),i=i.next}while(i!==r)}kc(e,t,n);break;case 1:if(!pc&&(hc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){$(n,t,e)}kc(e,t,n);break;case 21:kc(e,t,n);break;case 22:n.mode&1?(pc=(r=pc)||n.memoizedState!==null,kc(e,t,n),pc=r):kc(e,t,n);break;default:kc(e,t,n)}}function jc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new mc),t.forEach(function(t){var r=Hl.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function Mc(e,t){var n=t.deletions;if(n!==null)for(var i=0;i<n.length;i++){var a=n[i];try{var o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 5:Dc=c.stateNode,Oc=!1;break a;case 3:Dc=c.stateNode.containerInfo,Oc=!0;break a;case 4:Dc=c.stateNode.containerInfo,Oc=!0;break a}c=c.return}if(Dc===null)throw Error(r(160));Ac(o,s,a),Dc=null,Oc=!1;var l=a.alternate;l!==null&&(l.return=null),a.return=null}catch(e){$(a,t,e)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Nc(t,e),t=t.sibling}function Nc(e,t){var n=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Mc(t,e),Pc(e),i&4){try{yc(3,e,e.return),bc(3,e)}catch(t){$(e,e.return,t)}try{yc(5,e,e.return)}catch(t){$(e,e.return,t)}}break;case 1:Mc(t,e),Pc(e),i&512&&n!==null&&hc(n,n.return);break;case 5:if(Mc(t,e),Pc(e),i&512&&n!==null&&hc(n,n.return),e.flags&32){var a=e.stateNode;try{ke(a,``)}catch(t){$(e,e.return,t)}}if(i&4&&(a=e.stateNode,a!=null)){var o=e.memoizedProps,s=n===null?o:n.memoizedProps,c=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{c===`input`&&o.type===`radio`&&o.name!=null&&ge(a,o),Ie(c,s);var u=Ie(c,o);for(s=0;s<l.length;s+=2){var d=l[s],f=l[s+1];d===`style`?Ne(a,f):d===`dangerouslySetInnerHTML`?Oe(a,f):d===`children`?ke(a,f):S(a,d,f,u)}switch(c){case`input`:_e(a,o);break;case`textarea`:Ce(a,o);break;case`select`:var p=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!o.multiple;var m=o.value;m==null?p!==!!o.multiple&&(o.defaultValue==null?be(a,!!o.multiple,o.multiple?[]:``,!1):be(a,!!o.multiple,o.defaultValue,!0)):be(a,!!o.multiple,m,!1)}a[Pi]=o}catch(t){$(e,e.return,t)}}break;case 6:if(Mc(t,e),Pc(e),i&4){if(e.stateNode===null)throw Error(r(162));a=e.stateNode,o=e.memoizedProps;try{a.nodeValue=o}catch(t){$(e,e.return,t)}}break;case 3:if(Mc(t,e),Pc(e),i&4&&n!==null&&n.memoizedState.isDehydrated)try{dn(t.containerInfo)}catch(t){$(e,e.return,t)}break;case 4:Mc(t,e),Pc(e);break;case 13:Mc(t,e),Pc(e),a=e.child,a.flags&8192&&(o=a.memoizedState!==null,a.stateNode.isHidden=o,!o||a.alternate!==null&&a.alternate.memoizedState!==null||(el=B())),i&4&&jc(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(pc=(u=pc)||d,Mc(t,e),pc=u):Mc(t,e),Pc(e),i&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(Y=e,d=e.child;d!==null;){for(f=Y=d;Y!==null;){switch(p=Y,m=p.child,p.tag){case 0:case 11:case 14:case 15:yc(4,p,p.return);break;case 1:hc(p,p.return);var h=p.stateNode;if(typeof h.componentWillUnmount==`function`){i=p,n=p.return;try{t=i,h.props=t.memoizedProps,h.state=t.memoizedState,h.componentWillUnmount()}catch(e){$(i,n,e)}}break;case 5:hc(p,p.return);break;case 22:if(p.memoizedState!==null){Rc(f);continue}}m===null?Rc(f):(m.return=p,Y=m)}d=d.sibling}a:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{a=f.stateNode,u?(o=a.style,typeof o.setProperty==`function`?o.setProperty(`display`,`none`,`important`):o.display=`none`):(c=f.stateNode,l=f.memoizedProps.style,s=l!=null&&l.hasOwnProperty(`display`)?l.display:null,c.style.display=Me(`display`,s))}catch(t){$(e,e.return,t)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?``:f.memoizedProps}catch(t){$(e,e.return,t)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break a;for(;f.sibling===null;){if(f.return===null||f.return===e)break a;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Mc(t,e),Pc(e),i&4&&jc(e);break;case 21:break;default:Mc(t,e),Pc(e)}}function Pc(e){var t=e.flags;if(t&2){try{a:{for(var n=e.return;n!==null;){if(Cc(n)){var i=n;break a}n=n.return}throw Error(r(160))}switch(i.tag){case 5:var a=i.stateNode;i.flags&32&&(ke(a,``),i.flags&=-33),Ec(e,wc(e),a);break;case 3:case 4:var o=i.stateNode.containerInfo;Tc(e,wc(e),o);break;default:throw Error(r(161))}}catch(t){$(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Fc(e,t,n){Y=e,Ic(e,t,n)}function Ic(e,t,n){for(var r=(e.mode&1)!=0;Y!==null;){var i=Y,a=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||fc;if(!o){var s=i.alternate,c=s!==null&&s.memoizedState!==null||pc;s=fc;var l=pc;if(fc=o,(pc=c)&&!l)for(Y=i;Y!==null;)o=Y,c=o.child,o.tag===22&&o.memoizedState!==null||c===null?zc(i):(c.return=o,Y=c);for(;a!==null;)Y=a,Ic(a,t,n),a=a.sibling;Y=i,fc=s,pc=l}Lc(e,t,n)}else i.subtreeFlags&8772&&a!==null?(a.return=i,Y=a):Lc(e,t,n)}}function Lc(e){for(;Y!==null;){var t=Y;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:pc||bc(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!pc)if(n===null)i.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:vs(t.type,n.memoizedProps);i.componentDidUpdate(a,n.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&co(t,o,i);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}co(t,s,n)}break;case 5:var c=t.stateNode;if(n===null&&t.flags&4){n=c;var l=t.memoizedProps;switch(t.type){case`button`:case`input`:case`select`:case`textarea`:l.autoFocus&&n.focus();break;case`img`:l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&dn(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}pc||t.flags&512&&xc(t)}catch(e){$(t,t.return,e)}}if(t===e){Y=null;break}if(n=t.sibling,n!==null){n.return=t.return,Y=n;break}Y=t.return}}function Rc(e){for(;Y!==null;){var t=Y;if(t===e){Y=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Y=n;break}Y=t.return}}function zc(e){for(;Y!==null;){var t=Y;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{bc(4,t)}catch(e){$(t,n,e)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount==`function`){var i=t.return;try{r.componentDidMount()}catch(e){$(t,i,e)}}var a=t.return;try{xc(t)}catch(e){$(t,a,e)}break;case 5:var o=t.return;try{xc(t)}catch(e){$(t,o,e)}}}catch(e){$(t,t.return,e)}if(t===e){Y=null;break}var s=t.sibling;if(s!==null){s.return=t.return,Y=s;break}Y=t.return}}var Bc=Math.ceil,Vc=C.ReactCurrentDispatcher,Hc=C.ReactCurrentOwner,Uc=C.ReactCurrentBatchConfig,X=0,Wc=null,Z=null,Gc=0,Kc=0,qc=Gi(0),Q=0,Jc=null,Yc=0,Xc=0,Zc=0,Qc=null,$c=null,el=0,tl=1/0,nl=null,rl=!1,il=null,al=null,ol=!1,sl=null,cl=0,ll=0,ul=null,dl=-1,fl=0;function pl(){return X&6?B():dl===-1?dl=B():dl}function ml(e){return e.mode&1?X&2&&Gc!==0?Gc&-Gc:Pa.transition===null?(e=V,e===0?(e=window.event,e=e===void 0?16:yn(e.type),e):e):(fl===0&&(fl=It()),fl):1}function hl(e,t,n,i){if(50<ll)throw ll=0,ul=null,Error(r(185));Rt(e,n,i),(!(X&2)||e!==Wc)&&(e===Wc&&(!(X&2)&&(Xc|=n),Q===4&&xl(e,Gc)),gl(e,i),n===1&&X===0&&!(t.mode&1)&&(tl=B()+500,ia&&ca()))}function gl(e,t){var n=e.callbackNode;Pt(e,t);var r=Mt(e,e===Wc?Gc:0);if(r===0)n!==null&&pt(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&pt(n),t===1)e.tag===0?sa(Sl.bind(null,e)):oa(Sl.bind(null,e)),Di(function(){!(X&6)&&ca()}),n=null;else{switch(Vt(r)){case 1:n=_t;break;case 4:n=vt;break;case 16:n=yt;break;case 536870912:n=xt;break;default:n=yt}n=Wl(n,_l.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function _l(e,t){if(dl=-1,fl=0,X&6)throw Error(r(327));var n=e.callbackNode;if(Ll()&&e.callbackNode!==n)return null;var i=Mt(e,e===Wc?Gc:0);if(i===0)return null;if(i&30||(i&e.expiredLanes)!==0||t)t=Al(e,i);else{t=i;var a=X;X|=2;var o=Ol();(Wc!==e||Gc!==t)&&(nl=null,tl=B()+500,El(e,t));do try{Ml();break}catch(t){Dl(e,t)}while(1);Ga(),Vc.current=o,X=a,Z===null?(Wc=null,Gc=0,t=Q):t=0}if(t!==0){if(t===2&&(a=Ft(e),a!==0&&(i=a,t=vl(e,a))),t===1)throw n=Jc,El(e,0),xl(e,i),gl(e,B()),n;if(t===6)xl(e,i);else{if(a=e.current.alternate,!(i&30)&&!bl(a)&&(t=Al(e,i),t===2&&(o=Ft(e),o!==0&&(i=o,t=vl(e,o))),t===1))throw n=Jc,El(e,0),xl(e,i),gl(e,B()),n;switch(e.finishedWork=a,e.finishedLanes=i,t){case 0:case 1:throw Error(r(345));case 2:Fl(e,$c,nl);break;case 3:if(xl(e,i),(i&130023424)===i&&(t=el+500-B(),10<t)){if(Mt(e,0)!==0)break;if(a=e.suspendedLanes,(a&i)!==i){pl(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=wi(Fl.bind(null,e,$c,nl),t);break}Fl(e,$c,nl);break;case 4:if(xl(e,i),(i&4194240)===i)break;for(t=e.eventTimes,a=-1;0<i;){var s=31-Tt(i);o=1<<s,s=t[s],s>a&&(a=s),i&=~o}if(i=a,i=B()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Bc(i/1960))-i,10<i){e.timeoutHandle=wi(Fl.bind(null,e,$c,nl),i);break}Fl(e,$c,nl);break;case 5:Fl(e,$c,nl);break;default:throw Error(r(329))}}}return gl(e,B()),e.callbackNode===n?_l.bind(null,e):null}function vl(e,t){var n=Qc;return e.current.memoizedState.isDehydrated&&(El(e,t).flags|=256),e=Al(e,t),e!==2&&(t=$c,$c=n,t!==null&&yl(t)),e}function yl(e){$c===null?$c=e:$c.push.apply($c,e)}function bl(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!kr(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 xl(e,t){for(t&=~Zc,t&=~Xc,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Tt(t),r=1<<n;e[n]=-1,t&=~r}}function Sl(e){if(X&6)throw Error(r(327));Ll();var t=Mt(e,0);if(!(t&1))return gl(e,B()),null;var n=Al(e,t);if(e.tag!==0&&n===2){var i=Ft(e);i!==0&&(t=i,n=vl(e,i))}if(n===1)throw n=Jc,El(e,0),xl(e,t),gl(e,B()),n;if(n===6)throw Error(r(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Fl(e,$c,nl),gl(e,B()),null}function Cl(e,t){var n=X;X|=1;try{return e(t)}finally{X=n,X===0&&(tl=B()+500,ia&&ca())}}function wl(e){sl!==null&&sl.tag===0&&!(X&6)&&Ll();var t=X;X|=1;var n=Uc.transition,r=V;try{if(Uc.transition=null,V=1,e)return e()}finally{V=r,Uc.transition=n,X=t,!(X&6)&&ca()}}function Tl(){Kc=qc.current,U(qc)}function El(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Ti(n)),Z!==null)for(n=Z.return;n!==null;){var r=n;switch(xa(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Qi();break;case 3:go(),U(Ji),U(qi),xo();break;case 5:vo(r);break;case 4:go();break;case 13:U(K);break;case 19:U(K);break;case 10:Ka(r.type._context);break;case 22:case 23:Tl()}n=n.return}if(Wc=e,Z=e=Yl(e.current,null),Gc=Kc=t,Q=0,Jc=null,Zc=Xc=Yc=0,$c=Qc=null,Xa!==null){for(t=0;t<Xa.length;t++)if(n=Xa[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,a=n.pending;if(a!==null){var o=a.next;a.next=i,r.next=o}n.pending=r}Xa=null}return e}function Dl(e,t){do{var n=Z;try{if(Ga(),So.current=ms,Eo){for(var i=q.memoizedState;i!==null;){var a=i.queue;a!==null&&(a.pending=null),i=i.next}Eo=!1}if(wo=0,To=J=q=null,Do=!1,Oo=0,Hc.current=null,n===null||n.return===null){Q=1,Jc=t,Z=null;break}a:{var o=e,s=n.return,c=n,l=t;if(t=Gc,c.flags|=32768,typeof l==`object`&&l&&typeof l.then==`function`){var u=l,d=c,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=Ms(s);if(m!==null){m.flags&=-257,Ns(m,s,c,o,t),m.mode&1&&js(o,u,t),t=m,l=u;var h=t.updateQueue;if(h===null){var g=new Set;g.add(l),t.updateQueue=g}else h.add(l);break a}else{if(!(t&1)){js(o,u,t),kl();break a}l=Error(r(426))}}else if(G&&c.mode&1){var _=Ms(s);if(_!==null){!(_.flags&65536)&&(_.flags|=256),Ns(_,s,c,o,t),Na(Ts(l,c));break a}}o=l=Ts(l,c),Q!==4&&(Q=2),Qc===null?Qc=[o]:Qc.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var v=ks(o,l,t);oo(o,v);break a;case 1:c=l;var y=o.type,b=o.stateNode;if(!(o.flags&128)&&(typeof y.getDerivedStateFromError==`function`||b!==null&&typeof b.componentDidCatch==`function`&&(al===null||!al.has(b)))){o.flags|=65536,t&=-t,o.lanes|=t;var x=As(o,c,t);oo(o,x);break a}}o=o.return}while(o!==null)}Pl(n)}catch(e){t=e,Z===n&&n!==null&&(Z=n=n.return);continue}break}while(1)}function Ol(){var e=Vc.current;return Vc.current=ms,e===null?ms:e}function kl(){(Q===0||Q===3||Q===2)&&(Q=4),Wc===null||!(Yc&268435455)&&!(Xc&268435455)||xl(Wc,Gc)}function Al(e,t){var n=X;X|=2;var i=Ol();(Wc!==e||Gc!==t)&&(nl=null,El(e,t));do try{jl();break}catch(t){Dl(e,t)}while(1);if(Ga(),X=n,Vc.current=i,Z!==null)throw Error(r(261));return Wc=null,Gc=0,Q}function jl(){for(;Z!==null;)Nl(Z)}function Ml(){for(;Z!==null&&!mt();)Nl(Z)}function Nl(e){var t=Ul(e.alternate,e,Kc);e.memoizedProps=e.pendingProps,t===null?Pl(e):Z=t,Hc.current=null}function Pl(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=dc(n,t),n!==null){n.flags&=32767,Z=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Q=6,Z=null;return}}else if(n=uc(n,t,Kc),n!==null){Z=n;return}if(t=t.sibling,t!==null){Z=t;return}Z=t=e}while(t!==null);Q===0&&(Q=5)}function Fl(e,t,n){var r=V,i=Uc.transition;try{Uc.transition=null,V=1,Il(e,t,n,r)}finally{Uc.transition=i,V=r}return null}function Il(e,t,n,i){do Ll();while(sl!==null);if(X&6)throw Error(r(327));n=e.finishedWork;var a=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(r(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(zt(e,o),e===Wc&&(Z=Wc=null,Gc=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||ol||(ol=!0,Wl(yt,function(){return Ll(),null})),o=(n.flags&15990)!=0,n.subtreeFlags&15990||o){o=Uc.transition,Uc.transition=null;var s=V;V=1;var c=X;X|=4,Hc.current=null,vc(e,n),Nc(n,e),Ir(Si),pn=!!xi,Si=xi=null,e.current=n,Fc(n,e,a),ht(),X=c,V=s,Uc.transition=o}else e.current=n;if(ol&&(ol=!1,sl=e,cl=a),o=e.pendingLanes,o===0&&(al=null),wt(n.stateNode,i),gl(e,B()),t!==null)for(i=e.onRecoverableError,n=0;n<t.length;n++)a=t[n],i(a.value,{componentStack:a.stack,digest:a.digest});if(rl)throw rl=!1,e=il,il=null,e;return cl&1&&e.tag!==0&&Ll(),o=e.pendingLanes,o&1?e===ul?ll++:(ll=0,ul=e):ll=0,ca(),null}function Ll(){if(sl!==null){var e=Vt(cl),t=Uc.transition,n=V;try{if(Uc.transition=null,V=16>e?16:e,sl===null)var i=!1;else{if(e=sl,sl=null,cl=0,X&6)throw Error(r(331));var a=X;for(X|=4,Y=e.current;Y!==null;){var o=Y,s=o.child;if(Y.flags&16){var c=o.deletions;if(c!==null){for(var l=0;l<c.length;l++){var u=c[l];for(Y=u;Y!==null;){var d=Y;switch(d.tag){case 0:case 11:case 15:yc(8,d,o)}var f=d.child;if(f!==null)f.return=d,Y=f;else for(;Y!==null;){d=Y;var p=d.sibling,m=d.return;if(Sc(d),d===u){Y=null;break}if(p!==null){p.return=m,Y=p;break}Y=m}}}var h=o.alternate;if(h!==null){var g=h.child;if(g!==null){h.child=null;do{var _=g.sibling;g.sibling=null,g=_}while(g!==null)}}Y=o}}if(o.subtreeFlags&2064&&s!==null)s.return=o,Y=s;else b:for(;Y!==null;){if(o=Y,o.flags&2048)switch(o.tag){case 0:case 11:case 15:yc(9,o,o.return)}var v=o.sibling;if(v!==null){v.return=o.return,Y=v;break b}Y=o.return}}var y=e.current;for(Y=y;Y!==null;){s=Y;var b=s.child;if(s.subtreeFlags&2064&&b!==null)b.return=s,Y=b;else b:for(s=y;Y!==null;){if(c=Y,c.flags&2048)try{switch(c.tag){case 0:case 11:case 15:bc(9,c)}}catch(e){$(c,c.return,e)}if(c===s){Y=null;break b}var x=c.sibling;if(x!==null){x.return=c.return,Y=x;break b}Y=c.return}}if(X=a,ca(),Ct&&typeof Ct.onPostCommitFiberRoot==`function`)try{Ct.onPostCommitFiberRoot(St,e)}catch{}i=!0}return i}finally{V=n,Uc.transition=t}}return!1}function Rl(e,t,n){t=Ts(n,t),t=ks(e,t,1),e=io(e,t,1),t=pl(),e!==null&&(Rt(e,1,t),gl(e,t))}function $(e,t,n){if(e.tag===3)Rl(e,e,n);else for(;t!==null;){if(t.tag===3){Rl(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(al===null||!al.has(r))){e=Ts(n,e),e=As(t,e,1),t=io(t,e,1),e=pl(),t!==null&&(Rt(t,1,e),gl(t,e));break}}t=t.return}}function zl(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=pl(),e.pingedLanes|=e.suspendedLanes&n,Wc===e&&(Gc&n)===n&&(Q===4||Q===3&&(Gc&130023424)===Gc&&500>B()-el?El(e,0):Zc|=n),gl(e,t)}function Bl(e,t){t===0&&(e.mode&1?(t=At,At<<=1,!(At&130023424)&&(At=4194304)):t=1);var n=pl();e=$a(e,t),e!==null&&(Rt(e,t,n),gl(e,n))}function Vl(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Bl(e,n)}function Hl(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(r(314))}i!==null&&i.delete(t),Bl(e,n)}var Ul=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ji.current)Fs=!0;else{if((e.lanes&n)===0&&!(t.flags&128))return Fs=!1,ic(e,t,n);Fs=!!(e.flags&131072)}else Fs=!1,G&&t.flags&1048576&&ya(t,fa,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;nc(e,t),e=t.pendingProps;var a=Xi(t,qi.current);Ja(t,n),a=Mo(null,t,i,e,a,n);var o=No();return t.flags|=1,typeof a==`object`&&a&&typeof a.render==`function`&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Zi(i)?(o=!0,ta(t)):o=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,to(t),a.updater=bs,t.stateNode=a,a._reactInternals=t,ws(t,i,e,n),t=Ws(null,t,i,!0,o,n)):(t.tag=0,G&&o&&ba(t),Is(null,t,a,n),t=t.child),t;case 16:i=t.elementType;a:{switch(nc(e,t),e=t.pendingProps,a=i._init,i=a(i._payload),t.type=i,a=t.tag=Jl(i),e=vs(i,e),a){case 0:t=Hs(null,t,i,e,n);break a;case 1:t=Us(null,t,i,e,n);break a;case 11:t=Ls(null,t,i,e,n);break a;case 14:t=Rs(null,t,i,vs(i.type,e),n);break a}throw Error(r(306,i,``))}return t;case 0:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:vs(i,a),Hs(e,t,i,a,n);case 1:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:vs(i,a),Us(e,t,i,a,n);case 3:a:{if(Gs(t),e===null)throw Error(r(387));i=t.pendingProps,o=t.memoizedState,a=o.element,no(e,t),so(t,i,null,n);var s=t.memoizedState;if(i=s.element,o.isDehydrated)if(o={element:i,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){a=Ts(Error(r(423)),t),t=Ks(e,t,i,n,a);break a}else if(i!==a){a=Ts(Error(r(424)),t),t=Ks(e,t,i,n,a);break a}else for(Ca=Ai(t.stateNode.containerInfo.firstChild),Sa=t,G=!0,wa=null,n=Ba(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ma(),i===a){t=rc(e,t,n);break a}Is(e,t,i,n)}t=t.child}return t;case 5:return _o(t),e===null&&Oa(t),i=t.type,a=t.pendingProps,o=e===null?null:e.memoizedProps,s=a.children,Ci(i,a)?s=null:o!==null&&Ci(i,o)&&(t.flags|=32),Vs(e,t),Is(e,t,s,n),t.child;case 6:return e===null&&Oa(t),null;case 13:return Ys(e,t,n);case 4:return ho(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=za(t,null,i,n):Is(e,t,i,n),t.child;case 11:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:vs(i,a),Ls(e,t,i,a,n);case 7:return Is(e,t,t.pendingProps,n),t.child;case 8:return Is(e,t,t.pendingProps.children,n),t.child;case 12:return Is(e,t,t.pendingProps.children,n),t.child;case 10:a:{if(i=t.type._context,a=t.pendingProps,o=t.memoizedProps,s=a.value,W(Va,i._currentValue),i._currentValue=s,o!==null)if(kr(o.value,s)){if(o.children===a.children&&!Ji.current){t=rc(e,t,n);break a}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var c=o.dependencies;if(c!==null){s=o.child;for(var l=c.firstContext;l!==null;){if(l.context===i){if(o.tag===1){l=ro(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),qa(o.return,n,t),c.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(r(341));s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),qa(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}Is(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,i=t.pendingProps.children,Ja(t,n),a=Ya(a),i=i(a),t.flags|=1,Is(e,t,i,n),t.child;case 14:return i=t.type,a=vs(i,t.pendingProps),a=vs(i.type,a),Rs(e,t,i,a,n);case 15:return zs(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:vs(i,a),nc(e,t),t.tag=1,Zi(i)?(e=!0,ta(t)):e=!1,Ja(t,n),Ss(t,i,a),ws(t,i,a,n),Ws(null,t,i,!0,e,n);case 19:return tc(e,t,n);case 22:return Bs(e,t,n)}throw Error(r(156,t.tag))};function Wl(e,t){return ft(e,t)}function Gl(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Kl(e,t,n,r){return new Gl(e,t,n,r)}function ql(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Jl(e){if(typeof e==`function`)return+!!ql(e);if(e!=null){if(e=e.$$typeof,e===j)return 11;if(e===P)return 14}return 2}function Yl(e,t){var n=e.alternate;return n===null?(n=Kl(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Xl(e,t,n,i,a,o){var s=2;if(i=e,typeof e==`function`)ql(e)&&(s=1);else if(typeof e==`string`)s=5;else a:switch(e){case E:return Zl(n.children,a,o,t);case D:s=8,a|=8;break;case O:return e=Kl(12,n,t,a|2),e.elementType=O,e.lanes=o,e;case M:return e=Kl(13,n,t,a),e.elementType=M,e.lanes=o,e;case N:return e=Kl(19,n,t,a),e.elementType=N,e.lanes=o,e;case I:return Ql(n,a,o,t);default:if(typeof e==`object`&&e)switch(e.$$typeof){case k:s=10;break a;case A:s=9;break a;case j:s=11;break a;case P:s=14;break a;case F:s=16,i=null;break a}throw Error(r(130,e==null?e:typeof e,``))}return t=Kl(s,n,t,a),t.elementType=e,t.type=i,t.lanes=o,t}function Zl(e,t,n,r){return e=Kl(7,e,r,t),e.lanes=n,e}function Ql(e,t,n,r){return e=Kl(22,e,r,t),e.elementType=I,e.lanes=n,e.stateNode={isHidden:!1},e}function $l(e,t,n){return e=Kl(6,e,null,t),e.lanes=n,e}function eu(e,t,n){return t=Kl(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function tu(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Lt(0),this.expirationTimes=Lt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Lt(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function nu(e,t,n,r,i,a,o,s,c){return e=new tu(e,t,n,s,c),t===1?(t=1,!0===a&&(t|=8)):t=0,a=Kl(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},to(a),e}function ru(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:T,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}function iu(e){if(!e)return Ki;e=e._reactInternals;a:{if(ot(e)!==e||e.tag!==1)throw Error(r(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break a;case 1:if(Zi(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break a}}t=t.return}while(t!==null);throw Error(r(171))}if(e.tag===1){var n=e.type;if(Zi(n))return ea(e,n,t)}return t}function au(e,t,n,r,i,a,o,s,c){return e=nu(n,r,!0,e,i,a,o,s,c),e.context=iu(null),n=e.current,r=pl(),i=ml(n),a=ro(r,i),a.callback=t??null,io(n,a,i),e.current.lanes=i,Rt(e,i,r),gl(e,r),e}function ou(e,t,n,r){var i=t.current,a=pl(),o=ml(i);return n=iu(n),t.context===null?t.context=n:t.pendingContext=n,t=ro(a,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=io(i,t,o),e!==null&&(hl(e,i,o,a),ao(e,i,o)),o}function su(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function cu(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function lu(e,t){cu(e,t),(e=e.alternate)&&cu(e,t)}function uu(){return null}var du=typeof reportError==`function`?reportError:function(e){console.error(e)};function fu(e){this._internalRoot=e}pu.prototype.render=fu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(r(409));ou(e,t,null,null)},pu.prototype.unmount=fu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;wl(function(){ou(null,e,null,null)}),t[Fi]=null}};function pu(e){this._internalRoot=e}pu.prototype.unstable_scheduleHydration=function(e){if(e){var t=Gt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<en.length&&t!==0&&t<en[n].priority;n++);en.splice(n,0,e),n===0&&on(e)}};function mu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function hu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==` react-mount-point-unstable `))}function gu(){}function _u(e,t,n,r,i){if(i){if(typeof r==`function`){var a=r;r=function(){var e=su(o);a.call(e)}}var o=au(t,r,e,0,null,!1,!1,``,gu);return e._reactRootContainer=o,e[Fi]=o.current,li(e.nodeType===8?e.parentNode:e),wl(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r==`function`){var s=r;r=function(){var e=su(c);s.call(e)}}var c=nu(e,0,!1,null,null,!1,!1,``,gu);return e._reactRootContainer=c,e[Fi]=c.current,li(e.nodeType===8?e.parentNode:e),wl(function(){ou(t,c,n,r)}),c}function vu(e,t,n,r,i){var a=n._reactRootContainer;if(a){var o=a;if(typeof i==`function`){var s=i;i=function(){var e=su(o);s.call(e)}}ou(t,o,e,i)}else o=_u(n,t,e,i,r);return su(o)}Ht=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=jt(t.pendingLanes);n!==0&&(Bt(t,n|1),gl(t,B()),!(X&6)&&(tl=B()+500,ca()))}break;case 13:wl(function(){var t=$a(e,1);t!==null&&hl(t,e,1,pl())}),lu(e,1)}},Ut=function(e){if(e.tag===13){var t=$a(e,134217728);t!==null&&hl(t,e,134217728,pl()),lu(e,134217728)}},Wt=function(e){if(e.tag===13){var t=ml(e),n=$a(e,t);n!==null&&hl(n,e,t,pl()),lu(e,t)}},Gt=function(){return V},Kt=function(e,t){var n=V;try{return V=e,t()}finally{V=n}},ze=function(e,t,n){switch(t){case`input`:if(_e(e,n),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name=`+JSON.stringify(``+t)+`][type="radio"]`),t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var a=Hi(i);if(!a)throw Error(r(90));fe(i),_e(i,a)}}}break;case`textarea`:Ce(e,n);break;case`select`:t=n.value,t!=null&&be(e,!!n.multiple,t,!1)}},Ge=Cl,Ke=wl;var yu={usingClientEntryPoint:!1,Events:[Bi,Vi,Hi,Ue,We,Cl]},bu={findFiberByHostInstance:zi,bundleType:0,version:`18.3.1`,rendererPackageName:`react-dom`},xu={bundleType:bu.bundleType,version:bu.version,rendererPackageName:bu.rendererPackageName,rendererConfig:bu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:C.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=ut(e),e===null?null:e.stateNode},findFiberByHostInstance:bu.findFiberByHostInstance||uu,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:`18.3.1-next-f1338f8080-20240426`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Su=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Su.isDisabled&&Su.supportsFiber)try{St=Su.inject(xu),Ct=Su}catch{}}e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=yu,e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!mu(t))throw Error(r(200));return ru(e,t,null,n)},e.createRoot=function(e,t){if(!mu(e))throw Error(r(299));var n=!1,i=``,a=du;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=nu(e,1,!1,null,null,n,!1,i,a),e[Fi]=t.current,li(e.nodeType===8?e.parentNode:e),new fu(t)},e.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(r(188)):(e=Object.keys(e).join(`,`),Error(r(268,e)));return e=ut(t),e=e===null?null:e.stateNode,e},e.flushSync=function(e){return wl(e)},e.hydrate=function(e,t,n){if(!hu(t))throw Error(r(200));return vu(null,e,t,!0,n)},e.hydrateRoot=function(e,t,n){if(!mu(e))throw Error(r(405));var i=n!=null&&n.hydratedSources||null,a=!1,o=``,s=du;if(n!=null&&(!0===n.unstable_strictMode&&(a=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=au(t,null,e,1,n??null,a,!1,o,s),e[Fi]=t.current,li(e),i)for(e=0;e<i.length;e++)n=i[e],a=n._getVersion,a=a(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,a]:t.mutableSourceEagerHydrationData.push(n,a);return new pu(t)},e.render=function(e,t,n){if(!hu(t))throw Error(r(200));return vu(null,e,t,!1,n)},e.unmountComponentAtNode=function(e){if(!hu(e))throw Error(r(40));return e._reactRootContainer?(wl(function(){vu(null,null,e,!1,function(){e._reactRootContainer=null,e[Fi]=null})}),!0):!1},e.unstable_batchedUpdates=Cl,e.unstable_renderSubtreeIntoContainer=function(e,t,n,i){if(!hu(n))throw Error(r(200));if(e==null||e._reactInternals===void 0)throw Error(r(38));return vu(e,t,n,!1,i)},e.version=`18.3.1-next-f1338f8080-20240426`})),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=m();e.createRoot=t.createRoot,e.hydrateRoot=t.hydrateRoot})),g=c(u()),_=c(h()),v={bg:`#0A0B0D`,surface:`#111318`,surfaceHover:`#161A22`,border:`#1E2330`,borderLight:`#252D3D`,accent:`#F0A500`,accentDim:`#F0A50022`,accentHover:`#FFB733`,green:`#22C55E`,greenDim:`#22C55E18`,red:`#EF4444`,redDim:`#EF444418`,yellow:`#FBBF24`,yellowDim:`#FBBF2418`,blue:`#60A5FA`,blueDim:`#60A5FA18`,purple:`#A78BFA`,purpleDim:`#A78BFA18`,text:`#E8EAF0`,textMuted:`#6B7280`,textDim:`#3D4455`,mono:`'JetBrains Mono', 'Fira Code', monospace`,sans:`'DM Sans', system-ui, sans-serif`},y={dev:{color:v.green,bg:v.greenDim,label:`DEV`},staging:{color:v.yellow,bg:v.yellowDim,label:`STG`},production:{color:v.red,bg:v.redDim,label:`PRD`}},b={error:{color:v.red,bg:v.redDim,icon:`✕`,label:`Error`},warning:{color:v.yellow,bg:v.yellowDim,icon:`⚠`,label:`Warning`},info:{color:v.blue,bg:v.blueDim,icon:`i`,label:`Info`}},x={matrix:{label:`Matrix`,color:v.accent},schema:{label:`Schema`,color:v.blue},sops:{label:`SOPS`,color:v.purple}},S=`clef_ui_token`,C=null;function w(){let e=new URLSearchParams(window.location.search).get(`token`);if(e){C=e,sessionStorage.setItem(S,e);let t=new URL(window.location.href);t.searchParams.delete(`token`),window.history.replaceState({},``,t.pathname+t.hash)}else C=sessionStorage.getItem(S)}function T(e,t){let n=new Headers(t?.headers);return C&&n.set(`Authorization`,`Bearer ${C}`),fetch(e,{...t,headers:n})}var E=o((e=>{var t=u(),n=Symbol.for(`react.element`),r=Symbol.for(`react.fragment`),i=Object.prototype.hasOwnProperty,a=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,r){var s,c={},l=null,u=null;for(s in r!==void 0&&(l=``+r),t.key!==void 0&&(l=``+t.key),t.ref!==void 0&&(u=t.ref),t)i.call(t,s)&&!o.hasOwnProperty(s)&&(c[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps,t)c[s]===void 0&&(c[s]=t[s]);return{$$typeof:n,type:e,key:l,ref:u,props:c,_owner:a.current}}e.Fragment=r,e.jsx=s,e.jsxs=s})),D=o(((e,t)=>{t.exports=E()}))();function O({activeView:e,setView:t,activeNs:n,setNs:r,manifest:i,matrixStatuses:a,gitStatus:o,lintErrorCount:s,scanIssueCount:c}){let l=o?o.staged.length+o.unstaged.length+o.untracked.length:0,u=i?.namespaces??[];return(0,D.jsxs)(`div`,{style:{width:220,minHeight:`100vh`,background:v.surface,borderRight:`1px solid ${v.border}`,display:`flex`,flexDirection:`column`,flexShrink:0},children:[(0,D.jsxs)(`div`,{style:{padding:`20px 20px 16px`,borderBottom:`1px solid ${v.border}`,display:`flex`,alignItems:`center`,gap:10},children:[(0,D.jsx)(`div`,{style:{width:30,height:30,background:v.accentDim,border:`1px solid ${v.accent}44`,borderRadius:7,display:`flex`,alignItems:`center`,justifyContent:`center`,color:v.accent,fontSize:15},children:`♪`}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`div`,{style:{fontFamily:v.sans,fontWeight:700,fontSize:16,color:v.text,letterSpacing:`-0.02em`},children:`clef`}),(0,D.jsxs)(`div`,{style:{fontFamily:v.mono,fontSize:9,color:v.textMuted,marginTop:-1},children:[i?.sops.default_backend??`local`,` / main`]})]})]}),(0,D.jsxs)(`div`,{style:{padding:`12px 10px`,flex:1},children:[(0,D.jsx)(k,{icon:`⊞`,label:`Matrix`,active:e===`matrix`,onClick:()=>t(`matrix`)}),(0,D.jsx)(k,{icon:`⇄`,label:`Diff`,active:e===`diff`,onClick:()=>t(`diff`)}),(0,D.jsx)(k,{icon:`✔`,label:`Lint`,active:e===`lint`,onClick:()=>t(`lint`),badge:s>0?String(s):void 0,badgeColor:v.red}),(0,D.jsx)(k,{icon:`⌕`,label:`Scan`,active:e===`scan`,onClick:()=>t(`scan`),badge:c>0?String(c):void 0,badgeColor:v.yellow}),(0,D.jsx)(k,{icon:`⬆`,label:`Import`,active:e===`import`,onClick:()=>t(`import`)}),(0,D.jsx)(k,{icon:`♢`,label:`Recipients`,active:e===`recipients`,onClick:()=>t(`recipients`)}),(0,D.jsx)(k,{icon:`⚙`,label:`Service IDs`,active:e===`identities`,onClick:()=>t(`identities`),badge:i?.service_identities?.length?String(i.service_identities.length):void 0,badgeColor:v.purple}),(0,D.jsx)(k,{icon:`↻`,label:`Backend`,active:e===`backend`,onClick:()=>t(`backend`)}),(0,D.jsx)(k,{icon:`␡`,label:`Reset`,active:e===`reset`,onClick:()=>t(`reset`)}),(0,D.jsx)(k,{icon:`☰`,label:`Manifest`,active:e===`manifest`,onClick:()=>t(`manifest`)}),(0,D.jsx)(k,{icon:`⏱`,label:`History`,active:e===`history`,onClick:()=>t(`history`)}),(0,D.jsx)(`div`,{style:{marginTop:20,marginBottom:6,padding:`0 8px`},children:(0,D.jsx)(`span`,{style:{fontFamily:v.sans,fontSize:10,fontWeight:600,color:v.textDim,letterSpacing:`0.1em`,textTransform:`uppercase`},children:`Namespaces`})}),u.map(i=>{let o=a.some(e=>e.cell.namespace===i.name&&e.issues.length>0);return(0,D.jsx)(k,{icon:(0,D.jsx)(`span`,{style:{fontFamily:v.mono,fontSize:10,color:v.textMuted},children:`//`}),label:i.name,active:e===`editor`&&n===i.name,onClick:()=>{t(`editor`),r(i.name)},badge:o?`!`:void 0,badgeColor:v.yellow},i.name)})]}),(0,D.jsxs)(`div`,{style:{padding:`12px 16px`,borderTop:`1px solid ${v.border}`},children:[(0,D.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6,color:v.textMuted},children:(0,D.jsxs)(`span`,{style:{fontFamily:v.mono,fontSize:10},children:[l,` uncommitted`]})}),(0,D.jsx)(`div`,{style:{marginTop:5},children:(0,D.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6,color:v.green},children:[(0,D.jsx)(`span`,{style:{display:`inline-block`,width:6,height:6,borderRadius:`50%`,background:v.green,boxShadow:`0 0 5px ${v.green}`}}),(0,D.jsxs)(`span`,{style:{fontFamily:v.mono,fontSize:10},children:[i?.sops.default_backend??`age`,` key loaded`]})]})})]})]})}function k({icon:e,label:t,active:n,onClick:r,badge:i,badgeColor:a}){return(0,D.jsxs)(`div`,{role:`button`,tabIndex:0,"data-testid":`nav-${t.toLowerCase()}`,onClick:r,onKeyDown:e=>{e.key===`Enter`&&r()},style:{display:`flex`,alignItems:`center`,gap:9,padding:`7px 10px`,borderRadius:6,cursor:`pointer`,background:n?v.accentDim:`transparent`,border:n?`1px solid ${v.accent}22`:`1px solid transparent`,marginBottom:2,transition:`all 0.12s`,position:`relative`},children:[(0,D.jsx)(`span`,{style:{color:n?v.accent:v.textMuted,display:`flex`,alignItems:`center`,width:14},children:e}),(0,D.jsx)(`span`,{style:{fontFamily:v.sans,fontSize:13,fontWeight:n?600:400,color:n?v.accent:v.text,flex:1},children:t}),i&&a&&(0,D.jsx)(`span`,{style:{fontFamily:v.mono,fontSize:9,fontWeight:700,color:a,background:`${a}20`,border:`1px solid ${a}44`,borderRadius:3,padding:`1px 5px`},children:i})]})}function A({title:e,subtitle:t,actions:n}){return(0,D.jsxs)(`div`,{style:{height:54,borderBottom:`1px solid ${v.border}`,display:`flex`,alignItems:`center`,padding:`0 24px`,gap:16,flexShrink:0},children:[(0,D.jsxs)(`div`,{style:{flex:1},children:[(0,D.jsx)(`div`,{style:{fontFamily:v.sans,fontWeight:600,fontSize:14,color:v.text},children:e}),t&&(0,D.jsx)(`div`,{style:{fontFamily:v.mono,fontSize:10,color:v.textMuted,marginTop:1},children:t})]}),(0,D.jsx)(`div`,{style:{display:`flex`,gap:8},children:n})]})}var j={primary:{bg:v.accent,color:`#000`,border:`none`},ghost:{bg:`transparent`,color:v.text,border:`1px solid ${v.borderLight}`},danger:{bg:v.redDim,color:v.red,border:`1px solid ${v.red}44`}};function M({children:e,variant:t=`ghost`,onClick:n,icon:r,type:i=`button`,style:a,...o}){let s=j[t];return(0,D.jsxs)(`button`,{type:i,onClick:n,...o,style:{display:`flex`,alignItems:`center`,gap:6,padding:`5px 12px`,borderRadius:6,cursor:`pointer`,fontFamily:v.sans,fontSize:12,fontWeight:600,background:s.bg,color:s.color,border:s.border,transition:`all 0.12s`},children:[r&&(0,D.jsx)(`span`,{style:{display:`flex`},children:r}),e]})}function N({env:e,small:t}){let n=y[e]??{color:v.textMuted,bg:`transparent`,label:e.toUpperCase().slice(0,3)};return(0,D.jsx)(`span`,{style:{fontFamily:v.mono,fontSize:t?`9px`:`10px`,fontWeight:700,color:n.color,background:n.bg,border:`1px solid ${n.color}33`,borderRadius:`3px`,padding:t?`1px 5px`:`2px 7px`,letterSpacing:`0.08em`},children:n.label})}var P={ok:v.green,missing_keys:v.red,schema_warn:v.yellow,sops_error:v.red};function F({status:e}){let t=P[e]??v.textMuted;return(0,D.jsx)(`span`,{"data-testid":`status-dot`,style:{display:`inline-block`,width:7,height:7,borderRadius:`50%`,background:t,boxShadow:`0 0 6px ${t}88`}})}function I(e){if(!e.cell.exists)return`missing_keys`;let t=e.issues.some(e=>e.type===`missing_keys`||e.type===`sops_error`),n=e.issues.some(e=>e.type===`schema_warning`);return t?`missing_keys`:n?`schema_warn`:`ok`}function L(e){if(!e)return`never`;let t=new Date().getTime()-e.getTime(),n=Math.floor(t/(1e3*60*60));if(n<1)return`just now`;if(n<24)return`${n}h ago`;let r=Math.floor(n/24);return r<7?`${r}d ago`:`${Math.floor(r/7)}w ago`}function ee({namespaces:e,environments:t,matrixStatuses:n,onNamespaceClick:r}){return(0,D.jsxs)(`div`,{"data-testid":`matrix-table`,style:{background:v.surface,border:`1px solid ${v.border}`,borderRadius:12,overflow:`hidden`},children:[(0,D.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`180px ${t.map(()=>`1fr`).join(` `)}`,borderBottom:`1px solid ${v.border}`,background:`#0D0F14`},children:[(0,D.jsx)(`div`,{style:{padding:`12px 20px`,fontFamily:v.sans,fontSize:11,fontWeight:600,color:v.textMuted,textTransform:`uppercase`,letterSpacing:`0.08em`},children:`Namespace`}),t.map(e=>(0,D.jsxs)(`div`,{style:{padding:`12px 20px`,display:`flex`,alignItems:`center`,gap:8,borderLeft:`1px solid ${v.border}`},children:[(0,D.jsx)(N,{env:e.name}),(0,D.jsx)(`span`,{style:{fontFamily:v.sans,fontSize:12,fontWeight:500,color:v.text},children:e.name})]},e.name))]}),e.map((i,a)=>(0,D.jsxs)(`div`,{"data-testid":`matrix-row-${i.name}`,role:`button`,tabIndex:0,onClick:()=>r?.(i.name),onKeyDown:e=>{e.key===`Enter`&&r?.(i.name)},style:{display:`grid`,gridTemplateColumns:`180px ${t.map(()=>`1fr`).join(` `)}`,borderBottom:a<e.length-1?`1px solid ${v.border}`:`none`,cursor:r?`pointer`:`default`,transition:`background 0.1s`},onMouseEnter:e=>{e.currentTarget.style.background=v.surfaceHover},onMouseLeave:e=>{e.currentTarget.style.background=`transparent`},children:[(0,D.jsxs)(`div`,{style:{padding:`16px 20px`,display:`flex`,alignItems:`center`,gap:10},children:[(0,D.jsx)(`span`,{style:{fontFamily:v.mono,fontSize:11,color:v.textDim},children:`//`}),(0,D.jsx)(`span`,{style:{fontFamily:v.mono,fontSize:13,fontWeight:600,color:v.text},children:i.name})]}),t.map(e=>{let t=n.find(t=>t.cell.namespace===i.name&&t.cell.environment===e.name),r=t?I(t):`ok`,a=t?.keyCount??0,o=t?.lastModified?L(t.lastModified instanceof Date?t.lastModified:new Date(t.lastModified)):`never`,s=t?new Set(t.issues.filter(e=>e.type===`missing_keys`&&e.key).map(e=>e.key)).size:0,c=t?t.issues.filter(e=>e.type===`schema_warning`).length:0,l=t?.pendingCount??0;return(0,D.jsxs)(`div`,{style:{padding:`14px 20px`,borderLeft:`1px solid ${v.border}`,display:`flex`,flexDirection:`column`,gap:5},children:[(0,D.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:7},children:[(0,D.jsx)(F,{status:r}),(0,D.jsxs)(`span`,{style:{fontFamily:v.mono,fontSize:11,color:v.textMuted},children:[a,` keys`]}),s>0&&(0,D.jsxs)(`span`,{style:{fontFamily:v.mono,fontSize:10,color:v.red,background:v.redDim,border:`1px solid ${v.red}33`,borderRadius:3,padding:`1px 5px`},children:[`-`,s,` missing`]}),c>0&&(0,D.jsxs)(`span`,{style:{fontFamily:v.mono,fontSize:10,color:v.yellow,background:v.yellowDim,border:`1px solid ${v.yellow}33`,borderRadius:3,padding:`1px 5px`},children:[c,` warn`]}),l>0&&(0,D.jsxs)(`span`,{style:{fontFamily:v.mono,fontSize:10,color:v.accent,background:`${v.accent}18`,border:`1px solid ${v.accent}33`,borderRadius:3,padding:`1px 5px`},children:[l,` pending`]})]}),(0,D.jsx)(`div`,{style:{fontFamily:v.mono,fontSize:10,color:v.textDim},children:o})]},e.name)})]},i.name))]})}function R({setView:e,setNs:t,manifest:n,matrixStatuses:r}){if(!n)return(0,D.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`},children:[(0,D.jsx)(A,{title:`Secret Matrix`,subtitle:`Loading...`}),(0,D.jsx)(`div`,{style:{flex:1,padding:28},children:(0,D.jsx)(`p`,{style:{color:v.textMuted,fontFamily:v.sans,fontSize:13},children:`Loading manifest...`})})]});let i=n.environments,a=n.namespaces,o=r.length===0&&a.length>0,s=r.filter(e=>e.cell.exists&&e.issues.length===0).length,c=r.filter(e=>!e.cell.exists||e.issues.some(e=>e.type===`missing_keys`)).length,l=r.filter(e=>e.issues.some(e=>e.type===`schema_warning`)).length,u=r.reduce((e,t)=>e+(t.pendingCount??0),0),d=a.length*i.length;return(0,D.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:[(0,D.jsx)(A,{title:`Secret Matrix`,subtitle:`${a.length} namespaces \u00B7 ${i.length} environments \u00B7 ${d} files`,actions:(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(M,{onClick:()=>e(`lint`),children:`Lint All`}),(0,D.jsx)(M,{onClick:()=>e(`manifest`),"data-testid":`matrix-add-environment-btn`,children:`+ Environment`}),(0,D.jsx)(M,{variant:`primary`,onClick:()=>e(`manifest`),"data-testid":`matrix-add-namespace-btn`,children:`+ Namespace`})]})}),(0,D.jsxs)(`div`,{style:{flex:1,overflow:`auto`,padding:28,position:`relative`},children:[o&&(0,D.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`${v.bg}dd`,zIndex:10,borderRadius:8},children:(0,D.jsxs)(`div`,{style:{background:v.surface,border:`1px solid ${v.border}`,borderRadius:10,padding:`24px 36px`,textAlign:`center`},children:[(0,D.jsx)(`div`,{style:{fontSize:20,color:v.accent,marginBottom:8},children:`♪`}),(0,D.jsx)(`div`,{style:{fontFamily:v.sans,fontSize:13,color:v.textMuted},children:`Loading...`})]})}),(0,D.jsx)(`div`,{style:{display:`flex`,gap:10,marginBottom:28},children:[{label:`${s} healthy`,color:v.green},{label:`${c} missing keys`,color:v.red},{label:`${l} schema warning${l===1?``:`s`}`,color:v.yellow},...u>0?[{label:`${u} pending value${u===1?``:`s`}`,color:v.accent}]:[]].map(e=>(0,D.jsx)(`div`,{style:{fontFamily:v.sans,fontSize:12,fontWeight:500,color:e.color,background:`${e.color}14`,border:`1px solid ${e.color}33`,borderRadius:20,padding:`4px 14px`},children:e.label},e.label))}),(0,D.jsx)(ee,{namespaces:a,environments:i,matrixStatuses:r,onNamespaceClick:n=>{t(n),e(`editor`)}}),(0,D.jsx)(`div`,{style:{marginTop:20,display:`flex`,gap:10},children:(0,D.jsx)(M,{"data-testid":`diff-environments-btn`,onClick:()=>e(`diff`),children:`Diff environments`})})]})]})}function te({ns:e,manifest:t,onCommit:n}){let[r,i]=(0,g.useState)(``),[a,o]=(0,g.useState)([]),[s,c]=(0,g.useState)(!1),[l,u]=(0,g.useState)(`value`),[d,f]=(0,g.useState)(``),[p,m]=(0,g.useState)(``),[h,_]=(0,g.useState)(null),[b,x]=(0,g.useState)(null),[S,C]=(0,g.useState)(null),[w,E]=(0,g.useState)(!1),[O,k]=(0,g.useState)(null),[j,P]=(0,g.useState)(``),[F,I]=(0,g.useState)(!1),[L,ee]=(0,g.useState)(``),[R,te]=(0,g.useState)([]),[ne,re]=(0,g.useState)(null),ie=(0,g.useRef)();(0,g.useEffect)(()=>()=>clearTimeout(ie.current),[]);let ae=t?.environments??[],oe=ae.find(e=>e.name===r)?.protected===!0;(0,g.useEffect)(()=>{ae.length>0&&!r&&i(ae[0].name)},[ae,r]);let se=(0,g.useCallback)(async()=>{if(!(!r||!e)){E(!0),k(null);try{let t=await T(`/api/namespace/${e}/${r}`);if(!t.ok){k((await t.json()).error||`Failed to load`),o([]);return}let n=await t.json(),i=new Set(n.pending??[]);o(Object.entries(n.values).map(([e,t])=>({key:e,value:String(t),type:`string`,required:!1,visible:!1,edited:!1,isNew:!1,pending:i.has(e)})));let a=n.metadata?.backend??`age`,s=n.metadata?.recipients?.length??0;ee(`encrypted with ${a} \u00B7 ${s} recipient${s===1?``:`s`}`)}catch{k(`Failed to load namespace data`),o([])}finally{E(!1)}}},[e,r]);(0,g.useEffect)(()=>{se()},[se]),(0,g.useEffect)(()=>{e&&T(`/api/lint/${e}`).then(e=>e.ok?e.json():{issues:[]}).then(e=>te(e.issues??[])).catch(()=>te([]))},[e]);let ce=e=>{o(t=>t.map(t=>t.key===e?{...t,visible:!t.visible}:t)),clearTimeout(ie.current),ie.current=setTimeout(()=>{o(e=>e.map(e=>({...e,value:``,visible:!1})))},3e5)},le=(e,t)=>{o(n=>n.map(n=>n.key===e?{...n,value:t,edited:!0}:n))},ue=async t=>{let i=a.filter(e=>e.edited);await Promise.all(i.map(n=>{let i={value:n.value,commit:!1};return t&&(i.confirmed=!0),T(`/api/namespace/${e}/${r}/${n.key}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(i)})})),j&&await n(j),I(!1),P(``),await se()},de=async t=>{if(!d.trim())return;let n=d.trim(),i=l===`random`?{random:!0}:{value:p};t&&(i.confirmed=!0);try{let t=await T(`/api/namespace/${e}/${r}/${n}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(i)});if(!t.ok){k((await t.json()).error||`Failed to add key`);return}let a=await t.json();a.warning&&k(a.warning),o(e=>[...e,{key:n,value:l===`random`?``:p,type:`string`,required:!1,visible:!1,edited:!1,isNew:!0,pending:l===`random`}])}catch{k(`Failed to add key`)}finally{c(!1),u(`value`),f(``),m(``)}},fe=async t=>{try{let n=await T(`/api/namespace/${e}/${r}/${t}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({random:!0,...oe&&{confirmed:!0}})});if(!n.ok){k((await n.json()).error||`Failed to reset key`);return}o(e=>e.map(e=>e.key===t?{...e,pending:!0,value:``,edited:!1}:e))}catch{k(`Failed to reset key`)}finally{x(null),_(null)}},pe=async t=>{try{let n=await T(`/api/namespace/${e}/${r}/${t}/accept`,{method:`POST`});if(!n.ok){k((await n.json()).error||`Failed to accept value`);return}let i=await n.json();o(e=>e.map(e=>e.key===t?{...e,pending:!1,value:i.value??e.value}:e))}catch{k(`Failed to accept value`)}},me=async t=>{try{let n=await T(`/api/namespace/${e}/${r}/${t}`,{method:`DELETE`,headers:{"Content-Type":`application/json`},body:JSON.stringify(oe?{confirmed:!0}:{})});if(!n.ok){k((await n.json()).error||`Failed to delete key`);return}o(e=>e.filter(e=>e.key!==t))}catch{k(`Failed to delete key`)}finally{C(null)}},he=a.some(e=>e.edited);return(0,D.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:[(0,D.jsx)(A,{title:`/${e}`,subtitle:`Namespace \u00B7 ${a.length} keys`,actions:(0,D.jsxs)(D.Fragment,{children:[he&&!F&&(0,D.jsx)(M,{variant:`primary`,onClick:()=>I(!0),children:`Commit changes`}),F&&(0,D.jsxs)(`div`,{style:{display:`flex`,gap:6,alignItems:`center`},children:[(0,D.jsx)(`input`,{"data-testid":`commit-message-input`,value:j,onChange:e=>P(e.target.value),placeholder:`Commit message...`,style:{background:`#0D0F14`,border:`1px solid ${v.borderLight}`,borderRadius:5,padding:`5px 10px`,fontFamily:v.mono,fontSize:12,color:v.text,outline:`none`,width:220}}),(0,D.jsx)(M,{variant:`primary`,onClick:()=>{oe?re(`save`):ue()},children:`Save & Commit`}),(0,D.jsx)(M,{onClick:()=>I(!1),children:`Cancel`})]}),(0,D.jsx)(M,{variant:`primary`,"data-testid":`add-key-btn`,onClick:()=>c(!0),children:`+ Add key`})]})}),(0,D.jsxs)(`div`,{style:{display:`flex`,gap:0,borderBottom:`1px solid ${v.border}`,padding:`0 24px`,background:`#0D0F14`},children:[ae.map(e=>{let t=r===e.name,n=y[e.name]??{color:v.textMuted};return(0,D.jsxs)(`div`,{role:`tab`,tabIndex:0,onClick:()=>i(e.name),onKeyDown:t=>{t.key===`Enter`&&i(e.name)},style:{padding:`10px 18px`,cursor:`pointer`,borderBottom:t?`2px solid ${n.color}`:`2px solid transparent`,display:`flex`,alignItems:`center`,gap:7,marginBottom:-1},children:[(0,D.jsx)(N,{env:e.name,small:!0}),(0,D.jsx)(`span`,{style:{fontFamily:v.sans,fontSize:13,fontWeight:t?600:400,color:t?v.text:v.textMuted},children:e.name})]},e.name)}),(0,D.jsx)(`div`,{style:{flex:1}}),(0,D.jsx)(`div`,{style:{padding:`10px 0`,display:`flex`,alignItems:`center`},children:(0,D.jsx)(`span`,{style:{fontFamily:v.mono,fontSize:10,color:v.textMuted},children:L})})]}),(0,D.jsxs)(`div`,{style:{flex:1,overflow:`auto`,padding:24},children:[oe&&(0,D.jsxs)(`div`,{"data-testid":`production-warning`,style:{marginBottom:20,padding:`10px 16px`,background:v.redDim,border:`1px solid ${v.red}44`,borderRadius:8,display:`flex`,alignItems:`center`,gap:10},children:[(0,D.jsx)(`span`,{style:{fontSize:14},children:`🔒`}),(0,D.jsxs)(`span`,{style:{fontFamily:v.sans,fontSize:12,color:v.red},children:[(0,D.jsx)(`strong`,{children:`Production environment.`}),` Changes will require confirmation before committing.`]})]}),w&&(0,D.jsx)(`p`,{style:{color:v.textMuted,fontFamily:v.sans},children:`Loading...`}),O&&(0,D.jsx)(`div`,{style:{padding:`12px 16px`,background:v.redDim,border:`1px solid ${v.red}44`,borderRadius:8,fontFamily:v.sans,fontSize:12,color:v.red,marginBottom:20},children:O}),!w&&!O&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`div`,{style:{background:v.surface,border:`1px solid ${v.border}`,borderRadius:10},children:[(0,D.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`260px 1fr 90px 36px`,background:`#0D0F14`,padding:`10px 20px`,borderBottom:`1px solid ${v.border}`,borderRadius:`10px 10px 0 0`},children:[`Key`,`Value`,`Type`,``].map(e=>(0,D.jsx)(`span`,{style:{fontFamily:v.sans,fontSize:11,fontWeight:600,color:v.textMuted,textTransform:`uppercase`,letterSpacing:`0.07em`},children:e},e||`actions`))}),a.map((e,t)=>(0,D.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`260px 1fr 90px 36px`,padding:`0 20px`,borderBottom:t<a.length-1?`1px solid ${v.border}`:`none`,background:e.pending?`#F0A50012`:e.edited?`${v.accent}08`:`transparent`,borderLeft:e.pending?`3px solid #F0A50088`:e.edited?`2px solid ${v.accent}`:`2px solid transparent`,alignItems:`center`,minHeight:48},children:[(0,D.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,paddingRight:16},children:[e.required&&(0,D.jsx)(`span`,{style:{color:v.accent,fontSize:14,lineHeight:1},children:`*`}),(0,D.jsx)(`span`,{style:{fontFamily:v.mono,fontSize:12,color:v.text},children:e.key}),e.edited&&(0,D.jsx)(`span`,{"data-testid":`dirty-dot`,style:{width:6,height:6,borderRadius:`50%`,background:v.accent,flexShrink:0,display:`inline-block`}})]}),(0,D.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,paddingRight:16},children:[e.pending&&!e.visible?(0,D.jsxs)(`span`,{style:{fontFamily:v.mono,fontSize:11,fontStyle:`italic`,color:v.accent},children:[`PENDING `,`—`,` not yet set`]}):e.visible?(0,D.jsx)(`input`,{type:`text`,"data-testid":`value-input-${e.key}`,value:e.value,onChange:t=>le(e.key,t.target.value),autoComplete:`off`,placeholder:e.pending?`Enter real value...`:void 0,style:{flex:1,background:`#0D0F14`,border:`1px solid ${v.borderLight}`,borderRadius:5,padding:`5px 10px`,fontFamily:v.mono,fontSize:12,color:v.text,outline:`none`}}):(0,D.jsx)(`span`,{style:{fontFamily:v.mono,fontSize:13,color:v.textMuted,letterSpacing:`0.15em`},children:`•`.repeat(Math.min(e.value.length,20))}),e.pending&&!e.visible?(0,D.jsxs)(`div`,{style:{display:`flex`,gap:6},children:[(0,D.jsx)(`button`,{"data-testid":`set-value-${e.key}`,onClick:()=>ce(e.key),style:{background:`${v.accent}18`,border:`1px solid ${v.accent}55`,borderRadius:5,cursor:`pointer`,color:v.accent,padding:`3px 10px`,fontFamily:v.sans,fontSize:11,fontWeight:600},children:`Set value`}),(0,D.jsx)(`button`,{"data-testid":`accept-value-${e.key}`,onClick:()=>pe(e.key),title:`Accept the random value as the final secret`,style:{background:`${v.green}18`,border:`1px solid ${v.green}55`,borderRadius:5,cursor:`pointer`,color:v.green,padding:`3px 10px`,fontFamily:v.sans,fontSize:11,fontWeight:600},children:`Accept random`})]}):(0,D.jsx)(`button`,{"data-testid":`eye-${e.key}`,onClick:()=>ce(e.key),"aria-label":e.visible?`Hide value`:`Reveal value`,style:{background:`none`,border:`none`,cursor:`pointer`,color:e.visible?v.accent:v.textDim,padding:4,display:`flex`,alignItems:`center`,fontSize:13},children:`👁`})]}),(0,D.jsx)(`div`,{children:e.pending?(0,D.jsx)(`span`,{style:{fontFamily:v.mono,fontSize:10,fontWeight:700,color:v.accent,background:`${v.accent}18`,border:`1px solid ${v.accent}33`,borderRadius:3,padding:`2px 7px`},children:`PENDING`}):(0,D.jsx)(`span`,{style:{fontFamily:v.mono,fontSize:10,color:v.blue,background:v.blueDim,border:`1px solid ${v.blue}33`,borderRadius:3,padding:`2px 7px`},children:e.type})}),(0,D.jsxs)(`div`,{style:{display:`flex`,justifyContent:`center`,position:`relative`},children:[(0,D.jsx)(`button`,{"data-testid":`overflow-${e.key}`,onClick:()=>_(h===e.key?null:e.key),style:{background:`none`,border:`none`,cursor:`pointer`,color:v.textDim,fontSize:16,padding:4},children:`⋯`}),h===e.key&&(0,D.jsxs)(`div`,{"data-testid":`overflow-menu-${e.key}`,style:{position:`absolute`,top:`100%`,right:0,zIndex:10,background:v.surface,border:`1px solid ${v.border}`,borderRadius:6,padding:4,minWidth:200,boxShadow:`0 4px 12px rgba(0,0,0,0.3)`},children:[(0,D.jsx)(`button`,{"data-testid":`reset-random-${e.key}`,onClick:()=>{_(null),x(e.key)},title:`Use this to immediately invalidate a compromised secret while you arrange a replacement.`,style:{display:`block`,width:`100%`,textAlign:`left`,background:`none`,border:`none`,cursor:`pointer`,fontFamily:v.sans,fontSize:12,color:v.accent,padding:`6px 10px`,borderRadius:4},onMouseEnter:e=>{e.currentTarget.style.background=v.surfaceHover},onMouseLeave:e=>{e.currentTarget.style.background=`none`},children:`Reset to random (pending)`}),(0,D.jsx)(`button`,{"data-testid":`delete-key-${e.key}`,onClick:()=>{_(null),C(e.key)},style:{display:`block`,width:`100%`,textAlign:`left`,background:`none`,border:`none`,cursor:`pointer`,fontFamily:v.sans,fontSize:12,color:v.red,padding:`6px 10px`,borderRadius:4},onMouseEnter:e=>{e.currentTarget.style.background=v.surfaceHover},onMouseLeave:e=>{e.currentTarget.style.background=`none`},children:`Delete key`})]})]})]},e.key)),s&&(0,D.jsxs)(`div`,{style:{padding:`12px 20px`,borderTop:`1px solid ${v.border}`,display:`flex`,flexDirection:`column`,gap:10},children:[(0,D.jsxs)(`div`,{style:{display:`flex`,gap:10,alignItems:`center`},children:[(0,D.jsx)(`input`,{"data-testid":`new-key-input`,placeholder:`KEY_NAME`,value:d,onChange:e=>f(e.target.value),style:{flex:`0 0 240px`,background:`#0D0F14`,border:`1px solid ${v.accent}66`,borderRadius:5,padding:`6px 10px`,fontFamily:v.mono,fontSize:12,color:v.text,outline:`none`}}),(0,D.jsxs)(`div`,{role:`radiogroup`,style:{display:`flex`,border:`1px solid ${v.border}`,borderRadius:6,overflow:`hidden`},children:[(0,D.jsx)(`button`,{"data-testid":`mode-set-value`,role:`radio`,"aria-checked":l===`value`,onClick:()=>{u(`value`),m(``)},style:{fontFamily:v.sans,fontSize:11,fontWeight:600,padding:`4px 14px`,border:`none`,borderRight:`1px solid ${v.border}`,background:l===`value`?`${v.accent}22`:`transparent`,color:l===`value`?v.accent:v.textMuted,cursor:`pointer`},children:`Set value`}),(0,D.jsx)(`button`,{"data-testid":`mode-random`,role:`radio`,"aria-checked":l===`random`,onClick:()=>{u(`random`),m(``)},style:{fontFamily:v.sans,fontSize:11,fontWeight:600,padding:`4px 14px`,border:`none`,background:l===`random`?`${v.accent}22`:`transparent`,color:l===`random`?v.accent:v.textMuted,cursor:`pointer`},children:`Random (pending)`})]})]}),(0,D.jsxs)(`div`,{style:{display:`flex`,gap:10,alignItems:`center`},children:[l===`value`?(0,D.jsx)(`input`,{"data-testid":`new-value-input`,type:`password`,placeholder:`value`,value:p,onChange:e=>m(e.target.value),autoComplete:`off`,style:{flex:1,background:`#0D0F14`,border:`1px solid ${v.border}`,borderRadius:5,padding:`6px 10px`,fontFamily:v.mono,fontSize:12,color:v.text,outline:`none`}}):(0,D.jsx)(`div`,{style:{flex:1,fontFamily:v.mono,fontSize:11,fontStyle:`italic`,color:v.accent,padding:`6px 10px`},children:`A cryptographically random placeholder will be generated server-side.`}),(0,D.jsx)(M,{variant:`primary`,"data-testid":`add-key-submit`,onClick:()=>{oe?re(`add`):de()},children:l===`random`?`Generate random value`:`Add`}),(0,D.jsx)(M,{onClick:()=>{c(!1),u(`value`),f(``),m(``)},children:`Cancel`})]})]})]}),b&&(0,D.jsxs)(`div`,{"data-testid":`confirm-reset-dialog`,style:{marginTop:16,padding:`14px 18px`,background:`${v.accent}0A`,border:`1px solid ${v.accent}33`,borderRadius:8,fontFamily:v.sans,fontSize:12},children:[(0,D.jsxs)(`p`,{style:{color:v.text,margin:`0 0 10px 0`},children:[`Reset `,(0,D.jsx)(`strong`,{style:{fontFamily:v.mono},children:b}),` to a random placeholder? The current value will be overwritten.`]}),oe&&(0,D.jsxs)(`p`,{style:{color:v.red,margin:`0 0 10px 0`,fontSize:12,fontWeight:600},children:[`🔒`,` This is a protected environment.`]}),(0,D.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,D.jsx)(M,{variant:`primary`,"data-testid":`confirm-reset-yes`,onClick:()=>fe(b),children:`Reset to random`}),(0,D.jsx)(M,{"data-testid":`confirm-reset-no`,onClick:()=>x(null),children:`Cancel`})]})]}),S&&(0,D.jsxs)(`div`,{"data-testid":`confirm-delete-dialog`,style:{marginTop:16,padding:`14px 18px`,background:v.redDim,border:`1px solid ${v.red}44`,borderRadius:8,fontFamily:v.sans,fontSize:12},children:[(0,D.jsxs)(`p`,{style:{color:v.text,margin:`0 0 10px 0`},children:[`Permanently delete`,` `,(0,D.jsx)(`strong`,{style:{fontFamily:v.mono},children:S}),` from`,` `,(0,D.jsx)(`strong`,{children:r}),`? This cannot be undone.`]}),oe&&(0,D.jsxs)(`p`,{style:{color:v.red,margin:`0 0 10px 0`,fontSize:12,fontWeight:600},children:[`🔒`,` This is a protected environment.`]}),(0,D.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,D.jsx)(M,{variant:`danger`,"data-testid":`confirm-delete-yes`,onClick:()=>me(S),children:`Delete`}),(0,D.jsx)(M,{"data-testid":`confirm-delete-no`,onClick:()=>C(null),children:`Cancel`})]})]}),ne&&(0,D.jsxs)(`div`,{"data-testid":`confirm-protected-dialog`,style:{marginTop:16,padding:`14px 18px`,background:v.redDim,border:`1px solid ${v.red}44`,borderRadius:8,fontFamily:v.sans,fontSize:12},children:[(0,D.jsxs)(`p`,{style:{color:v.text,margin:`0 0 10px 0`},children:[`🔒`,` `,(0,D.jsx)(`strong`,{style:{color:v.red},children:`Protected environment.`}),` You are about to `,ne===`save`?`commit changes to`:`add a key to`,` `,(0,D.jsx)(`strong`,{children:r}),`. Are you sure?`]}),(0,D.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,D.jsx)(M,{variant:`primary`,"data-testid":`confirm-protected-yes`,onClick:async()=>{let e=ne;re(null),e===`save`?await ue(!0):await de(!0)},children:`Confirm`}),(0,D.jsx)(M,{"data-testid":`confirm-protected-no`,onClick:()=>re(null),children:`Cancel`})]})]}),(0,D.jsxs)(`div`,{style:{marginTop:24},children:[(0,D.jsxs)(`div`,{style:{fontFamily:v.sans,fontSize:11,fontWeight:600,color:v.textMuted,textTransform:`uppercase`,letterSpacing:`0.08em`,marginBottom:10},children:[`Schema `,`·`,` schemas/`,e,`.yaml`]}),(0,D.jsx)(`div`,{"data-testid":`schema-summary`,style:{background:v.surface,border:`1px solid ${v.border}`,borderRadius:8,padding:`12px 16px`,fontFamily:v.mono,fontSize:11,color:v.textMuted,lineHeight:1.7},children:(()=>{let e=R.filter(e=>e.severity===`error`),t=R.filter(e=>e.severity===`warning`);return e.length===0&&t.length===0?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`span`,{style:{color:v.green},children:`✓`}),` All required keys present \xA0`,`·`,`\xA0`,(0,D.jsx)(`span`,{style:{color:v.green},children:`✓`}),` All types valid \xA0`,`·`,`\xA0`,(0,D.jsx)(`span`,{style:{color:v.textDim},children:`0 warnings`})]}):(0,D.jsxs)(D.Fragment,{children:[e.length>0&&(0,D.jsxs)(`span`,{style:{color:v.red},children:[e.length,` error`,e.length===1?``:`s`]}),e.length>0&&t.length>0&&(0,D.jsxs)(`span`,{children:[` \xA0`,`·`,`\xA0 `]}),t.length>0&&(0,D.jsxs)(`span`,{style:{color:v.yellow},children:[t.length,` warning`,t.length===1?``:`s`]})]})})()})]})]})]})]})}function ne({text:e}){let[t,n]=(0,g.useState)(!1);return(0,D.jsx)(`button`,{"data-testid":`copy-button`,onClick:(0,g.useCallback)(()=>{navigator.clipboard?.writeText(e),n(!0),setTimeout(()=>n(!1),1800)},[e]),style:{background:t?v.greenDim:`none`,border:`1px solid ${t?v.green+`55`:v.borderLight}`,borderRadius:4,cursor:`pointer`,color:t?v.green:v.textDim,fontFamily:v.mono,fontSize:10,padding:`2px 8px`,transition:`all 0.15s`},children:t?`copied!`:`copy`})}function re(e,t){return e.length>t?e.slice(0,t)+`…`:e}function ie({manifest:e}){let t=e?.environments??[],n=e?.namespaces??[],[r,i]=(0,g.useState)(n[0]?.name??``),[a,o]=(0,g.useState)(t[0]?.name??``),[s,c]=(0,g.useState)(t[t.length-1]?.name??``),[l,u]=(0,g.useState)(!1),[d,f]=(0,g.useState)(!1),[p,m]=(0,g.useState)(null),[h,_]=(0,g.useState)(!1),[y,b]=(0,g.useState)(!1);(0,g.useEffect)(()=>{n.length>0&&!r&&i(n[0].name),t.length>0&&!a&&o(t[0].name),t.length>1&&!s&&c(t[t.length-1].name)},[n,t,r,a,s]);let x=(0,g.useCallback)(async()=>{if(!(!r||!a||!s||a===s)){_(!0);try{let e=await T(`/api/diff/${r}/${a}/${s}${d?`?showValues=true`:``}`);e.ok?m(await e.json()):m(null)}catch{m(null)}finally{_(!1)}}},[r,a,s,d]);(0,g.useEffect)(()=>{x()},[x]);let S=p?.rows??[],C=S.filter(e=>l||e.status!==`identical`),w=S.filter(e=>e.status===`changed`).length,E=S.filter(e=>e.status===`missing_a`).length,O=S.filter(e=>e.status===`missing_b`).length,k=S.filter(e=>e.status===`identical`).length,j=S.filter(e=>e.status===`missing_a`||e.status===`missing_b`),P={changed:{label:`Changed`,color:v.yellow},identical:{label:`Identical`,color:v.textMuted},missing_a:{label:`Missing in ${a}`,color:v.red},missing_b:{label:`Missing in ${s}`,color:v.red}};return(0,D.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:[(0,D.jsx)(A,{title:`Environment Diff`,subtitle:`Compare secrets across environments`,actions:(0,D.jsxs)(M,{variant:`primary`,"data-testid":`sync-missing-btn`,onClick:()=>{b(!0),setTimeout(()=>b(!1),2e3)},children:[`Sync missing keys `,`→`]})}),y&&(0,D.jsx)(`div`,{"data-testid":`coming-soon-toast`,style:{position:`fixed`,top:20,right:20,padding:`10px 18px`,background:v.surface,border:`1px solid ${v.accent}44`,borderRadius:8,fontFamily:v.sans,fontSize:12,color:v.accent,zIndex:1e3},children:`Coming soon`}),(0,D.jsxs)(`div`,{style:{padding:`14px 24px`,background:`#0D0F14`,borderBottom:`1px solid ${v.border}`,display:`flex`,alignItems:`center`,gap:12,flexWrap:`wrap`},children:[(0,D.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,D.jsx)(`span`,{style:{fontFamily:v.sans,fontSize:12,color:v.textMuted},children:`Namespace`}),(0,D.jsx)(`select`,{value:r,onChange:e=>i(e.target.value),style:{background:v.surface,border:`1px solid ${v.border}`,borderRadius:6,padding:`5px 10px`,fontFamily:v.mono,fontSize:12,color:v.text,cursor:`pointer`},children:n.map(e=>(0,D.jsx)(`option`,{value:e.name,children:e.name},e.name))})]}),(0,D.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,D.jsx)(`span`,{style:{fontFamily:v.sans,fontSize:12,color:v.textMuted},children:`Compare`}),(0,D.jsx)(`select`,{value:a,onChange:e=>o(e.target.value),style:{background:v.surface,border:`1px solid ${v.border}`,borderRadius:6,padding:`5px 10px`,fontFamily:v.mono,fontSize:12,color:v.text,cursor:`pointer`},children:t.map(e=>(0,D.jsx)(`option`,{value:e.name,children:e.name},e.name))}),(0,D.jsx)(`span`,{style:{fontFamily:v.mono,fontSize:12,color:v.textDim},children:`→`}),(0,D.jsx)(`select`,{value:s,onChange:e=>c(e.target.value),style:{background:v.surface,border:`1px solid ${v.border}`,borderRadius:6,padding:`5px 10px`,fontFamily:v.mono,fontSize:12,color:v.text,cursor:`pointer`},children:t.map(e=>(0,D.jsx)(`option`,{value:e.name,children:e.name},e.name))})]}),(0,D.jsx)(`div`,{style:{flex:1}}),(0,D.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:6,cursor:`pointer`},children:[(0,D.jsx)(`input`,{type:`checkbox`,checked:d,onChange:e=>f(e.target.checked),"data-testid":`show-values-toggle`,style:{accentColor:v.accent}}),(0,D.jsx)(`span`,{style:{fontFamily:v.sans,fontSize:12,color:v.textMuted},children:`Show values`})]}),(0,D.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:6,cursor:`pointer`},children:[(0,D.jsx)(`input`,{type:`checkbox`,checked:l,onChange:e=>u(e.target.checked),style:{accentColor:v.accent}}),(0,D.jsx)(`span`,{style:{fontFamily:v.sans,fontSize:12,color:v.textMuted},children:`Show identical`})]})]}),(0,D.jsx)(`div`,{style:{padding:`10px 24px`,display:`flex`,gap:10,borderBottom:`1px solid ${v.border}`},children:[{label:`${w} changed`,color:v.yellow},...E>0?[{label:`${E} missing in ${a}`,color:v.red}]:[],...O>0?[{label:`${O} missing in ${s}`,color:v.red}]:[],{label:`${k} identical`,color:v.textMuted}].map(e=>(0,D.jsx)(`span`,{style:{fontFamily:v.mono,fontSize:11,color:e.color,background:`${e.color}14`,border:`1px solid ${e.color}33`,borderRadius:20,padding:`2px 10px`},children:e.label},e.label))}),(0,D.jsxs)(`div`,{style:{flex:1,overflow:`auto`,padding:24},children:[h&&(0,D.jsx)(`p`,{style:{color:v.textMuted,fontFamily:v.sans},children:`Loading...`}),!h&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`div`,{"data-testid":`diff-table`,style:{background:v.surface,border:`1px solid ${v.border}`,borderRadius:10,overflow:`hidden`},children:[(0,D.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`220px 1fr 1fr 100px`,background:`#0D0F14`,padding:`10px 20px`,borderBottom:`1px solid ${v.border}`},children:[(0,D.jsx)(`span`,{style:{fontFamily:v.sans,fontSize:11,fontWeight:600,color:v.textMuted,textTransform:`uppercase`,letterSpacing:`0.07em`},children:`Key`}),(0,D.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,D.jsx)(N,{env:a,small:!0}),(0,D.jsx)(`span`,{style:{fontFamily:v.sans,fontSize:11,fontWeight:600,color:v.textMuted,textTransform:`uppercase`},children:a})]}),(0,D.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,D.jsx)(N,{env:s,small:!0}),(0,D.jsx)(`span`,{style:{fontFamily:v.sans,fontSize:11,fontWeight:600,color:v.textMuted,textTransform:`uppercase`},children:s})]}),(0,D.jsx)(`span`,{style:{fontFamily:v.sans,fontSize:11,fontWeight:600,color:v.textMuted,textTransform:`uppercase`},children:`Status`})]}),C.map((e,t)=>{let n=P[e.status];return(0,D.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`220px 1fr 1fr 100px`,padding:`0 20px`,minHeight:48,alignItems:`center`,borderBottom:t<C.length-1?`1px solid ${v.border}`:`none`,background:e.status===`changed`?`${v.yellow}06`:e.status.startsWith(`missing`)?`${v.red}06`:`transparent`},children:[(0,D.jsx)(`span`,{style:{fontFamily:v.mono,fontSize:12,color:v.text,paddingRight:16},children:e.key}),(0,D.jsx)(`div`,{style:{paddingRight:16},children:e.valueA===null?(0,D.jsxs)(`span`,{style:{fontFamily:v.mono,fontSize:11,color:v.textDim,fontStyle:`italic`},children:[`—`,` not set `,`—`]}):(0,D.jsx)(`span`,{style:{fontFamily:v.mono,fontSize:11,color:e.status===`changed`?v.yellow:v.textMuted,background:e.status===`changed`?v.yellowDim:`transparent`,padding:e.status===`changed`?`2px 6px`:`0`,borderRadius:3},children:re(e.valueA,36)})}),(0,D.jsx)(`div`,{style:{paddingRight:16},children:e.valueB===null?(0,D.jsxs)(`span`,{style:{fontFamily:v.mono,fontSize:11,color:v.textDim,fontStyle:`italic`},children:[`—`,` not set `,`—`]}):(0,D.jsx)(`span`,{style:{fontFamily:v.mono,fontSize:11,color:e.status===`changed`?v.blue:v.textMuted,background:e.status===`changed`?v.blueDim:`transparent`,padding:e.status===`changed`?`2px 6px`:`0`,borderRadius:3},children:re(e.valueB,36)})}),(0,D.jsx)(`span`,{style:{fontFamily:v.mono,fontSize:10,fontWeight:600,color:n.color,background:`${n.color}18`,border:`1px solid ${n.color}33`,borderRadius:3,padding:`2px 8px`,display:`inline-block`},children:n.label})]},e.key)})]}),j.length>0&&(0,D.jsx)(`div`,{"data-testid":`fix-hint`,style:{marginTop:20,padding:`14px 18px`,background:v.surface,border:`1px solid ${v.border}`,borderRadius:8,display:`flex`,flexDirection:`column`,gap:10},children:j.map(e=>{let t=e.status===`missing_a`?a:s,n=`clef set ${r}/${t} ${e.key}`;return(0,D.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,D.jsx)(`span`,{style:{fontSize:16},children:`💡`}),(0,D.jsxs)(`span`,{style:{fontFamily:v.sans,fontSize:12,color:v.textMuted,flex:1},children:[(0,D.jsx)(`strong`,{style:{color:v.text},children:e.key}),` is missing in`,` `,(0,D.jsx)(N,{env:t,small:!0}),`. Run`,` `,(0,D.jsx)(`code`,{style:{fontFamily:v.mono,fontSize:11,color:v.accent,background:v.accentDim,padding:`1px 6px`,borderRadius:3},children:n}),` `,`to add it.`]}),(0,D.jsx)(ne,{text:n})]},e.key)})})]})]})]})}function ae({setView:e,setNs:t}){let[n,r]=(0,g.useState)(`all`),[i,a]=(0,g.useState)([]),[o,s]=(0,g.useState)(null),[c,l]=(0,g.useState)(!1),u=(0,g.useCallback)(async()=>{l(!0);try{let e=await T(`/api/lint`);e.ok&&s(await e.json())}catch{}finally{l(!1)}},[]);(0,g.useEffect)(()=>{u()},[u]);let d=o?.issues??[],f=o?.fileCount??0,p=d.filter(e=>e.severity===`error`),m=d.filter(e=>e.severity===`warning`),h=d.filter(e=>e.severity===`info`),_=d.map((e,t)=>({...e,_idx:t})).filter(e=>!i.includes(e._idx)).filter(e=>n===`all`||e.severity===n||e.category===n),y=n=>{if(n.file){let r=n.file.split(`/`);t(r[r.length-2]??r[0]),e(`editor`)}},S=_.length===0;return(0,D.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:[(0,D.jsx)(A,{title:`Lint`,subtitle:`clef lint — full repo health check`,actions:(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(M,{onClick:u,children:[`↻`,` Re-run`]}),p.length===0&&(0,D.jsxs)(M,{variant:`primary`,children:[`All clear `,`—`,` commit`]})]})}),!c&&!S&&(0,D.jsxs)(`div`,{style:{padding:`14px 24px`,background:`#0D0F14`,borderBottom:`1px solid ${v.border}`,display:`flex`,alignItems:`center`,gap:10,flexWrap:`wrap`},children:[[{key:`all`,label:`All issues`,count:d.length,color:v.textMuted},{key:`error`,label:`Errors`,count:p.length,color:v.red},{key:`warning`,label:`Warnings`,count:m.length,color:v.yellow},{key:`info`,label:`Info`,count:h.length,color:v.blue}].map(e=>(0,D.jsxs)(`button`,{"data-testid":`filter-${e.key}`,onClick:()=>r(e.key),style:{display:`flex`,alignItems:`center`,gap:6,padding:`5px 12px`,borderRadius:20,cursor:`pointer`,fontFamily:v.sans,fontSize:12,fontWeight:n===e.key?600:400,color:n===e.key?e.color:v.textMuted,background:n===e.key?`${e.color}18`:`transparent`,border:`1px solid ${n===e.key?`${e.color}55`:v.border}`,transition:`all 0.12s`},children:[(0,D.jsx)(`span`,{style:{fontFamily:v.mono,fontSize:11,fontWeight:700,color:e.color},children:e.count}),e.label]},e.key)),(0,D.jsx)(`div`,{style:{flex:1}}),[`matrix`,`schema`,`sops`].map(e=>{let t=x[e];return(0,D.jsx)(`button`,{onClick:()=>r(n===e?`all`:e),style:{padding:`4px 10px`,borderRadius:4,cursor:`pointer`,fontFamily:v.mono,fontSize:10,fontWeight:600,color:n===e?t.color:v.textDim,background:n===e?`${t.color}18`:`transparent`,border:`1px solid ${n===e?`${t.color}55`:v.borderLight}`,letterSpacing:`0.06em`},children:t.label},e)})]}),(0,D.jsxs)(`div`,{style:{flex:1,overflow:`auto`,padding:24},children:[c&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`style`,{children:`
9
+ @keyframes clef-scan-line {
10
+ 0% { transform: scaleX(0); opacity: 0; }
11
+ 10% { opacity: 1; }
12
+ 50% { transform: scaleX(1); opacity: 1; }
13
+ 80% { transform: scaleX(1); opacity: 0.3; }
14
+ 100% { transform: scaleX(0); opacity: 0; }
15
+ }
16
+ @keyframes clef-scan-glow {
17
+ 0%, 100% { opacity: 0.4; }
18
+ 50% { opacity: 1; }
19
+ }
20
+ `}),(0,D.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,padding:`48px 24px`},children:(0,D.jsxs)(`div`,{style:{background:v.surface,border:`1px solid ${v.border}`,borderRadius:10,padding:`28px 40px`,textAlign:`center`,minWidth:200},children:[(0,D.jsx)(`div`,{style:{marginBottom:16,display:`flex`,flexDirection:`column`,gap:6},children:[0,.3,.6].map((e,t)=>(0,D.jsx)(`div`,{style:{height:3,borderRadius:2,background:v.accent,transformOrigin:`left`,animation:`clef-scan-line 1.8s ease-in-out ${e}s infinite`,opacity:0,width:[120,90,105][t]}},t))}),(0,D.jsx)(`div`,{style:{fontFamily:v.mono,fontSize:11,color:v.textMuted,animation:`clef-scan-glow 1.8s ease-in-out infinite`},children:`Linting...`})]})})]}),!c&&S&&(0,D.jsxs)(`div`,{"data-testid":`all-clear`,style:{display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:14,padding:`60px 0`},children:[(0,D.jsx)(`div`,{style:{width:56,height:56,borderRadius:`50%`,background:v.greenDim,border:`1px solid ${v.green}44`,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:24},children:`✓`}),(0,D.jsx)(`div`,{style:{fontFamily:v.sans,fontWeight:600,fontSize:16,color:v.green},children:`All clear`}),(0,D.jsxs)(`div`,{style:{fontFamily:v.mono,fontSize:12,color:v.textMuted},children:[`No issues found across `,f,` files`]})]}),!c&&!S&&[`error`,`warning`,`info`].map(e=>{let t=_.filter(t=>t.severity===e);if(!t.length)return null;let n=b[e];return(0,D.jsxs)(`div`,{style:{marginBottom:24},children:[(0,D.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,marginBottom:10},children:[(0,D.jsx)(`div`,{style:{width:22,height:22,borderRadius:`50%`,background:n.bg,border:`1px solid ${n.color}44`,display:`flex`,alignItems:`center`,justifyContent:`center`,fontFamily:v.mono,fontSize:11,fontWeight:700,color:n.color},children:n.icon}),(0,D.jsxs)(`span`,{style:{fontFamily:v.sans,fontWeight:600,fontSize:13,color:n.color},children:[n.label,`s`]}),(0,D.jsx)(`span`,{style:{fontFamily:v.mono,fontSize:10,color:n.color,background:n.bg,border:`1px solid ${n.color}33`,borderRadius:10,padding:`1px 8px`},children:t.length})]}),(0,D.jsx)(`div`,{style:{background:v.surface,border:`1px solid ${v.border}`,borderRadius:10,overflow:`hidden`},children:t.map((e,r)=>{let i=x[e.category]??{label:e.category,color:v.textMuted},o=e.file?.split(`/`)??[],s=o.length>=2?o[o.length-1]?.replace(`.enc.yaml`,``):void 0;return(0,D.jsxs)(`div`,{style:{display:`flex`,alignItems:`flex-start`,borderBottom:r<t.length-1?`1px solid ${v.border}`:`none`,borderLeft:`3px solid ${n.color}66`,transition:`background 0.1s`,padding:`14px 18px`,gap:14},children:[(0,D.jsx)(`div`,{style:{flexShrink:0,paddingTop:2},children:(0,D.jsx)(`span`,{style:{fontFamily:v.mono,fontSize:9,fontWeight:700,color:i.color,background:`${i.color}18`,border:`1px solid ${i.color}33`,borderRadius:3,padding:`2px 6px`,letterSpacing:`0.07em`,textTransform:`uppercase`},children:i.label})}),(0,D.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,D.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:4,flexWrap:`wrap`},children:[(0,D.jsx)(`span`,{"data-testid":`file-ref-${e.file}`,role:`link`,tabIndex:0,onClick:()=>y(e),onKeyDown:t=>{t.key===`Enter`&&y(e)},style:{fontFamily:v.mono,fontSize:12,fontWeight:600,color:v.accent,cursor:e.file?`pointer`:`default`,textDecoration:e.file?`underline`:`none`,textDecorationColor:`${v.accent}55`,textDecorationStyle:`dotted`},children:e.file}),e.key&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`span`,{style:{fontFamily:v.mono,fontSize:11,color:v.textDim},children:`→`}),(0,D.jsx)(`span`,{style:{fontFamily:v.mono,fontSize:11,color:v.text,background:`#1A1F2B`,border:`1px solid ${v.borderLight}`,borderRadius:3,padding:`1px 7px`},children:e.key})]}),s&&(0,D.jsx)(N,{env:s,small:!0})]}),(0,D.jsx)(`div`,{style:{fontFamily:v.sans,fontSize:12,color:v.textMuted,marginBottom:e.fixCommand?10:0},children:e.message}),e.fixCommand&&(0,D.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,background:`#0D0F14`,border:`1px solid ${v.borderLight}`,borderRadius:6,padding:`6px 10px`,width:`fit-content`},children:[(0,D.jsx)(`span`,{style:{fontFamily:v.mono,fontSize:11,color:v.green},children:`$`}),(0,D.jsx)(`span`,{style:{fontFamily:v.mono,fontSize:11,color:v.text},children:e.fixCommand}),(0,D.jsx)(ne,{text:e.fixCommand})]})]}),(0,D.jsx)(`button`,{onClick:()=>a(t=>[...t,e._idx]),title:`Dismiss`,"aria-label":`Dismiss issue`,style:{background:`none`,border:`none`,cursor:`pointer`,color:v.textDim,fontSize:16,flexShrink:0,padding:`0 4px`,lineHeight:1,transition:`color 0.1s`},children:`×`})]},e._idx)})})]},e)}),!c&&!S&&(0,D.jsxs)(`div`,{style:{marginTop:8,padding:`12px 16px`,background:v.surface,border:`1px solid ${v.border}`,borderRadius:8,display:`flex`,alignItems:`center`,gap:12},children:[(0,D.jsx)(`span`,{style:{fontSize:14},children:`💡`}),(0,D.jsxs)(`span`,{style:{fontFamily:v.sans,fontSize:12,color:v.textMuted},children:[`Fix all errors before committing. Warnings and info items won't block commits but should be reviewed. Run`,` `,(0,D.jsx)(`code`,{style:{fontFamily:v.mono,fontSize:11,color:v.accent,background:v.accentDim,padding:`1px 6px`,borderRadius:3},children:`clef lint --fix`}),` `,`to auto-resolve safe issues.`]})]})]})]})}function oe(){let[e,t]=(0,g.useState)(`idle`),[n,r]=(0,g.useState)(`all`),[i,a]=(0,g.useState)(null),[o,s]=(0,g.useState)(null),[c,l]=(0,g.useState)([]),[u,d]=(0,g.useState)(`all`);(0,g.useEffect)(()=>{T(`/api/scan/status`).then(e=>e.ok?e.json():null).then(e=>{e?.lastRun&&(a(e.lastRun),s(e.lastRunAt),t(e.lastRun.matches.length>0||e.lastRun.unencryptedMatrixFiles.length>0?`issues`:`clean`))}).catch(()=>{})},[]);let f=(0,g.useCallback)(async()=>{t(`scanning`),l([]);try{let e=await T(`/api/scan`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({severity:n})});if(!e.ok)throw Error(`Scan failed`);let r=await e.json();a(r),s(new Date().toISOString()),t(r.matches.length>0||r.unencryptedMatrixFiles.length>0?`issues`:`clean`)}catch{t(`idle`)}},[n]),p=async e=>{try{await T(`/api/editor/open`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({file:e})})}catch{}},m=e=>{if(!e)return``;let t=Date.now()-new Date(e).getTime();return t<6e4?`just now`:`${Math.floor(t/6e4)}m ago`},h=(i?.matches??[]).map((e,t)=>({...e,_idx:t})).filter(e=>!c.includes(e._idx)).filter(e=>u===`pattern`?e.matchType===`pattern`:u===`entropy`?e.matchType===`entropy`:!0),_=c.length,y=(i?.matches.length??0)+(i?.unencryptedMatrixFiles.length??0),b=i?(i.durationMs/1e3).toFixed(1):`0.0`;return(0,D.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:[(0,D.jsx)(A,{title:`Scan`,subtitle:`clef scan — detect plaintext secrets`,actions:e===`issues`||e===`clean`?(0,D.jsx)(M,{onClick:f,children:`↺ Scan again`}):void 0}),(0,D.jsxs)(`div`,{style:{flex:1,overflow:`auto`,padding:24},children:[e===`idle`&&(0,D.jsxs)(`div`,{"data-testid":`scan-idle`,style:{maxWidth:520,margin:`0 auto`,paddingTop:40},children:[(0,D.jsx)(`div`,{style:{fontFamily:v.sans,fontSize:14,color:v.textMuted,marginBottom:24,lineHeight:1.6},children:`Scans your repository for secrets that have escaped the Clef matrix — plaintext values in files that should be encrypted.`}),(0,D.jsxs)(`div`,{style:{marginBottom:24},children:[(0,D.jsx)(`div`,{style:{fontFamily:v.sans,fontSize:12,fontWeight:600,color:v.textMuted,marginBottom:10,letterSpacing:`0.05em`,textTransform:`uppercase`},children:`Severity`}),[`all`,`high`].map(e=>(0,D.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:10,marginBottom:8,cursor:`pointer`,fontFamily:v.sans,fontSize:13,color:n===e?v.text:v.textMuted},children:[(0,D.jsx)(`input`,{type:`radio`,name:`severity`,value:e,checked:n===e,onChange:()=>r(e),style:{accentColor:v.accent},"data-testid":`severity-${e}`}),e===`all`?`All (patterns + entropy)`:`High (patterns only)`]},e))]}),(0,D.jsx)(M,{variant:`primary`,onClick:f,"data-testid":`scan-button`,children:`Scan repository`}),(0,D.jsxs)(`div`,{style:{marginTop:24,padding:`12px 16px`,background:v.surface,border:`1px solid ${v.border}`,borderRadius:8,fontFamily:v.sans,fontSize:12,color:v.textMuted},children:[`ℹ️ `,(0,D.jsx)(`code`,{style:{fontFamily:v.mono},children:`clef scan`}),` runs automatically on every commit via the pre-commit hook.`]})]}),e===`scanning`&&(0,D.jsxs)(`div`,{"data-testid":`scan-scanning`,style:{display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:16,paddingTop:80},children:[(0,D.jsx)(`div`,{style:{width:40,height:40,borderRadius:`50%`,border:`3px solid ${v.accent}44`,borderTopColor:v.accent,animation:`spin 0.8s linear infinite`}}),(0,D.jsx)(`div`,{style:{fontFamily:v.sans,fontSize:14,color:v.textMuted},children:`Scanning...`})]}),e===`clean`&&i&&(0,D.jsxs)(`div`,{"data-testid":`scan-clean`,style:{display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:14,paddingTop:60},children:[(0,D.jsx)(`div`,{style:{width:56,height:56,borderRadius:`50%`,background:v.greenDim,border:`1px solid ${v.green}44`,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:24,color:v.green},children:`✓`}),(0,D.jsx)(`div`,{style:{fontFamily:v.sans,fontWeight:600,fontSize:16,color:v.green},children:`No issues found`}),(0,D.jsxs)(`div`,{style:{fontFamily:v.mono,fontSize:12,color:v.textMuted},children:[i.filesScanned,` files scanned in `,b,`s`]}),(0,D.jsxs)(`div`,{style:{fontFamily:v.mono,fontSize:11,color:v.textDim},children:[`Last run: `,m(o)]})]}),e===`issues`&&i&&(0,D.jsxs)(`div`,{children:[(0,D.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,marginBottom:20,flexWrap:`wrap`},children:[(0,D.jsxs)(`span`,{style:{fontFamily:v.sans,fontSize:14,color:v.text,fontWeight:600},children:[y,` issue`,y===1?``:`s`,` found in `,i.filesScanned,` `,`files (`,b,`s)`]}),(0,D.jsx)(`div`,{style:{flex:1}}),[{key:`all`,label:`All`},{key:`unencrypted`,label:`Unencrypted`},{key:`pattern`,label:`Pattern`},{key:`entropy`,label:`Entropy`}].map(({key:e,label:t})=>(0,D.jsx)(`button`,{"data-testid":`filter-${e}`,onClick:()=>d(e),style:{padding:`4px 10px`,borderRadius:4,cursor:`pointer`,fontFamily:v.mono,fontSize:11,fontWeight:u===e?600:400,color:u===e?v.accent:v.textMuted,background:u===e?v.accentDim:`transparent`,border:`1px solid ${u===e?v.accent+`55`:v.borderLight}`},children:t},e))]}),(u===`all`||u===`unencrypted`)&&i.unencryptedMatrixFiles.map(e=>(0,D.jsx)(se,{type:`error`,typeLabel:`UNENCRYPTED FILE`,file:e,message:`Missing SOPS metadata — file is in plaintext.`,fixCommand:`clef encrypt ${e.replace(/\.enc\.(yaml|json)$/,``)}`,onViewFile:()=>p(e)},`unenc-${e}`)),h.map(e=>(0,D.jsx)(se,{type:`warning`,typeLabel:e.matchType===`pattern`?(e.patternName??`Pattern match`).toUpperCase():`HIGH ENTROPY (${e.entropy?.toFixed(1)})`,file:`${e.file}:${e.line}`,message:e.preview,fixCommand:e.matchType===`pattern`?`clef set <namespace>/<env> <KEY>`:`clef set <namespace>/<env> ${e.preview.split(`=`)[0]}`,onViewFile:()=>p(e.file),onDismiss:()=>l(t=>[...t,e._idx])},`match-${e._idx}`)),_>0&&(0,D.jsxs)(`div`,{style:{fontFamily:v.mono,fontSize:11,color:v.textDim,marginTop:12},children:[_,` dismissed`]})]})]})]})}function se({type:e,typeLabel:t,file:n,message:r,fixCommand:i,onViewFile:a,onDismiss:o}){let s=e===`error`?v.red:v.yellow;return(0,D.jsxs)(`div`,{style:{background:v.surface,border:`1px solid ${v.border}`,borderLeft:`3px solid ${s}66`,borderRadius:8,padding:`14px 18px`,marginBottom:12,display:`flex`,alignItems:`flex-start`,gap:14},children:[(0,D.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,D.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:6,flexWrap:`wrap`},children:[(0,D.jsx)(`span`,{style:{fontFamily:v.mono,fontSize:9,fontWeight:700,color:s,background:`${s}18`,border:`1px solid ${s}33`,borderRadius:3,padding:`2px 6px`,letterSpacing:`0.07em`},children:t}),(0,D.jsx)(`span`,{style:{fontFamily:v.mono,fontSize:12,color:v.accent,cursor:a?`pointer`:`default`},onClick:a,role:a?`button`:void 0,tabIndex:a?0:void 0,onKeyDown:a?e=>{e.key===`Enter`&&a()}:void 0,children:n})]}),(0,D.jsx)(`div`,{style:{fontFamily:v.mono,fontSize:12,color:v.text,marginBottom:10},"data-testid":`match-preview`,children:r}),(0,D.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,background:`#0D0F14`,border:`1px solid ${v.borderLight}`,borderRadius:6,padding:`6px 10px`,width:`fit-content`},children:[(0,D.jsx)(`span`,{style:{fontFamily:v.mono,fontSize:11,color:v.green},children:`$`}),(0,D.jsx)(`span`,{style:{fontFamily:v.mono,fontSize:11,color:v.text},children:i}),(0,D.jsx)(ne,{text:i})]}),a&&(0,D.jsx)(`button`,{"data-testid":`view-file-button`,onClick:a,style:{marginTop:8,background:`none`,border:`1px solid ${v.borderLight}`,borderRadius:4,cursor:`pointer`,color:v.textMuted,fontFamily:v.sans,fontSize:11,padding:`3px 8px`},children:`View file`})]}),o&&(0,D.jsx)(`button`,{"data-testid":`dismiss-button`,onClick:o,title:`Dismiss`,"aria-label":`Dismiss issue`,style:{background:`none`,border:`none`,cursor:`pointer`,color:v.textDim,fontSize:16,flexShrink:0,padding:`0 4px`,lineHeight:1},children:`×`})]})}function ce({manifest:e,setView:t}){let[n,r]=(0,g.useState)(1),[i,a]=(0,g.useState)(``),[o,s]=(0,g.useState)(``),[c,l]=(0,g.useState)(``),[u,d]=(0,g.useState)(`auto`),[f,p]=(0,g.useState)(null),[m,h]=(0,g.useState)([]),[_,y]=(0,g.useState)(null),[b,x]=(0,g.useState)(!1),[S,C]=(0,g.useState)(null);(0,g.useEffect)(()=>{e&&(!i&&e.namespaces.length>0&&a(e.namespaces[0].name),!o&&e.environments.length>0&&s(e.environments[0].name))},[e,i,o]);let w=e?.namespaces??[],E=e?.environments??[],O=async()=>{if(!i||!o||!c.trim()){C(`Please select a namespace, environment, and paste content.`);return}x(!0),C(null);try{let e=await T(`/api/import/preview`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({target:`${i}/${o}`,content:c,format:u===`auto`?void 0:u,overwriteKeys:m})});if(!e.ok){C((await e.json()).error??`Preview failed`);return}p(await e.json()),h([]),r(2)}catch(e){C(e instanceof Error?e.message:`Preview failed`)}finally{x(!1)}},k=async()=>{if(!f)return;x(!0),C(null);let e=[...f.wouldImport,...f.wouldSkip.filter(e=>m.includes(e.key)).map(e=>e.key)];try{let t=await T(`/api/import/apply`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({target:`${i}/${o}`,content:c,format:u===`auto`?void 0:u,keys:e,overwriteKeys:m})});if(!t.ok){C((await t.json()).error??`Import failed`);return}y(await t.json()),l(``),r(3)}catch(e){C(e instanceof Error?e.message:`Import failed`)}finally{x(!1)}},j=()=>{r(1),l(``),p(null),y(null),h([]),C(null)},N=e=>{h(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},P=(f?.wouldImport.length??0)+m.filter(e=>f?.wouldSkip.some(t=>t.key===e)).length;return(0,D.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:[(0,D.jsx)(A,{title:`Import`,subtitle:`clef import — bulk migrate secrets`}),(0,D.jsx)(`div`,{style:{flex:1,overflow:`auto`,padding:24},children:(0,D.jsxs)(`div`,{style:{maxWidth:620,margin:`0 auto`},children:[(0,D.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:0,marginBottom:32},children:[1,2,3].map((e,t)=>(0,D.jsxs)(g.Fragment,{children:[(0,D.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,D.jsx)(`div`,{style:{width:24,height:24,borderRadius:`50%`,background:n>=e?v.accent:v.surface,border:`1px solid ${n>=e?v.accent:v.border}`,display:`flex`,alignItems:`center`,justifyContent:`center`,fontFamily:v.mono,fontSize:11,fontWeight:700,color:n>=e?`#000`:v.textDim},children:e}),(0,D.jsx)(`span`,{style:{fontFamily:v.sans,fontSize:12,color:n>=e?v.text:v.textDim,fontWeight:n===e?600:400},children:e===1?`Source`:e===2?`Preview`:`Done`})]}),t<2&&(0,D.jsx)(`div`,{style:{flex:1,height:1,background:n>e?v.accent:v.border,margin:`0 12px`,minWidth:40}})]},e))}),S&&(0,D.jsx)(`div`,{style:{background:v.redDim,border:`1px solid ${v.red}44`,borderRadius:8,padding:`12px 16px`,marginBottom:16,fontFamily:v.sans,fontSize:13,color:v.red},children:S}),n===1&&(0,D.jsxs)(`div`,{children:[(0,D.jsxs)(`div`,{style:{marginBottom:20},children:[(0,D.jsx)(le,{children:`Target`}),(0,D.jsxs)(`div`,{style:{display:`flex`,gap:12},children:[(0,D.jsxs)(`div`,{style:{flex:1},children:[(0,D.jsx)(ue,{children:`Namespace`}),(0,D.jsx)(de,{value:i,onChange:e=>a(e.target.value),children:w.map(e=>(0,D.jsx)(`option`,{value:e.name,children:e.name},e.name))})]}),(0,D.jsxs)(`div`,{style:{flex:1},children:[(0,D.jsx)(ue,{children:`Environment`}),(0,D.jsx)(de,{value:o,onChange:e=>s(e.target.value),children:E.map(e=>(0,D.jsx)(`option`,{value:e.name,children:e.name},e.name))})]})]})]}),(0,D.jsxs)(`div`,{style:{marginBottom:20},children:[(0,D.jsx)(le,{children:`Format`}),(0,D.jsx)(`div`,{style:{display:`flex`,gap:16},children:[`auto`,`dotenv`,`json`,`yaml`].map(e=>(0,D.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:6,cursor:`pointer`,fontFamily:v.sans,fontSize:13,color:u===e?v.text:v.textMuted},children:[(0,D.jsx)(`input`,{type:`radio`,name:`format`,value:e,checked:u===e,onChange:()=>d(e),style:{accentColor:v.accent}}),e===`auto`?`Auto`:e]},e))})]}),(0,D.jsxs)(`div`,{style:{marginBottom:8},children:[(0,D.jsx)(le,{children:`Paste secrets`}),(0,D.jsx)(`textarea`,{value:c,onChange:e=>l(e.target.value),placeholder:u===`json`?`{
21
+ "DB_HOST": "localhost",
22
+ "DB_PORT": "5432"
23
+ }`:u===`yaml`?`DB_HOST: localhost
24
+ DB_PORT: '5432'`:`DB_HOST=localhost
25
+ DB_PORT=5432
26
+ # Comments are ignored`,rows:12,style:{width:`100%`,background:v.surface,border:`1px solid ${v.border}`,borderRadius:8,padding:14,fontFamily:v.mono,fontSize:12,color:v.text,resize:`vertical`,outline:`none`,boxSizing:`border-box`}})]}),(0,D.jsx)(`div`,{style:{marginBottom:24,padding:`10px 14px`,background:v.surface,border:`1px solid ${v.border}`,borderRadius:6,fontFamily:v.sans,fontSize:11,color:v.textMuted,lineHeight:1.5},children:`Values are sent directly to the local Clef server (127.0.0.1) and encrypted immediately. They are never stored in browser memory beyond this session.`}),(0,D.jsx)(M,{variant:`primary`,onClick:O,disabled:b||!c.trim(),children:b?`Previewing...`:`Next: Preview`})]}),n===2&&f&&(0,D.jsxs)(`div`,{children:[(0,D.jsxs)(`div`,{style:{fontFamily:v.sans,fontSize:13,color:v.textMuted,marginBottom:20},children:[`Importing to`,` `,(0,D.jsxs)(`span`,{style:{color:v.accent,fontWeight:600},children:[i,`/`,o]}),`. `,f.totalKeys,` key`,f.totalKeys===1?``:`s`,` parsed.`]}),f.warnings.length>0&&(0,D.jsx)(`div`,{style:{marginBottom:16},children:f.warnings.map((e,t)=>(0,D.jsxs)(`div`,{style:{fontFamily:v.mono,fontSize:11,color:v.yellow,marginBottom:4},children:[`⚠ `,e]},t))}),f.wouldImport.length>0&&(0,D.jsxs)(`div`,{style:{marginBottom:16},children:[(0,D.jsxs)(fe,{color:v.green,children:[`New keys (`,f.wouldImport.length,`)`]}),f.wouldImport.map(e=>(0,D.jsx)(pe,{icon:`\\u2192`,iconColor:v.green,label:e},e))]}),f.wouldSkip.length>0&&(0,D.jsxs)(`div`,{style:{marginBottom:16},children:[(0,D.jsxs)(fe,{color:v.yellow,children:[`Already exists (`,f.wouldSkip.length,`) — toggle to overwrite`]}),f.wouldSkip.map(({key:e,reason:t})=>{let n=m.includes(e);return(0,D.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,padding:`6px 10px`,borderRadius:6,marginBottom:4,background:n?v.yellowDim:`transparent`,border:`1px solid ${n?v.yellow+`44`:v.border}`},children:[(0,D.jsx)(`input`,{type:`checkbox`,checked:n,onChange:()=>N(e),style:{accentColor:v.yellow},id:`overwrite-${e}`}),(0,D.jsx)(`label`,{htmlFor:`overwrite-${e}`,style:{fontFamily:v.mono,fontSize:12,color:n?v.yellow:v.textMuted,flex:1,cursor:`pointer`},children:e}),(0,D.jsx)(`span`,{style:{fontFamily:v.sans,fontSize:11,color:v.textDim},children:t})]},e)})]}),f.wouldImport.length===0&&f.wouldSkip.length===0&&(0,D.jsx)(`div`,{style:{fontFamily:v.sans,fontSize:13,color:v.textMuted,padding:`24px 0`,textAlign:`center`},children:`No importable keys found.`}),(0,D.jsxs)(`div`,{style:{display:`flex`,gap:10,marginTop:24},children:[(0,D.jsx)(M,{variant:`ghost`,onClick:()=>r(1),children:`Back`}),(0,D.jsx)(M,{variant:`primary`,onClick:k,disabled:b||P===0,children:b?`Importing...`:`Import ${P} key${P===1?``:`s`}`})]})]}),n===3&&_&&(0,D.jsxs)(`div`,{children:[(0,D.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`,paddingTop:20,paddingBottom:32},children:[(0,D.jsx)(`div`,{style:{width:56,height:56,borderRadius:`50%`,background:_.failed.length>0?v.redDim:v.greenDim,border:`1px solid ${_.failed.length>0?v.red+`44`:v.green+`44`}`,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:24,color:_.failed.length>0?v.red:v.green,marginBottom:16},children:_.failed.length>0?`⚠`:`✓`}),(0,D.jsx)(`div`,{style:{fontFamily:v.sans,fontWeight:600,fontSize:16,color:_.failed.length>0?v.yellow:v.green,marginBottom:8},children:_.failed.length>0?`Import completed with errors`:`Import complete`}),(0,D.jsxs)(`div`,{style:{fontFamily:v.mono,fontSize:12,color:v.textMuted},children:[_.imported.length,` imported, `,_.skipped.length,` skipped,`,` `,_.failed.length,` failed`]})]}),_.imported.length>0&&(0,D.jsxs)(`div`,{style:{marginBottom:16},children:[(0,D.jsxs)(fe,{color:v.green,children:[`Imported (`,_.imported.length,`)`]}),_.imported.map(e=>(0,D.jsx)(pe,{icon:`\\u2713`,iconColor:v.green,label:e},e))]}),_.failed.length>0&&(0,D.jsxs)(`div`,{style:{marginBottom:16},children:[(0,D.jsxs)(fe,{color:v.red,children:[`Failed (`,_.failed.length,`)`]}),_.failed.map(({key:e,error:t})=>(0,D.jsx)(pe,{icon:`\\u2717`,iconColor:v.red,label:e,note:t},e))]}),(0,D.jsxs)(`div`,{style:{display:`flex`,gap:10,marginTop:24},children:[(0,D.jsx)(M,{variant:`primary`,onClick:()=>t(`matrix`),children:`View in Matrix`}),(0,D.jsx)(M,{variant:`ghost`,onClick:j,children:`Import more`})]})]})]})})]})}function le({children:e}){return(0,D.jsx)(`div`,{style:{fontFamily:v.sans,fontSize:12,fontWeight:600,color:v.textMuted,marginBottom:8,letterSpacing:`0.05em`,textTransform:`uppercase`},children:e})}function ue({children:e}){return(0,D.jsx)(`div`,{style:{fontFamily:v.sans,fontSize:11,color:v.textDim,marginBottom:4},children:e})}function de({value:e,onChange:t,children:n}){return(0,D.jsx)(`select`,{value:e,onChange:t,style:{width:`100%`,background:v.surface,border:`1px solid ${v.border}`,borderRadius:6,padding:`7px 10px`,fontFamily:v.sans,fontSize:13,color:v.text,outline:`none`,cursor:`pointer`},children:n})}function fe({children:e,color:t}){return(0,D.jsx)(`div`,{style:{fontFamily:v.sans,fontSize:11,fontWeight:600,color:t,letterSpacing:`0.06em`,textTransform:`uppercase`,marginBottom:8},children:e})}function pe({icon:e,iconColor:t,label:n,note:r}){return(0,D.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,padding:`5px 10px`,borderRadius:6,marginBottom:3},children:[(0,D.jsx)(`span`,{style:{color:t,fontFamily:v.mono,fontSize:13},children:e}),(0,D.jsx)(`span`,{style:{fontFamily:v.mono,fontSize:12,color:v.text,flex:1},children:n}),r&&(0,D.jsx)(`span`,{style:{fontFamily:v.sans,fontSize:11,color:v.textDim},children:r})]})}function me({manifest:e,reloadManifest:t}){let[n,r]=(0,g.useState)({kind:`none`}),[i,a]=(0,g.useState)(null),o=(0,g.useCallback)(()=>{r({kind:`none`}),a(null)},[]);if(!e)return(0,D.jsx)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`},children:(0,D.jsx)(A,{title:`Manifest`,subtitle:`Loading...`})});let s=e.namespaces,c=e.environments;return(0,D.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:[(0,D.jsx)(A,{title:`Manifest`,subtitle:`${s.length} namespaces \u00B7 ${c.length} environments`}),(0,D.jsxs)(`div`,{style:{flex:1,overflow:`auto`,padding:28},children:[(0,D.jsx)(he,{title:`Namespaces`,actionLabel:`+ Namespace`,onAction:()=>r({kind:`addNamespace`}),actionTestId:`add-namespace-btn`,children:s.length===0?(0,D.jsx)(ve,{message:`No namespaces declared yet.`}):(0,D.jsx)(ge,{children:s.map(e=>(0,D.jsx)(_e,{testId:`namespace-row-${e.name}`,name:e.name,description:e.description,badges:e.schema?[{label:`schema: ${e.schema}`,color:v.purple}]:[],onEdit:()=>r({kind:`editNamespace`,ns:e}),onDelete:()=>r({kind:`removeNamespace`,ns:e})},e.name))})}),(0,D.jsx)(`div`,{style:{marginTop:36},children:(0,D.jsx)(he,{title:`Environments`,actionLabel:`+ Environment`,onAction:()=>r({kind:`addEnvironment`}),actionTestId:`add-environment-btn`,children:c.length===0?(0,D.jsx)(ve,{message:`No environments declared yet.`}):(0,D.jsx)(ge,{children:c.map(e=>(0,D.jsx)(_e,{testId:`environment-row-${e.name}`,name:e.name,description:e.description,badges:e.protected?[{label:`protected`,color:v.red}]:[],onEdit:()=>r({kind:`editEnvironment`,env:e}),onDelete:()=>r({kind:`removeEnvironment`,env:e})},e.name))})})})]}),n.kind===`addNamespace`&&(0,D.jsx)(we,{onClose:o,onSubmit:async e=>{let n=await T(`/api/namespaces`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});return n.ok?(t(),o(),!0):(a((await n.json()).error??`Failed to add namespace`),!1)},existingNames:s.map(e=>e.name),error:i,setError:a}),n.kind===`editNamespace`&&(0,D.jsx)(Te,{ns:n.ns,existingNames:s.map(e=>e.name),onClose:o,onSubmit:async e=>{let r=await T(`/api/namespaces/${encodeURIComponent(n.ns.name)}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});return r.ok?(t(),o(),!0):(a((await r.json()).error??`Failed to edit namespace`),!1)},error:i,setError:a}),n.kind===`removeNamespace`&&(0,D.jsx)(Oe,{title:`Delete namespace`,subjectKind:`namespace`,subjectName:n.ns.name,impactDescription:`This will delete every encrypted cell file under '${n.ns.name}/' across all environments and remove '${n.ns.name}' from any service identity that references it.`,onClose:o,onConfirm:async()=>{let e=await T(`/api/namespaces/${encodeURIComponent(n.ns.name)}`,{method:`DELETE`});return e.ok?(t(),o(),!0):(a((await e.json()).error??`Failed to remove namespace`),!1)},error:i}),n.kind===`addEnvironment`&&(0,D.jsx)(Ee,{existingNames:c.map(e=>e.name),onClose:o,onSubmit:async e=>{let n=await T(`/api/environments`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});return n.ok?(t(),o(),!0):(a((await n.json()).error??`Failed to add environment`),!1)},error:i,setError:a}),n.kind===`editEnvironment`&&(0,D.jsx)(De,{env:n.env,existingNames:c.map(e=>e.name),onClose:o,onSubmit:async e=>{let r=await T(`/api/environments/${encodeURIComponent(n.env.name)}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});return r.ok?(t(),o(),!0):(a((await r.json()).error??`Failed to edit environment`),!1)},error:i,setError:a}),n.kind===`removeEnvironment`&&(0,D.jsx)(Oe,{title:`Delete environment`,subjectKind:`environment`,subjectName:n.env.name,impactDescription:n.env.protected?`'${n.env.name}' is a protected environment and will be refused. Run "Edit" first and unprotect it before removing.`:`This will delete every encrypted cell file for '${n.env.name}' across all namespaces and remove the '${n.env.name}' entry from every service identity.`,onClose:o,onConfirm:async()=>{let e=await T(`/api/environments/${encodeURIComponent(n.env.name)}`,{method:`DELETE`});return e.ok?(t(),o(),!0):(a((await e.json()).error??`Failed to remove environment`),!1)},error:i})]})}function he(e){return(0,D.jsxs)(`div`,{children:[(0,D.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:14},children:[(0,D.jsx)(`h2`,{style:{fontFamily:v.sans,fontSize:14,fontWeight:600,color:v.text,margin:0,letterSpacing:`-0.01em`},children:e.title}),(0,D.jsx)(M,{variant:`primary`,onClick:e.onAction,"data-testid":e.actionTestId,children:e.actionLabel})]}),e.children]})}function ge(e){return(0,D.jsx)(`div`,{style:{border:`1px solid ${v.border}`,borderRadius:8,background:v.surface,overflow:`hidden`},children:e.children})}function _e(e){return(0,D.jsxs)(`div`,{"data-testid":e.testId,style:{display:`flex`,alignItems:`center`,padding:`12px 16px`,borderBottom:`1px solid ${v.border}`,gap:12},children:[(0,D.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,D.jsxs)(`div`,{style:{fontFamily:v.mono,fontSize:13,fontWeight:600,color:v.text,display:`flex`,alignItems:`center`,gap:8},children:[e.name,e.badges.map(e=>(0,D.jsx)(`span`,{style:{fontFamily:v.sans,fontSize:10,fontWeight:500,color:e.color,background:`${e.color}14`,border:`1px solid ${e.color}33`,borderRadius:10,padding:`1px 8px`},children:e.label},e.label))]}),e.description&&(0,D.jsx)(`div`,{style:{fontFamily:v.sans,fontSize:12,color:v.textMuted,marginTop:2},children:e.description})]}),(0,D.jsx)(M,{onClick:e.onEdit,"data-testid":`${e.testId}-edit`,children:`Edit`}),(0,D.jsx)(M,{onClick:e.onDelete,"data-testid":`${e.testId}-delete`,children:`Delete`})]})}function ve(e){return(0,D.jsx)(`div`,{style:{padding:24,border:`1px dashed ${v.border}`,borderRadius:8,textAlign:`center`,fontFamily:v.sans,fontSize:12,color:v.textMuted},children:e.message})}function ye(e){return(0,D.jsx)(`div`,{"data-testid":`manifest-modal`,onClick:e.onClose,style:{position:`fixed`,inset:0,background:`rgba(0,0,0,0.55)`,display:`flex`,alignItems:`center`,justifyContent:`center`,zIndex:100},children:(0,D.jsxs)(`div`,{onClick:e=>e.stopPropagation(),style:{background:v.surface,border:`1px solid ${v.border}`,borderRadius:10,padding:24,width:480,maxWidth:`90vw`},children:[(0,D.jsx)(`h3`,{style:{fontFamily:v.sans,fontSize:16,fontWeight:600,color:v.text,margin:`0 0 16px`},children:e.title}),e.children]})})}function z(e){return(0,D.jsxs)(`div`,{style:{marginBottom:14},children:[(0,D.jsx)(`label`,{style:{display:`block`,fontFamily:v.sans,fontSize:11,fontWeight:600,color:v.textMuted,marginBottom:4,textTransform:`uppercase`,letterSpacing:`0.05em`},children:e.label}),e.children,e.hint&&(0,D.jsx)(`div`,{style:{fontFamily:v.sans,fontSize:11,color:v.textMuted,marginTop:4},children:e.hint})]})}function be(e){return(0,D.jsx)(`input`,{type:`text`,value:e.value,onChange:t=>e.onChange(t.target.value),placeholder:e.placeholder,"data-testid":e.testId,autoFocus:e.autoFocus,style:{width:`100%`,padding:`8px 12px`,background:v.bg,border:`1px solid ${v.border}`,borderRadius:6,color:v.text,fontFamily:v.mono,fontSize:13,boxSizing:`border-box`}})}function xe(e){return(0,D.jsx)(`div`,{"data-testid":`manifest-modal-error`,style:{padding:`8px 12px`,background:`${v.red}14`,border:`1px solid ${v.red}33`,borderRadius:6,color:v.red,fontFamily:v.sans,fontSize:12,marginBottom:12},children:e.message})}function Se(e){return(0,D.jsx)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:8,marginTop:8},children:e.children})}function Ce(e){return/^[A-Za-z0-9._-]+$/.test(e)}function we(e){let[t,n]=(0,g.useState)(``),[r,i]=(0,g.useState)(``),[a,o]=(0,g.useState)(``),[s,c]=(0,g.useState)(!1),l=t.trim(),u=e.existingNames.includes(l),d=l.length>0&&Ce(l)&&!u,f=l?Ce(l)?u?`A namespace named '${l}' already exists.`:null:`Use letters, numbers, '.', '_', or '-' only.`:null;return(0,D.jsxs)(ye,{title:`Add namespace`,onClose:e.onClose,children:[e.error&&(0,D.jsx)(xe,{message:e.error}),(0,D.jsx)(z,{label:`Name`,hint:f??void 0,children:(0,D.jsx)(be,{value:t,onChange:t=>{n(t),e.setError(null)},placeholder:`payments`,testId:`namespace-name-input`,autoFocus:!0})}),(0,D.jsx)(z,{label:`Description`,children:(0,D.jsx)(be,{value:r,onChange:i,placeholder:`Payment processing secrets`,testId:`namespace-description-input`})}),(0,D.jsx)(z,{label:`Schema (optional)`,hint:`Path to a YAML schema file in the repo.`,children:(0,D.jsx)(be,{value:a,onChange:o,placeholder:`schemas/payments.yaml`,testId:`namespace-schema-input`})}),(0,D.jsxs)(Se,{children:[(0,D.jsx)(M,{onClick:e.onClose,"data-testid":`namespace-add-cancel`,children:`Cancel`}),(0,D.jsx)(M,{variant:`primary`,disabled:!d||s,"data-testid":`namespace-add-submit`,onClick:async()=>{c(!0),await e.onSubmit({name:l,description:r.trim()||void 0,schema:a.trim()||void 0}),c(!1)},children:s?`Adding...`:`Add namespace`})]})]})}function Te(e){let[t,n]=(0,g.useState)(e.ns.name),[r,i]=(0,g.useState)(e.ns.description??``),[a,o]=(0,g.useState)(e.ns.schema??``),[s,c]=(0,g.useState)(!1),l=t.trim(),u=l!==e.ns.name,d=u&&e.existingNames.includes(l),f=!u||Ce(l)&&!d,p=l?f?null:d?`A namespace named '${l}' already exists.`:`Use letters, numbers, '.', '_', or '-' only.`:`Name cannot be empty.`,m=u||r!==(e.ns.description??``)||a!==(e.ns.schema??``);return(0,D.jsxs)(ye,{title:`Edit namespace '${e.ns.name}'`,onClose:e.onClose,children:[e.error&&(0,D.jsx)(xe,{message:e.error}),(0,D.jsx)(z,{label:`Name`,hint:p??void 0,children:(0,D.jsx)(be,{value:t,onChange:t=>{n(t),e.setError(null)},testId:`namespace-rename-input`,autoFocus:!0})}),(0,D.jsx)(z,{label:`Description`,children:(0,D.jsx)(be,{value:r,onChange:i,testId:`namespace-description-input`})}),(0,D.jsx)(z,{label:`Schema (optional)`,hint:`Empty to clear.`,children:(0,D.jsx)(be,{value:a,onChange:o,testId:`namespace-schema-input`})}),(0,D.jsxs)(Se,{children:[(0,D.jsx)(M,{onClick:e.onClose,"data-testid":`namespace-edit-cancel`,children:`Cancel`}),(0,D.jsx)(M,{variant:`primary`,disabled:!m||!!p||s,"data-testid":`namespace-edit-submit`,onClick:async()=>{c(!0);let t={};u&&(t.rename=l),r!==(e.ns.description??``)&&(t.description=r),a!==(e.ns.schema??``)&&(t.schema=a),await e.onSubmit(t),c(!1)},children:s?`Saving...`:`Save changes`})]})]})}function Ee(e){let[t,n]=(0,g.useState)(``),[r,i]=(0,g.useState)(``),[a,o]=(0,g.useState)(!1),[s,c]=(0,g.useState)(!1),l=t.trim(),u=e.existingNames.includes(l),d=l.length>0&&Ce(l)&&!u,f=l?Ce(l)?u?`An environment named '${l}' already exists.`:null:`Use letters, numbers, '.', '_', or '-' only.`:null;return(0,D.jsxs)(ye,{title:`Add environment`,onClose:e.onClose,children:[e.error&&(0,D.jsx)(xe,{message:e.error}),(0,D.jsx)(z,{label:`Name`,hint:f??void 0,children:(0,D.jsx)(be,{value:t,onChange:t=>{n(t),e.setError(null)},placeholder:`staging`,testId:`environment-name-input`,autoFocus:!0})}),(0,D.jsx)(z,{label:`Description`,children:(0,D.jsx)(be,{value:r,onChange:i,placeholder:`Pre-production`,testId:`environment-description-input`})}),(0,D.jsx)(`div`,{style:{marginBottom:14},children:(0,D.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:8,fontFamily:v.sans,fontSize:12,color:v.text,cursor:`pointer`},children:[(0,D.jsx)(`input`,{type:`checkbox`,checked:a,onChange:e=>o(e.target.checked),"data-testid":`environment-protected-checkbox`}),`Mark as protected`]})}),(0,D.jsxs)(Se,{children:[(0,D.jsx)(M,{onClick:e.onClose,"data-testid":`environment-add-cancel`,children:`Cancel`}),(0,D.jsx)(M,{variant:`primary`,disabled:!d||s,"data-testid":`environment-add-submit`,onClick:async()=>{c(!0),await e.onSubmit({name:l,description:r.trim()||void 0,protected:a||void 0}),c(!1)},children:s?`Adding...`:`Add environment`})]})]})}function De(e){let[t,n]=(0,g.useState)(e.env.name),[r,i]=(0,g.useState)(e.env.description??``),[a,o]=(0,g.useState)(e.env.protected===!0),[s,c]=(0,g.useState)(!1),l=t.trim(),u=l!==e.env.name,d=u&&e.existingNames.includes(l),f=!u||Ce(l)&&!d,p=l?f?null:d?`An environment named '${l}' already exists.`:`Use letters, numbers, '.', '_', or '-' only.`:`Name cannot be empty.`,m=a!==(e.env.protected===!0),h=u||r!==(e.env.description??``)||m;return(0,D.jsxs)(ye,{title:`Edit environment '${e.env.name}'`,onClose:e.onClose,children:[e.error&&(0,D.jsx)(xe,{message:e.error}),(0,D.jsx)(z,{label:`Name`,hint:p??void 0,children:(0,D.jsx)(be,{value:t,onChange:t=>{n(t),e.setError(null)},testId:`environment-rename-input`,autoFocus:!0})}),(0,D.jsx)(z,{label:`Description`,children:(0,D.jsx)(be,{value:r,onChange:i,testId:`environment-description-input`})}),(0,D.jsx)(`div`,{style:{marginBottom:14},children:(0,D.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:8,fontFamily:v.sans,fontSize:12,color:v.text,cursor:`pointer`},children:[(0,D.jsx)(`input`,{type:`checkbox`,checked:a,onChange:e=>o(e.target.checked),"data-testid":`environment-protected-checkbox`}),`Protected (write operations require confirmation)`]})}),(0,D.jsxs)(Se,{children:[(0,D.jsx)(M,{onClick:e.onClose,"data-testid":`environment-edit-cancel`,children:`Cancel`}),(0,D.jsx)(M,{variant:`primary`,disabled:!h||!!p||s,"data-testid":`environment-edit-submit`,onClick:async()=>{c(!0);let t={};u&&(t.rename=l),r!==(e.env.description??``)&&(t.description=r),m&&(t.protected=a),await e.onSubmit(t),c(!1)},children:s?`Saving...`:`Save changes`})]})]})}function Oe(e){let[t,n]=(0,g.useState)(``),[r,i]=(0,g.useState)(!1),a=t===e.subjectName;return(0,D.jsxs)(ye,{title:e.title,onClose:e.onClose,children:[e.error&&(0,D.jsx)(xe,{message:e.error}),(0,D.jsx)(`p`,{style:{fontFamily:v.sans,fontSize:12,color:v.text,margin:`0 0 12px`,lineHeight:1.5},children:e.impactDescription}),(0,D.jsx)(z,{label:`Type the ${e.subjectKind} name to confirm`,children:(0,D.jsx)(be,{value:t,onChange:n,placeholder:e.subjectName,testId:`${e.subjectKind}-remove-confirm-input`,autoFocus:!0})}),(0,D.jsxs)(Se,{children:[(0,D.jsx)(M,{onClick:e.onClose,"data-testid":`${e.subjectKind}-remove-cancel`,children:`Cancel`}),(0,D.jsx)(M,{variant:`primary`,disabled:!a||r,"data-testid":`${e.subjectKind}-remove-submit`,onClick:async()=>{i(!0),await e.onConfirm(),i(!1)},children:r?`Deleting...`:`Delete ${e.subjectKind}`})]})]})}function ke({manifest:e,setView:t}){let[n,r]=(0,g.useState)([]),[i,a]=(0,g.useState)(0),[o,s]=(0,g.useState)(!1),[c,l]=(0,g.useState)(``),[u,d]=(0,g.useState)(``),[f,p]=(0,g.useState)(null),[m,h]=(0,g.useState)(!1),[_,y]=(0,g.useState)(null),[b,x]=(0,g.useState)(null),[S,C]=(0,g.useState)(0),[w,E]=(0,g.useState)(!1),[O,k]=(0,g.useState)(null),j=(0,g.useRef)(null),N=(0,g.useCallback)(async()=>{try{let e=await T(`/api/recipients`);if(e.ok){let t=await e.json();r(t.recipients),a(t.totalFiles)}}catch{}},[]);(0,g.useEffect)(()=>{N()},[N]),(0,g.useEffect)(()=>{if(!c.trim()){p(null);return}return j.current&&clearTimeout(j.current),j.current=setTimeout(async()=>{try{let e=await T(`/api/recipients/validate?key=${encodeURIComponent(c.trim())}`);e.ok&&p(await e.json())}catch{}},300),()=>{j.current&&clearTimeout(j.current)}},[c]);let P=async()=>{if(f?.valid){h(!0),y(null);try{let e=await T(`/api/recipients/add`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({key:c.trim(),label:u.trim()||void 0})});if(!e.ok){y((await e.json()).error??`Failed to add recipient`);return}r((await e.json()).recipients),s(!1),l(``),d(``),p(null)}catch(e){y(e instanceof Error?e.message:`Failed to add recipient`)}finally{h(!1)}}},F=e=>{x(e),C(1),E(!1)},I=()=>{x(null),C(0),E(!1)};return(0,D.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:[(0,D.jsx)(A,{title:`Recipients`,subtitle:`clef recipients -- manage age encryption keys`,actions:!o&&S===0?(0,D.jsx)(M,{variant:`primary`,onClick:()=>s(!0),children:`+ Add recipient`}):void 0}),(0,D.jsx)(`div`,{style:{flex:1,overflow:`auto`,padding:24},children:(0,D.jsxs)(`div`,{style:{maxWidth:620,margin:`0 auto`},children:[_&&(0,D.jsx)(`div`,{style:{background:v.redDim,border:`1px solid ${v.red}44`,borderRadius:8,padding:`12px 16px`,marginBottom:16,fontFamily:v.sans,fontSize:13,color:v.red},children:_}),O&&(0,D.jsxs)(`div`,{"data-testid":`rotation-banner`,style:{background:v.yellowDim,border:`1px solid ${v.yellow}44`,borderRadius:8,padding:`14px 18px`,marginBottom:20},children:[(0,D.jsx)(`div`,{style:{fontFamily:v.sans,fontSize:13,fontWeight:600,color:v.yellow,marginBottom:8},children:`Rotation reminder`}),(0,D.jsxs)(`div`,{style:{fontFamily:v.sans,fontSize:13,color:v.text,marginBottom:10,lineHeight:1.5},children:[(0,D.jsx)(`strong`,{children:O.name}),` has been removed and files re-encrypted. However, the removed key may still decrypt old versions of these files from git history. Rotate secret values in the following targets to complete revocation:`]}),O.targets.length>0&&(0,D.jsx)(`div`,{style:{fontFamily:v.mono,fontSize:11,color:v.textMuted,marginBottom:12,paddingLeft:12},children:O.targets.map(e=>(0,D.jsx)(`div`,{style:{marginBottom:2},children:e},e))}),(0,D.jsxs)(`div`,{style:{display:`flex`,gap:10},children:[(0,D.jsx)(M,{variant:`primary`,onClick:()=>t(`matrix`),children:`Go to Matrix to rotate`}),(0,D.jsx)(M,{variant:`ghost`,onClick:()=>k(null),children:`Dismiss`})]})]}),o&&(0,D.jsxs)(`div`,{"data-testid":`add-form`,style:{background:v.surface,border:`1px solid ${v.border}`,borderRadius:10,padding:20,marginBottom:24},children:[(0,D.jsx)(`div`,{style:{fontFamily:v.sans,fontSize:14,fontWeight:600,color:v.text,marginBottom:16},children:`Add recipient`}),(0,D.jsxs)(`div`,{style:{marginBottom:14},children:[(0,D.jsx)(Ae,{children:`Age public key`}),(0,D.jsx)(`input`,{type:`text`,value:c,onChange:e=>l(e.target.value),placeholder:`age1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq`,"data-testid":`add-key-input`,style:{width:`100%`,background:v.bg,border:`1px solid ${f?f.valid?v.green+`66`:v.red+`66`:v.border}`,borderRadius:6,padding:`8px 12px`,fontFamily:v.mono,fontSize:12,color:v.text,outline:`none`,boxSizing:`border-box`}}),f&&!f.valid&&(0,D.jsx)(`div`,{style:{fontFamily:v.sans,fontSize:11,color:v.red,marginTop:4},children:f.error}),f?.valid&&(0,D.jsx)(`div`,{style:{fontFamily:v.sans,fontSize:11,color:v.green,marginTop:4},children:`Valid age public key`})]}),(0,D.jsxs)(`div`,{style:{marginBottom:14},children:[(0,D.jsx)(Ae,{children:`Label (optional)`}),(0,D.jsx)(`input`,{type:`text`,value:u,onChange:e=>d(e.target.value),placeholder:`e.g. alice@example.com`,"data-testid":`add-label-input`,style:{width:`100%`,background:v.bg,border:`1px solid ${v.border}`,borderRadius:6,padding:`8px 12px`,fontFamily:v.sans,fontSize:13,color:v.text,outline:`none`,boxSizing:`border-box`}})]}),(0,D.jsxs)(`div`,{style:{marginBottom:16,padding:`10px 14px`,background:v.yellowDim,border:`1px solid ${v.yellow}44`,borderRadius:6,fontFamily:v.sans,fontSize:12,color:v.yellow,lineHeight:1.5},children:[`Adding a recipient will re-encrypt `,i,` file`,i===1?``:`s`,`. This may take a moment.`]}),(0,D.jsxs)(`div`,{style:{display:`flex`,gap:10},children:[(0,D.jsx)(M,{variant:`ghost`,onClick:()=>{s(!1),l(``),d(``),p(null),y(null)},children:`Cancel`}),(0,D.jsx)(M,{variant:`primary`,onClick:P,disabled:m||!f?.valid,children:m?`Re-encrypting...`:`Add and re-encrypt`})]})]}),S===1&&b&&(0,D.jsxs)(`div`,{"data-testid":`remove-dialog`,style:{background:v.surface,border:`1px solid ${v.red}44`,borderRadius:10,padding:20,marginBottom:24},children:[(0,D.jsx)(`div`,{style:{fontFamily:v.sans,fontSize:14,fontWeight:600,color:v.red,marginBottom:12},children:`Remove recipient`}),(0,D.jsxs)(`div`,{style:{fontFamily:v.sans,fontSize:13,color:v.text,lineHeight:1.6,marginBottom:16},children:[`You are about to remove`,` `,(0,D.jsx)(`strong`,{style:{color:v.accent},children:b.label??b.preview}),` `,`(`,b.preview,`). All `,i,` encrypted file`,i===1?``:`s`,` will be re-encrypted without this key.`]}),(0,D.jsxs)(`div`,{style:{background:v.redDim,border:`1px solid ${v.red}44`,borderRadius:6,padding:`12px 14px`,marginBottom:16,fontFamily:v.sans,fontSize:12,color:v.red,lineHeight:1.5},children:[`Re-encryption only removes `,(0,D.jsx)(`em`,{children:`future`}),` access. The removed key can still decrypt old versions from git history. You must rotate all secret values after removal.`]}),(0,D.jsxs)(`label`,{style:{display:`flex`,alignItems:`flex-start`,gap:10,cursor:`pointer`,fontFamily:v.sans,fontSize:13,color:v.text,marginBottom:16},children:[(0,D.jsx)(`input`,{type:`checkbox`,checked:w,onChange:e=>E(e.target.checked),"data-testid":`acknowledge-checkbox`,style:{accentColor:v.red,marginTop:2}}),`I understand — I will rotate secrets after removal`]}),(0,D.jsxs)(`div`,{style:{display:`flex`,gap:10},children:[(0,D.jsx)(M,{variant:`ghost`,onClick:I,children:`Cancel`}),(0,D.jsx)(M,{variant:`danger`,onClick:()=>C(2),disabled:!w,children:`Continue`})]})]}),S===2&&b&&(0,D.jsxs)(`div`,{"data-testid":`remove-confirm-dialog`,style:{background:v.surface,border:`1px solid ${v.red}44`,borderRadius:10,padding:20,marginBottom:24},children:[(0,D.jsx)(`div`,{style:{fontFamily:v.sans,fontSize:14,fontWeight:600,color:v.red,marginBottom:12},children:`Confirm removal`}),(0,D.jsxs)(`div`,{style:{fontFamily:v.sans,fontSize:13,color:v.text,lineHeight:1.6,marginBottom:16},children:[`This will remove`,` `,(0,D.jsx)(`strong`,{style:{color:v.accent},children:b.label??b.preview}),` `,`and re-encrypt all `,i,` file`,i===1?``:`s`,`. This cannot be undone.`]}),(0,D.jsxs)(`div`,{style:{display:`flex`,gap:10},children:[(0,D.jsx)(M,{variant:`ghost`,onClick:I,children:`Cancel`}),(0,D.jsx)(M,{variant:`danger`,onClick:async()=>{if(b){h(!0),y(null);try{let e=await T(`/api/recipients/remove`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({key:b.key})});if(!e.ok){y((await e.json()).error??`Failed to remove recipient`);return}let t=await e.json();r(t.recipients),k({name:b.label??b.preview,targets:t.rotationReminder??[]}),I()}catch(e){y(e instanceof Error?e.message:`Failed to remove recipient`)}finally{h(!1)}}},disabled:m,children:m?`Re-encrypting...`:`Remove and re-encrypt`})]})]}),n.length===0&&!o&&(0,D.jsx)(`div`,{style:{textAlign:`center`,paddingTop:40,fontFamily:v.sans,fontSize:14,color:v.textMuted},children:`No recipients configured. Add an age public key to get started.`}),n.length>0&&(0,D.jsxs)(`div`,{children:[(0,D.jsxs)(`div`,{style:{fontFamily:v.sans,fontSize:12,fontWeight:600,color:v.textMuted,letterSpacing:`0.05em`,textTransform:`uppercase`,marginBottom:10},children:[`Recipients (`,n.length,`)`]}),n.map(e=>(0,D.jsxs)(`div`,{"data-testid":`recipient-row`,style:{display:`flex`,alignItems:`center`,gap:14,padding:`12px 16px`,background:v.surface,border:`1px solid ${v.border}`,borderRadius:8,marginBottom:8},children:[(0,D.jsx)(`div`,{style:{width:32,height:32,borderRadius:6,background:v.accentDim,border:`1px solid ${v.accent}44`,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:14,flexShrink:0},children:`🔑`}),(0,D.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[e.label&&(0,D.jsx)(`div`,{style:{fontFamily:v.sans,fontSize:13,fontWeight:600,color:v.text,marginBottom:2},children:e.label}),(0,D.jsx)(`div`,{style:{fontFamily:v.mono,fontSize:11,color:v.textMuted,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e.preview})]}),(0,D.jsx)(M,{variant:`ghost`,onClick:()=>F(e),disabled:S!==0||m,children:`Remove`})]},e.key)),(0,D.jsxs)(`div`,{style:{fontFamily:v.mono,fontSize:11,color:v.textDim,marginTop:12},children:[i,` encrypted file`,i===1?``:`s`,` in the matrix`]})]})]})})]})}function Ae({children:e}){return(0,D.jsx)(`div`,{style:{fontFamily:v.sans,fontSize:12,fontWeight:600,color:v.textMuted,marginBottom:6,letterSpacing:`0.05em`,textTransform:`uppercase`},children:e})}function je({manifest:e}){let[t,n]=(0,g.useState)(`list`),[r,i]=(0,g.useState)([]),[a,o]=(0,g.useState)(null),[s,c]=(0,g.useState)(``),[l,u]=(0,g.useState)(``),[d,f]=(0,g.useState)(``),[p,m]=(0,g.useState)(new Set),[h,_]=(0,g.useState)({}),[y,b]=(0,g.useState)(!1),[x,S]=(0,g.useState)(``),[C,w]=(0,g.useState)({}),[E,O]=(0,g.useState)(``),[k,j]=(0,g.useState)({}),[P,F]=(0,g.useState)(!1),[I,L]=(0,g.useState)(``),[ee,R]=(0,g.useState)(void 0),[te,re]=(0,g.useState)({}),[ie,ae]=(0,g.useState)(!1),[oe,se]=(0,g.useState)(``),ce=(0,g.useCallback)(async()=>{try{let e=await T(`/api/service-identities`);e.ok&&i((await e.json()).identities)}catch{}},[]);(0,g.useEffect)(()=>{ce()},[ce]);let le=r.find(e=>e.name===a),ue=(0,g.useCallback)(()=>{u(``),f(``),m(new Set);let t={};for(let n of e?.environments??[])t[n.name]={type:`age`,provider:`aws`,keyId:``};_(t),S(``),n(`create`)},[e]),de=(0,g.useCallback)(e=>{let t={};for(let[n,r]of Object.entries(e.environments)){let e=r.type===`kms`?`kms`:`age`;t[n]={type:e,provider:r.kms?.provider??`aws`,keyId:r.kms?.keyId??``,originalType:e,originalKeyId:r.kms?.keyId??``}}j(t),L(``),n(`update`)},[]),fe=(0,g.useCallback)(()=>{o(null),c(``),n(`list`)},[]),pe=(0,g.useCallback)(()=>{c(``),se(``),n(`detail`)},[]);async function me(){b(!0),S(``);try{let e={};for(let[t,n]of Object.entries(h))n.type===`kms`&&(e[t]={provider:n.provider,keyId:n.keyId});let t={name:l.trim(),description:d.trim(),namespaces:Array.from(p)};Object.keys(e).length>0&&(t.kmsEnvConfigs=e);let r=await T(`/api/service-identities`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)}),i=await r.json();if(!r.ok){S(i.error??`Failed to create service identity.`);return}O(i.identity.name),w(i.privateKeys??{}),n(`keys`)}catch{S(`Network error. Check that the UI server is running.`)}finally{b(!1)}}async function he(){if(a){F(!0),L(``);try{let e={};for(let[t,n]of Object.entries(k))n.type===`kms`&&(n.originalType!==`kms`||n.keyId!==n.originalKeyId)&&(e[t]={provider:n.provider,keyId:n.keyId});if(Object.keys(e).length===0){L(`No changes to apply.`);return}let t=await T(`/api/service-identities/${encodeURIComponent(a)}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({kmsEnvConfigs:e})}),n=await t.json();if(!t.ok){L(n.error??`Failed to update service identity.`);return}await ce(),pe()}catch{L(`Network error. Check that the UI server is running.`)}finally{F(!1)}}}async function ge(e){if(a){R(e),c(``);try{let t=await T(`/api/service-identities/${encodeURIComponent(a)}/rotate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({environment:e})}),r=await t.json();if(!t.ok){c(r.error??`Failed to rotate key.`);return}re(r.privateKeys??{}),await ce(),n(`rotate-keys`)}catch{c(`Network error. Check that the UI server is running.`)}finally{R(void 0)}}}async function _e(){if(a){ae(!0),se(``);try{let e=await T(`/api/service-identities/${encodeURIComponent(a)}`,{method:`DELETE`});if(!e.ok){se((await e.json()).error??`Failed to delete service identity.`);return}await ce(),fe()}catch{se(`Network error. Check that the UI server is running.`)}finally{ae(!1)}}}if(t===`list`)return(0,D.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:[(0,D.jsx)(A,{title:`Service Identities`,subtitle:`Per-service cryptographic access scoping`,actions:e&&(0,D.jsx)(M,{variant:`primary`,onClick:ue,children:`+ New identity`})}),(0,D.jsx)(`div`,{style:{flex:1,overflow:`auto`,padding:24},children:(0,D.jsxs)(`div`,{style:{maxWidth:620,margin:`0 auto`},children:[s&&(0,D.jsx)(Pe,{children:s}),r.length===0&&(0,D.jsxs)(`div`,{style:{textAlign:`center`,padding:`48px 24px`,color:v.textMuted,fontFamily:v.sans,fontSize:13},children:[(0,D.jsx)(`div`,{style:{fontSize:28,marginBottom:12,opacity:.4},children:`🔑`}),`No service identities configured.`,e&&(0,D.jsx)(`div`,{style:{marginTop:16},children:(0,D.jsx)(M,{variant:`primary`,onClick:ue,children:`Create the first one`})})]}),r.map(e=>(0,D.jsxs)(`div`,{role:`button`,tabIndex:0,"data-testid":`si-${e.name}`,onClick:()=>{o(e.name),c(``),n(`detail`)},onKeyDown:t=>{t.key===`Enter`&&(o(e.name),n(`detail`))},style:{background:v.surface,border:`1px solid ${v.border}`,borderRadius:8,padding:`16px 20px`,marginBottom:8,cursor:`pointer`,transition:`all 0.12s`},onMouseEnter:e=>{e.currentTarget.style.borderColor=v.borderLight},onMouseLeave:e=>{e.currentTarget.style.borderColor=v.border},children:[(0,D.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,marginBottom:8},children:(0,D.jsx)(`span`,{style:{fontFamily:v.sans,fontWeight:600,fontSize:14,color:v.text},children:e.name})}),(0,D.jsxs)(`div`,{style:{fontFamily:v.sans,fontSize:12,color:v.textMuted,marginBottom:10},children:[`Scoped to: `,(0,D.jsx)(`span`,{style:{color:v.text},children:e.namespaces.join(`, `)})]}),(0,D.jsx)(`div`,{style:{display:`flex`,gap:6,flexWrap:`wrap`},children:Object.entries(e.environments).map(([e,t])=>(0,D.jsxs)(`span`,{style:{display:`inline-flex`,alignItems:`center`,gap:4},children:[(0,D.jsx)(N,{env:e,small:!0}),(0,D.jsx)(`span`,{style:{fontFamily:v.mono,fontSize:9,color:t.type===`kms`?v.purple:v.textDim},children:t.type===`kms`?`KMS`:`age`})]},e))})]},e.name))]})})]});if(t===`detail`)return(0,D.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:[(0,D.jsx)(A,{title:le?.name??a??``,subtitle:le?.description,actions:(0,D.jsxs)(`div`,{style:{display:`flex`,gap:6},children:[le&&(0,D.jsx)(M,{"data-testid":`update-backends-btn`,variant:`ghost`,onClick:()=>de(le),children:`Update backends`}),(0,D.jsxs)(`button`,{"data-testid":`back-button`,onClick:fe,style:{background:`none`,border:`1px solid ${v.borderLight}`,borderRadius:6,padding:`4px 12px`,cursor:`pointer`,fontFamily:v.sans,fontSize:12,color:v.textMuted,transition:`all 0.12s`},children:[`←`,` Back`]})]})}),(0,D.jsx)(`div`,{style:{flex:1,overflow:`auto`,padding:24},children:(0,D.jsxs)(`div`,{style:{maxWidth:620,margin:`0 auto`},children:[s&&(0,D.jsx)(Pe,{children:s}),le&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`div`,{style:{marginBottom:20},children:[(0,D.jsx)(Me,{children:`Scoped namespaces`}),(0,D.jsx)(`div`,{style:{display:`flex`,gap:6},children:le.namespaces.map(e=>(0,D.jsx)(`span`,{style:{fontFamily:v.mono,fontSize:11,color:v.accent,background:v.accentDim,border:`1px solid ${v.accent}33`,borderRadius:4,padding:`2px 8px`},children:e},e))})]}),(0,D.jsx)(Me,{children:`Environment keys`}),e?.environments.map(e=>{let t=le.environments[e.name];if(!t)return null;let n=t.protected??!1,r=ee===e.name;return(0,D.jsxs)(`div`,{"data-testid":`env-${e.name}`,style:{background:v.surface,border:`1px solid ${v.border}`,borderRadius:8,padding:`16px 20px`,marginBottom:10},children:[(0,D.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:12},children:[(0,D.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10},children:[(0,D.jsx)(N,{env:e.name}),n&&(0,D.jsx)(`span`,{style:{fontSize:12,color:v.red},children:`🔒`}),t.type===`kms`&&(0,D.jsx)(`span`,{style:{fontFamily:v.mono,fontSize:10,color:v.purple,background:v.purpleDim,border:`1px solid ${v.purple}33`,borderRadius:3,padding:`1px 6px`},children:`KMS`})]}),t.type===`age`&&(0,D.jsx)(`button`,{"data-testid":`rotate-${e.name}`,disabled:r,onClick:()=>ge(e.name),style:{background:`none`,border:`1px solid ${v.borderLight}`,borderRadius:5,padding:`3px 10px`,cursor:r?`default`:`pointer`,fontFamily:v.sans,fontSize:11,color:r?v.textDim:v.textMuted,opacity:r?.5:1},children:r?`Rotating…`:`Rotate key`})]}),t.type===`kms`&&t.kms&&(0,D.jsxs)(`div`,{style:{fontFamily:v.mono,fontSize:11,color:v.textMuted},children:[(0,D.jsxs)(`div`,{style:{marginBottom:8},children:[`Authentication: `,(0,D.jsx)(`span`,{style:{color:v.purple},children:`IAM + KMS`})]}),(0,D.jsxs)(`div`,{children:[`Provider:`,` `,(0,D.jsx)(`span`,{style:{color:v.text},children:t.kms.provider})]}),(0,D.jsxs)(`div`,{style:{marginTop:4},children:[`Key ID:`,` `,(0,D.jsx)(`span`,{style:{color:v.text,wordBreak:`break-all`},children:t.kms.keyId})]}),(0,D.jsx)(`div`,{style:{marginTop:10,padding:`8px 12px`,background:v.purpleDim,border:`1px solid ${v.purple}33`,borderRadius:4,fontSize:11,color:v.purple,fontFamily:v.sans},children:`No keys to provision. CI and runtime authenticate via IAM role with kms:Decrypt permission.`})]}),t.type===`age`&&(0,D.jsxs)(`div`,{style:{fontFamily:v.mono,fontSize:11,color:v.textMuted},children:[(0,D.jsxs)(`div`,{style:{marginBottom:8},children:[`Authentication: `,(0,D.jsx)(`span`,{style:{color:v.green},children:`age key`})]}),(0,D.jsxs)(`div`,{children:[`Public key:`,` `,(0,D.jsx)(`span`,{style:{color:v.text},children:t.publicKey?`${t.publicKey.slice(0,12)}...${t.publicKey.slice(-6)}`:`unknown`})]})]})]},e.name)}),(0,D.jsx)(`div`,{style:{marginTop:32,paddingTop:20,borderTop:`1px solid ${v.border}`,display:`flex`,justifyContent:`flex-end`},children:(0,D.jsx)(M,{"data-testid":`delete-identity-btn`,variant:`danger`,onClick:()=>{se(``),n(`delete-confirm`)},children:`Delete identity`})})]})]})})]});if(t===`delete-confirm`)return(0,D.jsxs)(`div`,{"data-testid":`delete-confirm-view`,style:{flex:1,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:[(0,D.jsx)(A,{title:`Delete service identity`,subtitle:`This action cannot be undone`}),(0,D.jsx)(`div`,{style:{flex:1,overflow:`auto`,padding:24},children:(0,D.jsxs)(`div`,{style:{maxWidth:560,margin:`0 auto`},children:[oe&&(0,D.jsx)(Pe,{children:oe}),(0,D.jsxs)(`div`,{style:{background:`#1a0a0a`,border:`1px solid ${v.red}55`,borderRadius:8,padding:`16px 20px`,marginBottom:24,fontFamily:v.sans,fontSize:13,color:v.red},children:[(0,D.jsxs)(`div`,{style:{fontWeight:600,marginBottom:8},children:[`Delete `,(0,D.jsx)(`span`,{style:{fontFamily:v.mono},children:a}),`?`]}),(0,D.jsxs)(`div`,{style:{color:v.textMuted,fontSize:12,lineHeight:1.6},children:[`This will remove the identity from`,` `,(0,D.jsx)(`span`,{style:{fontFamily:v.mono},children:`clef.yaml`}),` and de-register its recipients from all scoped encrypted files. Any runtimes currently using this identity's private key will lose access on the next artifact refresh.`]})]}),(0,D.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:8},children:[(0,D.jsx)(M,{"data-testid":`cancel-delete-btn`,variant:`ghost`,onClick:pe,disabled:ie,children:`Cancel`}),(0,D.jsx)(M,{"data-testid":`confirm-delete-btn`,variant:`danger`,onClick:_e,disabled:ie,children:ie?`Deleting…`:`Delete identity`})]})]})})]});if(t===`rotate-keys`)return(0,D.jsxs)(`div`,{"data-testid":`rotate-keys-view`,style:{flex:1,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:[(0,D.jsx)(A,{title:`Key rotated`,subtitle:`New keys for ${a}`}),(0,D.jsx)(`div`,{style:{flex:1,overflow:`auto`,padding:24},children:(0,D.jsxs)(`div`,{style:{maxWidth:620,margin:`0 auto`},children:[(0,D.jsxs)(`div`,{style:{background:`#1a1200`,border:`1px solid ${v.yellow}55`,borderRadius:8,padding:`14px 18px`,marginBottom:20,fontFamily:v.sans,fontSize:13,color:v.yellow,display:`flex`,gap:10,alignItems:`flex-start`},children:[(0,D.jsx)(`span`,{style:{fontSize:16,flexShrink:0},children:`⚠`}),(0,D.jsx)(`span`,{children:`Copy the new private key now — it will not be shown again. Provision it to the runtime and invalidate the old key.`})]}),(0,D.jsx)(Me,{children:`New private keys`}),Object.entries(te).map(([e,t])=>(0,D.jsxs)(`div`,{style:{background:v.surface,border:`1px solid ${v.border}`,borderRadius:8,padding:`14px 18px`,marginBottom:10},children:[(0,D.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:10},children:[(0,D.jsx)(N,{env:e}),(0,D.jsx)(ne,{text:t})]}),(0,D.jsx)(`div`,{style:{fontFamily:v.mono,fontSize:11,color:v.textMuted,wordBreak:`break-all`,background:v.bg,borderRadius:4,padding:`8px 10px`},children:t})]},e)),(0,D.jsx)(`div`,{style:{marginTop:8,display:`flex`,justifyContent:`flex-end`},children:(0,D.jsx)(M,{"data-testid":`rotate-done-btn`,variant:`primary`,onClick:pe,children:`Done`})})]})})]});if(t===`update`){let t=e?.environments??[],n=Object.values(k).filter(e=>e.type===`kms`?e.originalType!==`kms`||e.keyId!==e.originalKeyId:!1).length>0&&Object.entries(k).every(([,e])=>e.type===`kms`?e.keyId.trim()!==``:!0);return(0,D.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:[(0,D.jsx)(A,{title:`Update backends`,subtitle:`Environment backends for ${a}`,actions:(0,D.jsxs)(`button`,{onClick:pe,style:{background:`none`,border:`1px solid ${v.borderLight}`,borderRadius:6,padding:`4px 12px`,cursor:`pointer`,fontFamily:v.sans,fontSize:12,color:v.textMuted},children:[`←`,` Cancel`]})}),(0,D.jsx)(`div`,{style:{flex:1,overflow:`auto`,padding:24},children:(0,D.jsxs)(`div`,{style:{maxWidth:560,margin:`0 auto`},children:[I&&(0,D.jsx)(Pe,{children:I}),(0,D.jsx)(`div`,{style:{fontFamily:v.sans,fontSize:12,color:v.textMuted,marginBottom:16,lineHeight:1.6},children:`Switch age environments to KMS, or update an existing KMS key ID. To revert KMS to age, delete and recreate the identity.`}),(0,D.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8,marginBottom:28},children:t.map(e=>{let t=k[e.name];return t?(0,D.jsxs)(`div`,{style:{background:v.surface,border:`1px solid ${v.border}`,borderRadius:8,padding:`14px 16px`},children:[(0,D.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:t.type===`kms`?12:0},children:[(0,D.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,D.jsx)(N,{env:e.name}),e.protected&&(0,D.jsx)(`span`,{style:{fontSize:11,color:v.red},children:`🔒`})]}),(0,D.jsx)(`div`,{style:{display:`flex`,gap:4},children:[`age`,`kms`].map(n=>{let r=t.originalType===`kms`&&n===`age`;return(0,D.jsx)(`button`,{"data-testid":n===`kms`?`update-kms-toggle-${e.name}`:void 0,disabled:r,onClick:()=>{r||j(r=>({...r,[e.name]:{...t,type:n}}))},title:r?`KMS → age requires delete and recreate`:void 0,style:{background:t.type===n?n===`kms`?v.purple:v.accent:`transparent`,border:`1px solid ${t.type===n?n===`kms`?v.purple:v.accent:v.border}`,borderRadius:4,padding:`3px 10px`,cursor:r?`not-allowed`:`pointer`,fontFamily:v.mono,fontSize:11,color:t.type===n?`#fff`:v.textMuted,opacity:r?.4:1,transition:`all 0.1s`},children:n.toUpperCase()},n)})})]}),t.type===`kms`&&(0,D.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,D.jsxs)(`select`,{value:t.provider,onChange:n=>j(r=>({...r,[e.name]:{...t,provider:n.target.value}})),style:{...Fe,width:90,flexShrink:0,padding:`7px 8px`},children:[(0,D.jsx)(`option`,{value:`aws`,children:`AWS`}),(0,D.jsx)(`option`,{value:`gcp`,children:`GCP`}),(0,D.jsx)(`option`,{value:`azure`,children:`Azure`})]}),(0,D.jsx)(`input`,{"data-testid":`update-keyid-${e.name}`,value:t.keyId,onChange:n=>j(r=>({...r,[e.name]:{...t,keyId:n.target.value}})),placeholder:`arn:aws:kms:… or key resource ID`,style:{...Fe,flex:1}})]})]},e.name):null})}),(0,D.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:8},children:[(0,D.jsx)(M,{"data-testid":`update-cancel-btn`,variant:`ghost`,onClick:pe,disabled:P,children:`Cancel`}),(0,D.jsx)(M,{"data-testid":`update-submit-btn`,variant:`primary`,onClick:he,disabled:!n||P,children:P?`Saving…`:`Save changes`})]})]})})]})}if(t===`keys`){let e=Object.keys(C).length>0;return(0,D.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:[(0,D.jsx)(A,{title:`${E} created`,subtitle:`Service identity ready`}),(0,D.jsx)(`div`,{style:{flex:1,overflow:`auto`,padding:24},children:(0,D.jsxs)(`div`,{style:{maxWidth:620,margin:`0 auto`},children:[e&&(0,D.jsxs)(`div`,{style:{background:`#1a1200`,border:`1px solid ${v.yellow}55`,borderRadius:8,padding:`14px 18px`,marginBottom:20,fontFamily:v.sans,fontSize:13,color:v.yellow,display:`flex`,gap:10,alignItems:`flex-start`},children:[(0,D.jsx)(`span`,{style:{fontSize:16,flexShrink:0},children:`⚠`}),(0,D.jsx)(`span`,{children:`Copy these private keys now — they will not be shown again. Store each key securely and provision it to the relevant runtime.`})]}),!e&&(0,D.jsx)(`div`,{style:{background:v.purpleDim,border:`1px solid ${v.purple}44`,borderRadius:8,padding:`14px 18px`,marginBottom:20,fontFamily:v.sans,fontSize:13,color:v.purple},children:`All environments use KMS. No private keys to provision — runtimes authenticate via IAM role.`}),(0,D.jsx)(Me,{children:`Private keys`}),Object.entries(C).map(([e,t])=>(0,D.jsxs)(`div`,{style:{background:v.surface,border:`1px solid ${v.border}`,borderRadius:8,padding:`14px 18px`,marginBottom:10},children:[(0,D.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:10},children:[(0,D.jsx)(N,{env:e}),(0,D.jsx)(ne,{text:t})]}),(0,D.jsx)(`div`,{style:{fontFamily:v.mono,fontSize:11,color:v.textMuted,wordBreak:`break-all`,background:v.bg,borderRadius:4,padding:`8px 10px`},children:t})]},e)),(0,D.jsx)(`div`,{style:{marginTop:8,display:`flex`,justifyContent:`flex-end`},children:(0,D.jsx)(M,{variant:`primary`,onClick:()=>{ce(),fe()},children:`Done`})})]})})]})}let ve=e?.namespaces??[],ye=e?.environments??[],z=l.trim()&&r.some(e=>e.name===l.trim())?`A service identity with this name already exists.`:``,be=l.trim()!==``&&!z&&p.size>0&&ye.every(e=>{let t=h[e.name];return t?.type===`age`||t?.type===`kms`&&t.provider&&t.keyId.trim()});return(0,D.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:[(0,D.jsx)(A,{title:`New service identity`,subtitle:`Scope cryptographic access to specific namespaces`,actions:(0,D.jsxs)(`button`,{onClick:fe,style:{background:`none`,border:`1px solid ${v.borderLight}`,borderRadius:6,padding:`4px 12px`,cursor:`pointer`,fontFamily:v.sans,fontSize:12,color:v.textMuted},children:[`←`,` Cancel`]})}),(0,D.jsx)(`div`,{style:{flex:1,overflow:`auto`,padding:24},children:(0,D.jsxs)(`div`,{style:{maxWidth:560,margin:`0 auto`},children:[x&&(0,D.jsx)(Pe,{children:x}),(0,D.jsxs)(`div`,{style:{marginBottom:20},children:[(0,D.jsx)(Ne,{children:`Name`}),(0,D.jsx)(`input`,{"data-testid":`si-name-input`,value:l,onChange:e=>u(e.target.value),placeholder:`e.g. api-gateway`,style:Fe}),z&&(0,D.jsx)(`div`,{style:{fontFamily:v.sans,fontSize:12,color:v.red,marginTop:6},children:z})]}),(0,D.jsxs)(`div`,{style:{marginBottom:24},children:[(0,D.jsx)(Ne,{children:`Description (optional)`}),(0,D.jsx)(`input`,{value:d,onChange:e=>f(e.target.value),placeholder:`e.g. API gateway service account`,style:Fe})]}),(0,D.jsxs)(`div`,{style:{marginBottom:24},children:[(0,D.jsx)(Ne,{children:`Namespaces`}),(0,D.jsx)(`div`,{style:{fontFamily:v.sans,fontSize:12,color:v.textMuted,marginBottom:10},children:`This identity can decrypt secrets only from the selected namespaces.`}),ve.length===0&&(0,D.jsx)(`div`,{style:{fontFamily:v.sans,fontSize:12,color:v.textDim},children:`No namespaces defined in manifest.`}),(0,D.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6},children:ve.map(e=>{let t=p.has(e.name);return(0,D.jsxs)(`label`,{"data-testid":`ns-checkbox-${e.name}`,style:{display:`flex`,alignItems:`center`,gap:10,padding:`10px 14px`,background:t?v.accentDim:v.surface,border:`1px solid ${t?v.accent+`55`:v.border}`,borderRadius:6,cursor:`pointer`,transition:`all 0.1s`},children:[(0,D.jsx)(`input`,{type:`checkbox`,checked:t,onChange:t=>{let n=new Set(p);t.target.checked?n.add(e.name):n.delete(e.name),m(n)},style:{accentColor:v.accent}}),(0,D.jsx)(`span`,{style:{fontFamily:v.mono,fontSize:12,color:t?v.accent:v.text},children:e.name}),e.description&&(0,D.jsxs)(`span`,{style:{fontFamily:v.sans,fontSize:11,color:v.textMuted},children:[`— `,e.description]})]},e.name)})})]}),(0,D.jsxs)(`div`,{style:{marginBottom:28},children:[(0,D.jsx)(Ne,{children:`Environment backends`}),(0,D.jsx)(`div`,{style:{fontFamily:v.sans,fontSize:12,color:v.textMuted,marginBottom:10},children:`Age generates a key pair per environment. KMS uses your cloud provider — no key material is provisioned.`}),(0,D.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8},children:ye.map(e=>{let t=h[e.name]??{type:`age`,provider:`aws`,keyId:``};return(0,D.jsxs)(`div`,{style:{background:v.surface,border:`1px solid ${v.border}`,borderRadius:8,padding:`14px 16px`},children:[(0,D.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:t.type===`kms`?12:0},children:[(0,D.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,D.jsx)(N,{env:e.name}),e.protected&&(0,D.jsx)(`span`,{style:{fontSize:11,color:v.red},children:`🔒`})]}),(0,D.jsx)(`div`,{style:{display:`flex`,gap:4},children:[`age`,`kms`].map(n=>(0,D.jsx)(`button`,{onClick:()=>_(r=>({...r,[e.name]:{...t,type:n}})),style:{background:t.type===n?n===`kms`?v.purple:v.accent:`transparent`,border:`1px solid ${t.type===n?n===`kms`?v.purple:v.accent:v.border}`,borderRadius:4,padding:`3px 10px`,cursor:`pointer`,fontFamily:v.mono,fontSize:11,color:t.type===n?`#fff`:v.textMuted,transition:`all 0.1s`},children:n.toUpperCase()},n))})]}),t.type===`kms`&&(0,D.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,D.jsxs)(`select`,{value:t.provider,onChange:n=>_(r=>({...r,[e.name]:{...t,provider:n.target.value}})),style:{...Fe,width:90,flexShrink:0,padding:`7px 8px`},children:[(0,D.jsx)(`option`,{value:`aws`,children:`AWS`}),(0,D.jsx)(`option`,{value:`gcp`,children:`GCP`}),(0,D.jsx)(`option`,{value:`azure`,children:`Azure`})]}),(0,D.jsx)(`input`,{value:t.keyId,onChange:n=>_(r=>({...r,[e.name]:{...t,keyId:n.target.value}})),placeholder:`arn:aws:kms:… or key resource ID`,style:{...Fe,flex:1}})]})]},e.name)})})]}),(0,D.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:8},children:[(0,D.jsx)(M,{variant:`ghost`,onClick:fe,disabled:y,children:`Cancel`}),(0,D.jsx)(M,{"data-testid":`create-si-submit`,variant:`primary`,onClick:me,disabled:!be||y,children:y?`Creating…`:`Create identity`})]})]})})]})}function Me({children:e}){return(0,D.jsx)(`div`,{style:{fontFamily:v.sans,fontSize:12,fontWeight:600,color:v.textMuted,marginBottom:6,letterSpacing:`0.05em`,textTransform:`uppercase`},children:e})}function Ne({children:e}){return(0,D.jsx)(`div`,{style:{fontFamily:v.sans,fontSize:12,fontWeight:600,color:v.textMuted,marginBottom:6},children:e})}function Pe({children:e}){return(0,D.jsx)(`div`,{style:{background:v.redDim,border:`1px solid ${v.red}44`,borderRadius:8,padding:`12px 16px`,marginBottom:16,fontFamily:v.sans,fontSize:13,color:v.red},children:e})}var Fe={width:`100%`,background:v.surface,border:`1px solid ${v.border}`,borderRadius:6,padding:`8px 12px`,fontFamily:v.mono,fontSize:12,color:v.text,outline:`none`,boxSizing:`border-box`},Ie={age:`age`,awskms:`AWS KMS`,gcpkms:`GCP KMS`,azurekv:`Azure Key Vault`,pgp:`PGP`,cloud:`Cloud KMS`},Le={awskms:`arn:aws:kms:region:account:key/id`,gcpkms:`projects/.../locations/.../keyRings/.../cryptoKeys/...`,azurekv:`https://vault-name.vault.azure.net/keys/key-name/version`,pgp:`PGP fingerprint`},Re=[`age`,`awskms`,`gcpkms`,`azurekv`,`pgp`];function ze({manifest:e,setView:t,reloadManifest:n}){let[r,i]=(0,g.useState)(1),[a,o]=(0,g.useState)(null),[s,c]=(0,g.useState)(`age`),[l,u]=(0,g.useState)(``),[d,f]=(0,g.useState)(`all`),[p,m]=(0,g.useState)(``),[h,_]=(0,g.useState)(null),[y,b]=(0,g.useState)(!1),[x,S]=(0,g.useState)(!1),[C,w]=(0,g.useState)(null),[E,O]=(0,g.useState)(!1),[k,j]=(0,g.useState)(null);(0,g.useEffect)(()=>{N()},[]),(0,g.useEffect)(()=>{e&&e.environments.length>0&&!p&&m(e.environments[0].name)},[e,p]);let N=async()=>{try{let e=await T(`/api/backend-config`);e.ok&&o(await e.json())}catch{}},P=async(e=!1)=>{O(!0),j(null);let t={target:{backend:s,key:s===`age`?void 0:l},environment:d===`single`?p:void 0,confirmed:e||void 0};try{let e=await T(`/api/migrate-backend/preview`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)});if(e.status===409){b(!0),O(!1);return}if(!e.ok){j((await e.json()).error??`Preview failed`),O(!1);return}_(await e.json()),b(!1),S(!1),i(2)}catch(e){j(e instanceof Error?e.message:`Preview failed`)}finally{O(!1)}},F=async()=>{i(3),j(null);let e={target:{backend:s,key:s===`age`?void 0:l},environment:d===`single`?p:void 0,confirmed:!0};try{let t=await T(`/api/migrate-backend/apply`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok){j((await t.json()).error??`Migration failed`),i(2);return}w(await t.json()),n(),i(4)}catch(e){j(e instanceof Error?e.message:`Migration failed`),i(2)}},I=()=>{i(1),_(null),w(null),b(!1),S(!1),j(null),N()},L=e?.environments??[],ee=h?.events.filter(e=>e.type===`info`&&e.message.startsWith(`Would`)).length??0;return(0,D.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:[(0,D.jsx)(A,{title:`Backend`,subtitle:`clef migrate-backend — change encryption backend`}),(0,D.jsx)(`div`,{style:{flex:1,overflow:`auto`,padding:24},children:(0,D.jsxs)(`div`,{style:{maxWidth:620,margin:`0 auto`},children:[(0,D.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:0,marginBottom:32},children:[1,2,3,4].map((e,t)=>(0,D.jsxs)(g.Fragment,{children:[(0,D.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,D.jsx)(`div`,{style:{width:24,height:24,borderRadius:`50%`,background:r>=e?v.accent:v.surface,border:`1px solid ${r>=e?v.accent:v.border}`,display:`flex`,alignItems:`center`,justifyContent:`center`,fontFamily:v.mono,fontSize:11,fontWeight:700,color:r>=e?`#000`:v.textDim},children:e}),(0,D.jsx)(`span`,{style:{fontFamily:v.sans,fontSize:12,color:r>=e?v.text:v.textDim,fontWeight:r===e?600:400},children:e===1?`Configure`:e===2?`Preview`:e===3?`Migrate`:`Done`})]}),t<3&&(0,D.jsx)(`div`,{style:{flex:1,height:1,background:r>e?v.accent:v.border,margin:`0 12px`,minWidth:20}})]},e))}),k&&(0,D.jsx)(`div`,{style:{background:v.redDim,border:`1px solid ${v.red}44`,borderRadius:8,padding:`12px 16px`,marginBottom:16,fontFamily:v.sans,fontSize:13,color:v.red},children:k}),r===1&&(0,D.jsxs)(`div`,{children:[a&&(0,D.jsxs)(`div`,{style:{marginBottom:24},children:[(0,D.jsx)(Be,{children:`Current Configuration`}),(0,D.jsxs)(`div`,{style:{background:v.surface,border:`1px solid ${v.border}`,borderRadius:8,padding:14},children:[(0,D.jsxs)(`div`,{style:{fontFamily:v.mono,fontSize:12,color:v.text,marginBottom:8},children:[`Default backend:`,` `,(0,D.jsx)(`span`,{style:{color:v.accent,fontWeight:600},children:Ie[a.global.default_backend]})]}),a.environments.map(e=>(0,D.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,fontFamily:v.mono,fontSize:11,color:v.textMuted,marginBottom:2},children:[(0,D.jsxs)(`span`,{children:[e.protected?`🔒 `:``,e.name]}),(0,D.jsx)(`span`,{style:{color:v.textDim},children:`→`}),(0,D.jsxs)(`span`,{style:{color:e.hasOverride?v.yellow:v.textMuted},children:[Ie[e.effective.backend],e.hasOverride?` (override)`:``]})]},e.name))]})]}),(0,D.jsxs)(`div`,{style:{marginBottom:20},children:[(0,D.jsx)(Be,{children:`Target Backend`}),(0,D.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6},children:Re.map(e=>(0,D.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:8,cursor:`pointer`,fontFamily:v.sans,fontSize:13,color:s===e?v.text:v.textMuted},children:[(0,D.jsx)(`input`,{type:`radio`,name:`backend`,value:e,checked:s===e,onChange:()=>{c(e),u(``)},style:{accentColor:v.accent},"data-testid":`backend-radio-${e}`}),Ie[e]]},e))})]}),s!==`age`&&(0,D.jsxs)(`div`,{style:{marginBottom:20},children:[(0,D.jsx)(Be,{children:`Key Identifier`}),(0,D.jsx)(`input`,{type:`text`,value:l,onChange:e=>u(e.target.value),placeholder:Le[s],"data-testid":`backend-key-input`,style:{width:`100%`,background:v.surface,border:`1px solid ${v.border}`,borderRadius:6,padding:`8px 12px`,fontFamily:v.mono,fontSize:12,color:v.text,outline:`none`,boxSizing:`border-box`}})]}),(0,D.jsxs)(`div`,{style:{marginBottom:24},children:[(0,D.jsx)(Be,{children:`Scope`}),(0,D.jsxs)(`div`,{style:{display:`flex`,gap:16,marginBottom:8},children:[(0,D.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:6,cursor:`pointer`,fontFamily:v.sans,fontSize:13,color:d===`all`?v.text:v.textMuted},children:[(0,D.jsx)(`input`,{type:`radio`,name:`scope`,checked:d===`all`,onChange:()=>f(`all`),style:{accentColor:v.accent}}),`All environments`]}),(0,D.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:6,cursor:`pointer`,fontFamily:v.sans,fontSize:13,color:d===`single`?v.text:v.textMuted},children:[(0,D.jsx)(`input`,{type:`radio`,name:`scope`,checked:d===`single`,onChange:()=>f(`single`),style:{accentColor:v.accent}}),`Single environment`]})]}),d===`single`&&(0,D.jsx)(`select`,{value:p,onChange:e=>m(e.target.value),"data-testid":`env-select`,style:{width:`100%`,background:v.surface,border:`1px solid ${v.border}`,borderRadius:6,padding:`7px 10px`,fontFamily:v.sans,fontSize:13,color:v.text,outline:`none`,cursor:`pointer`},children:L.map(e=>(0,D.jsxs)(`option`,{value:e.name,children:[e.name,e.protected?` (protected)`:``]},e.name))})]}),y&&(0,D.jsxs)(`div`,{style:{background:v.yellowDim,border:`1px solid ${v.yellow}44`,borderRadius:8,padding:`12px 16px`,marginBottom:16},children:[(0,D.jsx)(`div`,{style:{fontFamily:v.sans,fontSize:13,color:v.yellow,marginBottom:8},children:`This migration affects protected environments.`}),(0,D.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:8,cursor:`pointer`,fontFamily:v.sans,fontSize:12,color:v.text},children:[(0,D.jsx)(`input`,{type:`checkbox`,checked:x,onChange:e=>S(e.target.checked),style:{accentColor:v.yellow},"data-testid":`protected-confirm`}),`I understand and want to proceed`]})]}),(0,D.jsx)(M,{variant:`primary`,onClick:()=>P(x),disabled:E||s!==`age`&&!l.trim(),children:E?`Loading...`:y&&x?`Confirm & Preview`:`Preview`})]}),r===2&&h&&(0,D.jsxs)(`div`,{children:[(0,D.jsxs)(`div`,{style:{fontFamily:v.sans,fontSize:13,color:v.textMuted,marginBottom:20},children:[`Migrating to`,` `,(0,D.jsx)(`span`,{style:{color:v.accent,fontWeight:600},children:Ie[s]}),d===`single`?` (${p} only)`:` (all environments)`]}),h.events.filter(e=>e.type===`info`).length>0&&(0,D.jsxs)(`div`,{style:{marginBottom:16},children:[(0,D.jsxs)(Ve,{color:v.green,children:[`Files to migrate (`,h.events.filter(e=>e.type===`info`).length,`)`]}),h.events.filter(e=>e.type===`info`).map((e,t)=>(0,D.jsx)(He,{icon:`→`,iconColor:v.green,label:e.message},t))]}),h.events.filter(e=>e.type===`skip`).length>0&&(0,D.jsxs)(`div`,{style:{marginBottom:16},children:[(0,D.jsxs)(Ve,{color:v.textDim,children:[`Already on target (`,h.events.filter(e=>e.type===`skip`).length,`)`]}),h.events.filter(e=>e.type===`skip`).map((e,t)=>(0,D.jsx)(He,{icon:`↷`,iconColor:v.textDim,label:e.message},t))]}),h.result.warnings.length>0&&(0,D.jsx)(`div`,{style:{marginBottom:16},children:h.result.warnings.map((e,t)=>(0,D.jsxs)(`div`,{style:{fontFamily:v.mono,fontSize:11,color:v.yellow,marginBottom:4},children:[`⚠`,` `,e]},t))}),(0,D.jsxs)(`div`,{style:{display:`flex`,gap:10,marginTop:24},children:[(0,D.jsx)(M,{variant:`ghost`,onClick:I,children:`Back`}),(0,D.jsxs)(M,{variant:`primary`,onClick:F,disabled:ee===0,"data-testid":`apply-button`,children:[`Migrate `,ee,` file`,ee===1?``:`s`]})]})]}),r===3&&(0,D.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`,paddingTop:40},children:[(0,D.jsx)(`div`,{style:{width:40,height:40,border:`3px solid ${v.border}`,borderTopColor:v.accent,borderRadius:`50%`,animation:`spin 1s linear infinite`,marginBottom:16}}),(0,D.jsx)(`div`,{style:{fontFamily:v.sans,fontSize:14,color:v.textMuted},children:`Migrating... this may take a moment`}),(0,D.jsx)(`style`,{children:`@keyframes spin { to { transform: rotate(360deg); } }`})]}),r===4&&C&&(0,D.jsxs)(`div`,{children:[(0,D.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`,paddingTop:20,paddingBottom:32},children:[(0,D.jsx)(`div`,{style:{width:56,height:56,borderRadius:`50%`,background:C.result.rolledBack?v.redDim:v.greenDim,border:`1px solid ${C.result.rolledBack?v.red+`44`:v.green+`44`}`,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:24,color:C.result.rolledBack?v.red:v.green,marginBottom:16},children:C.result.rolledBack?`⚠`:`✓`}),(0,D.jsx)(`div`,{style:{fontFamily:v.sans,fontWeight:600,fontSize:16,color:C.result.rolledBack?v.red:v.green,marginBottom:8},children:C.result.rolledBack?`Migration failed`:`Migration complete`}),C.result.rolledBack&&C.result.error&&(0,D.jsx)(`div`,{style:{fontFamily:v.mono,fontSize:12,color:v.red,marginBottom:8,textAlign:`center`},children:C.result.error}),C.result.rolledBack&&(0,D.jsx)(`div`,{style:{fontFamily:v.sans,fontSize:12,color:v.textMuted,marginBottom:8},children:`All changes have been rolled back.`}),!C.result.rolledBack&&(0,D.jsxs)(`div`,{style:{fontFamily:v.mono,fontSize:12,color:v.textMuted},children:[C.result.migratedFiles.length,` migrated,`,` `,C.result.skippedFiles.length,` skipped,`,` `,C.result.verifiedFiles.length,` verified`]})]}),C.result.warnings.length>0&&(0,D.jsx)(`div`,{style:{marginBottom:16},children:C.result.warnings.map((e,t)=>(0,D.jsxs)(`div`,{style:{fontFamily:v.mono,fontSize:11,color:v.yellow,marginBottom:4},children:[`⚠`,` `,e]},t))}),!C.result.rolledBack&&(0,D.jsxs)(`div`,{style:{background:v.surface,border:`1px solid ${v.border}`,borderRadius:6,padding:`10px 14px`,marginBottom:24,fontFamily:v.mono,fontSize:11,color:v.textMuted},children:[`git add clef.yaml .sops.yaml secrets/ && git commit -m "chore: migrate backend to`,` `,s,`"`]}),(0,D.jsxs)(`div`,{style:{display:`flex`,gap:10},children:[(0,D.jsx)(M,{variant:`primary`,onClick:()=>t(`matrix`),children:`View in Matrix`}),(0,D.jsx)(M,{variant:`ghost`,onClick:I,children:`Migrate again`})]})]})]})})]})}function Be({children:e}){return(0,D.jsx)(`div`,{style:{fontFamily:v.sans,fontSize:12,fontWeight:600,color:v.textMuted,marginBottom:8,letterSpacing:`0.05em`,textTransform:`uppercase`},children:e})}function Ve({children:e,color:t}){return(0,D.jsx)(`div`,{style:{fontFamily:v.sans,fontSize:11,fontWeight:600,color:t,letterSpacing:`0.06em`,textTransform:`uppercase`,marginBottom:8},children:e})}function He({icon:e,iconColor:t,label:n}){return(0,D.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,padding:`5px 10px`,borderRadius:6,marginBottom:3},children:[(0,D.jsx)(`span`,{style:{color:t,fontFamily:v.mono,fontSize:13},children:e}),(0,D.jsx)(`span`,{style:{fontFamily:v.mono,fontSize:12,color:v.text},children:n})]})}var Ue=[`age`,`awskms`,`gcpkms`,`azurekv`,`pgp`],We={age:`age`,awskms:`AWS KMS`,gcpkms:`GCP KMS`,azurekv:`Azure Key Vault`,pgp:`PGP`},Ge={awskms:`arn:aws:kms:region:account:key/id`,gcpkms:`projects/.../locations/.../keyRings/.../cryptoKeys/...`,azurekv:`https://vault-name.vault.azure.net/keys/key-name/version`,pgp:`PGP fingerprint`};function Ke({manifest:e,setView:t,reloadManifest:n}){let r=e?.environments??[],i=e?.namespaces??[],a=r[0]?.name??``,o=i[0]?.name??``,[s,c]=(0,g.useState)(`idle`),[l,u]=(0,g.useState)(null),[d,f]=(0,g.useState)(`env`),[p,m]=(0,g.useState)(a),[h,_]=(0,g.useState)(o),[y,b]=(0,g.useState)(o),[x,S]=(0,g.useState)(a),[C,w]=(0,g.useState)(!1),[E,O]=(0,g.useState)(`age`),[k,j]=(0,g.useState)(``),[N,P]=(0,g.useState)(``),[F,I]=(0,g.useState)(``),[L,ee]=(0,g.useState)(null),R=d===`env`?p?{kind:`env`,name:p}:null:d===`namespace`?h?{kind:`namespace`,name:h}:null:y&&x?{kind:`cell`,namespace:y,environment:x}:null,te=R?R.kind===`env`?`env ${R.name}`:R.kind===`namespace`?`namespace ${R.name}`:`${R.namespace}/${R.environment}`:``,ne=C&&E!==`age`&&k.trim().length===0,re=F===te&&te.length>0,ie=R!==null&&re&&!ne&&s===`idle`,ae=L?Object.values(L.pendingKeysByCell).reduce((e,t)=>e+t.length,0):0,oe=async()=>{if(!R)return;c(`running`),u(null);let e=N.split(`,`).map(e=>e.trim()).filter(e=>e.length>0),t={scope:R};C&&(t.backend=E,E!==`age`&&(t.key=k.trim())),e.length>0&&(t.keys=e);try{let e=await T(`/api/reset`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)});if(!e.ok){u((await e.json().catch(()=>({error:`Reset failed`}))).error??`Reset failed`),c(`idle`);return}ee((await e.json()).result),n(),c(`done`)}catch(e){u(e instanceof Error?e.message:`Reset failed`),c(`idle`)}},se=()=>{c(`idle`),ee(null),u(null),I(``)};return(0,D.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:[(0,D.jsx)(A,{title:`Reset`,subtitle:`clef reset — destructively scaffold fresh placeholders`}),(0,D.jsx)(`div`,{style:{flex:1,overflow:`auto`,padding:24},children:(0,D.jsxs)(`div`,{style:{maxWidth:620,margin:`0 auto`},children:[l&&(0,D.jsx)(`div`,{"data-testid":`reset-error`,style:{background:v.redDim,border:`1px solid ${v.red}44`,borderRadius:8,padding:`12px 16px`,marginBottom:16,fontFamily:v.sans,fontSize:13,color:v.red},children:l}),s===`idle`&&(0,D.jsxs)(`div`,{children:[(0,D.jsxs)(`div`,{style:{marginBottom:20},children:[(0,D.jsx)(qe,{children:`Scope`}),(0,D.jsx)(`div`,{style:{display:`flex`,gap:16,marginBottom:10},children:[`env`,`namespace`,`cell`].map(e=>(0,D.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:6,cursor:`pointer`,fontFamily:v.sans,fontSize:13,color:d===e?v.text:v.textMuted},children:[(0,D.jsx)(`input`,{type:`radio`,name:`reset-scope-kind`,checked:d===e,onChange:()=>{f(e),I(``)},"data-testid":`reset-scope-${e}`,style:{accentColor:v.accent}}),e===`env`?`Environment`:e===`namespace`?`Namespace`:`Cell`]},e))}),d===`env`&&(0,D.jsx)(`select`,{value:p,onChange:e=>{m(e.target.value),I(``)},"data-testid":`reset-env-select`,style:Je,children:r.map(e=>(0,D.jsxs)(`option`,{value:e.name,children:[e.name,e.protected?` (protected)`:``]},e.name))}),d===`namespace`&&(0,D.jsx)(`select`,{value:h,onChange:e=>{_(e.target.value),I(``)},"data-testid":`reset-namespace-select`,style:Je,children:i.map(e=>(0,D.jsx)(`option`,{value:e.name,children:e.name},e.name))}),d===`cell`&&(0,D.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,D.jsx)(`select`,{value:y,onChange:e=>{b(e.target.value),I(``)},"data-testid":`reset-cell-namespace-select`,style:{...Je,flex:1},children:i.map(e=>(0,D.jsx)(`option`,{value:e.name,children:e.name},e.name))}),(0,D.jsx)(`select`,{value:x,onChange:e=>{S(e.target.value),I(``)},"data-testid":`reset-cell-env-select`,style:{...Je,flex:1},children:r.map(e=>(0,D.jsxs)(`option`,{value:e.name,children:[e.name,e.protected?` (protected)`:``]},e.name))})]})]}),(0,D.jsxs)(`div`,{style:{marginBottom:20},children:[(0,D.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:8,cursor:`pointer`,fontFamily:v.sans,fontSize:13,color:v.text},children:[(0,D.jsx)(`input`,{type:`checkbox`,checked:C,onChange:e=>w(e.target.checked),"data-testid":`reset-switch-backend`,style:{accentColor:v.accent}}),`Switch backend as part of reset`]}),C&&(0,D.jsxs)(`div`,{style:{marginTop:12,padding:14,background:v.surface,border:`1px solid ${v.border}`,borderRadius:8},children:[(0,D.jsx)(qe,{children:`Target Backend`}),(0,D.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6},children:Ue.map(e=>(0,D.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:8,cursor:`pointer`,fontFamily:v.sans,fontSize:13,color:E===e?v.text:v.textMuted},children:[(0,D.jsx)(`input`,{type:`radio`,name:`reset-target-backend`,checked:E===e,onChange:()=>{O(e),j(``)},"data-testid":`reset-backend-radio-${e}`,style:{accentColor:v.accent}}),We[e]]},e))}),E!==`age`&&(0,D.jsxs)(`div`,{style:{marginTop:12},children:[(0,D.jsx)(qe,{children:`Key Identifier`}),(0,D.jsx)(`input`,{type:`text`,value:k,onChange:e=>j(e.target.value),placeholder:Ge[E],"data-testid":`reset-backend-key-input`,style:Ye})]})]})]}),(0,D.jsxs)(`div`,{style:{marginBottom:20},children:[(0,D.jsx)(qe,{children:`Explicit Keys (optional)`}),(0,D.jsx)(`input`,{type:`text`,value:N,onChange:e=>P(e.target.value),placeholder:`DB_URL, DB_PASSWORD`,"data-testid":`reset-keys-input`,style:Ye}),(0,D.jsx)(`div`,{style:{fontFamily:v.sans,fontSize:11,color:v.textMuted,marginTop:6},children:`Comma-separated. Ignored when the namespace has a schema — schema keys are authoritative.`})]}),(0,D.jsxs)(`div`,{style:{background:v.redDim,border:`1px solid ${v.red}44`,borderRadius:8,padding:`14px 16px`,marginBottom:16,fontFamily:v.sans,fontSize:13,color:v.red,lineHeight:1.5},children:[`⚠`,` This will `,(0,D.jsx)(`strong`,{children:`ABANDON`}),` the current encrypted contents of the affected cells. Decryption will `,(0,D.jsx)(`strong`,{children:`NOT`}),` be attempted. This cannot be undone except via `,(0,D.jsx)(`code`,{children:`git revert`}),`.`]}),(0,D.jsxs)(`div`,{style:{marginBottom:20},children:[(0,D.jsxs)(qe,{children:[`Type `,(0,D.jsx)(`code`,{style:{color:v.text},children:te||`<scope>`}),` to confirm`]}),(0,D.jsx)(`input`,{type:`text`,value:F,onChange:e=>I(e.target.value),placeholder:te,"data-testid":`reset-confirm-input`,disabled:!R,style:Ye})]}),(0,D.jsxs)(M,{variant:`primary`,onClick:oe,disabled:!ie,"data-testid":`reset-submit`,children:[`Reset `,te||`<scope>`]})]}),s===`running`&&(0,D.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`,paddingTop:40},"data-testid":`reset-running`,children:[(0,D.jsx)(`div`,{style:{width:40,height:40,border:`3px solid ${v.border}`,borderTopColor:v.accent,borderRadius:`50%`,animation:`spin 1s linear infinite`,marginBottom:16}}),(0,D.jsxs)(`div`,{style:{fontFamily:v.sans,fontSize:14,color:v.textMuted},children:[`Resetting `,te,`...`]}),(0,D.jsx)(`style`,{children:`@keyframes spin { to { transform: rotate(360deg); } }`})]}),s===`done`&&L&&(0,D.jsxs)(`div`,{"data-testid":`reset-done`,children:[(0,D.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`,paddingTop:20,paddingBottom:24},children:[(0,D.jsx)(`div`,{style:{width:56,height:56,borderRadius:`50%`,background:v.greenDim,border:`1px solid ${v.green}44`,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:24,color:v.green,marginBottom:16},children:`✓`}),(0,D.jsx)(`div`,{style:{fontFamily:v.sans,fontWeight:600,fontSize:16,color:v.green,marginBottom:8},children:`Reset complete`}),(0,D.jsxs)(`div`,{style:{fontFamily:v.mono,fontSize:12,color:v.textMuted},children:[L.scaffoldedCells.length,` cell`,L.scaffoldedCells.length===1?``:`s`,` scaffolded`,ae>0?`, ${ae} pending placeholder${ae===1?``:`s`}`:``]})]}),L.backendChanged&&(0,D.jsxs)(`div`,{style:{background:v.surface,border:`1px solid ${v.border}`,borderRadius:6,padding:`10px 14px`,marginBottom:16,fontFamily:v.mono,fontSize:11,color:v.textMuted},children:[`Backend override written for: `,L.affectedEnvironments.join(`, `)]}),ae>0&&(0,D.jsxs)(`div`,{style:{fontFamily:v.sans,fontSize:12,color:v.textMuted,marginBottom:16,lineHeight:1.5},children:[`Run `,(0,D.jsx)(`code`,{children:`clef set`}),` (or use the namespace editor) to replace placeholders with real values.`]}),(0,D.jsxs)(`div`,{style:{display:`flex`,gap:10},children:[(0,D.jsx)(M,{variant:`primary`,onClick:()=>t(`matrix`),"data-testid":`reset-view-matrix`,children:`View in Matrix`}),(0,D.jsx)(M,{variant:`ghost`,onClick:se,"data-testid":`reset-start-over`,children:`Reset another`})]})]})]})})]})}function qe({children:e}){return(0,D.jsx)(`div`,{style:{fontFamily:v.sans,fontSize:12,fontWeight:600,color:v.textMuted,marginBottom:8,letterSpacing:`0.05em`,textTransform:`uppercase`},children:e})}var Je={width:`100%`,background:v.surface,border:`1px solid ${v.border}`,borderRadius:6,padding:`7px 10px`,fontFamily:v.sans,fontSize:13,color:v.text,outline:`none`,cursor:`pointer`},Ye={width:`100%`,background:v.surface,border:`1px solid ${v.border}`,borderRadius:6,padding:`8px 12px`,fontFamily:v.mono,fontSize:12,color:v.text,outline:`none`,boxSizing:`border-box`};function Xe({manifest:e}){let t=e?.namespaces??[],n=e?.environments??[],[r,i]=(0,g.useState)(t[0]?.name??``),[a,o]=(0,g.useState)(n[0]?.name??``),[s,c]=(0,g.useState)([]),[l,u]=(0,g.useState)(!1),[d,f]=(0,g.useState)(null);(0,g.useEffect)(()=>{t.length>0&&!r&&i(t[0].name),n.length>0&&!a&&o(n[0].name)},[t,n,r,a]);let p=(0,g.useCallback)(async()=>{if(!(!r||!a)){u(!0),f(null);try{let e=await T(`/api/git/log/${r}/${a}`);e.ok?c((await e.json()).log):(f((await e.json().catch(()=>({}))).error??`Failed to load history`),c([]))}catch{f(`Network error — could not load history`),c([])}finally{u(!1)}}},[r,a]);return(0,g.useEffect)(()=>{p()},[p]),(0,D.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:[(0,D.jsx)(A,{title:`History`,subtitle:`Commit log per encrypted file`}),(0,D.jsxs)(`div`,{style:{display:`flex`,gap:12,padding:`16px 24px`,borderBottom:`1px solid ${v.border}`},children:[(0,D.jsxs)(`label`,{style:{display:`flex`,gap:8,alignItems:`center`,fontFamily:v.mono,fontSize:12,color:v.textMuted},children:[`Namespace`,(0,D.jsx)(`select`,{value:r,onChange:e=>i(e.target.value),style:{fontFamily:v.mono,fontSize:12,background:v.surface,color:v.text,border:`1px solid ${v.border}`,borderRadius:4,padding:`3px 8px`},children:t.map(e=>(0,D.jsx)(`option`,{value:e.name,children:e.name},e.name))})]}),(0,D.jsxs)(`label`,{style:{display:`flex`,gap:8,alignItems:`center`,fontFamily:v.mono,fontSize:12,color:v.textMuted},children:[`Environment`,(0,D.jsx)(`select`,{value:a,onChange:e=>o(e.target.value),style:{fontFamily:v.mono,fontSize:12,background:v.surface,color:v.text,border:`1px solid ${v.border}`,borderRadius:4,padding:`3px 8px`},children:n.map(e=>(0,D.jsx)(`option`,{value:e.name,children:e.name},e.name))})]})]}),(0,D.jsxs)(`div`,{style:{flex:1,overflow:`auto`,padding:`0 24px 24px`},children:[l&&(0,D.jsx)(`div`,{style:{padding:24,color:v.textMuted,fontFamily:v.mono,fontSize:12},children:`Loading…`}),!l&&d&&(0,D.jsx)(`div`,{style:{padding:24,color:v.red,fontFamily:v.mono,fontSize:12},children:d}),!l&&!d&&s.length===0&&(0,D.jsxs)(`div`,{style:{padding:24,color:v.textMuted,fontFamily:v.mono,fontSize:12},children:[`No commits found for `,r,`/`,a,`.`]}),!l&&!d&&s.length>0&&(0,D.jsxs)(`table`,{style:{width:`100%`,borderCollapse:`collapse`,fontFamily:v.mono,fontSize:12,marginTop:16},children:[(0,D.jsx)(`thead`,{children:(0,D.jsxs)(`tr`,{style:{borderBottom:`1px solid ${v.border}`,color:v.textDim},children:[(0,D.jsx)(`th`,{style:{textAlign:`left`,padding:`6px 12px 6px 0`,fontWeight:600},children:`Hash`}),(0,D.jsx)(`th`,{style:{textAlign:`left`,padding:`6px 12px`,fontWeight:600},children:`Date`}),(0,D.jsx)(`th`,{style:{textAlign:`left`,padding:`6px 12px`,fontWeight:600},children:`Author`}),(0,D.jsx)(`th`,{style:{textAlign:`left`,padding:`6px 0`,fontWeight:600},children:`Message`})]})}),(0,D.jsx)(`tbody`,{children:s.map(e=>(0,D.jsxs)(`tr`,{style:{borderBottom:`1px solid ${v.border}22`},children:[(0,D.jsx)(`td`,{style:{padding:`8px 12px 8px 0`,color:v.accent},children:e.hash.slice(0,7)}),(0,D.jsx)(`td`,{style:{padding:`8px 12px`,color:v.textMuted,whiteSpace:`nowrap`},children:new Date(e.date).toLocaleDateString()}),(0,D.jsx)(`td`,{style:{padding:`8px 12px`,color:v.textMuted},children:e.author}),(0,D.jsx)(`td`,{style:{padding:`8px 0`,color:v.text},children:e.message})]},e.hash))})]})]})]})}function Ze(){let[e,t]=(0,g.useState)(`matrix`),[n,r]=(0,g.useState)(``),[i,a]=(0,g.useState)(!0),[o,s]=(0,g.useState)(null),[c,l]=(0,g.useState)([]),[u,d]=(0,g.useState)(null),[f,p]=(0,g.useState)(0),[m,h]=(0,g.useState)(0),_=(0,g.useCallback)(async()=>{try{let e=await T(`/api/manifest`);if(e.ok){let t=await e.json();s(t),r(e=>e||(t.namespaces[0]?.name??``))}}catch{}finally{a(!1)}},[]),y=(0,g.useCallback)(async()=>{try{let e=await T(`/api/matrix`);e.ok&&l(await e.json())}catch{}},[]),b=(0,g.useCallback)(async()=>{try{let e=await T(`/api/git/status`);e.ok&&d(await e.json())}catch{}},[]),x=(0,g.useCallback)(async()=>{try{let e=await T(`/api/lint`);e.ok&&p((await e.json()).issues.filter(e=>e.severity===`error`).length)}catch{}},[]),S=(0,g.useCallback)(async()=>{try{let e=await T(`/api/scan/status`);if(e.ok){let t=await e.json();t.lastRun&&h((t.lastRun.matches?.length??0)+(t.lastRun.unencryptedMatrixFiles?.length??0))}}catch{}},[]);return(0,g.useEffect)(()=>{_(),y(),b(),x(),S()},[_,y,b,x,S]),(0,g.useEffect)(()=>{_(),y()},[e,_,y]),i?(0,D.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,height:`100vh`,background:v.bg,color:v.textMuted,fontFamily:v.sans},children:(0,D.jsxs)(`div`,{style:{textAlign:`center`},children:[(0,D.jsx)(`div`,{style:{fontSize:24,color:v.accent,marginBottom:12},children:`♪`}),(0,D.jsx)(`div`,{style:{fontSize:13},children:`Loading...`})]})}):(0,D.jsxs)(`div`,{style:{display:`flex`,height:`100vh`,background:v.bg,color:v.text,fontFamily:v.sans,overflow:`hidden`},children:[(0,D.jsx)(O,{activeView:e,setView:t,activeNs:n,setNs:r,manifest:o,matrixStatuses:c,gitStatus:u,lintErrorCount:f,scanIssueCount:m}),(0,D.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:[e===`matrix`&&(0,D.jsx)(R,{setView:t,setNs:r,manifest:o,matrixStatuses:c}),e===`editor`&&(0,D.jsx)(te,{ns:n,manifest:o,onCommit:async e=>{try{await T(`/api/git/commit`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({message:e})}),await Promise.all([b(),y()])}catch{}}}),e===`diff`&&(0,D.jsx)(ie,{manifest:o}),e===`lint`&&(0,D.jsx)(ae,{setView:t,setNs:r}),e===`scan`&&(0,D.jsx)(oe,{}),e===`import`&&(0,D.jsx)(ce,{manifest:o,setView:t}),e===`recipients`&&(0,D.jsx)(ke,{manifest:o,setView:t}),e===`identities`&&(0,D.jsx)(je,{manifest:o}),e===`backend`&&(0,D.jsx)(ze,{manifest:o,setView:t,reloadManifest:_}),e===`reset`&&(0,D.jsx)(Ke,{manifest:o,setView:t,reloadManifest:_}),e===`cloud`&&null,e===`history`&&(0,D.jsx)(Xe,{manifest:o}),e===`manifest`&&(0,D.jsx)(me,{manifest:o,reloadManifest:_})]})]})}w();var Qe=document.getElementById(`root`);Qe&&_.createRoot(Qe).render((0,D.jsx)(g.StrictMode,{children:(0,D.jsx)(Ze,{})}));