livelocale 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/README.md +230 -5
  2. package/dist/client/index.cjs +178 -70
  3. package/dist/client/index.cjs.map +1 -1
  4. package/dist/client/index.d.cts +36 -22
  5. package/dist/client/index.d.ts +36 -22
  6. package/dist/client/index.js +177 -70
  7. package/dist/client/index.js.map +1 -1
  8. package/dist/codemod/index.cjs +3057 -152
  9. package/dist/codemod/index.cjs.map +1 -1
  10. package/dist/codemod/index.js +3058 -153
  11. package/dist/codemod/index.js.map +1 -1
  12. package/dist/react/index.cjs +185 -77
  13. package/dist/react/index.cjs.map +1 -1
  14. package/dist/react/index.js +185 -77
  15. package/dist/react/index.js.map +1 -1
  16. package/dist/server/index.cjs +108 -66
  17. package/dist/server/index.cjs.map +1 -1
  18. package/dist/server/index.d.cts +13 -3
  19. package/dist/server/index.d.ts +13 -3
  20. package/dist/server/index.js +107 -66
  21. package/dist/server/index.js.map +1 -1
  22. package/dist/studio/assets/index-Bvbtkry-.css +1 -0
  23. package/dist/studio/assets/index-DC_jRsox.js +13 -0
  24. package/dist/studio/assets/inter-latin-300-normal-BVlfKGgI.woff2 +0 -0
  25. package/dist/studio/assets/inter-latin-300-normal-i8F0SvXL.woff +0 -0
  26. package/dist/studio/assets/inter-latin-400-normal-C38fXH4l.woff2 +0 -0
  27. package/dist/studio/assets/inter-latin-400-normal-CyCys3Eg.woff +0 -0
  28. package/dist/studio/assets/inter-latin-500-normal-BL9OpVg8.woff +0 -0
  29. package/dist/studio/assets/inter-latin-500-normal-Cerq10X2.woff2 +0 -0
  30. package/dist/studio/assets/inter-latin-600-normal-CiBQ2DWP.woff +0 -0
  31. package/dist/studio/assets/inter-latin-600-normal-LgqL8muc.woff2 +0 -0
  32. package/dist/studio/assets/inter-latin-700-normal-BLAVimhd.woff +0 -0
  33. package/dist/studio/assets/inter-latin-700-normal-Yt3aPRUw.woff2 +0 -0
  34. package/dist/studio/assets/outfit-latin-400-normal-BGsTXAXT.woff2 +0 -0
  35. package/dist/studio/assets/outfit-latin-400-normal-DMwTpYkH.woff +0 -0
  36. package/dist/studio/assets/outfit-latin-500-normal-ClnHRwRh.woff +0 -0
  37. package/dist/studio/assets/outfit-latin-500-normal-DKnIMDSk.woff2 +0 -0
  38. package/dist/studio/assets/outfit-latin-600-normal-B7SfZ07L.woff2 +0 -0
  39. package/dist/studio/assets/outfit-latin-600-normal-BEfTtDA7.woff +0 -0
  40. package/dist/studio/assets/outfit-latin-700-normal-Cu9v6i1X.woff2 +0 -0
  41. package/dist/studio/assets/outfit-latin-700-normal-D4itBLBr.woff +0 -0
  42. package/dist/studio/index.html +3 -6
  43. package/dist/vite/index.cjs +739 -77
  44. package/dist/vite/index.cjs.map +1 -1
  45. package/dist/vite/index.d.cts +22 -2
  46. package/dist/vite/index.d.ts +22 -2
  47. package/dist/vite/index.js +738 -77
  48. package/dist/vite/index.js.map +1 -1
  49. package/dist/{wrap-CsOtHp8r.d.cts → wrap-2qVxLN9Q.d.cts} +10 -18
  50. package/dist/{wrap-CsOtHp8r.d.ts → wrap-2qVxLN9Q.d.ts} +10 -18
  51. package/package.json +4 -1
  52. package/dist/studio/assets/index-D7ifnqy5.js +0 -10
  53. package/dist/studio/assets/index-Zh0KtFUH.css +0 -2
@@ -0,0 +1,13 @@
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),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=o((e=>{var t=Symbol.for(`react.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 ee(e,t){return typeof e==`object`&&e&&e.key!=null?O(``+e.key):t.toString(36)}function te(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`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===``?`.`+ee(c,0):a,x(o)?(i=``,e!=null&&(i=e.replace(k,`$&/`)+`/`),te(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+ee(s,l);c+=te(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+ee(s,l++),c+=te(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 ne(e,t,n){if(e==null)return e;var r=[],i=0;return te(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function re(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 A={current:null},ie={transition:null},ae={ReactCurrentDispatcher:A,ReactCurrentBatchConfig:ie,ReactCurrentOwner:C};function oe(){throw Error(`act(...) is not supported in production builds of React.`)}e.Children={map:ne,forEach:function(e,t,n){ne(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ne(e,function(){t++}),t},toArray:function(e){return ne(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=ae,e.act=oe,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:re}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=ie.transition;ie.transition={};try{e()}finally{ie.transition=t}},e.unstable_act=oe,e.useCallback=function(e,t){return A.current.useCallback(e,t)},e.useContext=function(e){return A.current.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e){return A.current.useDeferredValue(e)},e.useEffect=function(e,t){return A.current.useEffect(e,t)},e.useId=function(){return A.current.useId()},e.useImperativeHandle=function(e,t,n){return A.current.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return A.current.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return A.current.useLayoutEffect(e,t)},e.useMemo=function(e,t){return A.current.useMemo(e,t)},e.useReducer=function(e,t,n){return A.current.useReducer(e,t,n)},e.useRef=function(e){return A.current.useRef(e)},e.useState=function(e){return A.current.useState(e)},e.useSyncExternalStore=function(e,t,n){return A.current.useSyncExternalStore(e,t,n)},e.useTransition=function(){return A.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,ne(x);else{var t=n(l);t!==null&&re(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&&re(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 ee=new MessageChannel,te=ee.port2;ee.port1.onmessage=O,k=function(){te.postMessage(null)}}else k=function(){g(O,0)};function ne(e){C=e,S||(S=!0,k())}function re(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,ne(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,re(b,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,ne(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`),ee=Symbol.for(`react.context`),te=Symbol.for(`react.forward_ref`),ne=Symbol.for(`react.suspense`),re=Symbol.for(`react.suspense_list`),A=Symbol.for(`react.memo`),ie=Symbol.for(`react.lazy`),ae=Symbol.for(`react.offscreen`),oe=Symbol.iterator;function se(e){return typeof e!=`object`||!e?null:(e=oe&&e[oe]||e[`@@iterator`],typeof e==`function`?e:null)}var j=Object.assign,ce;function M(e){if(ce===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ce=t&&t[1]||``}return`
2
+ `+ce+e}var le=!1;function ue(e,t){if(!e||le)return``;le=!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{le=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:``)?M(e):``}function de(e){switch(e.tag){case 5:return M(e.type);case 16:return M(`Lazy`);case 13:return M(`Suspense`);case 19:return M(`SuspenseList`);case 0:case 2:case 15:return e=ue(e.type,!1),e;case 11:return e=ue(e.type.render,!1),e;case 1:return e=ue(e.type,!0),e;default:return``}}function fe(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 ne:return`Suspense`;case re:return`SuspenseList`}if(typeof e==`object`)switch(e.$$typeof){case ee:return(e.displayName||`Context`)+`.Consumer`;case k:return(e._context.displayName||`Context`)+`.Provider`;case te:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case A:return t=e.displayName||null,t===null?fe(e.type)||`Memo`:t;case ie:t=e._payload,e=e._init;try{return fe(e(t))}catch{}}return null}function pe(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 fe(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 me(e){switch(typeof e){case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function he(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function ge(e){var t=he(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 _e(e){e._valueTracker||=ge(e)}function ve(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=he(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function ye(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 be(e,t){var n=t.checked;return j({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function xe(e,t){var n=t.defaultValue==null?``:t.defaultValue,r=t.checked==null?t.defaultChecked:t.checked;n=me(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 Se(e,t){t=t.checked,t!=null&&S(e,`checked`,t,!1)}function Ce(e,t){Se(e,t);var n=me(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`)?Te(e,t.type,n):t.hasOwnProperty(`defaultValue`)&&Te(e,t.type,me(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function we(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 Te(e,t,n){(t!==`number`||ye(e.ownerDocument)!==e)&&(n==null?e.defaultValue=``+e._wrapperState.initialValue:e.defaultValue!==``+n&&(e.defaultValue=``+n))}var Ee=Array.isArray;function De(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=``+me(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 Oe(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(r(91));return j({},t,{value:void 0,defaultValue:void 0,children:``+e._wrapperState.initialValue})}function ke(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(Ee(n)){if(1<n.length)throw Error(r(93));n=n[0]}t=n}t??=``,n=t}e._wrapperState={initialValue:me(n)}}function Ae(e,t){var n=me(t.value),r=me(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 je(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==``&&t!==null&&(e.value=t)}function Me(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 Ne(e,t){return e==null||e===`http://www.w3.org/1999/xhtml`?Me(t):e===`http://www.w3.org/2000/svg`&&t===`foreignObject`?`http://www.w3.org/1999/xhtml`:e}var Pe,Fe=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(Pe||=document.createElement(`div`),Pe.innerHTML=`<svg>`+t.valueOf().toString()+`</svg>`,t=Pe.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ie(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Le={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},Re=[`Webkit`,`ms`,`Moz`,`O`];Object.keys(Le).forEach(function(e){Re.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Le[t]=Le[e]})});function ze(e,t,n){return t==null||typeof t==`boolean`||t===``?``:n||typeof t!=`number`||t===0||Le.hasOwnProperty(e)&&Le[e]?(``+t).trim():t+`px`}function Be(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=n.indexOf(`--`)===0,i=ze(n,t[n],r);n===`float`&&(n=`cssFloat`),r?e.setProperty(n,i):e[n]=i}}var Ve=j({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 He(e,t){if(t){if(Ve[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 Ue(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 We=null;function Ge(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ke=null,qe=null,Je=null;function N(e){if(e=Gi(e)){if(typeof Ke!=`function`)throw Error(r(280));var t=e.stateNode;t&&(t=qi(t),Ke(e.stateNode,e.type,t))}}function Ye(e){qe?Je?Je.push(e):Je=[e]:qe=e}function Xe(){if(qe){var e=qe,t=Je;if(Je=qe=null,N(e),t)for(e=0;e<t.length;e++)N(t[e])}}function Ze(e,t){return e(t)}function Qe(){}var $e=!1;function et(e,t,n){if($e)return e(t,n);$e=!0;try{return Ze(e,t,n)}finally{$e=!1,(qe!==null||Je!==null)&&(Qe(),Xe())}}function tt(e,t){var n=e.stateNode;if(n===null)return null;var i=qi(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 nt=!1;if(c)try{var rt={};Object.defineProperty(rt,"passive",{get:function(){nt=!0}}),window.addEventListener(`test`,rt,rt),window.removeEventListener(`test`,rt,rt)}catch{nt=!1}function it(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 at=!1,ot=null,st=!1,ct=null,lt={onError:function(e){at=!0,ot=e}};function ut(e,t,n,r,i,a,o,s,c){at=!1,ot=null,it.apply(lt,arguments)}function dt(e,t,n,i,a,o,s,c,l){if(ut.apply(this,arguments),at){if(at){var u=ot;at=!1,ot=null}else throw Error(r(198));st||(st=!0,ct=u)}}function ft(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 pt(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 mt(e){if(ft(e)!==e)throw Error(r(188))}function ht(e){var t=e.alternate;if(!t){if(t=ft(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 mt(a),e;if(o===i)return mt(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 gt(e){return e=ht(e),e===null?null:_t(e)}function _t(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=_t(e);if(t!==null)return t;e=e.sibling}return null}var vt=n.unstable_scheduleCallback,yt=n.unstable_cancelCallback,bt=n.unstable_shouldYield,xt=n.unstable_requestPaint,P=n.unstable_now,St=n.unstable_getCurrentPriorityLevel,Ct=n.unstable_ImmediatePriority,wt=n.unstable_UserBlockingPriority,Tt=n.unstable_NormalPriority,Et=n.unstable_LowPriority,Dt=n.unstable_IdlePriority,Ot=null,F=null;function kt(e){if(F&&typeof F.onCommitFiberRoot==`function`)try{F.onCommitFiberRoot(Ot,e,void 0,(e.current.flags&128)==128)}catch{}}var At=Math.clz32?Math.clz32:Nt,jt=Math.log,Mt=Math.LN2;function Nt(e){return e>>>=0,e===0?32:31-(jt(e)/Mt|0)|0}var Pt=64,Ft=4194304;function It(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 Lt(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=It(a))):r=It(s)}else o=n&~i,o===0?a!==0&&(r=It(a)):r=It(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-At(t),i=1<<n,r|=e[n],t&=~i;return r}function Rt(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 zt(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-At(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Rt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}}function Bt(e){return e=e.pendingLanes&-1073741825,e===0?e&1073741824?1073741824:0:e}function Vt(){var e=Pt;return Pt<<=1,!(Pt&4194240)&&(Pt=64),e}function Ht(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ut(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-At(t),e[t]=n}function Wt(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-At(n),a=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~a}}function Gt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-At(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var I=0;function Kt(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var qt,Jt,Yt,Xt,Zt,Qt=!1,$t=[],en=null,tn=null,nn=null,rn=new Map,an=new Map,on=[],sn=`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 cn(e,t){switch(e){case`focusin`:case`focusout`:en=null;break;case`dragenter`:case`dragleave`:tn=null;break;case`mouseover`:case`mouseout`:nn=null;break;case`pointerover`:case`pointerout`:rn.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:an.delete(t.pointerId)}}function ln(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=Gi(t),t!==null&&Jt(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function un(e,t,n,r,i){switch(t){case`focusin`:return en=ln(en,e,t,n,r,i),!0;case`dragenter`:return tn=ln(tn,e,t,n,r,i),!0;case`mouseover`:return nn=ln(nn,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return rn.set(a,ln(rn.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,an.set(a,ln(an.get(a)||null,e,t,n,r,i)),!0}return!1}function dn(e){var t=Wi(e.target);if(t!==null){var n=ft(t);if(n!==null){if(t=n.tag,t===13){if(t=pt(n),t!==null){e.blockedOn=t,Zt(e.priority,function(){Yt(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 fn(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Cn(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);We=r,n.target.dispatchEvent(r),We=null}else return t=Gi(n),t!==null&&Jt(t),e.blockedOn=n,!1;t.shift()}return!0}function pn(e,t,n){fn(e)&&n.delete(t)}function mn(){Qt=!1,en!==null&&fn(en)&&(en=null),tn!==null&&fn(tn)&&(tn=null),nn!==null&&fn(nn)&&(nn=null),rn.forEach(pn),an.forEach(pn)}function hn(e,t){e.blockedOn===t&&(e.blockedOn=null,Qt||(Qt=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,mn)))}function gn(e){function t(t){return hn(t,e)}if(0<$t.length){hn($t[0],e);for(var n=1;n<$t.length;n++){var r=$t[n];r.blockedOn===e&&(r.blockedOn=null)}}for(en!==null&&hn(en,e),tn!==null&&hn(tn,e),nn!==null&&hn(nn,e),rn.forEach(t),an.forEach(t),n=0;n<on.length;n++)r=on[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<on.length&&(n=on[0],n.blockedOn===null);)dn(n),n.blockedOn===null&&on.shift()}var _n=C.ReactCurrentBatchConfig,vn=!0;function yn(e,t,n,r){var i=I,a=_n.transition;_n.transition=null;try{I=1,xn(e,t,n,r)}finally{I=i,_n.transition=a}}function bn(e,t,n,r){var i=I,a=_n.transition;_n.transition=null;try{I=4,xn(e,t,n,r)}finally{I=i,_n.transition=a}}function xn(e,t,n,r){if(vn){var i=Cn(e,t,n,r);if(i===null)gi(e,t,r,Sn,n),cn(e,r);else if(un(i,e,t,n,r))r.stopPropagation();else if(cn(e,r),t&4&&-1<sn.indexOf(e)){for(;i!==null;){var a=Gi(i);if(a!==null&&qt(a),a=Cn(e,t,n,r),a===null&&gi(e,t,r,Sn,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else gi(e,t,r,null,n)}}var Sn=null;function Cn(e,t,n,r){if(Sn=null,e=Ge(r),e=Wi(e),e!==null)if(t=ft(e),t===null)e=null;else if(n=t.tag,n===13){if(e=pt(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 Sn=e,null}function wn(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(St()){case Ct:return 1;case wt:return 4;case Tt:case Et:return 16;case Dt:return 536870912;default:return 16}default:return 16}}var Tn=null,En=null,Dn=null;function On(){if(Dn)return Dn;var e,t=En,n=t.length,r,i=`value`in Tn?Tn.value:Tn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return Dn=i.slice(e,1<r?1-r:void 0)}function kn(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 An(){return!0}function jn(){return!1}function Mn(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)?An:jn,this.isPropagationStopped=jn,this}return j(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=An)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=An)},persist:function(){},isPersistent:An}),t}var Nn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Pn=Mn(Nn),Fn=j({},Nn,{view:0,detail:0}),In=Mn(Fn),Ln,Rn,zn,Bn=j({},Fn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Zn,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!==zn&&(zn&&e.type===`mousemove`?(Ln=e.screenX-zn.screenX,Rn=e.screenY-zn.screenY):Rn=Ln=0,zn=e),Ln)},movementY:function(e){return`movementY`in e?e.movementY:Rn}}),Vn=Mn(Bn),Hn=Mn(j({},Bn,{dataTransfer:0})),Un=Mn(j({},Fn,{relatedTarget:0})),Wn=Mn(j({},Nn,{animationName:0,elapsedTime:0,pseudoElement:0})),Gn=Mn(j({},Nn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Kn=Mn(j({},Nn,{data:0})),qn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Jn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},Yn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Xn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Yn[e])?!!t[e]:!1}function Zn(){return Xn}var Qn=Mn(j({},Fn,{key:function(e){if(e.key){var t=qn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=kn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Jn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Zn,charCode:function(e){return e.type===`keypress`?kn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?kn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),$n=Mn(j({},Bn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),er=Mn(j({},Fn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Zn})),tr=Mn(j({},Nn,{propertyName:0,elapsedTime:0,pseudoElement:0})),nr=Mn(j({},Bn,{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})),rr=[9,13,27,32],ir=c&&`CompositionEvent`in window,ar=null;c&&`documentMode`in document&&(ar=document.documentMode);var or=c&&`TextEvent`in window&&!ar,sr=c&&(!ir||ar&&8<ar&&11>=ar),cr=` `,lr=!1;function ur(e,t){switch(e){case`keyup`:return rr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function dr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var fr=!1;function pr(e,t){switch(e){case`compositionend`:return dr(t);case`keypress`:return t.which===32?(lr=!0,cr):null;case`textInput`:return e=t.data,e===cr&&lr?null:e;default:return null}}function mr(e,t){if(fr)return e===`compositionend`||!ir&&ur(e,t)?(e=On(),Dn=En=Tn=null,fr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return sr&&t.locale!==`ko`?null:t.data;default:return null}}var hr={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 gr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!hr[e.type]:t===`textarea`}function _r(e,t,n,r){Ye(r),t=vi(t,`onChange`),0<t.length&&(n=new Pn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var vr=null,yr=null;function br(e){di(e,0)}function xr(e){if(ve(Ki(e)))return e}function Sr(e,t){if(e===`change`)return t}var Cr=!1;if(c){var wr;if(c){var Tr=`oninput`in document;if(!Tr){var Er=document.createElement(`div`);Er.setAttribute(`oninput`,`return;`),Tr=typeof Er.oninput==`function`}wr=Tr}else wr=!1;Cr=wr&&(!document.documentMode||9<document.documentMode)}function Dr(){vr&&(vr.detachEvent(`onpropertychange`,Or),yr=vr=null)}function Or(e){if(e.propertyName===`value`&&xr(yr)){var t=[];_r(t,yr,e,Ge(e)),et(br,t)}}function kr(e,t,n){e===`focusin`?(Dr(),vr=t,yr=n,vr.attachEvent(`onpropertychange`,Or)):e===`focusout`&&Dr()}function Ar(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return xr(yr)}function jr(e,t){if(e===`click`)return xr(t)}function Mr(e,t){if(e===`input`||e===`change`)return xr(t)}function Nr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Pr=typeof Object.is==`function`?Object.is:Nr;function Fr(e,t){if(Pr(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)||!Pr(e[i],t[i]))return!1}return!0}function Ir(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Lr(e,t){var n=Ir(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=Ir(n)}}function Rr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Rr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function zr(){for(var e=window,t=ye();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=ye(e.document)}return t}function Br(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 Vr(e){var t=zr(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Rr(n.ownerDocument.documentElement,n)){if(r!==null&&Br(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=Lr(n,a);var o=Lr(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 Hr=c&&`documentMode`in document&&11>=document.documentMode,Ur=null,Wr=null,Gr=null,Kr=!1;function qr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Kr||Ur==null||Ur!==ye(r)||(r=Ur,`selectionStart`in r&&Br(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}),Gr&&Fr(Gr,r)||(Gr=r,r=vi(Wr,`onSelect`),0<r.length&&(t=new Pn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Ur)))}function Jr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Yr={animationend:Jr(`Animation`,`AnimationEnd`),animationiteration:Jr(`Animation`,`AnimationIteration`),animationstart:Jr(`Animation`,`AnimationStart`),transitionend:Jr(`Transition`,`TransitionEnd`)},Xr={},Zr={};c&&(Zr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Yr.animationend.animation,delete Yr.animationiteration.animation,delete Yr.animationstart.animation),`TransitionEvent`in window||delete Yr.transitionend.transition);function Qr(e){if(Xr[e])return Xr[e];if(!Yr[e])return e;var t=Yr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Zr)return Xr[e]=t[n];return e}var $r=Qr(`animationend`),ei=Qr(`animationiteration`),ti=Qr(`animationstart`),ni=Qr(`transitionend`),ri=new Map,ii=`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 ai(e,t){ri.set(e,t),o(t,[e])}for(var oi=0;oi<ii.length;oi++){var si=ii[oi];ai(si.toLowerCase(),`on`+(si[0].toUpperCase()+si.slice(1)))}ai($r,`onAnimationEnd`),ai(ei,`onAnimationIteration`),ai(ti,`onAnimationStart`),ai(`dblclick`,`onDoubleClick`),ai(`focusin`,`onFocus`),ai(`focusout`,`onBlur`),ai(ni,`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 ci=`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(` `),li=new Set(`cancel close invalid load scroll toggle`.split(` `).concat(ci));function ui(e,t,n){var r=e.type||`unknown-event`;e.currentTarget=n,dt(r,t,void 0,e),e.currentTarget=null}function di(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;ui(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;ui(i,s,l),a=c}}}if(st)throw e=ct,st=!1,ct=null,e}function L(e,t){var n=t[Vi];n===void 0&&(n=t[Vi]=new Set);var r=e+`__bubble`;n.has(r)||(hi(t,e,2,!1),n.add(r))}function fi(e,t,n){var r=0;t&&(r|=4),hi(n,e,r,t)}var pi=`_reactListening`+Math.random().toString(36).slice(2);function mi(e){if(!e[pi]){e[pi]=!0,i.forEach(function(t){t!==`selectionchange`&&(li.has(t)||fi(t,!1,e),fi(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[pi]||(t[pi]=!0,fi(`selectionchange`,!1,t))}}function hi(e,t,n,r){switch(wn(t)){case 1:var i=yn;break;case 4:i=bn;break;default:i=xn}n=i.bind(null,t,n,e),i=void 0,!nt||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 gi(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=Wi(s),o===null)return;if(c=o.tag,c===5||c===6){r=a=o;continue a}s=s.parentNode}}r=r.return}et(function(){var r=a,i=Ge(n),o=[];a:{var s=ri.get(e);if(s!==void 0){var c=Pn,l=e;switch(e){case`keypress`:if(kn(n)===0)break a;case`keydown`:case`keyup`:c=Qn;break;case`focusin`:l=`focus`,c=Un;break;case`focusout`:l=`blur`,c=Un;break;case`beforeblur`:case`afterblur`:c=Un;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=Vn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:c=Hn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:c=er;break;case $r:case ei:case ti:c=Wn;break;case ni:c=tr;break;case`scroll`:c=In;break;case`wheel`:c=nr;break;case`copy`:case`cut`:case`paste`:c=Gn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:c=$n}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=tt(p,f),h!=null&&u.push(_i(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!==We&&(l=n.relatedTarget||n.fromElement)&&(Wi(l)||l[Bi]))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?Wi(l):null,l!==null&&(d=ft(l),l!==d||l.tag!==5&&l.tag!==6)&&(l=null)):(c=null,l=r),c!==l)){if(u=Vn,h=`onMouseLeave`,f=`onMouseEnter`,p=`mouse`,(e===`pointerout`||e===`pointerover`)&&(u=$n,h=`onPointerLeave`,f=`onPointerEnter`,p=`pointer`),d=c==null?s:Ki(c),m=l==null?s:Ki(l),s=new u(h,p+`leave`,c,n,i),s.target=d,s.relatedTarget=m,h=null,Wi(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=yi(m))p++;for(m=0,h=f;h;h=yi(h))m++;for(;0<p-m;)u=yi(u),p--;for(;0<m-p;)f=yi(f),m--;for(;p--;){if(u===f||f!==null&&u===f.alternate)break b;u=yi(u),f=yi(f)}u=null}else u=null;c!==null&&bi(o,s,c,u,!1),l!==null&&d!==null&&bi(o,d,l,u,!0)}}a:{if(s=r?Ki(r):window,c=s.nodeName&&s.nodeName.toLowerCase(),c===`select`||c===`input`&&s.type===`file`)var g=Sr;else if(gr(s))if(Cr)g=Mr;else{g=Ar;var _=kr}else (c=s.nodeName)&&c.toLowerCase()===`input`&&(s.type===`checkbox`||s.type===`radio`)&&(g=jr);if(g&&=g(e,r)){_r(o,g,n,i);break a}_&&_(e,s,r),e===`focusout`&&(_=s._wrapperState)&&_.controlled&&s.type===`number`&&Te(s,`number`,s.value)}switch(_=r?Ki(r):window,e){case`focusin`:(gr(_)||_.contentEditable===`true`)&&(Ur=_,Wr=r,Gr=null);break;case`focusout`:Gr=Wr=Ur=null;break;case`mousedown`:Kr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Kr=!1,qr(o,n,i);break;case`selectionchange`:if(Hr)break;case`keydown`:case`keyup`:qr(o,n,i)}var v;if(ir)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 fr?ur(e,n)&&(y=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(y=`onCompositionStart`);y&&(sr&&n.locale!==`ko`&&(fr||y!==`onCompositionStart`?y===`onCompositionEnd`&&fr&&(v=On()):(Tn=i,En=`value`in Tn?Tn.value:Tn.textContent,fr=!0)),_=vi(r,y),0<_.length&&(y=new Kn(y,e,null,n,i),o.push({event:y,listeners:_}),v?y.data=v:(v=dr(n),v!==null&&(y.data=v)))),(v=or?pr(e,n):mr(e,n))&&(r=vi(r,`onBeforeInput`),0<r.length&&(i=new Kn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:i,listeners:r}),i.data=v))}di(o,t)})}function _i(e,t,n){return{instance:e,listener:t,currentTarget:n}}function vi(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=tt(e,n),a!=null&&r.unshift(_i(e,a,i)),a=tt(e,t),a!=null&&r.push(_i(e,a,i))),e=e.return}return r}function yi(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function bi(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=tt(n,a),c!=null&&o.unshift(_i(n,c,s))):i||(c=tt(n,a),c!=null&&o.push(_i(n,c,s)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var xi=/\r\n?/g,Si=/\u0000|\uFFFD/g;function Ci(e){return(typeof e==`string`?e:``+e).replace(xi,`
6
+ `).replace(Si,``)}function wi(e,t,n){if(t=Ci(t),Ci(e)!==t&&n)throw Error(r(425))}function Ti(){}var Ei=null,Di=null;function Oi(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 ki=typeof setTimeout==`function`?setTimeout:void 0,Ai=typeof clearTimeout==`function`?clearTimeout:void 0,ji=typeof Promise==`function`?Promise:void 0,Mi=typeof queueMicrotask==`function`?queueMicrotask:ji===void 0?ki:function(e){return ji.resolve(null).then(e).catch(Ni)};function Ni(e){setTimeout(function(){throw e})}function Pi(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),gn(t);return}r--}else n!==`$`&&n!==`$?`&&n!==`$!`||r++;n=i}while(n);gn(t)}function Fi(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 Ii(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 Li=Math.random().toString(36).slice(2),Ri=`__reactFiber$`+Li,zi=`__reactProps$`+Li,Bi=`__reactContainer$`+Li,Vi=`__reactEvents$`+Li,Hi=`__reactListeners$`+Li,Ui=`__reactHandles$`+Li;function Wi(e){var t=e[Ri];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Bi]||n[Ri]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Ii(e);e!==null;){if(n=e[Ri])return n;e=Ii(e)}return t}e=n,n=e.parentNode}return null}function Gi(e){return e=e[Ri]||e[Bi],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ki(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(r(33))}function qi(e){return e[zi]||null}var Ji=[],Yi=-1;function Xi(e){return{current:e}}function R(e){0>Yi||(e.current=Ji[Yi],Ji[Yi]=null,Yi--)}function z(e,t){Yi++,Ji[Yi]=e.current,e.current=t}var Zi={},B=Xi(Zi),Qi=Xi(!1),$i=Zi;function ea(e,t){var n=e.type.contextTypes;if(!n)return Zi;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 ta(e){return e=e.childContextTypes,e!=null}function na(){R(Qi),R(B)}function ra(e,t,n){if(B.current!==Zi)throw Error(r(168));z(B,t),z(Qi,n)}function ia(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,pe(e)||`Unknown`,a));return j({},n,i)}function aa(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Zi,$i=B.current,z(B,e),z(Qi,Qi.current),!0}function oa(e,t,n){var i=e.stateNode;if(!i)throw Error(r(169));n?(e=ia(e,t,$i),i.__reactInternalMemoizedMergedChildContext=e,R(Qi),R(B),z(B,e)):R(Qi),z(Qi,n)}var sa=null,ca=!1,la=!1;function ua(e){sa===null?sa=[e]:sa.push(e)}function da(e){ca=!0,ua(e)}function fa(){if(!la&&sa!==null){la=!0;var e=0,t=I;try{var n=sa;for(I=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}sa=null,ca=!1}catch(t){throw sa!==null&&(sa=sa.slice(e+1)),vt(Ct,fa),t}finally{I=t,la=!1}}return null}var pa=[],ma=0,ha=null,ga=0,_a=[],va=0,ya=null,ba=1,xa=``;function Sa(e,t){pa[ma++]=ga,pa[ma++]=ha,ha=e,ga=t}function Ca(e,t,n){_a[va++]=ba,_a[va++]=xa,_a[va++]=ya,ya=e;var r=ba;e=xa;var i=32-At(r)-1;r&=~(1<<i),n+=1;var a=32-At(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,ba=1<<32-At(t)+i|n<<i|r,xa=a+e}else ba=1<<a|n<<i|r,xa=e}function wa(e){e.return!==null&&(Sa(e,1),Ca(e,1,0))}function Ta(e){for(;e===ha;)ha=pa[--ma],pa[ma]=null,ga=pa[--ma],pa[ma]=null;for(;e===ya;)ya=_a[--va],_a[va]=null,xa=_a[--va],_a[va]=null,ba=_a[--va],_a[va]=null}var Ea=null,Da=null,V=!1,Oa=null;function ka(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 Aa(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,Ea=e,Da=Fi(t.firstChild),!0);case 6:return t=e.pendingProps===``||t.nodeType!==3?null:t,t===null?!1:(e.stateNode=t,Ea=e,Da=null,!0);case 13:return t=t.nodeType===8?t:null,t===null?!1:(n=ya===null?null:{id:ba,overflow:xa},e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Kl(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Ea=e,Da=null,!0);default:return!1}}function ja(e){return(e.mode&1)!=0&&(e.flags&128)==0}function Ma(e){if(V){var t=Da;if(t){var n=t;if(!Aa(e,t)){if(ja(e))throw Error(r(418));t=Fi(n.nextSibling);var i=Ea;t&&Aa(e,t)?ka(i,n):(e.flags=e.flags&-4097|2,V=!1,Ea=e)}}else{if(ja(e))throw Error(r(418));e.flags=e.flags&-4097|2,V=!1,Ea=e}}}function Na(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Ea=e}function Pa(e){if(e!==Ea)return!1;if(!V)return Na(e),V=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!==`head`&&t!==`body`&&!Oi(e.type,e.memoizedProps)),t&&=Da){if(ja(e))throw Fa(),Error(r(418));for(;t;)ka(e,t),t=Fi(t.nextSibling)}if(Na(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){Da=Fi(e.nextSibling);break a}t--}else n!==`$`&&n!==`$!`&&n!==`$?`||t++}e=e.nextSibling}Da=null}}else Da=Ea?Fi(e.stateNode.nextSibling):null;return!0}function Fa(){for(var e=Da;e;)e=Fi(e.nextSibling)}function Ia(){Da=Ea=null,V=!1}function La(e){Oa===null?Oa=[e]:Oa.push(e)}var Ra=C.ReactCurrentBatchConfig;function za(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 Ba(e,t){throw e=Object.prototype.toString.call(t),Error(r(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e))}function Va(e){var t=e._init;return t(e._payload)}function Ha(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===ie&&Va(i)===t.type)?(r=a(t,n.props),r.ref=za(e,t,n),r.return=e,r):(r=Xl(n.type,n.key,n.props,null,e.mode,r),r.ref=za(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=za(e,null,t),n.return=e,n;case T:return t=eu(t,e.mode,n),t.return=e,t;case ie:var r=t._init;return f(e,r(t._payload),n)}if(Ee(t)||se(t))return t=Zl(t,e.mode,n,null),t.return=e,t;Ba(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 ie:return i=n._init,p(e,t,i(n._payload),r)}if(Ee(n)||se(n))return i===null?d(e,t,n,r,null):null;Ba(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 ie:var a=r._init;return m(e,t,n,a(r._payload),i)}if(Ee(r)||se(r))return e=e.get(n)||null,d(t,e,r,i,null);Ba(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),V&&Sa(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 V&&Sa(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)}),V&&Sa(r,h),l}function g(a,s,c,l){var u=se(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),V&&Sa(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 V&&Sa(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)}),V&&Sa(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===ie&&Va(c)===l.type){n(e,l.sibling),r=a(l,i.props),r.ref=za(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=za(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 ie:return l=i._init,_(e,r,l(i._payload),o)}if(Ee(i))return h(e,r,i,o);if(se(i))return g(e,r,i,o);Ba(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 Ua=Ha(!0),Wa=Ha(!1),Ga=Xi(null),Ka=null,qa=null,Ja=null;function Ya(){Ja=qa=Ka=null}function Xa(e){var t=Ga.current;R(Ga),e._currentValue=t}function Za(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 Qa(e,t){Ka=e,Ja=qa=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Rs=!0),e.firstContext=null)}function $a(e){var t=e._currentValue;if(Ja!==e)if(e={context:e,memoizedValue:t,next:null},qa===null){if(Ka===null)throw Error(r(308));qa=e,Ka.dependencies={lanes:0,firstContext:e}}else qa=qa.next=e;return t}var eo=null;function to(e){eo===null?eo=[e]:eo.push(e)}function no(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,to(t)):(n.next=i.next,i.next=n),t.interleaved=n,ro(e,r)}function ro(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 io=!1;function ao(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function oo(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 so(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function co(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,J&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,ro(e,n)}return i=r.interleaved,i===null?(t.next=t,to(r)):(t.next=i.next,i.next=t),r.interleaved=t,ro(e,n)}function lo(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,Gt(e,n)}}function uo(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 fo(e,t,n,r){var i=e.updateQueue;io=!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=j({},d,f);break a;case 2:io=!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 po(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 mo={},ho=Xi(mo),go=Xi(mo),_o=Xi(mo);function vo(e){if(e===mo)throw Error(r(174));return e}function yo(e,t){switch(z(_o,t),z(go,e),z(ho,mo),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ne(null,``);break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Ne(t,e)}R(ho),z(ho,t)}function bo(){R(ho),R(go),R(_o)}function xo(e){vo(_o.current);var t=vo(ho.current),n=Ne(t,e.type);t!==n&&(z(go,e),z(ho,n))}function So(e){go.current===e&&(R(ho),R(go))}var H=Xi(0);function Co(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 wo=[];function To(){for(var e=0;e<wo.length;e++)wo[e]._workInProgressVersionPrimary=null;wo.length=0}var Eo=C.ReactCurrentDispatcher,Do=C.ReactCurrentBatchConfig,Oo=0,U=null,W=null,G=null,ko=!1,Ao=!1,jo=0,Mo=0;function No(){throw Error(r(321))}function Po(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Pr(e[n],t[n]))return!1;return!0}function Fo(e,t,n,i,a,o){if(Oo=o,U=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Eo.current=e===null||e.memoizedState===null?vs:ys,e=n(i,a),Ao){o=0;do{if(Ao=!1,jo=0,25<=o)throw Error(r(301));o+=1,G=W=null,t.updateQueue=null,Eo.current=bs,e=n(i,a)}while(Ao)}if(Eo.current=_s,t=W!==null&&W.next!==null,Oo=0,G=W=U=null,ko=!1,t)throw Error(r(300));return e}function Io(){var e=jo!==0;return jo=0,e}function Lo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return G===null?U.memoizedState=G=e:G=G.next=e,G}function Ro(){if(W===null){var e=U.alternate;e=e===null?null:e.memoizedState}else e=W.next;var t=G===null?U.memoizedState:G.next;if(t!==null)G=t,W=e;else{if(e===null)throw Error(r(310));W=e,e={memoizedState:W.memoizedState,baseState:W.baseState,baseQueue:W.baseQueue,queue:W.queue,next:null},G===null?U.memoizedState=G=e:G=G.next=e}return G}function zo(e,t){return typeof t==`function`?t(e):t}function Bo(e){var t=Ro(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var i=W,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((Oo&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,U.lanes|=d,Yc|=d}u=u.next}while(u!==null&&u!==o);l===null?s=i:l.next=c,Pr(i,t.memoizedState)||(Rs=!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,U.lanes|=o,Yc|=o,a=a.next;while(a!==e)}else a===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Vo(e){var t=Ro(),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);Pr(o,t.memoizedState)||(Rs=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,i]}function Ho(){}function Uo(e,t){var n=U,i=Ro(),a=t(),o=!Pr(i.memoizedState,a);if(o&&(i.memoizedState=a,Rs=!0),i=i.queue,ts(Ko.bind(null,n,i,e),[e]),i.getSnapshot!==t||o||G!==null&&G.memoizedState.tag&1){if(n.flags|=2048,Xo(9,Go.bind(null,n,i,a,t),void 0,null),Y===null)throw Error(r(349));Oo&30||Wo(n,t,a)}return a}function Wo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=U.updateQueue,t===null?(t={lastEffect:null,stores:null},U.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Go(e,t,n,r){t.value=n,t.getSnapshot=r,qo(t)&&Jo(e)}function Ko(e,t,n){return n(function(){qo(t)&&Jo(e)})}function qo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Pr(e,n)}catch{return!0}}function Jo(e){var t=ro(e,1);t!==null&&hl(t,e,1,-1)}function Yo(e){var t=Lo();return typeof e==`function`&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:zo,lastRenderedState:e},t.queue=e,e=e.dispatch=ps.bind(null,U,e),[t.memoizedState,e]}function Xo(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=U.updateQueue,t===null?(t={lastEffect:null,stores:null},U.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 Zo(){return Ro().memoizedState}function Qo(e,t,n,r){var i=Lo();U.flags|=e,i.memoizedState=Xo(1|t,n,void 0,r===void 0?null:r)}function $o(e,t,n,r){var i=Ro();r=r===void 0?null:r;var a=void 0;if(W!==null){var o=W.memoizedState;if(a=o.destroy,r!==null&&Po(r,o.deps)){i.memoizedState=Xo(t,n,a,r);return}}U.flags|=e,i.memoizedState=Xo(1|t,n,a,r)}function es(e,t){return Qo(8390656,8,e,t)}function ts(e,t){return $o(2048,8,e,t)}function ns(e,t){return $o(4,2,e,t)}function rs(e,t){return $o(4,4,e,t)}function is(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 as(e,t,n){return n=n==null?null:n.concat([e]),$o(4,4,is.bind(null,t,e),n)}function os(){}function ss(e,t){var n=Ro();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Po(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function cs(e,t){var n=Ro();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Po(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function ls(e,t,n){return Oo&21?(Pr(n,t)||(n=Vt(),U.lanes|=n,Yc|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Rs=!0),e.memoizedState=n)}function us(e,t){var n=I;I=n!==0&&4>n?n:4,e(!0);var r=Do.transition;Do.transition={};try{e(!1),t()}finally{I=n,Do.transition=r}}function ds(){return Ro().memoizedState}function fs(e,t,n){var r=ml(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},ms(e))hs(t,n);else if(n=no(e,t,n,r),n!==null){var i=pl();hl(n,e,r,i),gs(n,t,r)}}function ps(e,t,n){var r=ml(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(ms(e))hs(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,Pr(s,o)){var c=t.interleaved;c===null?(i.next=i,to(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}n=no(e,t,i,r),n!==null&&(i=pl(),hl(n,e,r,i),gs(n,t,r))}}function ms(e){var t=e.alternate;return e===U||t!==null&&t===U}function hs(e,t){Ao=ko=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function gs(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Gt(e,n)}}var _s={readContext:$a,useCallback:No,useContext:No,useEffect:No,useImperativeHandle:No,useInsertionEffect:No,useLayoutEffect:No,useMemo:No,useReducer:No,useRef:No,useState:No,useDebugValue:No,useDeferredValue:No,useTransition:No,useMutableSource:No,useSyncExternalStore:No,useId:No,unstable_isNewReconciler:!1},vs={readContext:$a,useCallback:function(e,t){return Lo().memoizedState=[e,t===void 0?null:t],e},useContext:$a,useEffect:es,useImperativeHandle:function(e,t,n){return n=n==null?null:n.concat([e]),Qo(4194308,4,is.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Qo(4194308,4,e,t)},useInsertionEffect:function(e,t){return Qo(4,2,e,t)},useMemo:function(e,t){var n=Lo();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Lo();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=fs.bind(null,U,e),[r.memoizedState,e]},useRef:function(e){var t=Lo();return e={current:e},t.memoizedState=e},useState:Yo,useDebugValue:os,useDeferredValue:function(e){return Lo().memoizedState=e},useTransition:function(){var e=Yo(!1),t=e[0];return e=us.bind(null,e[1]),Lo().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=U,a=Lo();if(V){if(n===void 0)throw Error(r(407));n=n()}else{if(n=t(),Y===null)throw Error(r(349));Oo&30||Wo(i,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,es(Ko.bind(null,i,o,e),[e]),i.flags|=2048,Xo(9,Go.bind(null,i,o,n,t),void 0,null),n},useId:function(){var e=Lo(),t=Y.identifierPrefix;if(V){var n=xa,r=ba;n=(r&~(1<<32-At(r)-1)).toString(32)+n,t=`:`+t+`R`+n,n=jo++,0<n&&(t+=`H`+n.toString(32)),t+=`:`}else n=Mo++,t=`:`+t+`r`+n.toString(32)+`:`;return e.memoizedState=t},unstable_isNewReconciler:!1},ys={readContext:$a,useCallback:ss,useContext:$a,useEffect:ts,useImperativeHandle:as,useInsertionEffect:ns,useLayoutEffect:rs,useMemo:cs,useReducer:Bo,useRef:Zo,useState:function(){return Bo(zo)},useDebugValue:os,useDeferredValue:function(e){return ls(Ro(),W.memoizedState,e)},useTransition:function(){return[Bo(zo)[0],Ro().memoizedState]},useMutableSource:Ho,useSyncExternalStore:Uo,useId:ds,unstable_isNewReconciler:!1},bs={readContext:$a,useCallback:ss,useContext:$a,useEffect:ts,useImperativeHandle:as,useInsertionEffect:ns,useLayoutEffect:rs,useMemo:cs,useReducer:Vo,useRef:Zo,useState:function(){return Vo(zo)},useDebugValue:os,useDeferredValue:function(e){var t=Ro();return W===null?t.memoizedState=e:ls(t,W.memoizedState,e)},useTransition:function(){return[Vo(zo)[0],Ro().memoizedState]},useMutableSource:Ho,useSyncExternalStore:Uo,useId:ds,unstable_isNewReconciler:!1};function xs(e,t){if(e&&e.defaultProps){for(var n in t=j({},t),e=e.defaultProps,e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Ss(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:j({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Cs={isMounted:function(e){return(e=e._reactInternals)?ft(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=pl(),i=ml(e),a=so(r,i);a.payload=t,n!=null&&(a.callback=n),t=co(e,a,i),t!==null&&(hl(t,e,i,r),lo(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=pl(),i=ml(e),a=so(r,i);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=co(e,a,i),t!==null&&(hl(t,e,i,r),lo(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=pl(),r=ml(e),i=so(n,r);i.tag=2,t!=null&&(i.callback=t),t=co(e,i,r),t!==null&&(hl(t,e,r,n),lo(t,e,r))}};function ws(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?!Fr(n,r)||!Fr(i,a):!0}function Ts(e,t,n){var r=!1,i=Zi,a=t.contextType;return typeof a==`object`&&a?a=$a(a):(i=ta(t)?$i:B.current,r=t.contextTypes,a=(r=r!=null)?ea(e,i):Zi),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Cs,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function Es(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&&Cs.enqueueReplaceState(t,t.state,null)}function Ds(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},ao(e);var a=t.contextType;typeof a==`object`&&a?i.context=$a(a):(a=ta(t)?$i:B.current,i.context=ea(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a==`function`&&(Ss(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&&Cs.enqueueReplaceState(i,i.state,null),fo(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount==`function`&&(e.flags|=4194308)}function Os(e,t){try{var n=``,r=t;do n+=de(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 ks(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function As(e,t){try{console.error(t.value)}catch(e){setTimeout(function(){throw e})}}var js=typeof WeakMap==`function`?WeakMap:Map;function Ms(e,t,n){n=so(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){rl||(rl=!0,il=r),As(e,t)},n}function Ns(e,t,n){n=so(-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(){As(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch==`function`&&(n.callback=function(){As(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 Ps(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new js;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 Fs(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 Is(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=so(-1,1),t.tag=2,co(n,t,1))),n.lanes|=1),e)}var Ls=C.ReactCurrentOwner,Rs=!1;function zs(e,t,n,r){t.child=e===null?Wa(t,null,n,r):Ua(t,e.child,n,r)}function Bs(e,t,n,r,i){n=n.render;var a=t.ref;return Qa(t,i),r=Fo(e,t,n,r,a,i),n=Io(),e!==null&&!Rs?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,oc(e,t,i)):(V&&n&&wa(t),t.flags|=1,zs(e,t,r,i),t.child)}function Vs(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,Hs(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?Fr:n,n(o,r)&&e.ref===t.ref)return oc(e,t,i)}return t.flags|=1,e=Yl(a,r),e.ref=t.ref,e.return=t,t.child=e}function Hs(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Fr(a,r)&&e.ref===t.ref)if(Rs=!1,t.pendingProps=r=a,(e.lanes&i)!==0)e.flags&131072&&(Rs=!0);else return t.lanes=e.lanes,oc(e,t,i)}return Gs(e,t,n,r,i)}function Us(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},z(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,z(qc,Kc),Kc|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a===null?n:a.baseLanes,z(qc,Kc),Kc|=r}else a===null?r=n:(r=a.baseLanes|n,t.memoizedState=null),z(qc,Kc),Kc|=r;return zs(e,t,i,n),t.child}function Ws(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Gs(e,t,n,r,i){var a=ta(n)?$i:B.current;return a=ea(t,a),Qa(t,i),n=Fo(e,t,n,r,a,i),r=Io(),e!==null&&!Rs?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,oc(e,t,i)):(V&&r&&wa(t),t.flags|=1,zs(e,t,n,i),t.child)}function Ks(e,t,n,r,i){if(ta(n)){var a=!0;aa(t)}else a=!1;if(Qa(t,i),t.stateNode===null)ac(e,t),Ts(t,n,r),Ds(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=$a(l):(l=ta(n)?$i:B.current,l=ea(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)&&Es(t,o,r,l),io=!1;var f=t.memoizedState;o.state=f,fo(t,r,o,i),c=t.memoizedState,s!==r||f!==c||Qi.current||io?(typeof u==`function`&&(Ss(t,n,u,r),c=t.memoizedState),(s=io||ws(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,oo(e,t),s=t.memoizedProps,l=t.type===t.elementType?s:xs(t.type,s),o.props=l,d=t.pendingProps,f=o.context,c=n.contextType,typeof c==`object`&&c?c=$a(c):(c=ta(n)?$i:B.current,c=ea(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)&&Es(t,o,r,c),io=!1,f=t.memoizedState,o.state=f,fo(t,r,o,i);var m=t.memoizedState;s!==d||f!==m||Qi.current||io?(typeof p==`function`&&(Ss(t,n,p,r),m=t.memoizedState),(l=io||ws(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 qs(e,t,n,r,a,i)}function qs(e,t,n,r,i,a){Ws(e,t);var o=(t.flags&128)!=0;if(!r&&!o)return i&&oa(t,n,!1),oc(e,t,a);r=t.stateNode,Ls.current=t;var s=o&&typeof n.getDerivedStateFromError!=`function`?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Ua(t,e.child,null,a),t.child=Ua(t,null,s,a)):zs(e,t,s,a),t.memoizedState=r.state,i&&oa(t,n,!0),t.child}function Js(e){var t=e.stateNode;t.pendingContext?ra(e,t.pendingContext,t.pendingContext!==t.context):t.context&&ra(e,t.context,!1),yo(e,t.containerInfo)}function Ys(e,t,n,r,i){return Ia(),La(i),t.flags|=256,zs(e,t,n,r),t.child}var Xs={dehydrated:null,treeContext:null,retryLane:0};function Zs(e){return{baseLanes:e,cachePool:null,transitions:null}}function Qs(e,t,n){var r=t.pendingProps,i=H.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),z(H,i&1),e===null)return Ma(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=Zs(n),t.memoizedState=Xs,e):$s(t,o));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return tc(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?Zs(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=Xs,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 $s(e,t){return t=Ql({mode:`visible`,children:t},e.mode,0,null),t.return=e,e.child=t}function ec(e,t,n,r){return r!==null&&La(r),Ua(t,e.child,null,n),e=$s(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function tc(e,t,n,i,a,o,s){if(n)return t.flags&256?(t.flags&=-257,i=ks(Error(r(422))),ec(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&&Ua(t,e.child,null,s),t.child.memoizedState=Zs(s),t.memoizedState=Xs,o):(t.child=e.child,t.flags|=128,null);if(!(t.mode&1))return ec(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=ks(o,i,void 0),ec(e,t,s,i)}if(c=(s&e.childLanes)!==0,Rs||c){if(i=Y,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,ro(e,a),hl(i,e,a,-1))}return kl(),i=ks(Error(r(421))),ec(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,Da=Fi(a.nextSibling),Ea=t,V=!0,Oa=null,e!==null&&(_a[va++]=ba,_a[va++]=xa,_a[va++]=ya,ba=e.id,xa=e.overflow,ya=t),t=$s(t,i.children),t.flags|=4096,t)}function nc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Za(e.return,t,n)}function rc(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 ic(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(zs(e,t,r.children,n),r=H.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&&nc(e,n,t);else if(e.tag===19)nc(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(z(H,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&&Co(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),rc(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&&Co(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}rc(t,!0,n,null,a);break;case`together`:rc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ac(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function oc(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 sc(e,t,n){switch(t.tag){case 3:Js(t),Ia();break;case 5:xo(t);break;case 1:ta(t.type)&&aa(t);break;case 4:yo(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;z(Ga,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(z(H,H.current&1),e=oc(e,t,n),e===null?null:e.sibling):Qs(e,t,n):(z(H,H.current&1),t.flags|=128,null);z(H,H.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return ic(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),z(H,H.current),r)break;return null;case 22:case 23:return t.lanes=0,Us(e,t,n)}return oc(e,t,n)}var cc=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}},lc=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,vo(ho.current);var o=null;switch(n){case`input`:i=be(e,i),r=be(e,r),o=[];break;case`select`:i=j({},i,{value:void 0}),r=j({},r,{value:void 0}),o=[];break;case`textarea`:i=Oe(e,i),r=Oe(e,r),o=[];break;default:typeof i.onClick!=`function`&&typeof r.onClick==`function`&&(e.onclick=Ti)}He(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`&&L(`scroll`,e),o||c===l||(o=[])):(o||=[]).push(u,l))}n&&(o||=[]).push(`style`,n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}},uc=function(e,t,n,r){n!==r&&(t.flags|=4)};function dc(e,t){if(!V)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function fc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&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 pc(e,t,n){var i=t.pendingProps;switch(Ta(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return fc(t),null;case 1:return ta(t.type)&&na(),fc(t),null;case 3:return i=t.stateNode,bo(),R(Qi),R(B),To(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Pa(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Oa!==null&&(yl(Oa),Oa=null))),fc(t),null;case 5:So(t);var o=vo(_o.current);if(n=t.type,e!==null&&t.stateNode!=null)lc(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 fc(t),null}if(e=vo(ho.current),Pa(t)){i=t.stateNode,n=t.type;var s=t.memoizedProps;switch(i[Ri]=t,i[zi]=s,e=(t.mode&1)!=0,n){case`dialog`:L(`cancel`,i),L(`close`,i);break;case`iframe`:case`object`:case`embed`:L(`load`,i);break;case`video`:case`audio`:for(o=0;o<ci.length;o++)L(ci[o],i);break;case`source`:L(`error`,i);break;case`img`:case`image`:case`link`:L(`error`,i),L(`load`,i);break;case`details`:L(`toggle`,i);break;case`input`:xe(i,s),L(`invalid`,i);break;case`select`:i._wrapperState={wasMultiple:!!s.multiple},L(`invalid`,i);break;case`textarea`:ke(i,s),L(`invalid`,i)}for(var c in He(n,s),o=null,s)if(s.hasOwnProperty(c)){var l=s[c];c===`children`?typeof l==`string`?i.textContent!==l&&(!0!==s.suppressHydrationWarning&&wi(i.textContent,l,e),o=[`children`,l]):typeof l==`number`&&i.textContent!==``+l&&(!0!==s.suppressHydrationWarning&&wi(i.textContent,l,e),o=[`children`,``+l]):a.hasOwnProperty(c)&&l!=null&&c===`onScroll`&&L(`scroll`,i)}switch(n){case`input`:_e(i),we(i,s,!0);break;case`textarea`:_e(i),je(i);break;case`select`:case`option`:break;default:typeof s.onClick==`function`&&(i.onclick=Ti)}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=Me(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[Ri]=t,e[zi]=i,cc(e,t,!1,!1),t.stateNode=e;a:{switch(c=Ue(n,i),n){case`dialog`:L(`cancel`,e),L(`close`,e),o=i;break;case`iframe`:case`object`:case`embed`:L(`load`,e),o=i;break;case`video`:case`audio`:for(o=0;o<ci.length;o++)L(ci[o],e);o=i;break;case`source`:L(`error`,e),o=i;break;case`img`:case`image`:case`link`:L(`error`,e),L(`load`,e),o=i;break;case`details`:L(`toggle`,e),o=i;break;case`input`:xe(e,i),o=be(e,i),L(`invalid`,e);break;case`option`:o=i;break;case`select`:e._wrapperState={wasMultiple:!!i.multiple},o=j({},i,{value:void 0}),L(`invalid`,e);break;case`textarea`:ke(e,i),o=Oe(e,i),L(`invalid`,e);break;default:o=i}for(s in He(n,o),l=o,l)if(l.hasOwnProperty(s)){var u=l[s];s===`style`?Be(e,u):s===`dangerouslySetInnerHTML`?(u=u?u.__html:void 0,u!=null&&Fe(e,u)):s===`children`?typeof u==`string`?(n!==`textarea`||u!==``)&&Ie(e,u):typeof u==`number`&&Ie(e,``+u):s!==`suppressContentEditableWarning`&&s!==`suppressHydrationWarning`&&s!==`autoFocus`&&(a.hasOwnProperty(s)?u!=null&&s===`onScroll`&&L(`scroll`,e):u!=null&&S(e,s,u,c))}switch(n){case`input`:_e(e),we(e,i,!1);break;case`textarea`:_e(e),je(e);break;case`option`:i.value!=null&&e.setAttribute(`value`,``+me(i.value));break;case`select`:e.multiple=!!i.multiple,s=i.value,s==null?i.defaultValue!=null&&De(e,!!i.multiple,i.defaultValue,!0):De(e,!!i.multiple,s,!1);break;default:typeof o.onClick==`function`&&(e.onclick=Ti)}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 fc(t),null;case 6:if(e&&t.stateNode!=null)uc(e,t,e.memoizedProps,i);else{if(typeof i!=`string`&&t.stateNode===null)throw Error(r(166));if(n=vo(_o.current),vo(ho.current),Pa(t)){if(i=t.stateNode,n=t.memoizedProps,i[Ri]=t,(s=i.nodeValue!==n)&&(e=Ea,e!==null))switch(e.tag){case 3:wi(i.nodeValue,n,(e.mode&1)!=0);break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&wi(i.nodeValue,n,(e.mode&1)!=0)}s&&(t.flags|=4)}else i=(n.nodeType===9?n:n.ownerDocument).createTextNode(i),i[Ri]=t,t.stateNode=i}return fc(t),null;case 13:if(R(H),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(V&&Da!==null&&t.mode&1&&!(t.flags&128))Fa(),Ia(),t.flags|=98560,s=!1;else if(s=Pa(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[Ri]=t}else Ia(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;fc(t),s=!1}else Oa!==null&&(yl(Oa),Oa=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||H.current&1?Q===0&&(Q=3):kl())),t.updateQueue!==null&&(t.flags|=4),fc(t),null);case 4:return bo(),e===null&&mi(t.stateNode.containerInfo),fc(t),null;case 10:return Xa(t.type._context),fc(t),null;case 17:return ta(t.type)&&na(),fc(t),null;case 19:if(R(H),s=t.memoizedState,s===null)return fc(t),null;if(i=(t.flags&128)!=0,c=s.rendering,c===null)if(i)dc(s,!1);else{if(Q!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(c=Co(e),c!==null){for(t.flags|=128,dc(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 z(H,H.current&1|2),t.child}e=e.sibling}s.tail!==null&&P()>tl&&(t.flags|=128,i=!0,dc(s,!1),t.lanes=4194304)}else{if(!i)if(e=Co(c),e!==null){if(t.flags|=128,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),dc(s,!0),s.tail===null&&s.tailMode===`hidden`&&!c.alternate&&!V)return fc(t),null}else 2*P()-s.renderingStartTime>tl&&n!==1073741824&&(t.flags|=128,i=!0,dc(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?(fc(t),null):(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=P(),t.sibling=null,n=H.current,z(H,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&&(fc(t),t.subtreeFlags&6&&(t.flags|=8192)):fc(t),null;case 24:return null;case 25:return null}throw Error(r(156,t.tag))}function mc(e,t){switch(Ta(t),t.tag){case 1:return ta(t.type)&&na(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return bo(),R(Qi),R(B),To(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return So(t),null;case 13:if(R(H),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));Ia()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return R(H),null;case 4:return bo(),null;case 10:return Xa(t.type._context),null;case 22:case 23:return Tl(),null;case 24:return null;default:return null}}var hc=!1,gc=!1,_c=typeof WeakSet==`function`?WeakSet:Set,K=null;function vc(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 yc(e,t,n){try{n()}catch(n){$(e,t,n)}}var bc=!1;function xc(e,t){if(Ei=vn,e=zr(),Br(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(Di={focusedElem:e,selectionRange:n},vn=!1,K=t;K!==null;)if(t=K,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,K=e;else for(;K!==null;){t=K;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:xs(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,K=e;break}K=t.return}return h=bc,bc=!1,h}function Sc(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&&yc(t,n,a)}i=i.next}while(i!==r)}}function Cc(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 wc(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 Tc(e){var t=e.alternate;t!==null&&(e.alternate=null,Tc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ri],delete t[zi],delete t[Vi],delete t[Hi],delete t[Ui])),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 Ec(e){return e.tag===5||e.tag===3||e.tag===4}function Dc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Ec(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 Oc(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=Ti));else if(r!==4&&(e=e.child,e!==null))for(Oc(e,t,n),e=e.sibling;e!==null;)Oc(e,t,n),e=e.sibling}function kc(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(kc(e,t,n),e=e.sibling;e!==null;)kc(e,t,n),e=e.sibling}var q=null,Ac=!1;function jc(e,t,n){for(n=n.child;n!==null;)Mc(e,t,n),n=n.sibling}function Mc(e,t,n){if(F&&typeof F.onCommitFiberUnmount==`function`)try{F.onCommitFiberUnmount(Ot,n)}catch{}switch(n.tag){case 5:gc||vc(n,t);case 6:var r=q,i=Ac;q=null,jc(e,t,n),q=r,Ac=i,q!==null&&(Ac?(e=q,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):q.removeChild(n.stateNode));break;case 18:q!==null&&(Ac?(e=q,n=n.stateNode,e.nodeType===8?Pi(e.parentNode,n):e.nodeType===1&&Pi(e,n),gn(e)):Pi(q,n.stateNode));break;case 4:r=q,i=Ac,q=n.stateNode.containerInfo,Ac=!0,jc(e,t,n),q=r,Ac=i;break;case 0:case 11:case 14:case 15:if(!gc&&(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)&&yc(n,t,o),i=i.next}while(i!==r)}jc(e,t,n);break;case 1:if(!gc&&(vc(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)}jc(e,t,n);break;case 21:jc(e,t,n);break;case 22:n.mode&1?(gc=(r=gc)||n.memoizedState!==null,jc(e,t,n),gc=r):jc(e,t,n);break;default:jc(e,t,n)}}function Nc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new _c),t.forEach(function(t){var r=Hl.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function Pc(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:q=c.stateNode,Ac=!1;break a;case 3:q=c.stateNode.containerInfo,Ac=!0;break a;case 4:q=c.stateNode.containerInfo,Ac=!0;break a}c=c.return}if(q===null)throw Error(r(160));Mc(o,s,a),q=null,Ac=!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;)Fc(t,e),t=t.sibling}function Fc(e,t){var n=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Pc(t,e),Ic(e),i&4){try{Sc(3,e,e.return),Cc(3,e)}catch(t){$(e,e.return,t)}try{Sc(5,e,e.return)}catch(t){$(e,e.return,t)}}break;case 1:Pc(t,e),Ic(e),i&512&&n!==null&&vc(n,n.return);break;case 5:if(Pc(t,e),Ic(e),i&512&&n!==null&&vc(n,n.return),e.flags&32){var a=e.stateNode;try{Ie(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&&Se(a,o),Ue(c,s);var u=Ue(c,o);for(s=0;s<l.length;s+=2){var d=l[s],f=l[s+1];d===`style`?Be(a,f):d===`dangerouslySetInnerHTML`?Fe(a,f):d===`children`?Ie(a,f):S(a,d,f,u)}switch(c){case`input`:Ce(a,o);break;case`textarea`:Ae(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?De(a,!!o.multiple,o.multiple?[]:``,!1):De(a,!!o.multiple,o.defaultValue,!0)):De(a,!!o.multiple,m,!1)}a[zi]=o}catch(t){$(e,e.return,t)}}break;case 6:if(Pc(t,e),Ic(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(Pc(t,e),Ic(e),i&4&&n!==null&&n.memoizedState.isDehydrated)try{gn(t.containerInfo)}catch(t){$(e,e.return,t)}break;case 4:Pc(t,e),Ic(e);break;case 13:Pc(t,e),Ic(e),a=e.child,a.flags&8192&&(o=a.memoizedState!==null,a.stateNode.isHidden=o,!o||a.alternate!==null&&a.alternate.memoizedState!==null||(el=P())),i&4&&Nc(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(gc=(u=gc)||d,Pc(t,e),gc=u):Pc(t,e),Ic(e),i&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(K=e,d=e.child;d!==null;){for(f=K=d;K!==null;){switch(p=K,m=p.child,p.tag){case 0:case 11:case 14:case 15:Sc(4,p,p.return);break;case 1:vc(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:vc(p,p.return);break;case 22:if(p.memoizedState!==null){Bc(f);continue}}m===null?Bc(f):(m.return=p,K=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=ze(`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:Pc(t,e),Ic(e),i&4&&Nc(e);break;case 21:break;default:Pc(t,e),Ic(e)}}function Ic(e){var t=e.flags;if(t&2){try{a:{for(var n=e.return;n!==null;){if(Ec(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&&(Ie(a,``),i.flags&=-33),kc(e,Dc(e),a);break;case 3:case 4:var o=i.stateNode.containerInfo;Oc(e,Dc(e),o);break;default:throw Error(r(161))}}catch(t){$(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Lc(e,t,n){K=e,Rc(e,t,n)}function Rc(e,t,n){for(var r=(e.mode&1)!=0;K!==null;){var i=K,a=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||hc;if(!o){var s=i.alternate,c=s!==null&&s.memoizedState!==null||gc;s=hc;var l=gc;if(hc=o,(gc=c)&&!l)for(K=i;K!==null;)o=K,c=o.child,o.tag===22&&o.memoizedState!==null||c===null?Vc(i):(c.return=o,K=c);for(;a!==null;)K=a,Rc(a,t,n),a=a.sibling;K=i,hc=s,gc=l}zc(e,t,n)}else i.subtreeFlags&8772&&a!==null?(a.return=i,K=a):zc(e,t,n)}}function zc(e){for(;K!==null;){var t=K;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:gc||Cc(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!gc)if(n===null)i.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:xs(t.type,n.memoizedProps);i.componentDidUpdate(a,n.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&po(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}po(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&&gn(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}gc||t.flags&512&&wc(t)}catch(e){$(t,t.return,e)}}if(t===e){K=null;break}if(n=t.sibling,n!==null){n.return=t.return,K=n;break}K=t.return}}function Bc(e){for(;K!==null;){var t=K;if(t===e){K=null;break}var n=t.sibling;if(n!==null){n.return=t.return,K=n;break}K=t.return}}function Vc(e){for(;K!==null;){var t=K;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Cc(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{wc(t)}catch(e){$(t,a,e)}break;case 5:var o=t.return;try{wc(t)}catch(e){$(t,o,e)}}}catch(e){$(t,t.return,e)}if(t===e){K=null;break}var s=t.sibling;if(s!==null){s.return=t.return,K=s;break}K=t.return}}var Hc=Math.ceil,Uc=C.ReactCurrentDispatcher,Wc=C.ReactCurrentOwner,Gc=C.ReactCurrentBatchConfig,J=0,Y=null,X=null,Z=0,Kc=0,qc=Xi(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 J&6?P():dl===-1?dl=P():dl}function ml(e){return e.mode&1?J&2&&Z!==0?Z&-Z:Ra.transition===null?(e=I,e===0?(e=window.event,e=e===void 0?16:wn(e.type),e):e):(fl===0&&(fl=Vt()),fl):1}function hl(e,t,n,i){if(50<ll)throw ll=0,ul=null,Error(r(185));Ut(e,n,i),(!(J&2)||e!==Y)&&(e===Y&&(!(J&2)&&(Xc|=n),Q===4&&xl(e,Z)),gl(e,i),n===1&&J===0&&!(t.mode&1)&&(tl=P()+500,ca&&fa()))}function gl(e,t){var n=e.callbackNode;zt(e,t);var r=Lt(e,e===Y?Z:0);if(r===0)n!==null&&yt(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&yt(n),t===1)e.tag===0?da(Sl.bind(null,e)):ua(Sl.bind(null,e)),Mi(function(){!(J&6)&&fa()}),n=null;else{switch(Kt(r)){case 1:n=Ct;break;case 4:n=wt;break;case 16:n=Tt;break;case 536870912:n=Dt;break;default:n=Tt}n=Wl(n,_l.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function _l(e,t){if(dl=-1,fl=0,J&6)throw Error(r(327));var n=e.callbackNode;if(Ll()&&e.callbackNode!==n)return null;var i=Lt(e,e===Y?Z:0);if(i===0)return null;if(i&30||(i&e.expiredLanes)!==0||t)t=Al(e,i);else{t=i;var a=J;J|=2;var o=Ol();(Y!==e||Z!==t)&&(nl=null,tl=P()+500,El(e,t));do try{Ml();break}catch(t){Dl(e,t)}while(1);Ya(),Uc.current=o,J=a,X===null?(Y=null,Z=0,t=Q):t=0}if(t!==0){if(t===2&&(a=Bt(e),a!==0&&(i=a,t=vl(e,a))),t===1)throw n=Jc,El(e,0),xl(e,i),gl(e,P()),n;if(t===6)xl(e,i);else{if(a=e.current.alternate,!(i&30)&&!bl(a)&&(t=Al(e,i),t===2&&(o=Bt(e),o!==0&&(i=o,t=vl(e,o))),t===1))throw n=Jc,El(e,0),xl(e,i),gl(e,P()),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-P(),10<t)){if(Lt(e,0)!==0)break;if(a=e.suspendedLanes,(a&i)!==i){pl(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=ki(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-At(i);o=1<<s,s=t[s],s>a&&(a=s),i&=~o}if(i=a,i=P()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Hc(i/1960))-i,10<i){e.timeoutHandle=ki(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,P()),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(!Pr(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-At(t),r=1<<n;e[n]=-1,t&=~r}}function Sl(e){if(J&6)throw Error(r(327));Ll();var t=Lt(e,0);if(!(t&1))return gl(e,P()),null;var n=Al(e,t);if(e.tag!==0&&n===2){var i=Bt(e);i!==0&&(t=i,n=vl(e,i))}if(n===1)throw n=Jc,El(e,0),xl(e,t),gl(e,P()),n;if(n===6)throw Error(r(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Fl(e,$c,nl),gl(e,P()),null}function Cl(e,t){var n=J;J|=1;try{return e(t)}finally{J=n,J===0&&(tl=P()+500,ca&&fa())}}function wl(e){sl!==null&&sl.tag===0&&!(J&6)&&Ll();var t=J;J|=1;var n=Gc.transition,r=I;try{if(Gc.transition=null,I=1,e)return e()}finally{I=r,Gc.transition=n,J=t,!(J&6)&&fa()}}function Tl(){Kc=qc.current,R(qc)}function El(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Ai(n)),X!==null)for(n=X.return;n!==null;){var r=n;switch(Ta(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&na();break;case 3:bo(),R(Qi),R(B),To();break;case 5:So(r);break;case 4:bo();break;case 13:R(H);break;case 19:R(H);break;case 10:Xa(r.type._context);break;case 22:case 23:Tl()}n=n.return}if(Y=e,X=e=Yl(e.current,null),Z=Kc=t,Q=0,Jc=null,Zc=Xc=Yc=0,$c=Qc=null,eo!==null){for(t=0;t<eo.length;t++)if(n=eo[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}eo=null}return e}function Dl(e,t){do{var n=X;try{if(Ya(),Eo.current=_s,ko){for(var i=U.memoizedState;i!==null;){var a=i.queue;a!==null&&(a.pending=null),i=i.next}ko=!1}if(Oo=0,G=W=U=null,Ao=!1,jo=0,Wc.current=null,n===null||n.return===null){Q=1,Jc=t,X=null;break}a:{var o=e,s=n.return,c=n,l=t;if(t=Z,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=Fs(s);if(m!==null){m.flags&=-257,Is(m,s,c,o,t),m.mode&1&&Ps(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)){Ps(o,u,t),kl();break a}l=Error(r(426))}}else if(V&&c.mode&1){var _=Fs(s);if(_!==null){!(_.flags&65536)&&(_.flags|=256),Is(_,s,c,o,t),La(Os(l,c));break a}}o=l=Os(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=Ms(o,l,t);uo(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=Ns(o,c,t);uo(o,x);break a}}o=o.return}while(o!==null)}Pl(n)}catch(e){t=e,X===n&&n!==null&&(X=n=n.return);continue}break}while(1)}function Ol(){var e=Uc.current;return Uc.current=_s,e===null?_s:e}function kl(){(Q===0||Q===3||Q===2)&&(Q=4),Y===null||!(Yc&268435455)&&!(Xc&268435455)||xl(Y,Z)}function Al(e,t){var n=J;J|=2;var i=Ol();(Y!==e||Z!==t)&&(nl=null,El(e,t));do try{jl();break}catch(t){Dl(e,t)}while(1);if(Ya(),J=n,Uc.current=i,X!==null)throw Error(r(261));return Y=null,Z=0,Q}function jl(){for(;X!==null;)Nl(X)}function Ml(){for(;X!==null&&!bt();)Nl(X)}function Nl(e){var t=Ul(e.alternate,e,Kc);e.memoizedProps=e.pendingProps,t===null?Pl(e):X=t,Wc.current=null}function Pl(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=mc(n,t),n!==null){n.flags&=32767,X=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Q=6,X=null;return}}else if(n=pc(n,t,Kc),n!==null){X=n;return}if(t=t.sibling,t!==null){X=t;return}X=t=e}while(t!==null);Q===0&&(Q=5)}function Fl(e,t,n){var r=I,i=Gc.transition;try{Gc.transition=null,I=1,Il(e,t,n,r)}finally{Gc.transition=i,I=r}return null}function Il(e,t,n,i){do Ll();while(sl!==null);if(J&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(Wt(e,o),e===Y&&(X=Y=null,Z=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||ol||(ol=!0,Wl(Tt,function(){return Ll(),null})),o=(n.flags&15990)!=0,n.subtreeFlags&15990||o){o=Gc.transition,Gc.transition=null;var s=I;I=1;var c=J;J|=4,Wc.current=null,xc(e,n),Fc(n,e),Vr(Di),vn=!!Ei,Di=Ei=null,e.current=n,Lc(n,e,a),xt(),J=c,I=s,Gc.transition=o}else e.current=n;if(ol&&(ol=!1,sl=e,cl=a),o=e.pendingLanes,o===0&&(al=null),kt(n.stateNode,i),gl(e,P()),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,fa(),null}function Ll(){if(sl!==null){var e=Kt(cl),t=Gc.transition,n=I;try{if(Gc.transition=null,I=16>e?16:e,sl===null)var i=!1;else{if(e=sl,sl=null,cl=0,J&6)throw Error(r(331));var a=J;for(J|=4,K=e.current;K!==null;){var o=K,s=o.child;if(K.flags&16){var c=o.deletions;if(c!==null){for(var l=0;l<c.length;l++){var u=c[l];for(K=u;K!==null;){var d=K;switch(d.tag){case 0:case 11:case 15:Sc(8,d,o)}var f=d.child;if(f!==null)f.return=d,K=f;else for(;K!==null;){d=K;var p=d.sibling,m=d.return;if(Tc(d),d===u){K=null;break}if(p!==null){p.return=m,K=p;break}K=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)}}K=o}}if(o.subtreeFlags&2064&&s!==null)s.return=o,K=s;else b:for(;K!==null;){if(o=K,o.flags&2048)switch(o.tag){case 0:case 11:case 15:Sc(9,o,o.return)}var v=o.sibling;if(v!==null){v.return=o.return,K=v;break b}K=o.return}}var y=e.current;for(K=y;K!==null;){s=K;var b=s.child;if(s.subtreeFlags&2064&&b!==null)b.return=s,K=b;else b:for(s=y;K!==null;){if(c=K,c.flags&2048)try{switch(c.tag){case 0:case 11:case 15:Cc(9,c)}}catch(e){$(c,c.return,e)}if(c===s){K=null;break b}var x=c.sibling;if(x!==null){x.return=c.return,K=x;break b}K=c.return}}if(J=a,fa(),F&&typeof F.onPostCommitFiberRoot==`function`)try{F.onPostCommitFiberRoot(Ot,e)}catch{}i=!0}return i}finally{I=n,Gc.transition=t}}return!1}function Rl(e,t,n){t=Os(n,t),t=Ms(e,t,1),e=co(e,t,1),t=pl(),e!==null&&(Ut(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=Os(n,e),e=Ns(t,e,1),t=co(t,e,1),e=pl(),t!==null&&(Ut(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,Y===e&&(Z&n)===n&&(Q===4||Q===3&&(Z&130023424)===Z&&500>P()-el?El(e,0):Zc|=n),gl(e,t)}function Bl(e,t){t===0&&(e.mode&1?(t=Ft,Ft<<=1,!(Ft&130023424)&&(Ft=4194304)):t=1);var n=pl();e=ro(e,t),e!==null&&(Ut(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||Qi.current)Rs=!0;else{if((e.lanes&n)===0&&!(t.flags&128))return Rs=!1,sc(e,t,n);Rs=!!(e.flags&131072)}else Rs=!1,V&&t.flags&1048576&&Ca(t,ga,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;ac(e,t),e=t.pendingProps;var a=ea(t,B.current);Qa(t,n),a=Fo(null,t,i,e,a,n);var o=Io();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,ta(i)?(o=!0,aa(t)):o=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,ao(t),a.updater=Cs,t.stateNode=a,a._reactInternals=t,Ds(t,i,e,n),t=qs(null,t,i,!0,o,n)):(t.tag=0,V&&o&&wa(t),zs(null,t,a,n),t=t.child),t;case 16:i=t.elementType;a:{switch(ac(e,t),e=t.pendingProps,a=i._init,i=a(i._payload),t.type=i,a=t.tag=Jl(i),e=xs(i,e),a){case 0:t=Gs(null,t,i,e,n);break a;case 1:t=Ks(null,t,i,e,n);break a;case 11:t=Bs(null,t,i,e,n);break a;case 14:t=Vs(null,t,i,xs(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:xs(i,a),Gs(e,t,i,a,n);case 1:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:xs(i,a),Ks(e,t,i,a,n);case 3:a:{if(Js(t),e===null)throw Error(r(387));i=t.pendingProps,o=t.memoizedState,a=o.element,oo(e,t),fo(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=Os(Error(r(423)),t),t=Ys(e,t,i,n,a);break a}else if(i!==a){a=Os(Error(r(424)),t),t=Ys(e,t,i,n,a);break a}else for(Da=Fi(t.stateNode.containerInfo.firstChild),Ea=t,V=!0,Oa=null,n=Wa(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ia(),i===a){t=oc(e,t,n);break a}zs(e,t,i,n)}t=t.child}return t;case 5:return xo(t),e===null&&Ma(t),i=t.type,a=t.pendingProps,o=e===null?null:e.memoizedProps,s=a.children,Oi(i,a)?s=null:o!==null&&Oi(i,o)&&(t.flags|=32),Ws(e,t),zs(e,t,s,n),t.child;case 6:return e===null&&Ma(t),null;case 13:return Qs(e,t,n);case 4:return yo(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Ua(t,null,i,n):zs(e,t,i,n),t.child;case 11:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:xs(i,a),Bs(e,t,i,a,n);case 7:return zs(e,t,t.pendingProps,n),t.child;case 8:return zs(e,t,t.pendingProps.children,n),t.child;case 12:return zs(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,z(Ga,i._currentValue),i._currentValue=s,o!==null)if(Pr(o.value,s)){if(o.children===a.children&&!Qi.current){t=oc(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=so(-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),Za(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),Za(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}zs(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,i=t.pendingProps.children,Qa(t,n),a=$a(a),i=i(a),t.flags|=1,zs(e,t,i,n),t.child;case 14:return i=t.type,a=xs(i,t.pendingProps),a=xs(i.type,a),Vs(e,t,i,a,n);case 15:return Hs(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:xs(i,a),ac(e,t),t.tag=1,ta(i)?(e=!0,aa(t)):e=!1,Qa(t,n),Ts(t,i,a),Ds(t,i,a,n),qs(null,t,i,!0,e,n);case 19:return ic(e,t,n);case 22:return Us(e,t,n)}throw Error(r(156,t.tag))};function Wl(e,t){return vt(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===te)return 11;if(e===A)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 ne:return e=Kl(13,n,t,a),e.elementType=ne,e.lanes=o,e;case re:return e=Kl(19,n,t,a),e.elementType=re,e.lanes=o,e;case ae:return Ql(n,a,o,t);default:if(typeof e==`object`&&e)switch(e.$$typeof){case k:s=10;break a;case ee:s=9;break a;case te:s=11;break a;case A:s=14;break a;case ie: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=ae,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=Ht(0),this.expirationTimes=Ht(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ht(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},ao(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 Zi;e=e._reactInternals;a:{if(ft(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(ta(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(ta(n))return ia(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=so(r,i),a.callback=t??null,co(n,a,i),e.current.lanes=i,Ut(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=so(a,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=co(i,t,o),e!==null&&(hl(e,i,o,a),lo(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[Bi]=null}};function pu(e){this._internalRoot=e}pu.prototype.unstable_scheduleHydration=function(e){if(e){var t=Xt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<on.length&&t!==0&&t<on[n].priority;n++);on.splice(n,0,e),n===0&&dn(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[Bi]=o.current,mi(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[Bi]=c.current,mi(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)}qt=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=It(t.pendingLanes);n!==0&&(Gt(t,n|1),gl(t,P()),!(J&6)&&(tl=P()+500,fa()))}break;case 13:wl(function(){var t=ro(e,1);t!==null&&hl(t,e,1,pl())}),lu(e,1)}},Jt=function(e){if(e.tag===13){var t=ro(e,134217728);t!==null&&hl(t,e,134217728,pl()),lu(e,134217728)}},Yt=function(e){if(e.tag===13){var t=ml(e),n=ro(e,t);n!==null&&hl(n,e,t,pl()),lu(e,t)}},Xt=function(){return I},Zt=function(e,t){var n=I;try{return I=e,t()}finally{I=n}},Ke=function(e,t,n){switch(t){case`input`:if(Ce(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=qi(i);if(!a)throw Error(r(90));ve(i),Ce(i,a)}}}break;case`textarea`:Ae(e,n);break;case`select`:t=n.value,t!=null&&De(e,!!n.multiple,t,!1)}},Ze=Cl,Qe=wl;var yu={usingClientEntryPoint:!1,Events:[Gi,Ki,qi,Ye,Xe,Cl]},bu={findFiberByHostInstance:Wi,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=gt(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{Ot=Su.inject(xu),F=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[Bi]=t.current,mi(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=gt(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[Bi]=t.current,mi(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[Bi]=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(),1),_=c(h(),1),v=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})),y=o(((e,t)=>{t.exports=v()}))(),b=8e3,x=({iframeRef:e,appOrigin:t,appUrl:n,connectionStatus:r})=>{let[i,a]=(0,g.useState)(!1);return(0,g.useEffect)(()=>{if(a(!1),r!==`connecting`)return;let e=setTimeout(()=>a(!0),b);return()=>clearTimeout(e)},[r]),(0,y.jsxs)(`div`,{className:`flex-1 flex flex-col h-full bg-slate-900 border border-slate-800 rounded-2xl overflow-hidden shadow-2xl relative`,children:[(0,y.jsxs)(`div`,{className:`h-14 bg-slate-950 border-b border-slate-800 flex items-center justify-between px-6 select-none shrink-0`,children:[(0,y.jsx)(`div`,{className:`flex items-center gap-3 w-1/3`,children:(0,y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,y.jsx)(`span`,{className:`w-3 h-3 rounded-full bg-rose-500/80`}),(0,y.jsx)(`span`,{className:`w-3 h-3 rounded-full bg-amber-500/80`}),(0,y.jsx)(`span`,{className:`w-3 h-3 rounded-full bg-emerald-500/80`})]})}),(0,y.jsxs)(`div`,{className:`flex items-center gap-4 w-1/3 justify-end`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,y.jsx)(`span`,{className:`text-[10px] font-semibold tracking-wider text-slate-500 uppercase`,children:`Status`}),(0,y.jsx)(`span`,{className:`px-2 py-0.5 rounded text-[10px] font-bold ${r===`connected`?`bg-emerald-500/10 text-emerald-400 border border-emerald-500/20`:r===`connecting`?`bg-amber-500/10 text-amber-400 border border-amber-500/20 animate-pulse`:`bg-rose-500/10 text-rose-400 border border-rose-500/20`}`,children:r===`connected`?`ACTIVE`:`CONNECTING`})]}),(0,y.jsx)(`button`,{onClick:()=>{e.current&&(e.current.src=e.current.src)},className:`p-1.5 hover:bg-slate-800 text-slate-400 hover:text-slate-200 rounded-lg transition duration-200 border border-transparent hover:border-slate-700`,title:`Reload Frame`,children:(0,y.jsxs)(`svg`,{className:`w-4 h-4`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,viewBox:`0 0 24 24`,children:[(0,y.jsx)(`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`}),(0,y.jsx)(`path`,{d:`M21 3v5h-5`})]})})]})]}),(0,y.jsxs)(`div`,{className:`flex-1 bg-slate-900 relative`,children:[(0,y.jsx)(`iframe`,{id:`app-preview-iframe`,ref:e,src:`${n}?livelocale-origin=${encodeURIComponent(window.location.origin)}`,className:`w-full h-full border-none bg-white`,sandbox:`allow-same-origin allow-scripts allow-forms allow-popups`}),r===`connecting`&&(0,y.jsxs)(`div`,{className:`absolute inset-0 bg-slate-950/80 backdrop-blur-sm flex flex-col items-center justify-center gap-4 transition duration-300`,children:[(0,y.jsxs)(`div`,{className:`relative w-12 h-12`,children:[(0,y.jsx)(`div`,{className:`absolute inset-0 rounded-full border-2 border-indigo-500/20`}),(0,y.jsx)(`div`,{className:`absolute inset-0 rounded-full border-2 border-t-indigo-500 animate-spin`})]}),(0,y.jsxs)(`div`,{className:`text-center`,children:[(0,y.jsx)(`h3`,{className:`text-slate-200 font-semibold tracking-wide font-outfit`,children:`Connecting to Project`}),(0,y.jsx)(`p`,{className:`text-xs text-slate-500 mt-1 font-mono`,children:`Waiting for client bridge initialization...`})]}),i&&(0,y.jsxs)(`div`,{role:`status`,"data-testid":`slow-connection-help`,className:`max-w-md mx-6 mt-2 rounded-xl border border-slate-800 bg-slate-900/90 p-4 text-left text-xs text-slate-300`,children:[(0,y.jsx)(`p`,{className:`font-semibold text-slate-100`,children:`Still connecting? Usual causes:`}),(0,y.jsxs)(`ul`,{className:`mt-2 space-y-1.5 list-disc pl-4`,children:[(0,y.jsxs)(`li`,{children:[`The app is not running at `,(0,y.jsx)(`span`,{className:`font-mono`,children:t}),`.`]}),(0,y.jsxs)(`li`,{children:[`The app blocks framing: its `,(0,y.jsx)(`span`,{className:`font-mono`,children:`frame-ancestors`}),` `,`or `,(0,y.jsx)(`span`,{className:`font-mono`,children:`X-Frame-Options`}),` header must allow`,` `,(0,y.jsx)(`span`,{className:`font-mono`,children:window.location.origin}),`.`]}),(0,y.jsxs)(`li`,{children:[(0,y.jsx)(`span`,{className:`font-mono`,children:`LiveLocaleProvider`}),` is not mounted, or LiveLocale is off in the app (preview builds need`,` `,(0,y.jsx)(`span`,{className:`font-mono`,children:`NEXT_PUBLIC_LIVELOCALE=preview`}),`).`]})]}),(0,y.jsxs)(`p`,{className:`mt-3 text-slate-400`,children:[`Run`,` `,(0,y.jsxs)(`span`,{className:`font-mono text-slate-200 select-all`,children:[`npx livelocale doctor --app `,t]}),` `,`to check.`]})]})]})]})]})},S=new Set([`plural`,`select`,`selectordinal`]);function C(e){let t=``,n=0;for(;n<e.length;){let r=e[n];if(r!==`'`){t+=r,n+=1;continue}if(e[n+1]===`'`){t+=`'`,n+=2;continue}let i=e[n+1];if(i===`{`||i===`}`||i===`#`||i===`|`){let t=n+1;for(;t<e.length;){if(e[t]===`'`){if(e[t+1]===`'`){t+=2;continue}break}t+=1}n=t+1;continue}t+=r,n+=1}return t}function w(e){let t=new Set,n=0,r=null,i=e=>{r||=e},a=t=>{for(;n<e.length;){let r=e[n];if(r===`{`)n+=1,s(t+1);else if(r===`}`)if(t===0)i(`Unbalanced braces: unexpected "}"`),n+=1;else return;else n+=1}t>0&&i(`Unbalanced braces: missing "}"`)},o=t=>{let r=``;for(;n<e.length&&!t.includes(e[n]);)r+=e[n],n+=1;return r},s=r=>{let s=o([`,`,`}`]).trim();if(s&&!s.includes(`{`)&&t.add(s),n>=e.length){i(`Unbalanced braces: missing "}"`);return}if(e[n]===`}`){n+=1;return}n+=1;let c=o([`,`,`}`]).trim();if(n>=e.length){i(`Unbalanced braces: missing "}"`);return}if(e[n]===`}`){n+=1;return}if(n+=1,S.has(c)){let t=!1;for(;n<e.length;){for(;n<e.length&&/\s/.test(e[n]);)n+=1;if(e[n]===`}`){n+=1,t||i(`"${s}" (${c}) has no "other" branch`);return}let l=o([`{`,`}`,` `,` `,`
9
+ `]).trim();for(;n<e.length&&/\s/.test(e[n]);)n+=1;if(e[n]!==`{`){i(`"${s}" (${c}): expected "{" after "${l}"`);return}l===`other`&&(t=!0),n+=1,a(r+1),e[n]===`}`&&(n+=1)}i(`Unbalanced braces: missing "}"`);return}let l=1;for(;n<e.length&&l>0;)e[n]===`{`?l+=1:e[n]===`}`&&--l,n+=1;l>0&&i(`Unbalanced braces: missing "}"`)};return a(0),{args:t,error:r}}var T=/\{\{\s*([^{}]*?)\s*\}\}/g,E=/\$t\([^)]*\)/g,D=/%(?:\d+\$)?[-+ 0#]*\d*(?:\.\d+)?[sdifgxXoc]/g,O=/<\/?([A-Za-z][\w-]*|\d+)\b[^<>]*>/g;function k(e){if(typeof e!=`string`||e===``)return[];let t=new Set,n=e.replace(T,(e,n)=>{let r=n.split(`,`)[0].trim();return r&&t.add(`{{${r}}}`),` `});for(let e of n.match(E)??[])t.add(e);for(let e of n.replace(/%%/g,``).match(D)??[])t.add(e);for(let e of n.matchAll(O))t.add(`<${e[1]}>`);let r=w(C(n.replace(O,` `)));for(let e of r.args)t.add(`{${e}}`);return Array.from(t).sort()}function ee(e,t){if(!e)return{ok:!0,missing:[],extra:[]};let n=new Set(k(e)),r=new Set(k(t)),i=Array.from(n).filter(e=>!r.has(e)),a=Array.from(r).filter(e=>!n.has(e));return{ok:i.length===0&&a.length===0,missing:i,extra:a}}function te(e){return typeof e==`string`?w(C(e.replace(T,` `).replace(O,` `))).error:null}var ne=[`zero`,`one`,`two`,`few`,`many`,`other`];function re(e,t){if(e[t+1]===`'`)return t+2;let n=e[t+1];if(n!==`{`&&n!==`}`&&n!==`#`&&n!==`|`)return t+1;let r=t+1;for(;r<e.length;){if(e[r]===`'`){if(e[r+1]===`'`){r+=2;continue}return r+1}r+=1}return e.length}function A(e,t){let n=0,r=t;for(;r<e.length;){let t=e[r];if(t===`'`){r=re(e,r);continue}if(t===`{`)n+=1;else if(t===`}`&&(--n,n===0))return r;r+=1}return-1}function ie(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(r===`'`){n=re(e,n);continue}if(r===`}`)return null;if(r===`{`){let r=A(e,n);if(r===-1)return null;t.push({start:n,end:r}),n=r+1;continue}n+=1}return t}var ae=/^\s*([\w.]+)\s*,\s*(plural|select|selectordinal)\s*,/;function oe(e){if(typeof e!=`string`)return null;let t=ie(e);if(!t)return null;let n=t.filter(t=>ae.test(e.slice(t.start+1,t.end)));if(n.length!==1)return null;let{start:r,end:i}=n[0],a=e.slice(r+1,i),o=ae.exec(a),s=o[1],c=o[2],l=o[0].length,u=null,d=[];for(;l<a.length;){for(;l<a.length&&/\s/.test(a[l]);)l+=1;if(l>=a.length)break;let e=``;for(;l<a.length&&!/[\s{]/.test(a[l]);)e+=a[l],l+=1;if(e.startsWith(`offset:`)){let t=e.slice(7);for(;l<a.length&&/\s/.test(a[l]);)l+=1;if(t===``)for(;l<a.length&&/\d/.test(a[l]);)t+=a[l],l+=1;u=t||null;continue}for(;l<a.length&&/\s/.test(a[l]);)l+=1;if(!e||a[l]!==`{`)return null;let t=A(a,l);if(t===-1)return null;d.push({selector:e,text:a.slice(l+1,t)}),l=t+1}return d.length===0?null:{variable:s,type:c,offset:u,prefix:e.slice(0,r),suffix:e.slice(i+1),branches:d}}function se(e){let t=[];e.offset&&t.push(` offset:${e.offset}`);for(let n of e.branches)n.text===``&&n.selector!==`other`||t.push(` ${n.selector} {${n.text}}`);return`${e.prefix}{${e.variable}, ${e.type},${t.join(``)}}${e.suffix}`}function j(e,t=`plural`){if(t===`select`)return[];try{let n=new Intl.PluralRules(e,{type:t===`selectordinal`?`ordinal`:`cardinal`}),r=new Set(n.resolvedOptions().pluralCategories);return ne.filter(e=>r.has(e))}catch{return[`one`,`other`]}}var ce={zero:`zero (e.g. 0)`,one:`one (singular)`,two:`two (dual)`,few:`few (small numbers)`,many:`many (large numbers)`,other:`other (default, required)`},M=({locale:e,value:t,onChange:n,disabled:r})=>{let i=(0,g.useMemo)(()=>oe(t),[t]),a=(0,g.useMemo)(()=>{if(!i)return[];let t=new Map(i.branches.map(e=>[e.selector,e.text])),n=j(e,i.type);return[...i.branches.map(e=>e.selector).filter(e=>!n.includes(e)),...n].map(e=>({selector:e,text:t.get(e)??``,required:n.includes(e)}))},[i,e]);if(!i)return null;let o=(e,t)=>{n(se({...i,...e,branches:t??i.branches}))},s=(e,t)=>{o({},a.map(n=>({selector:n.selector,text:n.selector===e?t:n.text})))},c=`w-full bg-slate-950 border border-slate-800 hover:border-slate-750 focus:border-indigo-500 focus:outline-hidden focus:ring-1 focus:ring-indigo-500/50 rounded-lg px-3 py-2 text-xs text-slate-100 placeholder-slate-600 transition duration-150 disabled:opacity-60`;return(0,y.jsxs)(`div`,{className:`space-y-3`,"data-testid":`plural-editor`,children:[(0,y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,y.jsxs)(`span`,{className:`text-[10px] text-slate-500 font-mono`,children:[i.type,` on `,(0,y.jsx)(`span`,{className:`text-indigo-400`,children:i.variable}),i.offset?` · offset ${i.offset}`:``]}),(0,y.jsxs)(`span`,{className:`text-[10px] text-slate-600`,children:[(0,y.jsx)(`code`,{className:`font-mono`,children:`#`}),` = the number`]})]}),i.prefix!==``&&(0,y.jsxs)(`label`,{className:`block space-y-1`,children:[(0,y.jsx)(`span`,{className:`text-[10px] font-semibold text-slate-500 uppercase tracking-wider`,children:`Before`}),(0,y.jsx)(`input`,{"data-testid":`plural-prefix`,dir:`auto`,value:i.prefix,disabled:r,onChange:e=>o({prefix:e.target.value}),className:c})]}),(0,y.jsx)(`div`,{className:`space-y-2`,children:a.map(t=>(0,y.jsxs)(`label`,{className:`block space-y-1`,children:[(0,y.jsxs)(`span`,{className:`flex items-center gap-2 text-[10px] font-mono`,children:[(0,y.jsx)(`span`,{className:`text-slate-300`,children:t.selector}),(0,y.jsx)(`span`,{className:`text-slate-600`,children:ce[t.selector]??`explicit case`}),t.required&&t.text===``&&t.selector!==`other`&&(0,y.jsxs)(`span`,{className:`text-amber-400`,children:[`needed for `,e]})]}),(0,y.jsx)(`input`,{"data-testid":`plural-branch-${t.selector}`,dir:`auto`,value:t.text,disabled:r,onChange:e=>s(t.selector,e.target.value),className:c})]},t.selector))}),i.suffix!==``&&(0,y.jsxs)(`label`,{className:`block space-y-1`,children:[(0,y.jsx)(`span`,{className:`text-[10px] font-semibold text-slate-500 uppercase tracking-wider`,children:`After`}),(0,y.jsx)(`input`,{"data-testid":`plural-suffix`,dir:`auto`,value:i.suffix,disabled:r,onChange:e=>o({suffix:e.target.value}),className:c})]})]})},le={present:`bg-slate-800/80 border-slate-700 text-slate-300`,missing:`bg-rose-500/10 border-rose-500/40 text-rose-300 line-through`,extra:`bg-amber-500/10 border-amber-500/40 text-amber-300`},ue={present:`Placeholder from the reference, present in your translation`,missing:`Placeholder from the reference is missing from your translation`,extra:`Placeholder not present in the reference`},de=({selected:e,inputValue:t,locale:n=`en`,isLoading:r,isSuccess:i,error:a,saveWarning:o,onInputChange:s,onSave:c,onForceSave:l,onDismissWarning:u,onClear:d})=>{let[f,p]=(0,g.useState)(!1),m=(0,g.useMemo)(()=>oe(t)!==null,[t]),h=m&&!f,_=!r&&t!==e.currentValue,v=e=>{e.key!==`Enter`||!(e.ctrlKey||e.metaKey)||(e.preventDefault(),_&&c())},b=(0,g.useMemo)(()=>{let n=new Set(k(e.fallbackValue||``)),r=new Set(k(t)),i=[];for(let e of n)i.push({token:e,state:r.has(e)?`present`:`missing`});for(let e of r)n.has(e)||i.push({token:e,state:`extra`});return i},[e.fallbackValue,t]);return(0,y.jsxs)(`div`,{className:`flex-1 flex flex-col p-6 overflow-y-auto space-y-6`,children:[(0,y.jsxs)(`div`,{className:`space-y-2`,children:[(0,y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,y.jsx)(`label`,{className:`text-[11px] font-bold text-slate-500 uppercase tracking-wider`,children:`Translation Key`}),(0,y.jsx)(`button`,{onClick:d,className:`text-[10px] font-medium text-slate-500 hover:text-slate-300 transition duration-200`,children:`Clear Selection`})]}),(0,y.jsx)(`div`,{className:`bg-slate-950 border border-slate-800/80 rounded-xl px-4 py-3 font-mono text-xs text-indigo-400 select-all break-all shadow-inner leading-relaxed`,children:e.key})]}),(0,y.jsxs)(`div`,{className:`space-y-2`,children:[(0,y.jsx)(`label`,{className:`text-[11px] font-bold text-slate-500 uppercase tracking-wider`,children:`Reference (Fallback Value)`}),(0,y.jsx)(`div`,{dir:`auto`,className:`bg-slate-950/40 border border-slate-850 rounded-xl px-4 py-3 text-sm text-slate-400 select-all leading-relaxed whitespace-pre-wrap`,children:e.fallbackValue||(0,y.jsx)(`span`,{className:`italic text-slate-600`,children:`None`})})]}),b.length>0&&(0,y.jsxs)(`div`,{className:`space-y-2`,children:[(0,y.jsx)(`label`,{className:`text-[11px] font-bold text-slate-500 uppercase tracking-wider`,children:`Placeholders`}),(0,y.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:b.map(({token:e,state:t})=>(0,y.jsx)(`span`,{"data-testid":`placeholder-${e}`,"data-state":t,title:ue[t],className:`px-2 py-0.5 rounded-md border text-[10px] font-mono ${le[t]}`,children:e},e))})]}),(0,y.jsxs)(`div`,{className:`space-y-2 flex-1 flex flex-col min-h-[180px]`,onKeyDown:v,children:[(0,y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,y.jsx)(`label`,{className:`text-[11px] font-bold text-slate-500 uppercase tracking-wider`,children:h?`Plural forms`:`Translation Output`}),(0,y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[m&&(0,y.jsx)(`button`,{type:`button`,"data-testid":`plural-raw-toggle`,onClick:()=>p(e=>!e),className:`text-[10px] font-semibold text-slate-500 hover:text-slate-300 transition duration-150`,children:f?`Edit forms`:`Edit raw`}),(0,y.jsxs)(`span`,{className:`text-[10px] text-slate-500 font-mono`,children:[t.length,`/10000`]})]})]}),h?(0,y.jsx)(M,{locale:n,value:t,onChange:s,disabled:r}):(0,y.jsx)(`textarea`,{id:`studio-translation-input`,dir:`auto`,value:t,onChange:e=>s(e.target.value),disabled:r,placeholder:`Type your translation here...`,className:`w-full min-h-32 bg-slate-950 border border-slate-800 hover:border-slate-750 focus:border-indigo-500 focus:outline-hidden focus:ring-1 focus:ring-indigo-500/50 rounded-xl px-4 py-3 text-sm text-slate-100 placeholder-slate-600 font-sans resize-none transition duration-205 shadow-inner leading-relaxed`})]}),o&&(0,y.jsxs)(`div`,{"data-testid":`save-warning`,className:`bg-amber-500/10 border border-amber-500/30 rounded-xl p-3 space-y-3`,children:[(0,y.jsx)(`div`,{className:`text-xs text-amber-200 leading-relaxed`,children:o.message}),(0,y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,y.jsx)(`button`,{onClick:l,disabled:r,className:`h-8 px-3 rounded-lg text-[11px] font-semibold text-white bg-amber-600 hover:bg-amber-500 active:bg-amber-700 transition duration-150`,children:`Save anyway`}),(0,y.jsx)(`button`,{onClick:u,className:`h-8 px-3 rounded-lg text-[11px] font-semibold text-slate-300 bg-slate-800 border border-slate-700 hover:border-slate-600 transition duration-150`,children:`Keep editing`})]})]}),a&&(0,y.jsxs)(`div`,{className:`bg-rose-500/10 border border-rose-500/20 rounded-xl p-3 flex items-start gap-[0.625rem] shadow-xs`,children:[(0,y.jsx)(`svg`,{className:`w-4 h-4 text-rose-500 shrink-0 mt-0.5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,y.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z`})}),(0,y.jsx)(`div`,{className:`text-xs text-rose-400 font-mono leading-normal break-all`,children:a})]}),(0,y.jsx)(`div`,{className:`flex items-center gap-3 pt-4 shrink-0`,children:(0,y.jsx)(`button`,{id:`studio-save-button`,onClick:c,disabled:!_,className:`flex-1 h-11 rounded-xl text-sm font-semibold tracking-wide flex items-center justify-center gap-2 shadow-sm transition duration-205 ${t===e.currentValue?`bg-slate-800 text-slate-500 cursor-not-allowed shadow-none border border-slate-850`:`bg-indigo-600 hover:bg-indigo-500 text-white active:bg-indigo-700`}`,children:r?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`svg`,{className:`animate-spin h-4 w-4 text-indigo-200`,fill:`none`,viewBox:`0 0 24 24`,children:[(0,y.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,y.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z`})]}),(0,y.jsx)(`span`,{children:`Saving...`})]}):i?(0,y.jsxs)(`span`,{"data-testid":`save-success`,className:`flex items-center gap-1 text-emerald-400 font-bold`,children:[(0,y.jsx)(`svg`,{className:`w-4 h-4 text-emerald-400`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,y.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M5 13l4 4L19 7`})}),(0,y.jsx)(`span`,{children:`Saved!`})]}):(0,y.jsx)(`span`,{children:`Save Changes`})})})]})},fe=()=>(0,y.jsxs)(`div`,{className:`flex-1 flex flex-col items-center justify-center p-6 text-center select-none`,children:[(0,y.jsx)(`div`,{className:`w-16 h-16 rounded-2xl bg-indigo-500/5 border border-indigo-500/10 flex items-center justify-center text-indigo-400 shadow-xs mb-6`,children:(0,y.jsx)(`svg`,{className:`w-8 h-8 text-indigo-500`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,y.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.5,d:`M15 15l-2 5L9 9l11 4-5 2zm0 0l5 5M7.188 2.239l.777 2.897M5.136 7.965l-2.898-.777M13.95 4.05l-2.122 2.122m-5.657 5.656l-2.12 2.122`})})}),(0,y.jsx)(`h3`,{className:`text-slate-200 font-semibold tracking-wide font-outfit`,children:`Select an Element`}),(0,y.jsx)(`p`,{className:`text-xs text-slate-500 max-w-xs mt-2 leading-relaxed`,children:`Hover over elements in the live preview iframe and click to load them into the visual editing sidebar.`})]}),pe=/^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,4})?$/,me=/^[a-zA-Z0-9._-]+$/,he=1e4,ge=new Set([`__proto__`,`constructor`,`prototype`]);function _e(e){return typeof e==`string`?!e.split(`.`).some(e=>ge.has(e)):!1}function ve(e){return typeof e==`string`&&e.length>=2&&e.length<=10&&pe.test(e)}function ye(e){return typeof e==`string`&&e.length>=1&&e.length<=200&&me.test(e)}function be(e){return typeof e==`string`&&e.length<=1e4}function xe(e){return!(e.includes(`..`)||e.includes(`/`)||e.includes(`\\`)||e.includes(`%`)||e.includes(`\0`))}var Se=({code:e,isActive:t,isLoading:n,allLocales:r,onRename:i,onDelete:a})=>{let[o,s]=(0,g.useState)(!1),[c,l]=(0,g.useState)(e),[u,d]=(0,g.useState)(!1),[f,p]=(0,g.useState)(null);return(0,y.jsx)(`div`,{className:`bg-slate-950/40 border border-slate-850 hover:border-slate-800/80 rounded-xl px-4 py-3 flex items-center justify-between gap-4 transition duration-200`,children:o?(0,y.jsxs)(`div`,{className:`flex-1 flex items-center gap-2`,children:[(0,y.jsx)(`input`,{type:`text`,value:c,onChange:e=>l(e.target.value),disabled:n,className:`flex-1 bg-slate-950 border border-slate-800 rounded-lg px-2.5 py-1 text-xs font-mono text-slate-100 focus:outline-hidden focus:border-indigo-500`,autoFocus:!0}),(0,y.jsx)(`button`,{onClick:async()=>{p(null);let t=c.trim();if(!t||t===e){s(!1);return}if(!ve(t)){p(`Invalid locale format.`);return}if(r.includes(t)&&t!==e){p(`Target locale already exists.`);return}try{await i(e,t),s(!1)}catch(e){p(e.message||`Failed to rename.`)}},disabled:n,className:`p-1 text-emerald-400 hover:text-emerald-300 transition duration-150`,title:`Save rename`,children:(0,y.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,y.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2.5,d:`M5 13l4 4L19 7`})})}),(0,y.jsx)(`button`,{onClick:()=>s(!1),disabled:n,className:`p-1 text-slate-500 hover:text-slate-400 transition duration-150`,title:`Cancel`,children:(0,y.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,y.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2.5,d:`M6 18L18 6M6 6l12 12`})})})]}):u?(0,y.jsxs)(`div`,{className:`flex-1 flex flex-col gap-2`,children:[(0,y.jsx)(`span`,{className:`text-[10px] font-semibold text-rose-400`,children:`Confirm deletion? This deletes the translation file.`}),f&&(0,y.jsx)(`span`,{className:`text-[10px] text-rose-400 font-mono`,children:f}),(0,y.jsxs)(`div`,{className:`flex items-center gap-2 justify-end`,children:[(0,y.jsx)(`button`,{onClick:()=>d(!1),disabled:n,className:`px-2.5 py-1 text-[10px] font-semibold bg-slate-800 hover:bg-slate-750 text-slate-300 rounded-lg transition`,children:`Cancel`}),(0,y.jsx)(`button`,{onClick:async()=>{p(null);try{await a(e),d(!1)}catch(e){p(e.message||`Failed to delete.`)}},disabled:n,className:`px-2.5 py-1 text-[10px] font-semibold bg-rose-600 hover:bg-rose-500 text-white rounded-lg transition shadow-sm shadow-rose-600/10`,children:`Delete`})]})]}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`div`,{className:`flex flex-col min-w-0`,children:[(0,y.jsx)(`span`,{className:`text-xs font-semibold text-slate-200 truncate`,children:e}),t&&(0,y.jsx)(`span`,{className:`text-[9px] text-indigo-400 font-bold tracking-wide mt-0.5`,children:`ACTIVE WORKSPACE`}),f&&(0,y.jsx)(`span`,{className:`text-[10px] text-rose-400 font-mono mt-0.5`,children:f})]}),(0,y.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0`,children:[(0,y.jsx)(`button`,{onClick:()=>{l(e),p(null),s(!0)},disabled:n,className:`p-1.5 text-slate-500 hover:text-slate-300 transition duration-150`,title:`Rename locale code`,children:(0,y.jsx)(`svg`,{className:`w-3.5 h-3.5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,y.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z`})})}),(0,y.jsx)(`button`,{onClick:()=>{p(null),d(!0)},disabled:n,className:`p-1.5 text-slate-500 hover:text-rose-400 transition duration-150`,title:`Delete locale`,children:(0,y.jsx)(`svg`,{className:`w-3.5 h-3.5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,y.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16`})})})]})]})})},Ce=({locale:e,locales:t,isLoading:n,error:r,onAddLocale:i,onRenameLocale:a,onDeleteLocale:o})=>{let[s,c]=(0,g.useState)(``),[l,u]=(0,g.useState)(null);return(0,y.jsxs)(`div`,{className:`flex-1 flex flex-col p-6 overflow-y-auto space-y-6`,children:[(0,y.jsxs)(`form`,{onSubmit:async e=>{e.preventDefault(),u(null);let n=s.trim();if(n){if(!ve(n)){u(`Locale format must be 2-3 letters, optionally followed by a region (e.g., fr or es-MX).`);return}if(t.includes(n)){u(`Locale already exists.`);return}try{await i(n),c(``)}catch(e){u(e.message||`Failed to add locale.`)}}},className:`space-y-2.5`,children:[(0,y.jsx)(`label`,{className:`text-[11px] font-bold text-slate-500 uppercase tracking-wider`,children:`Add New Locale`}),(0,y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,y.jsx)(`input`,{type:`text`,value:s,onChange:e=>c(e.target.value),placeholder:`e.g. fr, es-MX`,disabled:n,className:`flex-1 min-w-0 bg-slate-950 border border-slate-800 hover:border-slate-750 focus:border-indigo-500 focus:outline-hidden focus:ring-1 focus:ring-indigo-500/50 rounded-xl px-4 py-2.5 text-xs text-slate-100 placeholder-slate-600 font-mono transition duration-155`}),(0,y.jsx)(`button`,{type:`submit`,disabled:n||!s.trim(),className:`h-10 px-4 bg-indigo-600 hover:bg-indigo-500 disabled:bg-slate-800 disabled:text-slate-500 text-white text-xs font-semibold rounded-xl transition duration-155 flex items-center justify-center gap-1.5 shrink-0`,children:`Add`})]})]}),(l||r)&&(0,y.jsxs)(`div`,{className:`bg-rose-500/10 border border-rose-500/20 rounded-xl p-3 flex items-start gap-[0.625rem] shadow-xs`,children:[(0,y.jsx)(`svg`,{className:`w-4 h-4 text-rose-500 shrink-0 mt-0.5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,y.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z`})}),(0,y.jsx)(`div`,{className:`text-xs text-rose-400 font-mono leading-normal break-all`,children:l||r})]}),(0,y.jsxs)(`div`,{className:`flex-1 flex flex-col space-y-2`,children:[(0,y.jsx)(`label`,{className:`text-[11px] font-bold text-slate-500 uppercase tracking-wider mb-1`,children:`Active Locales`}),(0,y.jsx)(`div`,{className:`flex-1 overflow-y-auto space-y-2 pr-1 select-none`,children:t.map(r=>(0,y.jsx)(Se,{code:r,isActive:r===e,isLoading:n,allLocales:t,onRename:a,onDelete:o},r))})]})]})},we={en:`English`,ar:`Arabic`,es:`Spanish`,fr:`French`,de:`German`,zh:`Chinese`,ja:`Japanese`,pt:`Portuguese`,it:`Italian`,ru:`Russian`,hi:`Hindi`,tr:`Turkish`},Te=e=>`${we[e.split(`-`)[0]?.toLowerCase()||e]||we[e]||`Custom`} (${e})`,Ee=({selected:e,inputValue:t,locale:n,isLoading:r,isSuccess:i,error:a,saveWarning:o,onInputChange:s,onLocaleChange:c,onSave:l,onForceSave:u,onDismissWarning:d,onClear:f,locales:p,onAddLocale:m,onRenameLocale:h,onDeleteLocale:_,className:v=`w-[420px] shrink-0`})=>{let[b,x]=(0,g.useState)(!1);return(0,y.jsxs)(`div`,{"data-testid":`editor-panel`,className:`${v} bg-slate-900 border border-slate-800 rounded-2xl flex flex-col h-full shadow-2xl overflow-hidden`,children:[(0,y.jsxs)(`div`,{className:`h-14 bg-slate-950 border-b border-slate-800 flex items-center justify-between px-6 shrink-0 select-none`,children:[(0,y.jsx)(`h2`,{className:`text-sm font-bold tracking-wide font-outfit text-slate-200`,children:b?`Manage Languages`:`Translation Studio`}),(0,y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[!b&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`label`,{className:`text-[10px] font-semibold text-slate-500 uppercase tracking-wider`,children:`Locale`}),(0,y.jsx)(`select`,{value:n,onChange:e=>c(e.target.value),className:`bg-slate-900 border border-slate-800 hover:border-slate-700 text-slate-300 text-xs rounded-lg px-2.5 py-1.5 focus:outline-hidden focus:ring-1 focus:ring-indigo-500/50 cursor-pointer font-mono`,children:p.map(e=>(0,y.jsx)(`option`,{value:e,children:Te(e)},e))})]}),(0,y.jsx)(`button`,{onClick:()=>x(!b),className:`p-1.5 rounded-lg border transition duration-200 ${b?`bg-indigo-600/20 border-indigo-500 text-indigo-400`:`bg-slate-900 border-slate-800 text-slate-400 hover:text-slate-200 hover:border-slate-700`}`,title:b?`Back to Editor`:`Manage Languages`,children:b?(0,y.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,y.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2.5,d:`M10 19l-7-7m0 0l7-7m-7 7h18`})}):(0,y.jsxs)(`svg`,{className:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:[(0,y.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z`}),(0,y.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M15 12a3 3 0 11-6 0 3 3 0 016 0z`})]})})]})]}),b?(0,y.jsx)(Ce,{locale:n,locales:p,isLoading:r,error:a,onAddLocale:m,onRenameLocale:h,onDeleteLocale:_}):e?(0,y.jsx)(de,{selected:e,inputValue:t,locale:n,isLoading:r,isSuccess:i,error:a,saveWarning:o,onInputChange:s,onSave:l,onForceSave:u,onDismissWarning:d,onClear:f}):(0,y.jsx)(fe,{})]})};function De(e,t){if(typeof e!=`object`||!e)return t;if(typeof t!=`object`||!t)return e;let n={...e};for(let r of Object.keys(t))r in e?n[r]=De(e[r],t[r]):n[r]=t[r];return n}function Oe(e,t,n){let r=t.split(`.`);if(r.length>30)throw Error(`[livelocale] Key depth limit exceeded. Maximum depth is 30 levels.`);if(r.some(e=>ge.has(e)))throw Error(`[livelocale] Forbidden key segment in path: "${t}". Segment names like __proto__, constructor, and prototype are not allowed.`);let i=e;for(let e=0;e<r.length;e++){let t=r[e];if(e===r.length-1){i[t]=n;return}(!(t in i)||i[t]===null||typeof i[t]!=`object`||Array.isArray(i[t]))&&(i[t]={}),i=i[t]}}function ke(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ae(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function je(e,t){if(!ke(e))return{state:`missing`};let n=t.split(`.`),r=n.length-1,i=e;for(let e=0;e<r;e++){if(Ae(i,n.slice(e).join(`.`)))return{state:`occupied`};let t=n[e];if(!Ae(i,t))return{state:`missing`};let r=i[t];if(!ke(r))return{state:`occupied`};i=r}let a=n[r];if(!Ae(i,a))return{state:`missing`};let o=i[a];return typeof o==`string`?{state:`string`,value:o}:{state:`occupied`}}function Me(e,t=``,n=new Set){if(!e||typeof e!=`object`)return n;for(let r of Object.keys(e)){let i=e[r],a=t?`${t}.${r}`:r;i&&typeof i==`object`&&!Array.isArray(i)?Me(i,a,n):n.add(a)}return n}var Ne=(e,t,n)=>({ok:!1,status:e,code:t,error:n});function Pe(e,t={}){let{locale:n,key:r,value:i}=e;if(!ve(n))return Ne(400,`INVALID_LOCALE_FORMAT`,`Invalid locale string parameter.`);if(!ye(r))return Ne(400,`INVALID_KEY_FORMAT`,`Invalid key path. Must be 1-200 characters containing alphanumeric, dots, underscores, or hyphens.`);if(!_e(r))return Ne(400,`INVALID_KEY_FORMAT`,`Forbidden key path: segments like __proto__, constructor, or prototype are not allowed.`);if(!be(i))return Ne(400,`INVALID_VALUE_FORMAT`,`Invalid value. Must be a string less than 10000 characters.`);let a={ok:!0,locale:n,key:r,value:i};if(t.force===!0)return a;let o=te(a.value);if(o)return Ne(422,`MESSAGE_SYNTAX`,`Message syntax: ${o}.`);let s=ee(t.reference,a.value);if(!s.ok){let e=[];return s.missing.length&&e.push(`missing ${s.missing.join(`, `)}`),s.extra.length&&e.push(`unexpected ${s.extra.join(`, `)}`),{...Ne(422,`PLACEHOLDER_MISMATCH`,`Placeholders differ from the reference: ${e.join(`; `)}.`),details:{missing:s.missing,extra:s.extra}}}return a}function Fe(e,t){let n=je(t.source,e);return n.state===`string`?n.value:null}function Ie(e,t,n){let{locale:r,key:i,value:a}=e,o={locale:r,key:i,value:a},s=Pe(o,{force:!0});return s.ok?je(r===t.sourceLocale?t.source:t.target??{},i).state===`occupied`?Ne(409,`KEY_NOT_A_STRING`,`Cannot save "${i}" in ${r}: it would replace translations that are not a single text.`):Pe(o,{reference:Fe(i,t),force:n?.force===!0}):s}var Le={markup:`Adds markup that the source text does not have.`,"javascript-url":`Adds a javascript:, vbscript: or data: link.`,"new-url":`Adds a web address that the source text does not have.`,"bidi-control":`Contains invisible text-direction control characters.`},Re=/<\/?([A-Za-z][\w-]*)\b[^<>]*>/g,ze=[/\b(?:javascript|vbscript)\s*:/i,/\bdata:[a-z]+\/[\w.+-]+/i],Be=/\b(?:https?:\/\/|www\.)[^\s<>"')]+/gi,Ve=/[\u202A-\u202E\u2066-\u2069]/g,He=e=>Array.from(e.matchAll(Re),e=>e[1].toLowerCase()),Ue=(e,t)=>t.match(e)??[],We=(e,t)=>{let n=new Set(e);return t.some(e=>!n.has(e))};function Ge(e,t){let n=e??``,r=[];return We(He(n),He(t))&&r.push(`markup`),ze.some(e=>e.test(t)&&!e.test(n))&&r.push(`javascript-url`),We(Ue(Be,n),Ue(Be,t))&&r.push(`new-url`),We(Ue(Ve,n),Ue(Ve,t))&&r.push(`bidi-control`),r}var Ke=`lc1.`,qe="```livelocale",Je="```",N=class extends Error{code;constructor(e,t){super(t),this.name=`ChangeLinkError`,this.code=e}},Ye=`This change link is damaged or incomplete. Ask the sender to send the file instead.`,Xe=`This change link was made by a newer LiveLocale. Update LiveLocale and try again.`,Ze=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`,Qe=32768;function $e(e){let t=``;for(let n=0;n<e.length;n+=Qe)t+=String.fromCharCode(...e.subarray(n,n+Qe));return btoa(t).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}function et(e){if(!/^[A-Za-z0-9_-]*$/.test(e)||e.length%4==1)throw new N(`CORRUPT`,Ye);let t=e.length%4;if(t!==0){let n=t===2?15:3;if((Ze.indexOf(e[e.length-1])&n)!==0)throw new N(`CORRUPT`,Ye)}let n=atob(e.replace(/-/g,`+`).replace(/_/g,`/`)+`=`.repeat(t===0?0:4-t)),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return r}function tt(e){let t=RegExp(`${qe}(?:\\r\\n|\\r|\\n)`).exec(e);if(!t)return null;let n=e.slice(t.index+t[0].length).split(/\r\n|\r|\n/),r=n.indexOf(Je);return(r<0?n:n.slice(0,r)).join(``).replace(/\s+/g,``)}function nt(e){let t=(tt(e)??e).replace(/%23/gi,`#`),n=new Set;for(let e of t.matchAll(/(?:^|[^A-Za-z0-9_-])lc1\.([A-Za-z0-9_-]+)/g))n.add(e[1]);if(n.size===1)return Ke+[...n][0];throw n.size>1?new N(`AMBIGUOUS`,`This text holds more than one change link. Paste one link at a time.`):/(?:^|[^A-Za-z0-9_-])lc(?:[2-9]|[1-9]\d+)\.[A-Za-z0-9_-]/.test(t)?new N(`UNSUPPORTED_VERSION`,Xe):new N(`NOT_FOUND`,`This is not a LiveLocale change link. A change link contains "lc1.".`)}function rt(e){if(!/^[A-Za-z0-9][A-Za-z0-9-]{0,38}\/[A-Za-z0-9._-]{1,100}$/.test(e))return!1;let t=e.slice(e.indexOf(`/`)+1);return t!==`.`&&t!==`..`}var it=/^(?!-)(?!.*\.\.)[^\s\x00-\x1f\x7f]{1,255}$/;function at(e){return it.test(e)&&!ht(e)}var ot=2e3;function st(e){return{v:1,...e.repo===void 0?{}:{repo:e.repo},branch:e.branch,base:e.base,src:e.src,by:e.by,note:e.note,e:e.edits.map(({locale:e,key:t,from:n,to:r,force:i})=>i?[e,t,n,r,1]:[e,t,n,r])}}var ct=/^(?:[0-9a-f]{40}|[0-9a-f]{64})?$/,lt=/[\x00-\x1f\x7f]/,ut=/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/,dt=/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:^|[^\uD800-\uDBFF])[\uDC00-\uDFFF]/;function ft(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function pt(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0}function mt(e){return new N(`INVALID`,e)}function ht(e){return typeof e==`string`&&dt.test(e)}function gt(e,t){let n=e=>mt(`edit ${t}: ${e}`);if(!Array.isArray(e)||e.length!==4&&e.length!==5)throw n(`is not a [locale, key, from, to] entry.`);let[r,i,a,o,s]=e;if(typeof r!=`string`||!ve(r))throw n(`the locale is not a locale code.`);if(typeof i!=`string`||!ye(i)||!_e(i))throw n(`the key is not a valid translation key.`);if(a!==null&&(typeof a!=`string`||!be(a)))throw n(`the current text is not text of at most ${he} characters.`);if(typeof o!=`string`||!be(o))throw n(`the new text is not text of at most ${he} characters.`);if(e.length===5&&s!==1)throw n(`the force flag must be 1.`);return{locale:r,key:i,from:a,to:o,force:e.length===5}}function _t(e){let t=new Map;e.forEach(({locale:e,key:n},r)=>{let i=t.get(e);if(i||t.set(e,i=new Set),i.has(n))throw mt(`edit ${r+1}: an earlier edit changes the same key.`);i.add(n)}),e.forEach(({locale:e,key:n},r)=>{let i=t.get(e);for(let e=n.indexOf(`.`);e>=0;e=n.indexOf(`.`,e+1))if(i.has(n.slice(0,e)))throw mt(`edit ${r+1}: another edit changes a key that contains this one.`)})}function vt(e){if(!ft(e))throw mt(`This change link does not hold a change set.`);if(pt(e,`v`)!==1)throw new N(`UNSUPPORTED_VERSION`,Xe);let t=pt(e,`repo`);if(t!==void 0&&(typeof t!=`string`||!rt(t)))throw mt(`The repository is not an owner/name slug.`);let n=pt(e,`branch`);if(typeof n!=`string`||n!==``&&!at(n))throw mt(`The branch is not a valid branch name.`);let r=pt(e,`base`);if(typeof r!=`string`||!ct.test(r))throw mt(`The base is not a full commit id.`);let i=pt(e,`src`);if(typeof i!=`string`||!ve(i))throw mt(`The source locale is not a locale code.`);let a=pt(e,`by`);if(typeof a!=`string`||a.length>100||lt.test(a))throw mt(`The name is not one line of at most 100 characters.`);let o=pt(e,`note`);if(typeof o!=`string`||o.length>2e3||ut.test(o))throw mt(`The note is not plain text of at most ${ot} characters.`);let s=pt(e,`e`);if(!Array.isArray(s))throw mt(`This change link holds no list of edits.`);if(s.length>500)throw new N(`TOO_MANY_EDITS`,`A change link holds at most 500 edits. Send the rest in another link.`);if(s.length===0)throw mt(`This change link holds no edits.`);let c=Array.from(s,(e,t)=>gt(e,t+1));if(_t(c),[t,n,r,i,a,o].some(ht))throw mt(`This change link holds broken text.`);return c.forEach(({locale:e,key:t,from:n,to:r},i)=>{if([e,t,n,r].some(ht))throw mt(`edit ${i+1}: holds broken text.`)}),{...t===void 0?{}:{repo:t},branch:n,base:r,src:i,by:a,note:o,edits:c}}var yt=512*1024,bt=`A change link holds at most ${yt/1024} KB of text. Send the changes in smaller links.`,xt=`This browser cannot create or read change links. Use a current Chrome, Edge or Firefox, or Safari 16.4 or later.`,P=4096;async function St(e,t,n){let r=new Uint8Array(t),i=e.writable.getWriter(),a=e.readable.getReader(),o=!1;(async()=>{for(let e=0;e<r.length;e+=P){if(o)return;await i.write(r.subarray(e,e+P))}o||await i.close()})().catch(()=>{});let s=[],c=0;try{for(;;){let{done:e,value:t}=await a.read();if(e)break;if(c+=t.length,c>n)throw new N(`TOO_LARGE`,bt);s.push(t)}}catch(e){throw o=!0,i.abort(e).catch(()=>{}),await a.cancel(e).catch(()=>{}),e}let l=new Uint8Array(c),u=0;for(let e of s)l.set(e,u),u+=e.length;return l}var Ct=async e=>{if(typeof globalThis.CompressionStream!=`function`)throw new N(`UNSUPPORTED_ENVIRONMENT`,xt);return St(new CompressionStream(`deflate`),e,1/0)},wt=async(e,t)=>{if(typeof globalThis.DecompressionStream!=`function`)throw new N(`UNSUPPORTED_ENVIRONMENT`,xt);try{return await St(new DecompressionStream(`deflate`),e,t)}catch(e){throw e instanceof N?e:new N(`CORRUPT`,Ye)}};async function Tt(e,t=Ct){let n=JSON.stringify(st(vt(st(e)))),r=new TextEncoder().encode(n);if(r.length>524288)throw new N(`TOO_LARGE`,bt);return Ke+$e(await t(r))}async function Et(e,t=wt){let n=nt(e);if(n.length>1e6)throw new N(`TOO_LARGE`,bt);try{let e=await t(et(n.slice(4)),yt),r=new TextDecoder(`utf-8`,{fatal:!0}).decode(e);return vt(JSON.parse(r))}catch(e){throw e instanceof N?e:new N(`CORRUPT`,Ye)}}var Dt=`manifest.json`,Ot=/^[0-9a-f]{40}([0-9a-f]{24})?$/;function F(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0}function kt(e,t){if(!Array.isArray(e))return!1;for(let n=0;n<e.length;n++)if(!t(e[n]))return!1;return!0}function At(e){return typeof e==`string`}function jt(e){return typeof e==`string`&&pe.test(e)}function Mt(e,t){return e===null||typeof e==`string`&&t(e)}function Nt(e){if(typeof e!=`object`||!e||Array.isArray(e))return!1;let t=F(e,`repo`),n=F(e,`layout`),r=F(e,`locales`),i=F(e,`sourceLocale`);return F(e,`format`)===1&&(t===void 0||typeof t==`string`&&rt(t))&&Mt(F(e,`defaultBranch`),at)&&Mt(F(e,`branch`),at)&&Mt(F(e,`base`),e=>Ot.test(e))&&typeof F(e,`localesPath`)==`string`&&(n===`flat`||n===`namespaced`)&&kt(r,jt)&&typeof i==`string`&&r.includes(i)&&Mt(F(e,`basePath`),e=>e.startsWith(`/`)&&e.endsWith(`/`))&&kt(F(e,`codeKeys`),At)}function Pt(e){return Nt(e)?e:null}function Ft(e){if(typeof e!=`string`||e.trim()===``)return null;try{let t=new URL(e.trim());return t.protocol!==`http:`&&t.protocol!==`https:`?null:t.origin}catch{return null}}function It(e){let t=null;if(e.search)try{t=new URLSearchParams(e.search).get(`app`)}catch{t=null}return Ft(t)??Ft(e.injected)??Ft(e.buildTime)??`http://localhost:3000`}var Lt=`This Studio was opened from a website, but livelocale/manifest.json is missing or is not a LiveLocale manifest. Rebuild with share: true (or run livelocale pack) and upload the whole livelocale/ folder.`;function Rt(e){return new URL(`../`,e).href}var zt=/\/livelocale\/(index\.html)?$/;async function Bt(e){try{let t=await e.fetch(new URL(Dt,e.href).href,{cache:`no-store`,credentials:`same-origin`});if(!t.ok)return null;let n=await t.text(),r=Pt(JSON.parse(n));return r?{manifest:r,manifestText:n}:null}catch{return null}}async function Vt(e){let t=t=>{let n=It(e);return{kind:`server`,appOrigin:n,appUrl:n,problems:t}};if(Ft(e.injected)!==null)return t([]);let n=await Bt(e);return n?{kind:`static`,appOrigin:new URL(e.href).origin,appUrl:Rt(e.href),...n}:t(zt.test(new URL(e.href).pathname)?[Lt]:[])}var Ht=null;function Ut(e){Ht=e}function Wt(){if(Ht)return Ht;let e=typeof window<`u`,t=It({search:e?window.location.search:void 0,injected:e?window.__LIVELOCALE_CONFIG__?.appOrigin:void 0,buildTime:void 0});return{kind:`server`,appOrigin:t,appUrl:t,problems:[]}}function Gt(){return Wt().appOrigin}function I(){return Wt().appUrl}function Kt(){let e=Wt();return e.kind===`static`?e.transport:null}function qt(){let e=Wt();if(e.kind!==`static`)return{};let{basePath:t,locales:n}=e.manifest;return{basePath:t??new URL(e.appUrl).pathname,locales:n}}function Jt(){let e=Wt();return e.kind===`server`&&e.problems.includes(`This Studio was opened from a website, but livelocale/manifest.json is missing or is not a LiveLocale manifest. Rebuild with share: true (or run livelocale pack) and upload the whole livelocale/ folder.`)}var Yt=()=>`${Gt()}/api/livelocale`,Xt=`livelocale-token`,Zt=`livelocale:unauthorized`,Qt=`livelocale:token-changed`,$t=class extends Error{code;details;constructor(e,t,n){super(e),this.name=`ValidationError`,this.code=t,this.details={missing:n?.missing??[],extra:n?.extra??[]}}},en=class extends Error{code=`UNAUTHORIZED`;constructor(e=`Unauthorized`){super(e),this.name=`UnauthorizedError`}},tn=null;function nn(){try{return window.sessionStorage.getItem(`livelocale-token`)??tn}catch{return tn}}function rn(e){tn=e;try{e?window.sessionStorage.setItem(Xt,e):window.sessionStorage.removeItem(Xt)}catch{}typeof window<`u`&&window.dispatchEvent(new Event(Qt))}function an(e={}){let t=nn();return t?{...e,Authorization:`Bearer ${t}`}:e}async function on(e){let t=null;try{t=await e.json()}catch{}if(e.status===401)throw typeof window<`u`&&window.dispatchEvent(new Event(Zt)),new en(t?.error||`Unauthorized`);if(e.status===422)throw new $t(t?.error||`The translation was rejected.`,t?.code||`VALIDATION`,t?.details);if(!e.ok)throw Error(t?.error||`Server responded with status ${e.status}`);return t}function sn(e=``){let t=`${Yt()}${e}`;return(nn()?fetch(t,{headers:an()}):fetch(t)).then(e=>on(e))}async function cn(e){return on(await fetch(Yt(),{method:`POST`,headers:an({"Content-Type":`application/json`}),body:JSON.stringify(e)}))}var ln={fetchInfo:()=>sn(`?action=info`),fetchLocales:()=>sn(),fetchKeysMetadata:()=>sn(`?action=keys`),fetchLocaleDictionary:e=>sn(`?locale=${encodeURIComponent(e)}`),fetchGitState:()=>sn(`?action=git`),saveTranslation:(e,t,n,r={})=>cn({locale:e,key:t,value:n,...r.reference===void 0?{}:{reference:r.reference},...r.force?{force:!0}:{}}),addLocaleRequest:e=>cn({action:`addLocale`,locale:e}),renameLocaleRequest:(e,t)=>cn({action:`renameLocale`,locale:e,newLocale:t}),deleteLocaleRequest:e=>cn({action:`deleteLocale`,locale:e}),commitLocales:e=>cn({action:`commit`,message:e}),discardLocales:()=>cn({action:`discard`})},un=ln;function dn(e){un=e??ln}var fn=()=>un.fetchInfo(),pn=()=>un.fetchLocales(),mn=()=>un.fetchKeysMetadata(),hn=e=>un.fetchLocaleDictionary(e),gn=()=>un.fetchGitState(),_n=(e,t,n,r={})=>un.saveTranslation(e,t,n,r),vn=e=>un.addLocaleRequest(e),yn=(e,t)=>un.renameLocaleRequest(e,t),bn=e=>un.deleteLocaleRequest(e),xn=e=>un.commitLocales(e),Sn=()=>un.discardLocales();function Cn(e,t){return e.repo?e.repo:`path:`+new URL(t).pathname}function wn(e,t,n){let r=e.layout===`namespaced`?`${t}/${n.split(`.`)[0]}.json`:`${t}.json`;return e.localesPath===`.`?r:`${e.localesPath}/${r}`}var Tn=(e,t)=>e<t?-1:+(e>t);function En(e,t){let n=e.map(e=>({path:wn(t,e.locale,e.key),draft:e})).sort((e,t)=>Tn(e.path,t.path)||Tn(e.draft.key,t.draft.key)),r=[],i=null;for(let{path:e,draft:t}of n)e!==i&&(r.push(`--- a/${e}`,`+++ b/${e}`),i=e),r.push(`@@ ${t.key} @@`),t.from!==null&&r.push(`-${JSON.stringify(t.from)}`),r.push(`+${JSON.stringify(t.to)}`);return r.join(`
10
+ `)}var Dn=`livelocale:drafts-changed`,On=`This browser cannot keep your changes after the tab closes (private window or blocked storage). Send them before you leave.`,kn=`Adding, renaming or deleting languages is not available on a share link. Ask your developer.`,An=`Use "Send to developer" to hand your changes over.`,jn=(e,t)=>e.startsWith(t+`.`)||t.startsWith(e+`.`);async function Mn(e){let{manifest:t,studioUrl:n,appUrl:r,store:i}=e,a=e.fetch??((e,t)=>globalThis.fetch(e,t)),o=e.now??(()=>Date.now()),s=e.events??(typeof window<`u`?window:new EventTarget),c=()=>{s.dispatchEvent(new Event(Dn))},l=Cn(t,r),u=new Map,d=e=>ve(e)&&xe(e)&&t.locales.includes(e);async function f(e){let t=`locales/${e}.json`,r=await a(new URL(t,n).href,{cache:`no-cache`,credentials:`same-origin`});if(!r.ok)throw Error(`Could not load ${t} (${r.status}).`);return await r.json()}function p(e){if(!d(e))return Promise.reject(Error(`Unknown language "${e}".`));let t=u.get(e);return t||(t=f(e),u.set(e,t),t.catch(()=>{u.get(e)===t&&u.delete(e)})),t}async function m(e){return(await i.list(l)).filter(t=>t.locale===e).reverse()}async function h(){let e=await Promise.allSettled(t.locales.map(e=>p(e))),n=[];return e.forEach((e,r)=>{e.status===`fulfilled`&&n.push([t.locales[r],e.value])}),n}return{manifest:t,scope:l,persistent:i.persistent,events:s,readBuiltLocale:p,async fetchInfo(){return{mode:`static`,authRequired:!1,git:!1,problems:i.persistent?[]:[On]}},async fetchLocales(){return[...t.locales]},async fetchLocaleDictionary(e){let t=await p(e),n={};for(let t of await m(e))Oe(n,t.key,t.to);return De(t,n)},async fetchKeysMetadata(){let e=new Set(t.codeKeys);for(let[,t]of await h())Me(t,``,e);for(let t of await i.list(l))e.add(t.key);return{allKeys:[...e].sort(),codeKeys:[...t.codeKeys]}},async textCandidates(){let e={};for(let[t,n]of await h()){let r={};for(let e of Me(n)){let t=je(n,e);t.state===`string`&&(r[e]=[t.value])}for(let e of await m(t)){let t=r[e.key]??=[];t.includes(e.to)||t.push(e.to)}e[t]=r}return e},listDrafts(){return i.list(l)},async discardDraft(e,t){let n=await i.get(l,e,t);return n&&await i.delete(l,e,t),c(),n},async markDraftsSent(e){let t=o();for(let{locale:n,key:r}of e){let e=await i.get(l,n,r);e&&await i.put({...e,status:`sent`,sentAt:t})}c()},async restoreDrafts(e){let n=await i.list(l),r=0;for(let{locale:a,key:s,from:c,to:u,force:f}of e){let e=n.some(e=>e.locale===a&&(e.key===s||jn(e.key,s)));if(!d(a)||e)continue;let p={scope:l,locale:a,key:s,from:c,to:u,force:f,base:t.base,branch:t.branch,status:`unsent`,conflict:!1,updatedAt:o(),sentAt:null};await i.put(p),n.push(p),r++}return r>0&&c(),{added:r,skipped:e.length-r}},async saveTranslation(e,n,r,a={}){let s=await p(e),u=je(s,n),d=u.state===`string`?u.value:null;if(r===d)return await i.delete(l,e,n),c(),{success:!0,key:n,locale:e};let f=a.force===!0,m=Ie({locale:e,key:n,value:r},{sourceLocale:t.sourceLocale,source:await p(t.sourceLocale),target:s},{force:f});if(!m.ok&&m.status!==422)throw Error(m.error);if((await i.list(l)).filter(t=>t.locale===e&&t.key!==n).some(e=>jn(e.key,n)))throw Error(`Cannot save "${n}" in ${e}: it would replace translations that are not a single text.`);if(!m.ok)throw new $t(m.error,m.code,m.details);return await i.put({scope:l,locale:e,key:n,from:d,to:r,force:f,base:t.base,branch:t.branch,status:`unsent`,conflict:!1,updatedAt:o(),sentAt:null}),c(),{success:!0,key:n,locale:e}},async discardLocales(){for(let e of await i.list(l))e.status===`unsent`&&await i.delete(l,e.locale,e.key);return c(),{success:!0}},async fetchGitState(){let e=await i.list(l),n=new Set(e.map(e=>wn(t,e.locale,e.key)));return{available:!0,isRepo:!0,branch:t.branch,mode:`static`,changes:[...n].sort().map(e=>({path:e,status:`modified`})),diff:En(e,t),pullRequestUrl:null}},addLocaleRequest:()=>Promise.reject(Error(kn)),renameLocaleRequest:()=>Promise.reject(Error(kn)),deleteLocaleRequest:()=>Promise.reject(Error(kn)),commitLocales:()=>Promise.reject(Error(An))}}function Nn(e){return e===1?`1 change not sent`:`${e} changes not sent`}function Pn(e){let[t,n]=(0,g.useState)([]),r=(0,g.useCallback)(async()=>{e&&n(await e.listDrafts())},[e]);(0,g.useEffect)(()=>{if(!e)return;let t=!0,r=()=>{e.listDrafts().then(e=>{t&&n(e)}).catch(()=>{})};return r(),e.events.addEventListener(Dn,r),()=>{t=!1,e.events.removeEventListener(Dn,r)}},[e]);let i=(0,g.useCallback)(async t=>e?.discardDraft(t.locale,t.key),[e]),a=(0,g.useCallback)(async t=>{e&&await e.markDraftsSent(t.map(({locale:e,key:t})=>({locale:e,key:t})))},[e]),{unsentCount:o,sentCount:s}=(0,g.useMemo)(()=>{let e=t.filter(e=>e.status===`unsent`).length;return{unsentCount:e,sentCount:t.length-e}},[t]);return{drafts:t,unsentCount:o,sentCount:s,refresh:r,discard:i,markSent:a}}var Fn=e=>e===1?`Reviewing 1 proposed change`:`Reviewing ${e} proposed changes`,In={content:`detected from page text`,url:`from the page address`,manual:`chosen by you`,remembered:`from your last visit`},Ln=({coveragePercentage:e,mode:t,changesCount:n,isChangesOpen:r,onToggleChanges:i,unsentCount:a=0,targetLocale:o=null,locales:s,onChooseLocale:c,canSend:l=!1,onSend:u,reviewCount:d=null,onCloseReview:f})=>{let p=d!==null,m=o?.mismatch&&(!s||s.includes(o.mismatch))?o.mismatch:null;return(0,y.jsxs)(`header`,{className:`h-16 bg-[#080b11]/90 backdrop-blur-md border-b border-slate-900/60 px-4 xl:px-8 flex items-center justify-between gap-4 shrink-0 select-none`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-3 shrink-0`,children:[(0,y.jsx)(`div`,{className:`w-8 h-8 rounded-xl bg-linear-to-tr from-indigo-600 to-violet-500 flex items-center justify-center shadow-lg shadow-indigo-500/20`,children:(0,y.jsxs)(`svg`,{className:`w-4 h-4 text-white`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:[(0,y.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2.5,d:`M15 12a3 3 0 11-6 0 3 3 0 016 0z`}),(0,y.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z`})]})}),(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`h1`,{className:`text-base font-extrabold tracking-wide font-outfit bg-linear-to-r from-slate-100 to-slate-300 bg-clip-text text-transparent`,children:`LiveLocale`}),(0,y.jsx)(`p`,{className:`hidden xl:block text-[10px] text-slate-500 font-medium tracking-wider uppercase mt-0.5`,children:`Live Visual Translation Studio`})]})]}),(0,y.jsxs)(`div`,{className:`flex items-center justify-end gap-3 xl:gap-5 min-w-0`,children:[o&&(0,y.jsxs)(`div`,{"data-testid":`target-locale`,className:`flex items-center gap-2 select-none min-w-0 overflow-hidden`,children:[o.source===null?(0,y.jsx)(`span`,{className:`px-2.5 py-1 rounded-full bg-slate-900 border border-slate-800 text-[10px] font-semibold text-slate-400 whitespace-nowrap truncate min-w-0`,children:`Language: not chosen yet`}):(0,y.jsxs)(`span`,{className:`flex items-center gap-1.5 px-2.5 py-1 rounded-full bg-indigo-600/10 border border-indigo-500/30 text-[10px] whitespace-nowrap min-w-0`,children:[(0,y.jsx)(`span`,{className:`font-bold text-indigo-200`,children:`Editing: ${o.locale}`}),(0,y.jsx)(`span`,{className:`hidden xl:inline text-slate-400`,children:In[o.source]})]}),m&&(0,y.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[10px] text-amber-300 whitespace-nowrap shrink-0`,children:[(0,y.jsx)(`span`,{className:`hidden xl:inline`,children:`This text looks like ${m}.`}),(0,y.jsx)(`button`,{type:`button`,onClick:()=>c?.(m),title:`This text looks like ${m}.`,className:`px-2 py-0.5 rounded-md bg-amber-500/10 border border-amber-500/30 font-semibold hover:bg-amber-500/20 transition duration-150`,children:`Switch to ${m}`})]})]}),(0,y.jsxs)(`div`,{className:`items-center gap-2.5 shrink-0 ${o?`hidden xl:flex`:`flex`}`,title:`${e}% of keys translated`,children:[(0,y.jsx)(`span`,{className:`text-[10px] text-slate-500 font-medium select-none whitespace-nowrap`,children:`Coverage`}),(0,y.jsx)(`div`,{className:`w-16 xl:w-28 h-1.5 bg-slate-800 rounded-full overflow-hidden`,children:(0,y.jsx)(`div`,{className:`h-full rounded-full transition-all duration-700 ease-out`,style:{width:`${e}%`,background:e>=80?`linear-gradient(90deg, #34d399, #059669)`:e>=40?`linear-gradient(90deg, #fbbf24, #f59e0b)`:`linear-gradient(90deg, #f87171, #ef4444)`}})}),(0,y.jsxs)(`span`,{className:`text-[10px] font-bold font-mono text-slate-400 select-none tabular-nums`,children:[e,`%`]})]}),t===`preview`&&(0,y.jsx)(`span`,{className:`px-2.5 py-1 rounded-full bg-amber-500/10 border border-amber-500/30 text-[10px] font-extrabold tracking-wider text-amber-300 select-none`,title:`Edits go to a git branch on the server; nothing is written locally.`,children:`PREVIEW`}),p&&(0,y.jsx)(`span`,{"data-testid":`review-chip`,className:`shrink-0 px-2.5 py-1 rounded-full bg-indigo-600/10 border border-indigo-500/30 text-[10px] font-semibold text-indigo-200 select-none whitespace-nowrap`,children:Fn(d)}),p&&f&&(0,y.jsx)(`button`,{id:`studio-close-review`,type:`button`,onClick:f,className:`shrink-0 px-3 py-1.5 rounded-xl border text-[11px] font-semibold bg-slate-900 border-slate-800 text-slate-300 hover:text-slate-100 hover:border-slate-700 transition duration-150 whitespace-nowrap`,children:`Close review`}),!p&&a>0&&(0,y.jsx)(`span`,{"data-testid":`unsent-counter`,className:`shrink-0 px-2.5 py-1 rounded-full bg-amber-500/10 border border-amber-500/30 text-[10px] font-semibold text-amber-300 select-none whitespace-nowrap`,title:`Saved in this browser only. Send them to your developer before you leave.`,children:Nn(a)}),!p&&u&&(0,y.jsx)(`button`,{id:`studio-send-button`,onClick:u,disabled:!l,className:`shrink-0 px-3 py-1.5 rounded-xl border text-[11px] font-semibold bg-indigo-600 border-indigo-500 text-indigo-50 hover:bg-indigo-500 disabled:opacity-40 disabled:cursor-not-allowed transition duration-150 whitespace-nowrap`,title:`Turn your changes into a link or file for your developer`,children:`Send to developer`}),(0,y.jsxs)(`button`,{id:`studio-changes-button`,onClick:i,className:`shrink-0 flex items-center gap-2 px-3 py-1.5 rounded-xl border text-[11px] font-semibold whitespace-nowrap transition duration-150 ${r?`bg-indigo-600/20 border-indigo-500 text-indigo-300`:`bg-slate-900 border-slate-800 text-slate-300 hover:text-slate-100 hover:border-slate-700`}`,title:`Review, commit, or undo locale changes`,children:[(0,y.jsxs)(`svg`,{className:`w-3.5 h-3.5`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,viewBox:`0 0 24 24`,children:[(0,y.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`}),(0,y.jsx)(`path`,{d:`M12 3v6M12 15v6`})]}),`Changes`,n>0&&(0,y.jsx)(`span`,{className:`px-1.5 py-0.5 rounded-md bg-amber-500/15 border border-amber-500/30 text-[10px] font-mono font-bold text-amber-300`,children:n})]}),(0,y.jsxs)(`span`,{className:`hidden xl:block px-3 py-1 rounded-full bg-slate-900 border border-slate-800 text-[10px] font-bold text-slate-400 select-none`,children:[`v`,`0.9.0`,` (BETA)`]})]})]})},Rn=({showConfirmModal:e,onConfirm:t,onCancel:n})=>e?(0,y.jsx)(`div`,{className:`fixed inset-0 z-50 bg-slate-950/80 backdrop-blur-sm flex items-center justify-center p-4`,children:(0,y.jsxs)(`div`,{className:`bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-md p-6 shadow-2xl relative animate-in fade-in zoom-in-95 duration-200`,children:[(0,y.jsx)(`h3`,{className:`text-base font-bold text-slate-200 font-outfit`,children:`Unsaved Changes`}),(0,y.jsx)(`p`,{className:`text-xs text-slate-400 mt-2 leading-relaxed`,children:`You have unsaved edits in your translation. Selecting another element will discard these modifications. Do you want to discard your edits?`}),(0,y.jsxs)(`div`,{className:`flex items-center justify-end gap-3 mt-6`,children:[(0,y.jsx)(`button`,{onClick:n,className:`px-4 py-2 text-xs font-semibold text-slate-400 hover:text-slate-200 bg-slate-800 hover:bg-slate-750 border border-slate-850 hover:border-slate-700 rounded-xl transition duration-150`,children:`Keep Editing`}),(0,y.jsx)(`button`,{onClick:t,className:`px-4 py-2 text-xs font-semibold text-white bg-rose-600 hover:bg-rose-500 rounded-xl shadow-lg shadow-rose-600/10 active:bg-rose-700 transition duration-150`,children:`Discard Edits`})]})]})}):null,zn=({filteredKeys:e,selected:t,localeData:n,searchTerm:r,setSearchTerm:i,filterPageOnly:a,setFilterPageOnly:o,visibleKeys:s,selectKeyDirectly:c,className:l=`w-[300px] shrink-0`})=>(0,y.jsxs)(`div`,{"data-testid":`keys-directory`,className:`${l} bg-slate-900 border border-slate-800 rounded-2xl flex flex-col h-full shadow-2xl overflow-hidden`,children:[(0,y.jsxs)(`div`,{className:`h-14 bg-slate-950 border-b border-slate-800 flex items-center justify-between px-6 shrink-0 select-none`,children:[(0,y.jsx)(`h2`,{className:`text-sm font-bold tracking-wide font-outfit text-slate-200`,children:`Locale Directory`}),(0,y.jsxs)(`span`,{className:`text-[10px] font-bold font-mono px-2 py-0.5 rounded bg-slate-900 text-indigo-400 border border-slate-850`,children:[e.length,` keys`]})]}),(0,y.jsxs)(`div`,{className:`p-4 border-b border-slate-800/80 shrink-0 bg-slate-900/40 space-y-3`,children:[(0,y.jsxs)(`div`,{className:`relative`,children:[(0,y.jsx)(`input`,{type:`text`,value:r,onChange:e=>i(e.target.value),placeholder:`Search keys or values...`,className:`w-full h-9 pl-9 pr-4 bg-slate-950 border border-slate-800 hover:border-slate-750 focus:border-indigo-500 focus:outline-hidden focus:ring-1 focus:ring-indigo-500/50 rounded-lg text-xs text-slate-200 placeholder-slate-600 transition duration-150`}),(0,y.jsx)(`svg`,{className:`w-3.5 h-3.5 text-slate-600 absolute left-3 top-2.5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,y.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2.5,d:`M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z`})})]}),(0,y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,y.jsx)(`span`,{className:`text-[10px] text-slate-500 font-semibold uppercase tracking-wider`,children:`Scope`}),(0,y.jsxs)(`div`,{className:`flex items-center gap-1 bg-slate-950 border border-slate-850 rounded-lg p-0.5 select-none shrink-0`,children:[(0,y.jsx)(`button`,{onClick:()=>o(!1),className:`px-2.5 py-1 text-[9px] font-bold rounded-md transition duration-150 ${a?`text-slate-500 hover:text-slate-300`:`bg-indigo-600 text-white shadow-sm`}`,children:`All Keys`}),(0,y.jsx)(`button`,{onClick:()=>o(!0),disabled:s===null,className:`px-2.5 py-1 text-[9px] font-bold rounded-md transition duration-150 ${a?`bg-indigo-600 text-white shadow-sm`:`text-slate-500 hover:text-slate-300 disabled:opacity-40 disabled:cursor-not-allowed`}`,title:s===null?`Waiting for preview connection...`:`Only show keys on the current page`,children:`Page Keys`})]})]})]}),(0,y.jsx)(`div`,{className:`flex-1 overflow-y-auto p-3 space-y-1 scrollbar-thin`,children:e.length>0?e.map(e=>{let r=t?.key===e,i=n[e]||``,a=n[e]===void 0;return(0,y.jsxs)(`button`,{onClick:()=>c(e),className:`w-full text-left p-3 rounded-xl border transition duration-150 flex flex-col gap-1.5 ${r?`bg-indigo-600/10 border-indigo-500 text-slate-100 shadow-sm`:`bg-slate-950/20 hover:bg-slate-950/50 border-transparent text-slate-300 hover:text-slate-200`}`,children:[(0,y.jsxs)(`div`,{className:`w-full flex items-center justify-between gap-2`,children:[(0,y.jsx)(`span`,{className:`text-[11px] font-semibold font-mono break-all line-clamp-2 leading-relaxed text-indigo-400`,children:e}),a&&(0,y.jsx)(`span`,{className:`px-1.5 py-0.5 rounded bg-rose-500/10 text-[8px] font-extrabold text-rose-400 border border-rose-500/20 shrink-0 uppercase tracking-wider`,children:`Missing`})]}),(0,y.jsx)(`span`,{dir:`auto`,className:`text-[10px] text-slate-500 break-all line-clamp-1`,children:i||(0,y.jsx)(`span`,{className:`italic text-slate-750`,children:`Empty`})})]},e)}):(0,y.jsxs)(`div`,{className:`h-full flex flex-col items-center justify-center p-6 text-center text-slate-600 select-none`,children:[(0,y.jsx)(`svg`,{className:`w-8 h-8 text-slate-700 mb-2`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,y.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.5,d:`M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z`})}),(0,y.jsx)(`span`,{className:`text-xs`,children:`No keys found`})]})})]}),Bn={unsent:`Not sent`,sent:`Sent`,live:`Live now`,conflict:`Changed by someone else, please check`},Vn={unsent:`text-amber-400 border-amber-500/30 bg-amber-500/10`,sent:`text-sky-400 border-sky-500/30 bg-sky-500/10`,live:`text-emerald-400 border-emerald-500/30 bg-emerald-500/10`,conflict:`text-rose-400 border-rose-500/30 bg-rose-500/10`},Hn=`Removes it from this list. A link you already sent still carries it.`;function Un(e){return e.conflict?`conflict`:e.status}var Wn=`h-9 px-3 rounded-xl text-xs font-semibold text-slate-300 hover:text-slate-100 bg-slate-800 hover:bg-slate-700 border border-slate-700 transition duration-150 cursor-pointer`,Gn=({drafts:e,onUndo:t,isUndoing:n,onDownloadBackup:r,onRestoreBackup:i,onReviewChange:a})=>{let[o,s]=(0,g.useState)(null);return(0,y.jsxs)(`section`,{className:`space-y-3`,children:[(0,y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,y.jsx)(`h3`,{className:`text-[11px] font-bold text-slate-500 uppercase tracking-wider`,children:`Your changes`}),(0,y.jsx)(`span`,{className:`text-[10px] font-bold font-mono px-2 py-0.5 rounded bg-slate-950 text-indigo-400 border border-slate-850`,children:e.length})]}),e.length===0?(0,y.jsx)(`p`,{className:`text-xs text-slate-500`,children:`No changes yet. Alt+Click any text in the app to fix it.`}):(0,y.jsx)(`ul`,{className:`space-y-1.5`,children:e.map(e=>{let r=Un(e),i=r===`sent`;return(0,y.jsxs)(`li`,{className:`px-3 py-2 rounded-xl bg-slate-950/40 border border-slate-800/80 space-y-1`,children:[(0,y.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,y.jsx)(`span`,{className:`text-[11px] font-mono text-indigo-400 break-all`,children:`${e.key} · ${e.locale}`}),(0,y.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,y.jsx)(`span`,{className:`px-1.5 py-0.5 rounded text-[9px] font-extrabold uppercase tracking-wider border ${Vn[r]}`,children:Bn[r]}),(0,y.jsx)(`button`,{onClick:()=>t(e),disabled:n,className:`text-[10px] font-semibold text-slate-400 hover:text-slate-100 px-2 py-0.5 rounded-md border border-slate-800 hover:border-slate-600 disabled:opacity-40 transition duration-150`,title:i?Hn:`Go back to the published text`,children:i?`Remove`:`Undo`})]})]}),(0,y.jsxs)(`div`,{className:`text-[10px] leading-relaxed`,children:[e.from?(0,y.jsx)(`span`,{dir:`auto`,className:`text-rose-400/80 line-through break-all`,children:e.from}):(0,y.jsx)(`em`,{className:`text-rose-400/80 line-through`,children:`empty`}),(0,y.jsx)(`span`,{className:`text-slate-600`,children:` → `}),e.to?(0,y.jsx)(`span`,{dir:`auto`,className:`text-emerald-300 break-all`,children:e.to}):(0,y.jsx)(`em`,{className:`text-emerald-300`,children:`empty`})]})]},`${e.locale}/${e.key}`)})}),(0,y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 pt-2`,children:[(0,y.jsx)(`button`,{onClick:async()=>{s(null);try{await r(),s(`Backup downloaded.`)}catch(e){s(e?.message||`Could not create the backup.`)}},className:Wn,children:`Download backup`}),(0,y.jsxs)(`label`,{className:`${Wn} inline-flex items-center`,children:[`Restore backup`,(0,y.jsx)(`input`,{type:`file`,accept:`.txt,text/plain`,onChange:async e=>{let t=e.currentTarget,n=t.files?.[0];if(n){s(null);try{s(await i(n))}catch(e){s(e?.message||`Could not restore the backup.`)}finally{t.value=``}}},className:`sr-only`})]}),a&&(0,y.jsx)(`button`,{onClick:a,className:Wn,children:`Review a change link or file`})]}),o&&(0,y.jsx)(`p`,{role:`status`,className:`text-[11px] text-slate-400 break-words`,children:o})]})},Kn=async()=>{},qn=async()=>``,Jn={modified:`text-amber-400 border-amber-500/30 bg-amber-500/10`,added:`text-emerald-400 border-emerald-500/30 bg-emerald-500/10`,deleted:`text-rose-400 border-rose-500/30 bg-rose-500/10`,renamed:`text-sky-400 border-sky-500/30 bg-sky-500/10`},Yn=e=>e.startsWith(`+++`)||e.startsWith(`---`)?`text-slate-500`:e.startsWith(`@@`)?`text-indigo-400`:e.startsWith(`diff `)||e.startsWith(`new file`)?`text-slate-600`:e.startsWith(`+`)?`text-emerald-300 bg-emerald-500/10`:e.startsWith(`-`)?`text-rose-300 bg-rose-500/10`:`text-slate-400`,Xn=e=>new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,second:`2-digit`}),Zn=({isOpen:e,onClose:t,git:n,gitError:r,isGitLoading:i,lastCommit:a,onCommit:o,onDiscard:s,onRefresh:c,history:l,onUndo:u,isUndoing:d,drafts:f,onUndoDraft:p=Kn,onDownloadBackup:m=Kn,onRestoreBackup:h=qn,onReviewChange:_})=>{let[v,b]=(0,g.useState)(``),[x,S]=(0,g.useState)(!1),[C,w]=(0,g.useState)(!1);if(!e)return null;let T=n?.changes??[],E=n?.mode===`github`,D=!!n?.isRepo&&T.length>0&&v.trim().length>0;return(0,y.jsxs)(`div`,{className:`fixed inset-0 top-16 z-40 flex justify-end`,"data-testid":`changes-panel`,children:[(0,y.jsx)(`div`,{className:`absolute inset-0 bg-slate-950/60 backdrop-blur-[2px]`,onClick:t}),(0,y.jsxs)(`aside`,{className:`relative w-[520px] max-w-full h-full bg-slate-900 border-l border-slate-800 shadow-2xl flex flex-col animate-in slide-in-from-right duration-200`,children:[(0,y.jsxs)(`div`,{className:`h-14 bg-slate-950 border-b border-slate-800 flex items-center justify-between px-6 shrink-0 select-none`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,y.jsx)(`h2`,{className:`text-sm font-bold tracking-wide font-outfit text-slate-200`,children:`Changes`}),n?.isRepo&&n.branch&&(0,y.jsx)(`span`,{className:`px-2 py-0.5 rounded-md bg-slate-900 border border-slate-800 text-[10px] font-mono text-indigo-400`,children:n.branch})]}),(0,y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,y.jsx)(`button`,{onClick:c,className:`p-1.5 rounded-lg text-slate-400 hover:text-slate-200 hover:bg-slate-800 border border-transparent hover:border-slate-700 transition duration-150`,title:`Refresh`,children:(0,y.jsxs)(`svg`,{className:`w-4 h-4`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,viewBox:`0 0 24 24`,children:[(0,y.jsx)(`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`}),(0,y.jsx)(`path`,{d:`M21 3v5h-5`})]})}),(0,y.jsx)(`button`,{onClick:t,className:`p-1.5 rounded-lg text-slate-400 hover:text-slate-200 hover:bg-slate-800 border border-transparent hover:border-slate-700 transition duration-150`,title:`Close`,children:(0,y.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,viewBox:`0 0 24 24`,children:(0,y.jsx)(`path`,{d:`M18 6L6 18M6 6l12 12`})})})]})]}),Array.isArray(f)?(0,y.jsx)(`div`,{className:`flex-1 overflow-y-auto p-6 space-y-6`,children:(0,y.jsx)(Gn,{drafts:f,onUndo:p,isUndoing:d,onDownloadBackup:m,onRestoreBackup:h,onReviewChange:_})}):(0,y.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-6 space-y-6`,children:[(0,y.jsxs)(`section`,{className:`space-y-3`,children:[(0,y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,y.jsx)(`label`,{className:`text-[11px] font-bold text-slate-500 uppercase tracking-wider`,children:`Locale files`}),(0,y.jsxs)(`span`,{className:`text-[10px] font-bold font-mono px-2 py-0.5 rounded bg-slate-950 text-indigo-400 border border-slate-850`,children:[T.length,` changed`]})]}),n===null?(0,y.jsx)(`p`,{className:`text-xs text-slate-500`,children:`Loading git status…`}):n.available?n.isRepo?T.length===0?(0,y.jsx)(`p`,{className:`text-xs text-slate-500`,children:`Working tree is clean. Edits you save will show up here.`}):(0,y.jsx)(`ul`,{className:`space-y-1.5`,children:T.map(e=>(0,y.jsxs)(`li`,{className:`flex items-center justify-between gap-3 px-3 py-2 rounded-xl bg-slate-950/40 border border-slate-800/80`,children:[(0,y.jsx)(`span`,{className:`text-[11px] font-mono text-slate-300 break-all`,children:e.path}),(0,y.jsx)(`span`,{className:`px-1.5 py-0.5 rounded text-[9px] font-extrabold uppercase tracking-wider border shrink-0 ${Jn[e.status]??Jn.modified}`,children:e.status})]},e.path))}):(0,y.jsxs)(`p`,{className:`text-xs text-slate-500 leading-relaxed`,children:[`The locales directory is not inside a git repository, or the`,` `,(0,y.jsx)(`code`,{className:`font-mono text-slate-400`,children:`git`}),` command is not on PATH.`]}):(0,y.jsxs)(`p`,{className:`text-xs text-slate-500 leading-relaxed`,children:[`Git integration is disabled for this handler. Enable it by removing`,` `,(0,y.jsx)(`code`,{className:`font-mono text-slate-400`,children:`git: false`}),` from the route configuration.`]}),n?.isRepo&&T.length>0&&(0,y.jsxs)(`div`,{className:`space-y-2`,children:[(0,y.jsx)(`button`,{onClick:()=>w(e=>!e),className:`text-[10px] font-semibold text-slate-500 hover:text-slate-300 transition duration-150`,children:C?`Hide diff`:`Show diff`}),C&&(0,y.jsx)(`pre`,{className:`max-h-72 overflow-auto rounded-xl bg-slate-950 border border-slate-800 p-3 text-[10px] font-mono leading-relaxed whitespace-pre`,children:n.diff.split(`
11
+ `).map((e,t)=>(0,y.jsx)(`div`,{className:`px-1 ${Yn(e)}`,children:e||` `},t))})]})]}),n?.isRepo&&(0,y.jsxs)(`section`,{className:`space-y-3`,children:[(0,y.jsx)(`label`,{className:`text-[11px] font-bold text-slate-500 uppercase tracking-wider`,children:E?`Propose`:`Commit`}),E&&n?.pullRequestUrl&&(0,y.jsx)(`a`,{href:n.pullRequestUrl,target:`_blank`,rel:`noreferrer`,className:`block text-[11px] text-indigo-400 hover:text-indigo-300 underline underline-offset-2`,children:`View the open pull request`}),(0,y.jsx)(`textarea`,{id:`studio-commit-message`,value:v,onChange:e=>b(e.target.value),disabled:i||T.length===0,placeholder:T.length===0?E?`No changes on the branch yet`:`Nothing to commit`:E?`Pull request title, e.g. "Update checkout copy"`:`i18n: describe the copy change…`,maxLength:500,className:`w-full min-h-20 bg-slate-950 border border-slate-800 hover:border-slate-750 focus:border-indigo-500 focus:outline-hidden focus:ring-1 focus:ring-indigo-500/50 rounded-xl px-4 py-3 text-xs text-slate-100 placeholder-slate-600 font-sans resize-none transition duration-150 disabled:opacity-60`}),(0,y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,y.jsx)(`button`,{id:`studio-commit-button`,onClick:async()=>{await o(v.trim())&&b(``)},disabled:!D||i,className:`flex-1 h-10 rounded-xl text-xs font-semibold tracking-wide bg-indigo-600 hover:bg-indigo-500 active:bg-indigo-700 text-white disabled:bg-slate-800 disabled:text-slate-500 disabled:cursor-not-allowed transition duration-150`,children:i?`Working…`:E?n?.pullRequestUrl?`Pull request is open`:`Open pull request`:`Commit locale changes`}),x?(0,y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,y.jsx)(`button`,{onClick:async()=>{await s()&&S(!1)},disabled:i,className:`h-10 px-3 rounded-xl text-xs font-semibold text-white bg-rose-600 hover:bg-rose-500 active:bg-rose-700 transition duration-150`,children:E?`Reset to base`:`Discard all`}),(0,y.jsx)(`button`,{onClick:()=>S(!1),className:`h-10 px-3 rounded-xl text-xs font-semibold text-slate-400 hover:text-slate-200 bg-slate-800 border border-slate-850 transition duration-150`,children:`Keep`})]}):(0,y.jsx)(`button`,{onClick:()=>S(!0),disabled:T.length===0||i,className:`h-10 px-4 rounded-xl text-xs font-semibold text-rose-400 bg-rose-500/10 hover:bg-rose-500/20 border border-rose-500/20 disabled:opacity-40 disabled:cursor-not-allowed transition duration-150`,children:E?`Reset branch`:`Discard`})]}),a&&!r&&(0,y.jsx)(`p`,{className:`text-[11px] text-emerald-400 font-mono break-all`,children:E?(0,y.jsxs)(y.Fragment,{children:[`Pull request:`,` `,(0,y.jsx)(`a`,{href:a,target:`_blank`,rel:`noreferrer`,className:`underline`,children:a})]}):(0,y.jsxs)(y.Fragment,{children:[`Committed as `,a,`. Push whenever you are ready.`]})}),r&&(0,y.jsx)(`div`,{className:`bg-rose-500/10 border border-rose-500/20 rounded-xl p-3 text-xs text-rose-400 font-mono break-all`,children:r})]}),(0,y.jsxs)(`section`,{className:`space-y-3`,children:[(0,y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,y.jsx)(`label`,{className:`text-[11px] font-bold text-slate-500 uppercase tracking-wider`,children:`This session`}),(0,y.jsxs)(`span`,{className:`text-[10px] font-bold font-mono px-2 py-0.5 rounded bg-slate-950 text-slate-400 border border-slate-850`,children:[l.length,` edits`]})]}),l.length===0?(0,y.jsx)(`p`,{className:`text-xs text-slate-500`,children:`No edits saved yet in this session.`}):(0,y.jsx)(`ul`,{className:`space-y-1.5`,children:l.map(e=>(0,y.jsxs)(`li`,{className:`px-3 py-2 rounded-xl bg-slate-950/40 border border-slate-800/80 space-y-1`,children:[(0,y.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,y.jsxs)(`span`,{className:`text-[11px] font-mono text-indigo-400 break-all`,children:[e.key,(0,y.jsxs)(`span`,{className:`text-slate-600`,children:[` · `,e.locale]})]}),(0,y.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,y.jsx)(`span`,{className:`text-[9px] text-slate-600 font-mono`,children:Xn(e.at)}),(0,y.jsx)(`button`,{onClick:()=>u(e),disabled:d,className:`text-[10px] font-semibold text-slate-400 hover:text-slate-100 px-2 py-0.5 rounded-md border border-slate-800 hover:border-slate-600 disabled:opacity-40 transition duration-150`,title:`Restore the previous value`,children:`Undo`})]})]}),(0,y.jsxs)(`div`,{className:`text-[10px] leading-relaxed`,children:[(0,y.jsx)(`span`,{className:`text-rose-400/80 line-through break-all`,children:e.previousValue||(0,y.jsx)(`em`,{children:`empty`})}),(0,y.jsx)(`span`,{className:`text-slate-600`,children:` → `}),(0,y.jsx)(`span`,{className:`text-emerald-300 break-all`,children:e.nextValue||(0,y.jsx)(`em`,{children:`empty`})})]})]},e.id))})]})]})]})]})},Qn=({isOpen:e,onSubmit:t})=>{let[n,r]=(0,g.useState)(``);return e?(0,y.jsx)(`div`,{className:`fixed inset-0 z-50 bg-slate-950/80 backdrop-blur-sm flex items-center justify-center p-4`,children:(0,y.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),n.trim()&&t(n.trim())},className:`bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-md p-6 shadow-2xl animate-in fade-in zoom-in-95 duration-200 space-y-4`,children:[(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`h3`,{className:`text-base font-bold text-slate-200 font-outfit`,children:`Access token required`}),(0,y.jsxs)(`p`,{className:`text-xs text-slate-400 mt-2 leading-relaxed`,children:[`This app runs LiveLocale in preview mode. Paste the access token configured on the server (`,(0,y.jsx)(`code`,{className:`font-mono text-slate-300`,children:`LIVELOCALE_TOKEN`}),`) to edit translations. It is kept in this browser tab only.`]})]}),(0,y.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,y.jsx)(`label`,{htmlFor:`studio-access-token`,className:`text-[11px] font-bold text-slate-500 uppercase tracking-wider`,children:`Access token`}),(0,y.jsx)(`input`,{id:`studio-access-token`,type:`password`,autoComplete:`off`,value:n,onChange:e=>r(e.target.value),className:`w-full bg-slate-950 border border-slate-800 hover:border-slate-750 focus:border-indigo-500 focus:outline-hidden focus:ring-1 focus:ring-indigo-500/50 rounded-xl px-4 py-2.5 text-sm text-slate-100 font-mono transition duration-150`})]}),(0,y.jsx)(`div`,{className:`flex items-center justify-end`,children:(0,y.jsx)(`button`,{type:`submit`,disabled:!n.trim(),className:`px-4 py-2 text-xs font-semibold text-white bg-indigo-600 hover:bg-indigo-500 active:bg-indigo-700 disabled:bg-slate-800 disabled:text-slate-500 disabled:cursor-not-allowed rounded-xl transition duration-150`,children:`Connect`})})]})}):null},$n=`Saving will fail until the server setup is fixed:`,er=({problems:e,title:t=$n})=>e.length===0?null:(0,y.jsxs)(`div`,{role:`alert`,"data-testid":`setup-problems`,className:`mx-6 mt-4 rounded-xl border border-rose-500/30 bg-rose-500/10 px-4 py-3 text-xs text-rose-200 select-text`,children:[(0,y.jsx)(`p`,{className:`font-semibold text-rose-100`,children:t}),(0,y.jsx)(`ul`,{className:`mt-1.5 space-y-1 list-disc pl-4`,children:e.map(e=>(0,y.jsx)(`li`,{children:e},e))})]}),tr=({candidates:e,onChoose:t,onCancel:n})=>e===null?null:(0,y.jsx)(`div`,{className:`fixed inset-0 z-50 bg-slate-950/80 backdrop-blur-sm flex items-center justify-center p-4`,children:(0,y.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-labelledby":`studio-locale-picker-title`,className:`bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-md p-6 shadow-2xl relative animate-in fade-in zoom-in-95 duration-200`,children:[(0,y.jsx)(`h3`,{id:`studio-locale-picker-title`,className:`text-base font-bold text-slate-200 font-outfit`,children:`Which language are you editing?`}),(0,y.jsx)(`p`,{className:`text-xs text-slate-400 mt-2 leading-relaxed`,children:`LiveLocale could not tell from the page. Your fix will be saved to the language you pick.`}),(0,y.jsx)(`div`,{className:`flex flex-wrap gap-2 mt-5`,children:e.map(e=>(0,y.jsx)(`button`,{onClick:()=>t(e),className:`px-4 py-2 text-xs font-mono font-semibold text-indigo-200 bg-indigo-600/20 hover:bg-indigo-600/30 border border-indigo-500/40 hover:border-indigo-400 rounded-xl transition duration-150`,children:e},e))}),(0,y.jsx)(`div`,{className:`flex items-center justify-end mt-6`,children:(0,y.jsx)(`button`,{onClick:n,className:`px-4 py-2 text-xs font-semibold text-slate-400 hover:text-slate-200 bg-slate-800 border border-slate-850 hover:border-slate-700 rounded-xl transition duration-150`,children:`Cancel`})})]})}),nr=new Map;function rr(e){return`livelocale:${e}`}function ir(e){try{return localStorage.getItem(rr(e))}catch{return nr.get(e)??null}}function ar(e,t){t===null?nr.delete(e):nr.set(e,t);try{t===null?localStorage.removeItem(rr(e)):localStorage.setItem(rr(e),t)}catch{}}function or(e){let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.position=`fixed`,t.style.top=`-1000px`,t.style.left=`-1000px`;try{return document.body.appendChild(t),t.select(),document.execCommand(`copy`)}catch{return!1}finally{t.remove()}}async function sr(e){try{if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(e),!0}catch{}return or(e)}function cr(e,t){let n=URL.createObjectURL(new Blob([t],{type:`text/plain;charset=utf-8`})),r=document.createElement(`a`);r.href=n,r.download=e,r.style.display=`none`;try{document.body.appendChild(r),r.click()}finally{r.remove(),URL.revokeObjectURL(n)}}var lr=[`Hold Alt/Option and click any text.`,`Type your fix. The page updates as you type, and your changes are kept in this browser.`,`When you are done, press Send to developer and paste the link to your developer.`];function ur(e){let[t,n]=(0,g.useState)(()=>ir(`tips-seen`)===`1`),[r,i]=(0,g.useState)(()=>ir(`translator-name`)??``);return{showTips:e&&!t,dismiss:()=>{ar(`tips-seen`,`1`),n(!0)},name:r,setName:e=>{i(e),ar(`translator-name`,e===``?null:e)}}}var dr=({open:e,name:t,onNameChange:n,onDismiss:r})=>e?(0,y.jsx)(`div`,{className:`fixed inset-0 z-50 bg-slate-950/80 backdrop-blur-sm flex items-center justify-center p-4`,children:(0,y.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-labelledby":`studio-tips-title`,className:`bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-md p-6 shadow-2xl`,children:[(0,y.jsx)(`h3`,{id:`studio-tips-title`,className:`text-base font-bold text-slate-200 font-outfit`,children:`Welcome to LiveLocale`}),(0,y.jsx)(`ol`,{className:`mt-3 space-y-2 list-decimal list-inside text-xs text-slate-300 leading-relaxed`,children:lr.map(e=>(0,y.jsx)(`li`,{children:e},e))}),(0,y.jsx)(`label`,{htmlFor:`studio-tips-name`,className:`block mt-5 text-xs font-semibold text-slate-400`,children:`Your name (optional, credited in the pull request)`}),(0,y.jsx)(`input`,{id:`studio-tips-name`,type:`text`,maxLength:80,dir:`auto`,value:t,onChange:e=>n(e.target.value),className:`mt-1 w-full h-9 px-3 rounded-xl bg-slate-950 border border-slate-800 text-xs text-slate-200 focus:outline-none focus:border-indigo-500`}),(0,y.jsx)(`div`,{className:`flex items-center justify-end mt-6`,children:(0,y.jsx)(`button`,{onClick:r,className:`px-4 py-2 text-xs font-semibold text-white bg-indigo-600 hover:bg-indigo-500 rounded-xl transition duration-150`,children:`Start editing`})})]})}):null;function fr(e,t){let n=e.filter(e=>!e.conflict&&(e.status===`unsent`||t.includeSent)).sort((e,t)=>e.updatedAt-t.updatedAt);return{included:n.slice(0,500),overflow:Math.max(0,n.length-500)}}function pr(e){return e>=55296&&e<=56319}function mr(e){return e>=56320&&e<=57343}function hr(e){let t=``;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);pr(r)?n+1<e.length&&mr(e.charCodeAt(n+1))&&(t+=e.slice(n,n+2),n++):mr(r)||(t+=e.charAt(n))}return t}function gr(e,t){let n=hr(e).slice(0,t);return n.length>0&&pr(n.charCodeAt(n.length-1))?n.slice(0,-1):n}var _r=/[\x00-\x1f\x7f]/g,vr=/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g;function yr(e){return gr((e??``).replace(/\s+/g,` `).replace(_r,``).trim(),80)}function br(e){return gr((e??``).replace(vr,``).trim(),500)}function xr(e,t){return e<t?-1:+(e>t)}function Sr(e){let{drafts:t,manifest:n}=e,r=t.map(({locale:e,key:t,from:n,to:r,force:i})=>({locale:e,key:t,from:n,to:r,force:i})).sort((e,t)=>xr(e.locale,t.locale)||xr(e.key,t.key));return{...typeof n.repo==`string`&&n.repo!==``?{repo:n.repo}:{},branch:n.branch??``,base:n.base??``,src:n.sourceLocale,by:yr(e.by),note:br(e.note),edits:r}}function Cr(e,t){let n=new URL(e),r=n.pathname.endsWith(`/`)?`${n.pathname}index.html`:n.pathname;return`${n.origin}${r}#${t}`}function wr(e,t){return`livelocale-${e}-${t.toISOString().slice(0,10)}.txt`}var Tr=`This change link is damaged or incomplete, which happens when an email or chat app breaks a long link. Ask the sender to send the file instead.`,Er=`This change link is larger than LiveLocale accepts (500 changes, 512 KB).`,Dr={NOT_FOUND:`This is not a LiveLocale change link. A change link contains "lc1.".`,AMBIGUOUS:`This text holds more than one change link. Paste one link at a time.`,CORRUPT:Tr,INVALID:Tr,TOO_LARGE:Er,TOO_MANY_EDITS:Er,UNSUPPORTED_VERSION:`This change link was made by a newer LiveLocale. Update the site and try again.`,UNSUPPORTED_ENVIRONMENT:`This browser cannot create or read change links. Use a current Chrome, Edge or Firefox, or Safari 16.4 or later.`};function Or(e){return e instanceof N&&Object.hasOwn(Dr,e.code)?Dr[e.code]:e instanceof Error&&e.message||`Could not read the change link.`}var kr=`Link copied. Paste it to your developer in chat or email.`,Ar=`Copy did not work in this browser. Select the link above, copy it, then press “I copied it”.`,jr=`File saved. Send it to your developer.`,Mr=`This batch is too long for a chat message. Use Download file instead.`,Nr=`There are no changes to send.`,Pr=e=>e===1?`1 change`:`${e} changes`,Fr=`h-9 px-4 rounded-xl text-xs font-semibold border transition duration-150 disabled:opacity-40 disabled:cursor-not-allowed`,Ir=({isOpen:e,onClose:t,drafts:n,manifest:r,studioHref:i,onMarkSent:a})=>{let[o,s]=(0,g.useState)(()=>ir(`translator-name`)??``),[c,l]=(0,g.useState)(``),[u,d]=(0,g.useState)(!1),[f,p]=(0,g.useState)(null),[m,h]=(0,g.useState)(!1),[_,v]=(0,g.useState)(null),[b,x]=(0,g.useState)(null),[S,C]=(0,g.useState)(null),w=(0,g.useRef)(0);(0,g.useEffect)(()=>{e&&(s(ir(`translator-name`)??``),l(``),d(!1),x(null),C(null))},[e]);let T=(0,g.useMemo)(()=>n.filter(e=>e.status===`sent`&&!e.conflict).length,[n]),{included:E,overflow:D}=(0,g.useMemo)(()=>fr(n,{includeSent:u}),[n,u]);if((0,g.useEffect)(()=>{if(!e||!r)return;let t=++w.current;if(p(null),v(null),E.length===0){h(!1);return}h(!0),Tt(Sr({drafts:E,manifest:r,by:o,note:c})).then(e=>{t===w.current&&p(Cr(i,e))}).catch(e=>{t===w.current&&v(`Could not create the link: `+Or(e))}).finally(()=>{t===w.current&&h(!1)})},[e,r,E,o,c,i]),!e||!r)return null;let O=f!==null&&f.length>6e3,k=!m&&f!==null&&!O,ee=!m&&f!==null,te=async(e,t)=>{try{await a(e),x(t)}catch(e){C(e?.message||`Could not mark the changes as sent.`)}},ne=async()=>{if(!f)return;let e=E;C(null),await sr(f)?await te(e,`copied`):x(`copy-failed`)},re=async()=>{if(!f)return;let e=E;C(null);try{cr(wr(`changes`,new Date),f+`
12
+ `)}catch(e){C(e?.message||`Could not save the file.`);return}await te(e,`downloaded`)},A=e=>{s(e),ar(`translator-name`,e===``?null:e)};return(0,y.jsx)(`div`,{className:`fixed inset-0 z-50 bg-slate-950/80 backdrop-blur-sm flex items-center justify-center p-4`,children:(0,y.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-labelledby":`studio-send-title`,className:`bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg max-h-[90vh] overflow-y-auto p-6 shadow-2xl space-y-4`,children:[(0,y.jsx)(`h3`,{id:`studio-send-title`,className:`text-base font-bold text-slate-200 font-outfit`,children:`Send to developer`}),(0,y.jsxs)(`label`,{className:`block space-y-1`,children:[(0,y.jsx)(`span`,{className:`text-[11px] font-semibold text-slate-400`,children:`Your name`}),(0,y.jsx)(`input`,{id:`studio-send-name`,type:`text`,dir:`auto`,maxLength:80,value:o,onChange:e=>A(e.target.value),className:`w-full h-9 px-3 rounded-xl bg-slate-950 border border-slate-800 text-xs text-slate-200 focus:outline-none focus:border-indigo-500`})]}),(0,y.jsxs)(`label`,{className:`block space-y-1`,children:[(0,y.jsx)(`span`,{className:`text-[11px] font-semibold text-slate-400`,children:`Note for the developer (optional)`}),(0,y.jsx)(`textarea`,{id:`studio-send-note`,dir:`auto`,rows:2,maxLength:500,value:c,onChange:e=>l(e.target.value),className:`w-full px-3 py-2 rounded-xl bg-slate-950 border border-slate-800 text-xs text-slate-200 focus:outline-none focus:border-indigo-500 resize-none`})]}),T>0&&(0,y.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-slate-300`,children:[(0,y.jsx)(`input`,{type:`checkbox`,checked:u,onChange:e=>d(e.target.checked)}),`Also include ${Pr(T)} already sent`]}),E.length===0?(0,y.jsx)(`p`,{className:`text-xs text-slate-500`,children:Nr}):(0,y.jsx)(`ul`,{"data-testid":`send-dialog-changes`,className:`max-h-48 overflow-y-auto space-y-1.5`,children:E.map(e=>(0,y.jsxs)(`li`,{className:`px-3 py-2 rounded-xl bg-slate-950/40 border border-slate-800/80 space-y-1`,children:[(0,y.jsx)(`span`,{className:`block text-[11px] font-mono text-indigo-400 break-all`,children:`${e.key} · ${e.locale}`}),(0,y.jsxs)(`div`,{className:`text-[10px] leading-relaxed`,children:[e.from?(0,y.jsx)(`span`,{dir:`auto`,className:`text-rose-400/80 line-through break-all`,children:e.from}):(0,y.jsx)(`em`,{className:`text-rose-400/80 line-through`,children:`empty`}),(0,y.jsx)(`span`,{className:`text-slate-600`,children:` → `}),e.to?(0,y.jsx)(`span`,{dir:`auto`,className:`text-emerald-300 break-all`,children:e.to}):(0,y.jsx)(`em`,{className:`text-emerald-300`,children:`empty`})]})]},`${e.locale}/${e.key}`))}),D>0&&(0,y.jsx)(`p`,{className:`text-xs text-amber-300`,children:`${E.length} of ${E.length+D} changes are in this link. Send again for the rest.`}),_&&(0,y.jsx)(`p`,{className:`text-xs text-rose-400 break-words`,children:_}),f!==null&&!O&&(0,y.jsx)(`input`,{id:`studio-send-link`,"data-testid":`change-link`,type:`text`,readOnly:!0,value:f,onFocus:e=>e.currentTarget.select(),className:`w-full h-9 px-3 rounded-xl bg-slate-950 border border-slate-800 text-[11px] font-mono text-slate-300`}),O&&(0,y.jsx)(`p`,{className:`text-xs text-amber-300`,children:Mr}),(0,y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,y.jsx)(`button`,{id:`studio-send-copy`,onClick:ne,disabled:!k,className:`${Fr} text-indigo-100 bg-indigo-600 hover:bg-indigo-500 border-indigo-500`,children:`Copy link`}),(0,y.jsx)(`button`,{id:`studio-send-download`,onClick:re,disabled:!ee,className:`${Fr} text-slate-300 hover:text-slate-100 bg-slate-800 hover:bg-slate-700 border-slate-700`,children:`Download file`}),(0,y.jsx)(`button`,{onClick:t,className:`${Fr} ml-auto text-slate-400 hover:text-slate-200 bg-slate-800 border-slate-800 hover:border-slate-700`,children:`Close`})]}),b===`copied`&&(0,y.jsx)(`p`,{role:`status`,className:`text-xs text-emerald-300`,children:kr}),b===`downloaded`&&(0,y.jsx)(`p`,{role:`status`,className:`text-xs text-emerald-300`,children:jr}),b===`copy-failed`&&(0,y.jsxs)(`div`,{role:`status`,className:`space-y-2`,children:[(0,y.jsx)(`p`,{className:`text-xs text-amber-300`,children:Ar}),(0,y.jsx)(`button`,{onClick:()=>te(E,`copied`),className:`${Fr} text-slate-300 hover:text-slate-100 bg-slate-800 hover:bg-slate-700 border-slate-700`,children:`I copied it`})]}),S&&(0,y.jsx)(`p`,{className:`text-xs text-rose-400 break-words`,children:S})]})})},Lr=/\u200C(?:[\u200B\u200D]{8})+\u200C/g;function Rr(e){Lr.lastIndex=0;let t=Lr.test(e);return Lr.lastIndex=0,t}var zr={...Le,forced:`Saved with “Save anyway”.`,"new-key":`Adds a key the source locale does not have.`};function Br(e,t){let n=t.indexOf(`.`);if(n===-1)return!1;let r=t.slice(0,n);if(!Object.prototype.hasOwnProperty.call(e,r))return!1;let i=e[r];return typeof i==`object`&&!!i&&!Array.isArray(i)}function Vr(e,t,n){let{locale:r,key:i,from:a,to:o,force:s}=e,c={locale:r,key:i,from:a,to:o,force:s},l=(e,t)=>({...c,status:`invalid`,code:e,message:t,flags:[]}),u=t.targets.get(r);if(!u)return l(`UNKNOWN_LOCALE`,`No "${r}" locale file on the target.`);if(u.layout===`namespaced`&&!Br(u.dict,i))return l(`UNKNOWN_NAMESPACE`,`"${i}" is not in an existing namespace file of ${r}.`);if(Rr(o))return l(`CONTAINS_WATERMARK`,`The new text contains LiveLocale watermark characters.`);let d={sourceLocale:t.sourceLocale,source:n,target:u.dict},f=Fe(i,d),p=[],m=e=>({...c,...e,flags:[...p,...Ge(f??a??void 0,o)]}),h=je(u.dict,i);if(h.state===`string`&&h.value===o)return m({status:`already`,current:h.value});let g=Ie({locale:r,key:i,value:o},d,{force:!1});if(!g.ok){if(g.status!==422||!s)return l(g.code,g.error);if(!t.allowForce)return m({status:`needs-force`,code:g.code,message:g.error});p.push(`forced`)}let _=h.state===`string`?h.value:void 0;return _===void 0?a===null?(f===null&&p.push(`new-key`),m({status:`apply`})):m({status:`conflict`,code:`REMOVED_ON_TARGET`,message:`Removed on the target since the link was made.`}):m(_===a?{status:`apply`}:{status:`conflict`,code:`CHANGED_ON_TARGET`,message:`Changed on the target since the link was made.`,current:_})}function Hr(e){let t=e.targets.get(e.sourceLocale);if(!t)throw Error(`Source locale "${e.sourceLocale}" has no locale file on the target.`);let n=e.edits.map(n=>Vr(n,e,t.dict)),r={apply:0,already:0,conflict:0,invalid:0,"needs-force":0};for(let e of n)r[e.status]+=1;return{edits:n,counts:r}}var Ur={apply:`Ready`,already:`Already applied`,conflict:`Changed since`,invalid:`Invalid`,"needs-force":`Saved with “Save anyway”`};function Wr(e){let t=[];e.status===`invalid`&&e.message&&t.push({level:`error`,message:e.message}),e.status===`needs-force`&&e.message&&t.push({level:`warning`,message:`${e.message} Saved with “Save anyway”.`});for(let n of e.flags)t.push({level:`warning`,message:zr[n]});return t}function Gr(e){let{edits:t}=Hr({edits:e.set.edits,sourceLocale:e.sourceLocale,targets:e.targets,allowForce:e.allowForce===!0});return t.map(e=>({...e,id:`${e.locale}\u0000${e.key}`,checks:Wr(e)}))}function Kr(e){let t={apply:0,already:0,conflict:0,invalid:0,"needs-force":0};for(let n of e)t[n.status]+=1;return t}var qr=`npx livelocale apply --clipboard --pr`;function Jr(e){let t=`npx livelocale apply "${e}" --pr`;return t.length>8e3?qr:t}var Yr=`This change link cannot be opened:`,Xr=`Run it in the repository. It opens a pull request with your git and gh, on any git host.`,Zr=`Copied.`,Qr=`Copy did not work in this browser. Select the text above and copy it.`,$r=[`apply`,`already`,`conflict`,`needs-force`,`invalid`],ei={apply:`text-emerald-300`,already:`text-slate-400`,conflict:`text-amber-300`,"needs-force":`text-amber-300`,invalid:`text-rose-300`},ti=()=>{},ni=`h-8 px-3 rounded-xl text-[11px] font-semibold border transition duration-150 text-slate-300 hover:text-slate-100 bg-slate-800 hover:bg-slate-700 border-slate-700`,ri=({value:e})=>e===null||e===``?(0,y.jsx)(`em`,{className:`text-slate-500`,children:`empty`}):(0,y.jsx)(`span`,{dir:`auto`,className:`break-all whitespace-pre-wrap`,children:e}),ii=({row:e})=>oe(e.to)===null?(0,y.jsx)(ri,{value:e.to}):(0,y.jsx)(M,{disabled:!0,locale:e.locale,value:e.to,onChange:ti}),ai=({review:e,error:t,isLoading:n,focusKey:r,onSelectLocale:i,onClose:a,studioHref:o,actions:s,className:c=`w-[420px] shrink-0`})=>{let[l,u]=(0,g.useState)(null),d=(0,g.useRef)(null),f=(0,g.useMemo)(()=>e?Cr(o,e.token):null,[e,o]),p=f===null?null:Jr(f),m=(0,g.useMemo)(()=>e?Kr(e.rows):null,[e]),h=e?.rows.find(e=>e.key===r)?.id??null;(0,g.useEffect)(()=>u(null),[e]),(0,g.useEffect)(()=>{d.current?.scrollIntoView?.({block:`nearest`})},[h]);let _=async e=>{u(await sr(e)?Zr:Qr)},v=e?.set.by??``,b=e?.set.note??``;return(0,y.jsxs)(`section`,{"data-testid":`review-panel`,className:`${c} bg-slate-900 border border-slate-800 rounded-2xl flex flex-col h-full shadow-2xl overflow-hidden`,children:[(0,y.jsxs)(`div`,{className:`h-14 bg-slate-950 border-b border-slate-800 flex items-center justify-between px-6 shrink-0 select-none`,children:[(0,y.jsx)(`h2`,{className:`text-sm font-bold tracking-wide font-outfit text-slate-200`,children:`Review`}),(0,y.jsx)(`button`,{type:`button`,onClick:a,className:`text-[11px] font-semibold text-slate-400 hover:text-slate-100 transition duration-150`,children:`Close review`})]}),(0,y.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-4 space-y-4 select-text`,children:[t!==null&&(0,y.jsx)(er,{title:Yr,problems:[t]}),n&&e===null&&(0,y.jsx)(`p`,{className:`text-xs text-slate-400`,children:`Opening the change link…`}),e&&m&&f&&p&&(0,y.jsxs)(y.Fragment,{children:[(v!==``||b!==``)&&(0,y.jsx)(`p`,{"data-testid":`review-note`,dir:`auto`,className:`px-3 py-2 rounded-xl bg-slate-950/60 border border-slate-800 text-xs text-slate-300 whitespace-pre-wrap break-words`,children:`From ${v||`the translator`}${b===``?``:`: ${b}`}`}),(0,y.jsx)(`ul`,{"data-testid":`review-summary`,className:`flex flex-wrap gap-2 text-[11px]`,children:$r.filter(e=>m[e]>0).map(e=>(0,y.jsx)(`li`,{className:`px-2.5 py-1 rounded-full bg-slate-950 border border-slate-800 ${ei[e]}`,children:`${m[e]} ${Ur[e]}`},e))}),s,(0,y.jsxs)(`div`,{className:`space-y-2 px-3 py-3 rounded-xl bg-slate-950/40 border border-slate-800`,children:[(0,y.jsx)(`h3`,{className:`text-xs font-semibold text-slate-200`,children:`Apply with the command line`}),(0,y.jsx)(`code`,{"data-testid":`review-apply-command`,className:`block px-3 py-2 rounded-lg bg-slate-950 border border-slate-800 text-[11px] font-mono text-slate-300 break-all`,children:p}),(0,y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,y.jsx)(`button`,{type:`button`,onClick:()=>_(p),className:ni,children:`Copy command`}),p===qr&&(0,y.jsx)(`button`,{type:`button`,onClick:()=>_(f),className:ni,children:`Copy link`}),l&&(0,y.jsx)(`span`,{className:`text-[11px] text-slate-400`,children:l})]}),(0,y.jsx)(`p`,{className:`text-[11px] text-slate-500`,children:Xr})]}),(0,y.jsxs)(`table`,{className:`w-full text-[11px] text-left border-collapse`,children:[(0,y.jsx)(`thead`,{className:`text-slate-500`,children:(0,y.jsxs)(`tr`,{children:[(0,y.jsx)(`th`,{className:`py-1 pr-2 font-semibold`,children:`Language`}),(0,y.jsx)(`th`,{className:`py-1 pr-2 font-semibold`,children:`Key`}),(0,y.jsx)(`th`,{className:`py-1 pr-2 font-semibold`,children:`Before`}),(0,y.jsx)(`th`,{className:`py-1 pr-2 font-semibold`,children:`After`}),(0,y.jsx)(`th`,{className:`py-1 font-semibold`,children:`Check`})]})}),(0,y.jsx)(`tbody`,{className:`text-slate-300 align-top`,children:e.rows.map(e=>{let t=e.id===h;return(0,y.jsxs)(`tr`,{ref:t?d:void 0,"aria-current":t?`true`:void 0,className:`border-t border-slate-800 ${t?`bg-indigo-600/10`:``}`,children:[(0,y.jsx)(`td`,{className:`py-2 pr-2`,children:(0,y.jsx)(`button`,{type:`button`,onClick:()=>i(e.locale),title:`Show the page in ${e.locale}`,className:`font-mono text-indigo-300 hover:text-indigo-100 underline-offset-2 hover:underline`,children:e.locale})}),(0,y.jsx)(`td`,{className:`py-2 pr-2 font-mono text-indigo-400 break-all`,children:e.key}),(0,y.jsxs)(`td`,{className:`py-2 pr-2`,children:[(0,y.jsx)(ri,{value:e.from}),e.status===`conflict`&&e.current!==void 0&&(0,y.jsxs)(`p`,{className:`mt-1 text-amber-300`,children:[`Now on the site: `,(0,y.jsx)(`span`,{dir:`auto`,className:`break-all whitespace-pre-wrap`,children:e.current})]})]}),(0,y.jsx)(`td`,{className:`py-2 pr-2`,children:(0,y.jsx)(ii,{row:e})}),(0,y.jsxs)(`td`,{className:`py-2`,children:[(0,y.jsx)(`span`,{className:`font-semibold ${ei[e.status]}`,children:Ur[e.status]}),e.checks.length>0&&(0,y.jsx)(`ul`,{className:`mt-1 space-y-0.5`,children:e.checks.map(e=>(0,y.jsx)(`li`,{className:e.level===`error`?`text-rose-300`:`text-amber-300`,children:e.message},e.message))})]})]},e.id)})})]})]})]})]})},oi=`studio-drawer-keys`,si=`studio-drawer-side`,ci=`absolute inset-y-0 z-30 w-[min(400px,45vw)] p-2`,li=e=>`px-3 py-1.5 rounded-xl border text-[11px] font-semibold transition duration-150 ${e?`bg-indigo-600/20 border-indigo-500 text-indigo-300`:`bg-slate-900 border-slate-800 text-slate-300 hover:text-slate-100 hover:border-slate-700`}`,ui=({isWide:e,keys:t,viewer:n,side:r,sideLabel:i,openPanel:a,onOpenPanelChange:o,toolbar:s})=>{let c=e?null:a;(0,g.useEffect)(()=>{if(c===null)return;let e=e=>{e.key===`Escape`&&o(null)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[c,o]);let l=e=>o(a===e?null:e);return(0,y.jsxs)(`main`,{className:`flex-1 flex overflow-hidden min-h-0 bg-linear-to-b from-[#0b0f19] to-[#070a10] ${e?`gap-6 p-6`:`relative gap-0 p-2`}`,children:[(0,y.jsx)(`div`,{id:oi,"data-testid":oi,className:e?`h-full shrink-0`:`${ci} left-0`,hidden:!e&&c!==`keys`,children:t}),(0,y.jsxs)(`div`,{className:`flex-1 min-w-0 h-full flex flex-col gap-2`,children:[!e&&(0,y.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0 select-none`,children:[(0,y.jsx)(`button`,{type:`button`,"data-testid":`studio-toggle-keys`,"aria-expanded":c===`keys`,"aria-controls":oi,onClick:()=>l(`keys`),className:li(c===`keys`),children:`Keys`}),(0,y.jsx)(`button`,{type:`button`,"data-testid":`studio-toggle-side`,"aria-expanded":c===`side`,"aria-controls":si,onClick:()=>l(`side`),className:li(c===`side`),children:i}),s]}),n]}),(0,y.jsx)(`div`,{id:si,"data-testid":si,className:e?`h-full shrink-0`:`${ci} right-0`,hidden:!e&&c!==`side`,children:r})]})},di=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);function L(e,t={}){let n;try{n=new URL(e,`http://localhost`)}catch{return null}let r=n.searchParams.get(`locale`),{basePath:i,locales:a}=t;if(!a){if(r)return r;let e=n.pathname.split(`/`)[1];return e&&e.length===2?e:null}let o=e=>{if(!e)return null;let t=e.toLowerCase();return a.find(e=>e.toLowerCase()===t)??null},s=o(r);if(s)return s;let c=i??`/`;return n.pathname.startsWith(c)?o(n.pathname.slice(c.length).split(`/`)[0]):null}function fi(e){return e.normalize(`NFC`).replace(/\s+/g,` `).trim().toLowerCase()}function pi(e,t,n){let r=new Set(t.map(fi).filter(e=>e!==``));if(r.size===0)return[];let i=[];for(let t of Object.keys(n)){let a=n[t];!a||!di(a,e)||(a[e]??[]).some(e=>r.has(fi(e)))&&i.push(t)}return i.sort()}function mi(e,t){let n=new Map;for(let{key:r,text:i}of e)for(let e of pi(r,[i],t))n.set(e,(n.get(e)??0)+1);let r=Math.max(0,...n.values());return r===0?[]:[...n.keys()].filter(e=>n.get(e)===r).sort()}function hi(e,t,n){let{locale:r,source:i}=t;return i===`manual`?{locale:r,source:i}:e.length===1?{locale:e[0],source:`content`}:e.length>1?i!==null&&e.includes(r)?{locale:r,source:i}:{pick:[...e]}:i===null?{pick:[...n]}:{locale:r,source:i}}function gi(e,t){return t.source===`manual`||e===null?t:{locale:e,source:`url`}}function _i(e,t){return t.source===`manual`?t:e.length===1?{locale:e[0],source:`content`}:t.source===`remembered`&&e.includes(t.locale)?{locale:t.locale,source:`content`}:t}function vi(e,t){if(t.source!==`manual`||e.length!==1)return null;let n=e[0];return n===t.locale?null:n}function yi(e){return e.source===`content`||e.source===`url`||e.source===`manual`}function bi(e){let t=[];for(let n of e){if(t.length>=100)break;if(!n||typeof n!=`object`)continue;let{key:e,text:r}=n;typeof e==`string`&&typeof r==`string`&&t.push({key:e,text:r})}return t}var xi=e=>{let[t,n]=(0,g.useState)(`connecting`),[r,i]=(0,g.useState)(`/`),[a,o]=(0,g.useState)(null),s=(0,g.useRef)(null),c=(0,g.useRef)(e);return c.current=e,(0,g.useEffect)(()=>{let e=e=>{if(e.origin!==Gt()||e.data?.source!==`livelocale-client`)return;let{type:t,payload:r}=e.data;if(t===`READY`){n(`connected`),i(r.url||`/`),o(null);let e=L(r.url||`/`,qt());e&&c.current.onLocaleDetected(e)}else t===`ELEMENT_SELECTED`?c.current.onElementSelected(r):t===`ERROR`?c.current.onError(r.error||`Client-side error occurred.`):t===`VISIBLE_KEYS_CHANGED`?Array.isArray(r)&&o(r):t===`VISIBLE_TEXTS_CHANGED`&&Array.isArray(r)&&c.current.onVisibleTexts?.(bi(r))};return window.addEventListener(`message`,e),()=>{window.removeEventListener(`message`,e)}},[]),{connectionStatus:t,currentPath:r,visibleKeys:a,iframeRef:s,sendToIframe:(0,g.useCallback)((e,t)=>{s.current&&s.current.contentWindow&&s.current.contentWindow.postMessage({source:`livelocale-studio`,type:e,payload:t},Gt())},[])}};function Si(e,t=``){let n={};if(!e||typeof e!=`object`)return n;for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)){let i=t?`${t}.${r}`:r;typeof e[r]==`object`&&e[r]!==null&&!Array.isArray(e[r])?Object.assign(n,Si(e[r],i)):n[i]=String(e[r])}return n}var Ci=({connectionStatus:e,iframeRef:t,referenceLocale:n=`en`})=>{let[r,i]=(0,g.useState)(`en`),[a,o]=(0,g.useState)([]),[s,c]=(0,g.useState)([]),[l,u]=(0,g.useState)([]),[d,f]=(0,g.useState)({}),[p,m]=(0,g.useState)(null),[h,_]=(0,g.useState)({}),v=(0,g.useCallback)(async e=>{try{let t=await pn();Array.isArray(t)&&(o(t),e&&t.length>0&&i(e=>t.includes(e)?e:t.includes(`en`)?`en`:t[0]||`en`))}catch(e){console.warn(`[livelocale] Failed to fetch locales list:`,e.message)}},[]),y=(0,g.useCallback)(async()=>{try{let e=await mn();e&&Array.isArray(e.allKeys)&&c(e.allKeys),e&&Array.isArray(e.codeKeys)&&u(e.codeKeys)}catch(e){console.warn(`[livelocale] Failed to fetch keys metadata:`,e.message)}},[]),b=(0,g.useCallback)(async e=>{try{f(Si(await hn(e))),m(e)}catch(e){console.warn(`[livelocale] Failed to load full locale dictionary:`,e.message)}},[]);(0,g.useEffect)(()=>{e===`connected`&&(v(!0),y())},[e,v,y]),(0,g.useEffect)(()=>{e===`connected`&&r&&b(r)},[e,r,b]),(0,g.useEffect)(()=>{e===`connected`&&hn(n).then(e=>_(Si(e))).catch(e=>console.warn(`[livelocale] Failed to load reference locale:`,e.message))},[e,n]),(0,g.useEffect)(()=>{r===n&&_(d)},[r,d,n]);let x=(0,g.useCallback)(e=>{if(i(e),t.current&&t.current.contentWindow)try{let n=new URL(t.current.src);n.searchParams.set(`locale`,e),t.current.src=n.toString()}catch{}},[t]),S=(0,g.useCallback)(async()=>{await v(),await y(),await b(r)},[v,y,b,r]),C=(0,g.useCallback)((e,t)=>{f(n=>({...n,[e]:t}))},[]),w=s.length,T=s.filter(e=>{let t=d[e];return t!==void 0&&t.trim()!==``}).length;return{locale:r,setLocale:i,locales:a,allKeys:s,codeKeys:l,localeData:d,dataLocale:p,enLocaleData:h,coveragePercentage:w>0?Math.round(T/w*100):100,handleLocaleChange:x,fetchLocales:v,fetchKeysMetadata:y,fetchLocaleData:b,refreshAll:S,updateLocaleDataCache:C}},wi=({localeData:e,enLocaleData:t,sendToIframe:n,locale:r,refreshKeysMetadata:i,updateLocaleDataCache:a,setLoading:o,setError:s,onSaved:c})=>{let[l,u]=(0,g.useState)(null),[d,f]=(0,g.useState)(``),[p,m]=(0,g.useState)(!1),[h,_]=(0,g.useState)(null),[v,y]=(0,g.useState)(0),b=(0,g.useRef)(null);(0,g.useEffect)(()=>()=>{b.current&&clearTimeout(b.current)},[]);let[x,S]=(0,g.useState)(!1),[C,w]=(0,g.useState)(null),T=l!==null&&d!==l.currentValue,E=(0,g.useCallback)(e=>{f(e),_(null),n(`APPLY_PREVIEW`,{key:l?.key,value:e})},[n,l?.key]),D=(0,g.useCallback)(t=>{if(T){w(t),S(!0);return}let n=e[t.key]??t.currentValue;u({...t,currentValue:n}),y(e=>e+1),f(n),m(!1),_(null),s(null)},[T,e,s]),O=(0,g.useCallback)(()=>{if(C){let t=e[C.key]??C.currentValue;u({...C,currentValue:t}),y(e=>e+1),f(t)}else u(null),f(``),n(`CLEAR_SELECTION`);w(null),S(!1),m(!1),s(null)},[C,e,n,s]),k=(0,g.useCallback)(()=>{w(null),S(!1)},[]),ee=(0,g.useCallback)(t=>{let n=e[t]||``;D({key:t,fallbackValue:n,currentValue:n})},[e,D]);return(0,g.useEffect)(()=>{if(l){let n=e[l.key]||``,r=t[l.key]||l.fallbackValue||``;l.currentValue!==n&&(u(e=>e?{...e,currentValue:n,fallbackValue:r}:null),f(n))}},[e,t]),{selected:l,selectionCount:v,inputValue:d,isSuccess:p,showConfirmModal:x,hasUnsavedChanges:T,selectElement:D,confirmDiscard:O,cancelDiscard:k,selectKeyDirectly:ee,handleInputChange:E,handleSave:async(e={})=>{if(l){o(!0),m(!1),s(null);try{let o=l.currentValue,s=r===`en`?o:t[l.key]??l.fallbackValue;await _n(r,l.key,d,{reference:s||void 0,force:e.force}),_(null),m(!0),c?.({locale:r,key:l.key,previousValue:o,nextValue:d}),u(e=>e?{...e,currentValue:d}:null),a(l.key,d),i(),n(`COMMIT_PREVIEW`,{key:l.key,value:d}),n(`CLEAR_SELECTION`),b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{m(!1),b.current=null},2e3)}catch(e){e instanceof $t?_({code:e.code,message:e.message,missing:e.details.missing,extra:e.details.extra}):s(e.message||`Failed to save translation.`)}finally{o(!1)}}},handleClearSelection:(0,g.useCallback)(()=>{if(T){w(null),S(!0);return}u(null),f(``),n(`CLEAR_SELECTION`)},[T,n]),saveWarning:h,dismissSaveWarning:()=>_(null)}},Ti=({locale:e,locales:t,handleLocaleChange:n,refreshAll:r,handleClearSelection:i,setLoading:a,setError:o})=>({handleAddLocale:(0,g.useCallback)(async e=>{try{a(!0),o(null),await vn(e),await r(),n(e)}catch(e){o(e.message||`Failed to add locale.`)}finally{a(!1)}},[r,n,a,o]),handleRenameLocale:(0,g.useCallback)(async(t,i)=>{try{a(!0),o(null),await yn(t,i),await r(),e===t&&n(i)}catch(e){o(e.message||`Failed to rename locale.`)}finally{a(!1)}},[e,r,n,a,o]),handleDeleteLocale:(0,g.useCallback)(async s=>{try{a(!0),o(null),await bn(s);let c=t.filter(e=>e!==s),l=`en`;c.length>0&&(l=c.includes(`en`)?`en`:c[0]||`en`),await r(),e===s&&(n(l),i())}catch(e){o(e.message||`Failed to delete locale.`)}finally{a(!1)}},[t,e,r,n,i,a,o])}),Ei=({allKeys:e,visibleKeys:t,localeData:n})=>{let[r,i]=(0,g.useState)(``),[a,o]=(0,g.useState)(!1);return{searchTerm:r,setSearchTerm:i,filterPageOnly:a,setFilterPageOnly:o,filteredKeys:(0,g.useMemo)(()=>e.filter(e=>{if(a&&t!==null&&!t.includes(e))return!1;let i=n[e]||``;return e.toLowerCase().includes(r.toLowerCase())||i.toLowerCase().includes(r.toLowerCase())}),[e,t,n,r,a])}},Di=({connectionStatus:e,onAfterDiscard:t})=>{let[n,r]=(0,g.useState)(null),[i,a]=(0,g.useState)(!1),[o,s]=(0,g.useState)(null),[c,l]=(0,g.useState)(null),u=(0,g.useCallback)(async()=>{try{r(await gn())}catch(e){s(e.message||`Failed to read git status.`)}},[]);return(0,g.useEffect)(()=>{e===`connected`&&u()},[e,u]),{git:n,isLoading:i,error:o,lastCommit:c,refresh:u,commit:(0,g.useCallback)(async e=>{a(!0),s(null);try{let t=await xn(e);return l(t.hash),await u(),t.hash}catch(e){s(e.message||`Commit failed.`);return}finally{a(!1)}},[u]),discard:(0,g.useCallback)(async()=>{a(!0),s(null);try{return await Sn(),await t(),await u(),!0}catch(e){return s(e.message||`Discard failed.`),!1}finally{a(!1)}},[t,u]),clearError:()=>s(null)}},Oi=200,ki=0,Ai=()=>{let[e,t]=(0,g.useState)([]);return{entries:e,record:(0,g.useCallback)(e=>{ki+=1;let n={...e,id:`${Date.now()}-${ki}`,at:Date.now()};t(e=>[n,...e].slice(0,Oi))},[]),remove:(0,g.useCallback)(e=>{t(t=>t.filter(t=>t.id!==e))},[]),clear:(0,g.useCallback)(()=>t([]),[])}},ji=()=>{let[e,t]=(0,g.useState)(()=>nn()),[n,r]=(0,g.useState)(!1),[i,a]=(0,g.useState)(0);return(0,g.useEffect)(()=>{let e=()=>r(!0);return window.addEventListener(Zt,e),()=>window.removeEventListener(Zt,e)},[]),{token:e,needsToken:n,tokenVersion:i,submitToken:(0,g.useCallback)(e=>{let n=e.trim();n&&(rn(n),t(n),r(!1),a(e=>e+1))},[]),clearToken:(0,g.useCallback)(()=>{rn(null),t(null),a(e=>e+1)},[])}};function Mi(e){(0,g.useEffect)(()=>{if(!e)return;let t=e=>{e.preventDefault(),e.returnValue=``};return window.addEventListener(`beforeunload`,t),()=>window.removeEventListener(`beforeunload`,t)},[e])}function Ni(e){let{mode:t,locale:n,localeConfirmed:r,history:i,drafts:a}=e,o=new Map;if(t===`preview`)for(let e of[...i].reverse())e.locale===n&&o.set(e.key,e.nextValue);else if(t===`static`&&r)for(let e of a)e.locale===n&&o.set(e.key,e.to);return o}var Pi=`livelocale-target-locale:`;function Fi(e){try{return localStorage.getItem(Pi+e)}catch{return null}}function Ii(e,t){try{localStorage.setItem(Pi+e,t)}catch{}}var Li=({enabled:e,scope:t,locale:n,setLocale:r,setMenuLocale:i=r,locales:a,getCandidates:o})=>{let[s,c]=(0,g.useState)(null),[l,u]=(0,g.useState)(null),[d,f]=(0,g.useState)(null),p=(0,g.useRef)(n);p.current=n;let m=(0,g.useRef)(s);m.current=s;let h=(0,g.useRef)(null),_=(0,g.useRef)(null),v=()=>({locale:p.current,source:m.current}),y=e=>{let n=v();e.locale===n.locale&&e.source===n.source||(p.current=e.locale,m.current=e.source,r(e.locale),c(e.source),t!==null&&yi(e)&&Ii(t,e.locale))};(0,g.useEffect)(()=>{if(!e||t===null||_.current===t||m.current!==null)return;let n=Fi(t);n===null||!a.includes(n)||(_.current=t,p.current=n,m.current=`remembered`,r(n),c(`remembered`))},[e,t,a]);let b=t=>{if(!e){r(t);return}y(gi(t,v()))},x=async t=>{e&&y(_i(mi(t,await o()),v()))},S=async t=>{if(!e)return!0;let n=await o(),r=pi(t.key,[t.currentValue],n),i=v();u(vi(r,i));let s=hi(r,i,a);return`pick`in s?s.pick.length===0?!0:(h.current=t,f(s.pick),!1):(y(s),!0)},C=t=>!e||m.current!==null||a.length===0?!0:(h.current=t,f([...a]),!1),w=e=>{p.current=e,m.current=`manual`,r(e),c(`manual`),t!==null&&Ii(t,e),u(null),f(null);let n=h.current;return h.current=null,n},T=t=>{e?w(t):i(t)},E=(0,g.useCallback)(()=>{h.current=null,f(null)},[]);return{source:s,confirmed:yi({locale:n,source:s}),mismatch:l,pickerCandidates:d,onUrlLocale:b,onVisibleTexts:x,resolveForSelection:S,resolveForDirectPick:C,choose:w,onMenuLocale:T,cancelPick:E}},Ri=`More than 500 changes: send some of them first, then download the backup.`,zi=`No change link found in this file.`;async function Bi(e){let{drafts:t,manifest:n,studioHref:r,by:i}=e;if(t.length>500)throw Error(Ri);let a=await Tt(Sr({drafts:t,manifest:n,by:i}));return{fileName:wr(`backup`,e.now??new Date),text:Cr(r,a)+`
13
+ `}}async function Vi(e,t){let n;try{({edits:n}=await Et(e))}catch(e){return e instanceof N&&e.code===`NOT_FOUND`?zi:Or(e)}let{added:r,skipped:i}=await t.restoreDrafts(n);return`Restored ${r} changes (${i} already here).`}function Hi(e){let{transport:t}=e;return{undoDraft:async n=>{if(t){e.setIsUndoing(!0),e.setError(null);try{await e.discard(n);let r=je(await t.readBuiltLocale(n.locale),n.key),i=r.state===`string`?r.value:n.from??``;n.locale===e.locale&&(e.updateLocaleDataCache(n.key,i),e.sendToIframe(`COMMIT_PREVIEW`,{key:n.key,value:i}))}catch(t){e.setError(t?.message||`Undo failed.`)}finally{e.setIsUndoing(!1)}}},downloadBackup:async()=>{if(!t)return;let n=await Bi({drafts:e.drafts,manifest:t.manifest,studioHref:e.studioHref(),by:e.translatorName()??void 0});e.download(n.fileName,n.text)},restoreBackupFile:async e=>{if(!t)throw Error(`Backups work only on a share link.`);return Vi(await e.text(),t)}}}var Ui=`#lc1.`,Wi=`No change link found. A change link contains "lc1.".`,Gi=e=>`The source locale "${e}" could not be loaded.`;function Ki(e){let[t,n]=(0,g.useState)(null),[r,i]=(0,g.useState)(null),[a,o]=(0,g.useState)(!1),[s,c]=(0,g.useState)(null),l=(0,g.useRef)(e);l.current=e;let u=(0,g.useRef)(new Set),d=(0,g.useRef)(0),f=(0,g.useCallback)(async e=>{let t=++d.current,r=()=>t===d.current;i(null),o(!0);try{let t,a;try{t=await Et(e),a=nt(e)}catch(e){return r()&&i(e instanceof N&&e.code===`NOT_FOUND`?Wi:Or(e)),!1}let o=l.current,s=o.mode===`development`?`local`:`github`,d=o.sourceLocale??(o.locales.includes(t.src)?t.src:`en`),f=o.mode===`static`?o.layout:`flat`,p=[...new Set([...t.edits.map(e=>e.locale),d])],m=await Promise.allSettled(p.map(e=>o.readLocale(e))),h=new Map;if(p.forEach((e,t)=>{let n=m[t];h.set(e,n.status===`fulfilled`?{layout:f,dict:n.value}:null)}),!h.get(d))return r()&&i(Gi(d)),!1;let g=Gr({set:t,sourceLocale:d,targets:h});return r()?(u.current.add(a),c(null),n({token:a,set:t,rows:g,sourceLocale:d,target:s}),!0):!1}finally{r()&&o(!1)}},[]);return(0,g.useEffect)(()=>{if(e.mode===null)return;let t=()=>{let e=window.location.hash;if(!e.startsWith(Ui))return;let t=e.slice(1),n;try{n=nt(t)}catch{n=t}u.current.has(n)||(u.current.add(n),f(t))};return t(),window.addEventListener(`hashchange`,t),()=>window.removeEventListener(`hashchange`,t)},[e.mode,f]),(0,g.useEffect)(()=>{if(!(t===null||e.connectionStatus!==`connected`))for(let n of t.rows)n.locale!==e.locale||n.status===`invalid`||e.sendToIframe(`COMMIT_PREVIEW`,{key:n.key,value:n.to})},[t,e.connectionStatus,e.currentPath,e.visibleKeys,e.locale]),{review:t,error:r,isLoading:a,focusKey:s,setFocusKey:c,openReview:f,closeReview:(0,g.useCallback)(()=>{d.current++,n(null),i(null),c(null),o(!1),window.location.hash.startsWith(Ui)&&history.replaceState(null,``,window.location.pathname+window.location.search),l.current.reloadFrame()},[])}}var qi=()=>{let e=Wt();return e.kind===`server`?e.problems:[]},Ji=()=>{let[e,t]=(0,g.useState)(!1),[n,r]=(0,g.useState)(null),[i,a]=(0,g.useState)(!1),[o,s]=(0,g.useState)(!1),[c,l]=(0,g.useState)(!1),[u,d]=(0,g.useState)(null),[f,p]=(0,g.useState)(qi),m=ji(),h=(0,g.useRef)(()=>{}),_=(0,g.useRef)(()=>{}),v=(0,g.useRef)(()=>{}),y=(0,g.useRef)(()=>{}),{connectionStatus:b,currentPath:x,visibleKeys:S,iframeRef:C,sendToIframe:w}=xi({onElementSelected:e=>h.current(e),onLocaleDetected:e=>_.current(e),onError:e=>v.current(e),onVisibleTexts:e=>y.current(e)}),{locale:T,setLocale:E,locales:D,allKeys:O,codeKeys:k,localeData:ee,dataLocale:te,enLocaleData:ne,coveragePercentage:re,handleLocaleChange:A,fetchKeysMetadata:ie,refreshAll:ae,updateLocaleDataCache:oe}=Ci({connectionStatus:b,iframeRef:C,referenceLocale:Kt()?.manifest.sourceLocale??`en`}),se=Ai(),j=Kt(),ce=Pn(j),M=Li({enabled:j!==null,scope:j?.scope??null,locale:T,setLocale:E,setMenuLocale:A,locales:D,getCandidates:async()=>j?j.textCandidates():{}}),le=M.onMenuLocale,{selected:ue,selectionCount:de,inputValue:fe,isSuccess:pe,showConfirmModal:me,selectElement:he,confirmDiscard:ge,cancelDiscard:_e,selectKeyDirectly:ve,handleInputChange:ye,handleSave:be,handleClearSelection:xe,saveWarning:Se,dismissSaveWarning:Ce}=wi({localeData:ee,enLocaleData:ne,sendToIframe:w,locale:T,refreshKeysMetadata:ie,updateLocaleDataCache:oe,setLoading:t,setError:r,onSaved:e=>{se.record(e),we.refresh()}}),we=Di({connectionStatus:b,onAfterDiscard:async()=>{se.clear(),xe(),await ae()}});(0,g.useEffect)(()=>{b===`connected`&&fn().then(e=>{d(e.mode),p([...qi(),...e.problems??[]])}).catch(()=>{})},[b,m.tokenVersion]);let Te=(0,g.useRef)(m.tokenVersion);(0,g.useEffect)(()=>{m.tokenVersion!==Te.current&&b===`connected`&&(ae(),we.refresh())},[m.tokenVersion]);let Ee=Ki({mode:u,locale:T,locales:D,sourceLocale:j?.manifest.sourceLocale??null,layout:j?.manifest.layout??`flat`,readLocale:j?e=>j.readBuiltLocale(e):e=>hn(e),connectionStatus:b,currentPath:x,visibleKeys:S,sendToIframe:w,reloadFrame:()=>{C.current&&(C.current.src=C.current.src)}}),{review:De}=Ee;(0,g.useEffect)(()=>{b!==`connected`||De!==null||Ni({mode:u,locale:T,localeConfirmed:M.confirmed,history:se.entries,drafts:ce.drafts}).forEach((e,t)=>w(`COMMIT_PREVIEW`,{key:t,value:e}))},[u,b,x,S,T,M.confirmed,se.entries,ce.drafts,De]);let[Oe,ke]=(0,g.useState)(null);(0,g.useEffect)(()=>{Oe===null||te!==T||(ke(null),he(Oe))},[Oe,te,T]);let Ae=e=>{if(!j){he(e);return}M.resolveForSelection(e).then(t=>{t&&ke(e)}).catch(e=>r(e?.message||`Could not tell which language to edit.`))},je=e=>{if(!j){ve(e);return}let t=ee[e]||``,n={key:e,fallbackValue:t,currentValue:t};M.resolveForDirectPick(n)&&ve(e)},Me=e=>{let t=M.choose(e);t&&ke(t)},Ne=ur(u===`static`&&!De);Mi(u===`static`&&ce.unsentCount>0&&!De);let Pe=async e=>{l(!0),r(null);try{await _n(e.locale,e.key,e.previousValue),e.locale===T&&(oe(e.key,e.previousValue),w(`COMMIT_PREVIEW`,{key:e.key,value:e.previousValue})),se.remove(e.id),await we.refresh()}catch(e){r(e.message||`Undo failed.`)}finally{l(!1)}},{undoDraft:Fe,downloadBackup:Ie,restoreBackupFile:Le}=Hi({transport:j,drafts:ce.drafts,locale:T,discard:ce.discard,updateLocaleDataCache:oe,sendToIframe:w,setError:r,setIsUndoing:l,studioHref:()=>window.location.href,translatorName:()=>ir(`translator-name`),download:cr});h.current=De?e=>Ee.setFocusKey(e.key):Ae,_.current=M.onUrlLocale,y.current=e=>{M.onVisibleTexts(e).catch(()=>{})},v.current=r;let{handleAddLocale:Re,handleRenameLocale:ze,handleDeleteLocale:Be}=Ti({locale:T,locales:D,handleLocaleChange:A,refreshAll:ae,handleClearSelection:xe,setLoading:t,setError:r}),{searchTerm:Ve,setSearchTerm:He,filterPageOnly:Ue,setFilterPageOnly:We,filteredKeys:Ge}=Ei({allKeys:O,visibleKeys:S,localeData:ee});return{selected:ue,selectionCount:de,inputValue:fe,locale:T,connectionStatus:b,isLoading:e,isSuccess:pe,error:n,currentPath:x,iframeRef:C,appOrigin:Gt(),appUrl:I(),showConfirmModal:me,localeData:ee,searchTerm:Ve,filteredKeys:Ge,coveragePercentage:re,setSearchTerm:He,selectKeyDirectly:je,handleInputChange:ye,handleLocaleChange:le,handleSave:be,handleClearSelection:xe,confirmDiscard:ge,cancelDiscard:_e,locales:D,handleAddLocale:Re,handleRenameLocale:ze,handleDeleteLocale:Be,allKeys:O,codeKeys:k,filterPageOnly:Ue,setFilterPageOnly:We,visibleKeys:S,isChangesOpen:i,toggleChanges:()=>a(e=>!e),closeChanges:()=>a(!1),git:we.git,gitError:we.error,isGitLoading:we.isLoading,lastCommit:we.lastCommit,commitChanges:we.commit,discardChanges:we.discard,refreshGit:we.refresh,history:se.entries,undoEntry:Pe,isUndoing:c,setupProblems:f,saveWarning:Se,handleForceSave:()=>be({force:!0}),dismissSaveWarning:Ce,drafts:ce.drafts,unsentCount:ce.unsentCount,sentCount:ce.sentCount,markDraftsSent:ce.markSent,isSendOpen:o,openSend:()=>s(!0),closeSend:()=>s(!1),undoDraft:Fe,downloadBackup:Ie,restoreBackupFile:Le,staticManifest:j?.manifest??null,targetLocale:j?{locale:T,source:M.source,mismatch:M.mismatch}:null,localePickerCandidates:M.pickerCandidates,chooseTargetLocale:Me,cancelLocalePick:M.cancelPick,showTips:Ne.showTips,dismissTips:Ne.dismiss,translatorName:Ne.name,setTranslatorName:Ne.setName,review:De,reviewError:Ee.error,isReviewLoading:Ee.isLoading,reviewFocusKey:Ee.focusKey,setReviewFocusKey:Ee.setFocusKey,openReview:Ee.openReview,closeReview:Ee.closeReview,selectReviewLocale:A,mode:u,needsToken:m.needsToken,submitToken:m.submitToken}},Yi=`(min-width: 1280px)`,Xi=e=>typeof window<`u`&&typeof window.matchMedia==`function`?window.matchMedia(e):null;function R(e,t){let[n,r]=(0,g.useState)(()=>Xi(e)?.matches??t);return(0,g.useEffect)(()=>{let n=Xi(e);if(!n){r(t);return}r(n.matches);let i=e=>r(e.matches);return n.addEventListener(`change`,i),()=>n.removeEventListener(`change`,i)},[e,t]),n}var z=()=>{let{selected:e,selectionCount:t,inputValue:n,locale:r,connectionStatus:i,isLoading:a,isSuccess:o,error:s,currentPath:c,iframeRef:l,appOrigin:u,appUrl:d,showConfirmModal:f,searchTerm:p,filteredKeys:m,localeData:h,coveragePercentage:_,setSearchTerm:v,selectKeyDirectly:b,handleInputChange:S,handleLocaleChange:C,handleSave:w,saveWarning:T,handleForceSave:E,dismissSaveWarning:D,handleClearSelection:O,confirmDiscard:k,cancelDiscard:ee,locales:te,handleAddLocale:ne,handleRenameLocale:re,handleDeleteLocale:A,filterPageOnly:ie,setFilterPageOnly:ae,visibleKeys:oe,isChangesOpen:se,toggleChanges:j,closeChanges:ce,git:M,gitError:le,isGitLoading:ue,lastCommit:de,commitChanges:fe,discardChanges:pe,refreshGit:me,history:he,undoEntry:ge,isUndoing:_e,mode:ve,needsToken:ye,submitToken:be,setupProblems:xe,drafts:Se,undoDraft:Ce,downloadBackup:we,restoreBackupFile:Te,unsentCount:De,sentCount:Oe,markDraftsSent:ke,staticManifest:Ae,isSendOpen:je,openSend:Me,closeSend:Ne,targetLocale:Pe,localePickerCandidates:Fe,chooseTargetLocale:Ie,cancelLocalePick:Le,showTips:Re,dismissTips:ze,translatorName:Be,setTranslatorName:Ve,review:He,reviewError:Ue,isReviewLoading:We,reviewFocusKey:Ge,closeReview:Ke,selectReviewLocale:qe}=Ji(),Je=R(Yi,!0),[N,Ye]=(0,g.useState)(null);(0,g.useEffect)(()=>{t>0&&Ye(`side`)},[t]);let Xe=He!==null||Ue!==null;(0,g.useEffect)(()=>{Xe&&Ye(`side`)},[Xe]);let Ze=(0,g.useCallback)(e=>{b(e),Ye(`side`)},[b]);return(0,y.jsxs)(`div`,{className:`w-screen h-screen flex flex-col bg-[#0b0f19] text-slate-100 font-sans select-none overflow-hidden antialiased`,children:[(0,y.jsx)(Qn,{isOpen:ye,onSubmit:be}),(0,y.jsx)(Ln,{coveragePercentage:_,mode:ve,changesCount:ve===`static`?Se.length:M?.changes.length??0,isChangesOpen:se,onToggleChanges:j,unsentCount:De,targetLocale:Pe,locales:te,onChooseLocale:Ie,canSend:De+Oe>0,onSend:ve===`static`?Me:void 0,reviewCount:He?He.rows.length:null,onCloseReview:Ke}),(0,y.jsx)(Zn,{isOpen:se,onClose:ce,git:M,gitError:le,isGitLoading:ue,lastCommit:de,onCommit:fe,onDiscard:pe,onRefresh:me,history:he,onUndo:ge,isUndoing:_e,drafts:ve===`static`?Se:void 0,onUndoDraft:Ce,onDownloadBackup:we,onRestoreBackup:Te}),(0,y.jsx)(er,{problems:xe}),(0,y.jsx)(ui,{isWide:Je,openPanel:N,onOpenPanelChange:Ye,sideLabel:Xe?`Review`:`Editor`,keys:(0,y.jsx)(zn,{className:Je?void 0:`w-full`,filteredKeys:m,selected:e,localeData:h,searchTerm:p,setSearchTerm:v,filterPageOnly:ie,setFilterPageOnly:ae,visibleKeys:oe,selectKeyDirectly:Ze}),viewer:Jt()?(0,y.jsx)(`section`,{"data-testid":`app-preview-blocked`,className:`flex-1 flex items-center justify-center h-full bg-slate-900 border border-slate-800 rounded-2xl p-6 text-center text-sm text-slate-400`,children:`The app preview is unavailable until the setup problem above is fixed.`}):(0,y.jsx)(x,{iframeRef:l,appOrigin:u,appUrl:d,connectionStatus:i,currentPath:c}),side:Xe?(0,y.jsx)(ai,{className:Je?void 0:`w-full`,review:He,error:Ue,isLoading:We,focusKey:Ge,onSelectLocale:qe,onClose:Ke,studioHref:window.location.href}):(0,y.jsx)(Ee,{className:Je?void 0:`w-full`,selected:e,inputValue:n,locale:r,isLoading:a,isSuccess:o,error:s,onInputChange:S,onLocaleChange:C,onSave:()=>w(),saveWarning:T,onForceSave:E,onDismissWarning:D,onClear:O,locales:te,onAddLocale:ne,onRenameLocale:re,onDeleteLocale:A})}),(0,y.jsx)(Rn,{showConfirmModal:f,onConfirm:k,onCancel:ee}),(0,y.jsx)(Ir,{isOpen:ve===`static`&&je,onClose:Ne,drafts:Se,manifest:Ae,studioHref:window.location.href,onMarkSent:ke}),(0,y.jsx)(dr,{open:Re,name:Be,onNameChange:Ve,onDismiss:ze}),(0,y.jsx)(tr,{candidates:Fe,onChoose:Ie,onCancel:Le})]})},Zi=`livelocale-drafts`,B=`drafts`,Qi=3e3,$i=`scope`;function ea(e){return e.sort((e,t)=>t.updatedAt-e.updatedAt)}function ta(e){return new Promise((t,n)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>n(e.error??Error(`IndexedDB request failed`))})}function na(e){return new Promise((t,n)=>{e.oncomplete=()=>t(),e.onerror=()=>n(e.error??Error(`IndexedDB transaction failed`)),e.onabort=()=>n(e.error??Error(`IndexedDB transaction aborted`))})}function ra(e){let t=()=>e.transaction(B,`readonly`).objectStore(B),n=async t=>{let n=e.transaction(B,`readwrite`),r=na(n);t(n.objectStore(B)),await r};return{persistent:!0,async get(e,n,r){return await ta(t().get([e,n,r]))},put(e){return n(t=>t.put(e))},delete(e,t,r){return n(n=>n.delete([e,t,r]))},async list(e){return ea(await ta(t().index($i).getAll(e)))}}}function ia(e){return new Promise((t,n)=>{let r=!1,i=setTimeout(()=>{r=!0,n(Error(`IndexedDB did not open in time`))},Qi),a=e=>{r||(r=!0,clearTimeout(i),n(e))},o;try{o=e.open(Zi,1)}catch(e){a(e);return}o.onupgradeneeded=()=>{let e=o.result;e.objectStoreNames.contains(`drafts`)||e.createObjectStore(B,{keyPath:[`scope`,`locale`,`key`]}).createIndex($i,`scope`)},o.onerror=()=>a(o.error??Error(`IndexedDB failed to open`)),o.onsuccess=()=>{let e=o.result;if(r){e.close();return}r=!0,clearTimeout(i),e.onversionchange=()=>e.close(),t(ra(e))}})}function aa(){let e=new Map,t=(e,t,n)=>JSON.stringify([e,t,n]);return{persistent:!1,async get(n,r,i){let a=e.get(t(n,r,i));return a?{...a}:void 0},async put(n){e.set(t(n.scope,n.locale,n.key),{...n})},async delete(n,r,i){e.delete(t(n,r,i))},async list(t){return ea([...e.values()].filter(e=>e.scope===t).map(e=>({...e})))}}}async function oa(e){if(!e)return aa();try{return await ia(e)}catch{return aa()}}async function sa(e){let t=await Vt(e);if(t.kind!==`static`)return t;let n=await oa(e.indexedDB),r=await Mn({manifest:t.manifest,manifestText:t.manifestText,studioUrl:e.href,appUrl:t.appUrl,store:n,fetch:e.fetch,now:e.now});return{...t,transport:r}}async function ca(e){let t;try{t=await sa(e)}catch{let n=It(e);t={kind:`server`,appOrigin:n,appUrl:n,problems:[]}}return dn(t.kind===`static`?t.transport:null),Ut(t),t}ca({href:location.href,search:location.search,injected:window.__LIVELOCALE_CONFIG__?.appOrigin,buildTime:void 0,fetch:window.fetch.bind(window),indexedDB:window.indexedDB}).catch(console.error).finally(()=>{_.createRoot(document.getElementById(`root`)).render((0,y.jsx)(g.StrictMode,{children:(0,y.jsx)(z,{})}))});