vendor: 8,455 bytes, lines 1-2
1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/html2canvas-CkeJErw0.js","assets/chunk-DECur_0Z.js","assets/jspdf.es.min-BcW4vZmN.js","assets/preload-helper-DSXbuxSR.js","assets/typeof-GPCnPm50.js"])))=>i.map(i=>d[i]); 2import{n as e,r as t,t as n}from"./chunk-DECur_0Z.js";import{t as r}from"./preload-helper-DSXbuxSR.js";(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 i=n((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function ee(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function P(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var F=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},I={map:ee,forEach:function(e,t,n){ee(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ee(e,function(){t++}),t},toArray:function(e){return ee(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=I,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:P}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,F)}catch(e){F(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()}
2,e.version=`19.2.5`})),a=n(((e,t)=>{t.exports=i()})),o=n((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),s=n(((e,t)=>{t.exports=o()})),c=n((e=>{var t=a();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for(`react.portal`);function s(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return s(e,t,null,r)},e.flushSync=function(e){var t=c.T,n=i.p;try{if(c.T=null,i.p=2,e)return e()}finally{c.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=l(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},e.useFormStatus=function(){return c.H.useHostTransitionStatus()}
vendor: 11,583 bytes, lines 2-9
2,e.version=`19.2.5`})),l=n(((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=c()})),u=n((e=>{var t=s(),n=a(),r=l();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function c(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 u(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 d(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function f(e){if(c(e)!==e)throw Error(i(188))}function p(e){var t=e.alternate;if(!t){if(t=c(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var o=a.alternate;if(o===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===o.child){for(o=a.child;o;){if(o===n)return f(a),e;if(o===r)return f(a),t;o=o.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=o;else{for(var s=!1,l=a.child;l;){if(l===n){s=!0,n=a,r=o;break}if(l===r){s=!0,r=a,n=o;break}l=l.sibling}if(!s){for(l=o.child;l;){if(l===n){s=!0,n=o,r=a;break}if(l===r){s=!0,r=o,n=a;break}l=l.sibling}if(!s)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function m(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=m(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),k=Symbol.for(`react.activity`),A=Symbol.for(`react.memo_cache_sentinel`),j=Symbol.iterator;function M(e){return typeof e!=`object`||!e?null:(e=j&&e[j]||e[`@@iterator`],typeof e==`function`?e:null)}var N=Symbol.for(`react.client.reference`);function ee(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===N?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case k:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?ee(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return ee(e(t))}catch{}}return null}var P=Array.isArray,F=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te={pending:!1,data:null,method:null,action:null},L=[],ne=-1;function R(e){return{current:e}}function z(e){0>ne||(e.current=L[ne],L[ne]=null,ne--)}function B(e,t){ne++,L[ne]=e.current,e.current=t}var re=R(null),ie=R(null),ae=R(null),oe=R(null);function se(e,t){switch(B(ae,t),B(ie,e),B(re,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Kd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Kd(t),e=qd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}z(re),B(re,e)}function ce(){z(re),z(ie),z(ae)}function le(e){e.memoizedState!==null&&B(oe,e);var t=re.current,n=qd(t,e.type);t!==n&&(B(ie,e),B(re,n))}function ue(e){ie.current===e&&(z(re),z(ie)),oe.current===e&&(z(oe),rp._currentValue=te)}var de,fe;function pe(e){if(de===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);de=t&&t[1]||``,fe=-1<e.stack.indexOf(` 3 at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return` 4`+de+e+fe}var me=!1;function he(e,t){if(!e||me)return``;me=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(` 5`),l=s.split(` 6`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=` 7`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{me=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?pe(n):``}function ge(e,t){switch(e.tag){case 26:case 27:case 5:return pe(e.type);case 16:return pe(`Lazy`);case 13:return e.child!==t&&t!==null?pe(`Suspense Fallback`):pe(`Suspense`);case 19:return pe(`SuspenseList`);case 0:case 15:return he(e.type,!1);case 11:return he(e.type.render,!1);case 1:return he(e.type,!0);case 31:return pe(`Activity`);default:return``}}function _e(e){try{var t=``,n=null;do t+=ge(e,n),n=e,e=e.return;while(e);return t}catch(e){return` 8Error generating stack: `+e.message+` 9`+e.stack}}var ve=Object.prototype.hasOwnProperty,ye=t.unstable_scheduleCallback,be=t.unstable_cancelCallback,xe=t.unstable_shouldYield,Se=t.unstable_requestPaint,Ce=t.unstable_now,we=t.unstable_getCurrentPriorityLevel,Te=t.unstable_ImmediatePriority,Ee=t.unstable_UserBlockingPriority,De=t.unstable_NormalPriority,Oe=t.unstable_LowPriority,ke=t.unstable_IdlePriority,Ae=t.log,je=t.unstable_setDisableYieldValue,Me=null,Ne=null;function Pe(e){if(typeof Ae==`function`&&je(e),Ne&&typeof Ne.setStrictMode==`function`)try{Ne.setStrictMode(Me,e)}catch{}}var Fe=Math.clz32?Math.clz32:Re,Ie=Math.log,Le=Math.LN2;function Re(e){return e>>>=0,e===0?32:31-(Ie(e)/Le|0)|0}var ze=256,Be=262144,Ve=4194304;function He(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ue(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=He(n))):i=He(o):i=He(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=He(n))):i=He(o)):i=He(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function We(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ge(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ke(){var e=Ve;return Ve<<=1,!(Ve&62914560)&&(Ve=4194304),e}function qe(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Je(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ye(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Fe(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&Xe(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Xe(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Fe(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Ze(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Fe(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Qe(e,t){var n=t&-t;return n=n&42?1:$e(n),(n&(e.suspendedLanes|t))===0?n:0}function $e(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function et(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function tt(){var e=I.p;return e===0?(e=window.event,e===void 0?32:yp(e.type)):e}function nt(e,t){var n=I.p;try{return I.p=e,t()}finally{I.p=n}}var rt=Math.random().toString(36).slice(2),it=`__reactFiber$`+rt,at=`__reactProps$`+rt,ot=`__reactContainer$`+rt,st=`__reactEvents$`+rt,ct=`__reactListeners$`+rt,lt=`__reactHandles$`+rt,ut=`__reactResources$`+rt,dt=`__reactMarker$`+rt;function ft(e){delete e[it],delete e[at],delete e[st],delete e[ct],delete e[lt]}function pt(e){var t=e[it];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ot]||n[it]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=gf(e);e!==null;){if(n=e[it])return n;e=gf(e)}return t}e=n,n=e.parentNode}return null}function mt(e){if(e=e[it]||e[ot]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ht(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function gt(e){var t=e[ut];return t||=e[ut]={hoistableStyles:new Map,hoistableScripts:new Map},t}function _t(e){e[dt]=!0}var vt=new Set,yt={};function bt(e,t){V(e,t),V(e+`Capture`,t)}function V(e,t){for(yt[e]=t,e=0;e<t.length;e++)vt.add(t[e])}var xt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u
9037D\\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]*$`),St={},Ct={};function wt(e){return ve.call(Ct,e)?!0:ve.call(St,e)?!1:xt.test(e)?Ct[e]=!0:(St[e]=!0,!1)}function Tt(e,t,n){if(wt(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function Et(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function Dt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Ot(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function kt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function At(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function jt(e){if(!e._valueTracker){var t=kt(e)?`checked`:`value`;e._valueTracker=At(e,t,``+e[t])}}function Mt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=kt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Nt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Pt=/[\n"\\]/g;function Ft(e){return e.replace(Pt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function It(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Ot(t)):e.value!==``+Ot(t)&&(e.value=``+Ot(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Rt(e,o,Ot(n)):Rt(e,o,Ot(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Ot(s):e.removeAttribute(`name`)}function Lt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){jt(e);return}n=n==null?``:``+Ot(n),t=t==null?n:``+Ot(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),jt(e)}function Rt(e,t,n){t===`number`&&Nt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function zt(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=``+Ot(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 Bt(e,t,n){if(t!=null&&(t=``+Ot(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Ot(n)}function Vt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(P(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}
vendor: 9,508 bytes, line 9
9n=Ot(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),jt(e)}function Ht(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ut=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function Wt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Ut.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Gt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Wt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Wt(e,o,t[o])}function Kt(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var qt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Jt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Yt(e){return Jt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Xt(){}var Zt=null;function Qt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var $t=null,en=null;function tn(e){var t=mt(e);if(t&&(e=t.stateNode)){var n=e[at]||null;a:switch(e=t.stateNode,t.type){case`input`:if(It(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Ft(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[at]||null;if(!a)throw Error(i(90));It(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Mt(r)}break a;case`textarea`:Bt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&zt(e,!!n.multiple,t,!1)}}}var nn=!1;function rn(e,t,n){if(nn)return e(t,n);nn=!0;try{return e(t)}finally{if(nn=!1,($t!==null||en!==null)&&(wu(),$t&&(t=$t,e=en,en=$t=null,tn(t),e)))for(t=0;t<e.length;t++)tn(e[t])}}function an(e,t){var n=e.stateNode;if(n===null)return null;var r=n[at]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var on=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),sn=!1;if(on)try{var cn={};Object.defineProperty(cn,`passive`,{get:function(){sn=!0}}),window.addEventListener(`test`,cn,cn),window.removeEventListener(`test`,cn,cn)}catch{sn=!1}var ln=null,un=null,dn=null;function fn(){if(dn)return dn;var e,t=un,n=t.length,r,i=`value`in ln?ln.value:ln.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return dn=i.slice(e,1<r?1-r:void 0)}function pn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function mn(){return!0}function hn(){return!1}function gn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?mn:hn,this.isPropagationStopped=hn,this}return h(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=mn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=mn)},persist:function(){},isPersistent:mn}),t}var _n={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},vn=gn(_n),yn=h({},_n,{view:0,detail:0}),bn=gn(yn),xn,Sn,Cn,wn=h({},yn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Fn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Cn&&(Cn&&e.type===`mousemove`?(xn=e.screenX-Cn.screenX,Sn=e.screenY-Cn.screenY):Sn=xn=0,Cn=e),xn)},movementY:function(e){return`movementY`in e?e.movementY:Sn}}),Tn=gn(wn),En=gn(h({},wn,{dataTransfer:0})),Dn=gn(h({},yn,{relatedTarget:0})),On=gn(h({},_n,{animationName:0,elapsedTime:0,pseudoElement:0})),kn=gn(h({},_n,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),An=gn(h({},_n,{data:0})),jn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Mn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F
95`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},Nn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Pn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Nn[e])?!!t[e]:!1}function Fn(){return Pn}var In=gn(h({},yn,{key:function(e){if(e.key){var t=jn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=pn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Mn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Fn,charCode:function(e){return e.type===`keypress`?pn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?pn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Ln=gn(h({},wn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Rn=gn(h({},yn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Fn})),zn=gn(h({},_n,{propertyName:0,elapsedTime:0,pseudoElement:0})),Bn=gn(h({},wn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Vn=gn(h({},_n,{newState:0,oldState:0})),Hn=[9,13,27,32],Un=on&&`CompositionEvent`in window,Wn=null;on&&`documentMode`in document&&(Wn=document.documentMode);var Gn=on&&`TextEvent`in window&&!Wn,Kn=on&&(!Un||Wn&&8<Wn&&11>=Wn),qn=` `,Jn=!1;function Yn(e,t){switch(e){case`keyup`:return Hn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Xn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Zn=!1;function Qn(e,t){switch(e){case`compositionend`:return Xn(t);case`keypress`:return t.which===32?(Jn=!0,qn):null;case`textInput`:return e=t.data,e===qn&&Jn?null:e;default:return null}}function $n(e,t){if(Zn)return e===`compositionend`||!Un&&Yn(e,t)?(e=fn(),dn=un=ln=null,Zn=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Kn&&t.locale!==`ko`?null:t.data;default:return null}}var er={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 tr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!er[e.type]:t===`textarea`}function nr(e,t,n,r){$t?en?en.push(r):en=[r]:$t=r,t=Ad(t,`onChange`),0<t.length&&(n=new vn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var rr=null,ir=null;function ar(e){Sd(e,0)}function or(e){if(Mt(ht(e)))return e}function sr(e,t){if(e===`change`)return t}var cr=!1;if(on){var lr;if(on){var ur=`oninput`in document;if(!ur){var dr=document.createElement(`div`);dr.setAttribute(`oninput`,`return;`),ur=typeof dr.oninput==`function`}lr=ur}else lr=!1;cr=lr&&(!document.documentMode||9<document.documentMode)}function fr(){rr&&(rr.detachEvent(`onpropertychange`,pr),ir=rr=null)}function pr(e){if(e.propertyName===`value`&&or(ir)){var t=[];nr(t,ir,e,Qt(e)),rn(ar,t)}}function mr(e,t,n){e===`focusin`?(fr(),rr=t,ir=n,rr.attachEvent(`onpropertychange`,pr)):e===`focusout`&&fr()}function hr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return or(ir)}function gr(e,t){if(e===`click`)return or(t)}function _r(e,t){if(e===`input`||e===`change`)return or(t)}function vr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var yr=typeof Object.is==`function`?Object.is:vr;function br(e,t){if(yr(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(!ve.call(t,i)||!yr(e[i],t[i]))return!1}return!0}function xr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Sr(e,t){var n=xr(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=xr(n)}}function Cr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Cr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function wr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Nt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Nt(e.document)}return t}function Tr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Er=on&&`documentMode`in document&&11>=document.documentMode,Dr=null,Or=null,kr=null,Ar=!1;function jr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ar||Dr==null||Dr!==Nt(r)||(r=Dr,`selectionStart`in r&&Tr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focu
vendor: 76,738 bytes, line 9
9sNode:r.focusNode,focusOffset:r.focusOffset}),kr&&br(kr,r)||(kr=r,r=Ad(Or,`onSelect`),0<r.length&&(t=new vn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Dr)))}function Mr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Nr={animationend:Mr(`Animation`,`AnimationEnd`),animationiteration:Mr(`Animation`,`AnimationIteration`),animationstart:Mr(`Animation`,`AnimationStart`),transitionrun:Mr(`Transition`,`TransitionRun`),transitionstart:Mr(`Transition`,`TransitionStart`),transitioncancel:Mr(`Transition`,`TransitionCancel`),transitionend:Mr(`Transition`,`TransitionEnd`)},Pr={},Fr={};on&&(Fr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Nr.animationend.animation,delete Nr.animationiteration.animation,delete Nr.animationstart.animation),`TransitionEvent`in window||delete Nr.transitionend.transition);function Ir(e){if(Pr[e])return Pr[e];if(!Nr[e])return e;var t=Nr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Fr)return Pr[e]=t[n];return e}var Lr=Ir(`animationend`),Rr=Ir(`animationiteration`),zr=Ir(`animationstart`),Br=Ir(`transitionrun`),Vr=Ir(`transitionstart`),Hr=Ir(`transitioncancel`),Ur=Ir(`transitionend`),Wr=new Map,Gr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Gr.push(`scrollEnd`);function Kr(e,t){Wr.set(e,t),bt(t,[e])}var qr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Jr=[],Yr=0,Xr=0;function Zr(){for(var e=Yr,t=Xr=Yr=0;t<e;){var n=Jr[t];Jr[t++]=null;var r=Jr[t];Jr[t++]=null;var i=Jr[t];Jr[t++]=null;var a=Jr[t];if(Jr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ti(n,i,a)}}function Qr(e,t,n,r){Jr[Yr++]=e,Jr[Yr++]=t,Jr[Yr++]=n,Jr[Yr++]=r,Xr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function $r(e,t,n,r){return Qr(e,t,n,r),ni(e)}function ei(e,t){return Qr(e,null,null,t),ni(e)}function ti(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Fe(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ni(e){if(50<hu)throw hu=0,gu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ri={};function ii(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ai(e,t,n,r){return new ii(e,t,n,r)}function oi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function si(e,t){var n=e.alternate;return n===null?(n=ai(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function ci(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function li(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)oi(e)&&(s=1);else if(typeof e==`string`)s=Jf(e,n,re.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case k:return e=ai(31,n,t,a),e.elementType=k,e.lanes=o,e;case y:return ui(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=ai(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=ai(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=ai(19,n,t,a),e.elementType=E,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case D:s=14;break a;case O:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ai(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function ui(e,t,n,r){return e=ai(7,e,r,t),e.lanes=n,e}function di(e,t,n){return e=ai(6,e,null,t),e.lanes=n,e}function fi(e){var t=ai(18,null,null,0);return t.stateNode=e,t}function pi(e,t,n){return t=ai(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var mi=new WeakMap;function hi(e,t){if(typeof e==`object`&&e){var n=mi.get(e);return n===void 0?(t={value:e,source:t,stack:_e(t)},mi.set(e,t),t):n}return{value:e,source:t,stack:_e(t)}}var gi=[],_i=0,vi=null,yi=0,bi=[],xi=0,Si=null,Ci=1,wi=``;function Ti(e,t){gi[_i++]=yi,gi[_i++]=vi,vi=e,yi=t}function Ei(e,t,n){bi[xi++]=Ci,bi[xi++]=wi,bi[xi++]=Si,Si=e;var r=Ci;e=wi;var i=32-Fe(r)-1;r&=~(1<<i),n+=1;var a=32-Fe(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ci=1<<32-Fe(t)+i|n<<i|r,wi=a+e}else Ci=1<<a|n<<i|r,wi=e}function Di(e){e.return!==null&&(Ti(e,1),Ei(e,1,0))}function Oi(e){for(;e===vi;)vi=gi[--_i],gi[_i]=null,yi=gi[--_i],gi[_i]=null;for(;e===Si;)Si=bi[--xi],bi[xi]=null,wi=bi[--xi],bi[xi]=null,Ci=bi[--xi],bi[xi]=null}function ki(e,t){bi[xi++]=Ci,bi[xi++]=wi,bi[xi++]=Si,Ci=t.id,wi=t.overflow,Si=e}var Ai=null,ji=null,Mi=!1,Ni=null,Pi=!1,Fi=Error(i(519));function Ii(e){throw Hi(hi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Fi}function Li(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[it]=e,t[at]=r,n){case`dialog`:Cd(`cancel`,t),Cd(`close`,t);break;case`iframe`:case`object`:case`embed`:Cd(`load`,t);break;case`video`:case`audio`:for(n=0;n<bd.length;n++)Cd(bd[n],t);break;case`source`:Cd(`error`,t);break;case`img`:case`image`:case`link`:Cd(`error`,t),Cd(`load`,t);break;case`details`:Cd(`toggle`,t);break;case`input`:Cd(`invalid`,t),Lt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Cd(`invalid`,t);break;case`textarea`:Cd(`invalid`,t),Vt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Id(t.textContent,n)?(r.popover!=null&&(Cd(`beforetoggle`,t),Cd(`toggle`,t)),r.onScroll!=null&&Cd(`scroll`,t),r.onScrollEnd!=null&&Cd(`scrollend`,t),r.onClick!=null&&(t.onclick=Xt),t=!0):t=!1,t||Ii(e,!0)}function Ri(e){for(Ai=e.return;Ai;)switch(Ai.tag){case 5:case 31:case 13:Pi=!1;return;case 27:case 3:Pi=!0;return;default:Ai=Ai.return}}function zi(e){if(e!==Ai)return!1;if(!Mi)return Ri(e),Mi=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Jd(e.type,e.memoizedProps)),n=!n),n&&ji&&Ii(e),Ri(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ji=hf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ji=hf(e)}else t===27?(t=ji,nf(e.type)?(e=mf,mf=null,ji=e):ji=t):ji=Ai?pf(e.stateNode.nextSibling):null;return!0}function Bi(){ji=Ai=null,Mi=!1}function Vi(){var e=Ni;return e!==null&&(nu===null?nu=e:nu.push.apply(nu,e),Ni=null),e}function Hi(e){Ni===null?Ni=[e]:Ni.push(e)}var Ui=R(null),Wi=null,Gi=null;function Ki(e,t,n){B(Ui,t._currentValue),t._currentValue=n}function qi(e){e._currentValue=Ui.current,z(Ui)}function Ji(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 Yi(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Ji(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Ji(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Xi(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;yr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===oe.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[rp]:e.push(rp))}a=a.return}e!==null&&Yi(t,e,n,r),t.flags|=262144}function Zi(e){for(e=e.firstContext;e!==null;){if(!yr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Qi(e){Wi=e,Gi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function $i(e){return ta(Wi,e)}function ea(e,t){return Wi===null&&Qi(e),ta(e,t)}function ta(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Gi===null){if(e===null)throw Error(i(308));Gi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Gi=Gi.next=t;return n}var na=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ra=t.unstable_scheduleCallback,ia=t.unstable_NormalPriority,aa={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function oa(){return{controller:new na,data:new Map,refCount:0}}function sa(e){e.refCount--,e.refCount===0&&ra(ia,function(){e.controller.abort()})}var ca=null,la=0,ua=0,da=null;function fa(e,t){if(ca===null){var n=ca=[];la=0,ua=md(),da={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return la++,t.then(pa,pa),t}function pa(){if(--la===0&&ca!==null){da!==null&&(da.status=`fulfilled`);var e=ca;ca=null,ua=0,da=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ma(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var ha=F.S;F.S=function(e,t){au=Ce(),typeof t==`object`&&t&&typeof t.then==`function`&&fa(e,t),ha!==null&&ha(e,t)};var ga=R(null);function _a(){var e=ga.current;return e===null?Vl.pooledCache:e}function va(e,t){t===null?B(ga,ga.current):B(ga,t.pool)}function ya(){var e=_a();return e===null?null:{parent:aa._currentValue,pool:e}}var ba=Error(i(460)),xa=Error(i(474)),Sa=Error(i(542)),Ca={then:function(){}};function wa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ta(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Xt,Xt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ka(e),e;default:if(typeof t.status==`string`)t.then(Xt,Xt);else{if(e=Vl,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ka(e),e}throw Da=t,ba}}function Ea(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Da=e,ba):e}}var Da=null;function Oa(){if(Da===null)throw Error(i(459));var e=Da;return Da=null,e}function ka(e){if(e===ba||e===Sa)throw Error(i(483))}var Aa=null,ja=0;function Ma(e){var t=ja;return ja+=1,Aa===null&&(Aa=[]),Ta(Aa,e,t)}function Na(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Pa(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Fa(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=si(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=di(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===O&&Ea(i)===t.type)?(t=a(t,n.props),Na(t,n),t.return=e,t):(t=li(n.type,n.key,n.props,null,e.mode,r),Na(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=pi(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=ui(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=di(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=li(t.type,t.key,t.props,null,e.mode,n),Na(n,t),n.return=e,n;case v:return t=pi(t,e.mode,n),t.return=e,t;case O:return t=Ea(t),f(e,t,n)}if(P(t)||M(t))return t=ui(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Ma(t),n);if(t.$$typeof===C)return f(e,ea(e,t),n);Pa(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case O:return n=Ea(n),p(e,t,n,r)}if(P(n)||M(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Ma(n),r);if(n.$$typeof===C)return p(e,t,ea(e,n),r);Pa(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case O:return r=Ea(r),m(e,t,n,r,i)}if(P(r)||M(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Ma(r),i);if(r.$$typeof===C)return m(e,t,n,ea(t,r),i);Pa(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),Mi&&Ti(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return Mi&&Ti(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),Mi&&Ti(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),Mi&&Ti(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 Mi&&Ti(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),Mi&&Ti(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&Ea(l)===r.type){n(e,r.sibling),c=a(r,o.props),Na(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=ui(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=li(o.type,o.key,o.props,null,e.mode,c),Na(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=pi(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=Ea(o),b(e,r,o,c)}if(P(o))return h(e,r,o,c);if(M(o)){if(l=M(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Ma(o),c);if(o.$$typeof===C)return b(e,r,ea(e,o),c);Pa(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=di(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{ja=0;var i=b(e,t,n,r);return Aa=null,i}catch(t){if(t===ba||t===Sa)throw t;var a=ai(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ia=Fa(!0),La=Fa(!1),Ra=!1;function za(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ba(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Va(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ha(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Bl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ni(e),ti(e,null,n),t}return Qr(e,r,t,n),ni(e)}function Ua(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ze(e,n)}}function Wa(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ga=!1;function Ka(){if(Ga){var e=da;if(e!==null)throw e}}function qa(e,t,n,r){Ga=!1;var i=e.updateQueue;Ra=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Ul&f)===f:(r&f)===f){f!==0&&f===ua&&(Ga=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(m=g.payload,typeof m==`function`){d=m.call(_,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m==`function`?m.call(_,d,f):m,f==null)break a;d=h({},d,f);break a;case 2:Ra=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Xl|=o,e.lanes=o,e.memoizedState=d}}function Ja(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Ya(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ja(n[e],t)}var Xa=R(null),H=R(0);function Za(e,t){e=Jl,B(H,e),B(Xa,t),Jl=e|t.baseLanes}function Qa(){B(H,Jl),B(Xa,Xa.current)}function $a(){Jl=H.current,z(Xa),z(H)}var eo=R(null),to=null;function no(e){var t=e.alternate;B(so,so.current&1),B(eo,e),to===null&&(t===null||Xa.current!==null||t.memoizedState!==null)&&(to=e)}function ro(e){B(so,so.current),B(eo,e),to===null&&(to=e)}function io(e){e.tag===22?(B(so,so.current),B(eo,e),to===null&&(to=e)):ao(e)}function ao(){B(so,so.current),B(eo,eo.current)}function oo(e){z(eo),to===e&&(to=null),z(so)}var so=R(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||uf(n)||df(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var lo=0,uo=null,fo=null,po=null,mo=!1,ho=!1,go=!1,_o=0,vo=0,yo=null,bo=0;function xo(){throw Error(i(321))}function So(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!yr(e[n],t[n]))return!1;return!0}function Co(e,t,n,r,i,a){return lo=a,uo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,F.H=e===null||e.memoizedState===null?zs:Bs,go=!1,a=n(r,i),go=!1,ho&&(a=To(t,n,r,i)),wo(e),a}function wo(e){F.H=Rs;var t=fo!==null&&fo.next!==null;if(lo=0,po=fo=uo=null,mo=!1,vo=0,yo=null,t)throw Error(i(300));e===null||rc||(e=e.dependencies,e!==null&&Zi(e)&&(rc=!0))}function To(e,t,n,r){uo=e;var a=0;do{if(ho&&(yo=null),vo=0,ho=!1,25<=a)throw Error(i(301));if(a+=1,po=fo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}F.H=Vs,o=t(n,r)}while(ho);return o}function Eo(){var e=F.H,t=e.useState()[0];return t=typeof t.then==`function`?No(t):t,e=e.useState()[0],(fo===null?null:fo.memoizedState)!==e&&(uo.flags|=1024),t}function Do(){var e=_o!==0;return _o=0,e}function Oo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ko(e){if(mo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}mo=!1}lo=0,po=fo=uo=null,ho=!1,vo=_o=0,yo=null}function Ao(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return po===null?uo.memoizedState=po=e:po=po.next=e,po}function jo(){if(fo===null){var e=uo.alternate;e=e===null?null:e.memoizedState}else e=fo.next;var t=po===null?uo.memoizedState:po.next;if(t!==null)po=t,fo=e;else{if(e===null)throw uo.alternate===null?Error(i(467)):Error(i(310));fo=e,e={memoizedState:fo.memoizedState,baseState:fo.baseState,baseQueue:fo.baseQueue,queue:fo.queue,next:null},po===null?uo.memoizedState=po=e:po=po.next=e}return po}function Mo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function No(e){var t=vo;return vo+=1,yo===null&&(yo=[]),e=Ta(yo,e,t),t=uo,(po===null?t.memoizedState:po.next)===null&&(t=t.alternate,F.H=t===null||t.memoizedState===null?zs:Bs),e}function Po(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return No(e);if(e.$$typeof===C)return $i(e)}throw Error(i(438,String(e)))}function Fo(e){var t=null,n=uo.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=uo.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Mo(),uo.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=A;return t.index++,n}function Io(e,t){return typeof t==`function`?t(e):t}function Lo(e){return Ro(jo(),fo,e)}function Ro(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(lo&f)===f:(Ul&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ua&&(d=!0);else if((lo&p)===p){u=u.next,p===ua&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,uo.lanes|=p,Xl|=p;f=u.action,go&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,uo.lanes|=f,Xl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!yr(o,e.memoizedState)&&(rc=!0,d&&(n=da,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function zo(e){var t=jo(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);yr(o,t.memoizedState)||(rc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Bo(e,t,n){var r=uo,a=jo(),o=Mi;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!yr((fo||a).memoizedState,n);if(s&&(a.memoizedState=n,rc=!0),a=a.queue,ds(Uo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||po!==null&&po.memoizedState.tag&1){if(r.flags|=2048,os(9,{destroy:void 0},Ho.bind(null,r,a,n,t),null),Vl===null)throw Error(i(349));o||lo&127||Vo(r,t,n)}return n}function Vo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=uo.updateQueue,t===null?(t=Mo(),uo.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ho(e,t,n,r){t.value=n,t.getSnapshot=r,Wo(t)&&Go(e)}function Uo(e,t,n){return n(function(){Wo(t)&&Go(e)})}function Wo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!yr(e,n)}catch{return!0}}function Go(e){var t=ei(e,2);t!==null&&yu(t,e,2)}function Ko(e){var t=Ao();if(typeof e==`function`){var n=e;if(e=n(),go){Pe(!0);try{n()}finally{Pe(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Io,lastRenderedState:e},t}function qo(e,t,n,r){return e.baseState=n,Ro(e,fo,typeof r==`function`?r:Io)}function Jo(e,t,n,r,a){if(Fs(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};F.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Yo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Yo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=F.T,o={};F.T=o;try{var s=n(i,r),c=F.S;c!==null&&c(o,s),Xo(e,t,s)}catch(n){Qo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),F.T=a}}else try{a=n(i,r),Xo(e,t,a)}catch(n){Qo(e,t,n)}}function Xo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Zo(e,t,n)},function(n){return Qo(e,t,n)}):Zo(e,t,n)}function Zo(e,t,n){t.status=`fulfilled`,t.value=n,$o(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Yo(e,n)))}function Qo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,$o(t),t=t.next;while(t!==r)}e.action=null}function $o(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function es(e,t){return t}function ts(e,t){if(Mi){var n=Vl.formState;if(n!==null){a:{var r=uo;if(Mi){if(ji){b:{for(var i=ji,a=Pi;i.nodeType!==8;){if(!a){i=null;break b}if(i=pf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ji=pf(i.nextSibling),r=i.data===`F!`;break a}}Ii(r)}r=!1}r&&(t=n[0])}}return n=Ao(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:es,lastRenderedState:t},n.queue=r,n=Ms.bind(null,uo,r),r.dispatch=n,r=Ko(!1),a=Ps.bind(null,uo,!1,r.queue),r=Ao(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Jo.bind(null,uo,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function ns(e){return rs(jo(),fo,e)}function rs(e,t,n){if(t=Ro(e,t,es)[0],e=Lo(Io)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=No(t)}catch(e){throw e===ba?Sa:e}else r=t;t=jo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(uo.flags|=2048,os(9,{destroy:void 0},is.bind(null,i,n),null)),[r,a,e]}function is(e,t){e.action=t}function as(e){var t=jo(),n=fo;if(n!==null)return rs(t,n,e);jo(),t=t.memoizedState,n=jo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function os(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=uo.updateQueue,t===null&&(t=Mo(),uo.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function ss(){return jo().memoizedState}function cs(e,t,n,r){var i=Ao();uo.flags|=e,i.memoizedState=os(1|t,{destroy:void 0},n,r===void 0?null:r)}function ls(e,t,n,r){var i=jo();r=r===void 0?null:r;var a=i.memoizedState.inst;fo!==null&&r!==null&&So(r,fo.memoizedState.deps)?i.memoizedState=os(t,a,n,r):(uo.flags|=e,i.memoizedState=os(1|t,a,n,r))}function us(e,t){cs(8390656,8,e,t)}function ds(e,t){ls(2048,8,e,t)}function fs(e){uo.flags|=4;var t=uo.updateQueue;if(t===null)t=Mo(),uo.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ps(e){var t=jo().memoizedState;return fs({ref:t,nextImpl:e}),function(){if(Bl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function ms(e,t){return ls(4,2,e,t)}function hs(e,t){return ls(4,4,e,t)}function gs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function _s(e,t,n){n=n==null?null:n.concat([e]),ls(4,4,gs.bind(null,t,e),n)}function vs(){}function ys(e,t){var n=jo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&So(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function bs(e,t){var n=jo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&So(t,r[1]))return r[0];if(r=e(),go){Pe(!0);try{e()}finally{Pe(!1)}}return n.memoizedState=[r,t],r}function xs(e,t,n){return n===void 0||lo&1073741824&&!(Ul&261930)?e.memoizedState=t:(e.memoizedState=n,e=vu(),uo.lanes|=e,Xl|=e,n)}function Ss(e,t,n,r){return yr(n,t)?n:Xa.current===null?!(lo&42)||lo&1073741824&&!(Ul&261930)?(rc=!0,e.memoizedState=n):(e=vu(),uo.lanes|=e,Xl|=e,t):(e=xs(e,n,r),yr(e,t)||(rc=!0),e)}function Cs(e,t,n,r,i){var a=I.p;I.p=a!==0&&8>a?a:8;var o=F.T,s={};F.T=s,Ps(e,!1,t,n);try{var c=i(),l=F.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Ns(e,t,ma(c,r),_u(e)):Ns(e,t,r,_u(e))}catch(n){Ns(e,t,{then:function(){},status:`rejected`,reason:n},_u())}finally{I.p=a,o!==null&&s.types!==null&&(o.types=s.types),F.T=o}}function ws(){}function Ts(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=U(e).queue;Cs(e,a,t,te,n===null?ws:function(){return Es(e),n(r)})}function U(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:te,baseState:te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Io,lastRenderedState:te},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Io,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Es(e){var t=U(e);t.next===null&&(t=e.alternate.memoizedState),Ns(e,t.next.queue,{},_u())}function Ds(){return $i(rp)}function Os(){return jo().memoizedState}function ks(){return jo().memoizedState}function As(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=_u();e=Va(n);var r=Ha(t,e,n);r!==null&&(yu(r,t,n),Ua(r,t,n)),t={cache:oa()},e.payload=t;return}t=t.return}}function js(e,t,n){var r=_u();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Fs(e)?Is(t,n):(n=$r(e,t,n,r),n!==null&&(yu(n,e,r),Ls(n,t,r)))}function Ms(e,t,n){Ns(e,t,n,_u())}function Ns(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Fs(e))Is(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,yr(s,o))return Qr(e,t,i,0),Vl===null&&Zr(),!1}catch{}if(n=$r(e,t,i,r),n!==null)return yu(n,e,r),Ls(n,t,r),!0}return!1}function Ps(e,t,n,r){if(r={lane:2,revertLane:md(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Fs(e)){if(t)throw Error(i(479))}else t=$r(e,n,r,2),t!==null&&yu(t,e,2)}function Fs(e){var t=e.alternate;return e===uo||t!==null&&t===uo}function Is(e,t){ho=mo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ls(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ze(e,n)}}var Rs={readContext:$i,use:Po,useCallback:xo,useContext:xo,useEffect:xo,useImperativeHandle:xo,useLayoutEffect:xo,useInsertionEffect:xo,useMemo:xo,useReducer:xo,useRef:xo,useState:xo,useDebugValue:xo,useDeferredValue:xo,useTransition:xo,useSyncExternalStore:xo,useId:xo,useHostTransitionStatus:xo,useFormState:xo,useActionState:xo,useOptimistic:xo,useMemoCache:xo,useCacheRefresh:xo};Rs.useEffectEvent=xo;var zs={readContext:$i,use:Po,useCallback:function(e,t){return Ao().memoizedState=[e,t===void 0?null:t],e},useContext:$i,useEffect:us,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),cs(4194308,4,gs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return cs(4194308,4,e,t)},useInsertionEffect:function(e,t){cs(4,2,e,t)},useMemo:function(e,t){var n=Ao();t=t===void 0?null:t;var r=e();if(go){Pe(!0);try{e()}finally{Pe(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Ao();if(n!==void 0){var i=n(t);if(go){Pe(!0);try{n(t)}finally{Pe(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=js.bind(null,uo,e),[r.memoizedState,e]},useRef:function(e){var t=Ao();return e={current:e},t.memoizedState=e},useState:function(e){e=Ko(e);var t=e.queue,n=Ms.bind(null,uo,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:vs,useDeferredValue:function(e,t){return xs(Ao(),e,t)},useTransition:function(){var e=Ko(!1);return e=Cs.bind(null,uo,e.queue,!0,!1),Ao().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=uo,a=Ao();if(Mi){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Vl===null)throw Error(i(349));Ul&127||Vo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,us(Uo.bind(null,r,o,e),[e]),r.flags|=2048,os(9,{destroy:void 0},Ho.bind(null,r,o,n,t),null),n},useId:function(){var e=Ao(),t=Vl.identifierPrefix;if(Mi){var n=wi,r=Ci;n=(r&~(1<<32-Fe(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=_o++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=bo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Ds,useFormState:ts,useActionState:ts,useOptimistic:function(e){var t=Ao();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ps.bind(null,uo,!0,n),n.dispatch=t,[e,t]},useMemoCache:Fo,useCacheRefresh:function(){return Ao().memoizedState=As.bind(null,uo)},useEffectEvent:function(e){var t=Ao(),n={impl:e};return t.memoizedState=n,function(){if(Bl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Bs={readContext:$i,use:Po,useCallback:ys,useContext:$i,useEffect:ds,useImperativeHandle:_s,useInsertionEffect:ms,useLayoutEffect:hs,useMemo:bs,useReducer:Lo,useRef:ss,useState:function(){return Lo(Io)},useDebugValue:vs,useDeferredValue:function(e,t){return Ss(jo(),fo.memoizedState,e,t)},useTransition:function(){var e=Lo(Io)[0],t=jo().memoizedState;return[typeof e==`boolean`?e:No(e),t]},useSyncExternalStore:Bo,useId:Os,useHostTransitionStatus:Ds,useFormState:ns,useActionState:ns,useOptimistic:function(e,t){return qo(jo(),fo,e,t)},useMemoCache:Fo,useCacheRefresh:ks};Bs.useEffectEvent=ps;var Vs={readContext:$i,use:Po,useCallback:ys,useContext:$i,useEffect:ds,useImperativeHandle:_s,useInsertionEffect:ms,useLayoutEffect:hs,useMemo:bs,useReducer:zo,useRef:ss,useState:function(){return zo(Io)},useDebugValue:vs,useDeferredValue:function(e,t){var n=jo();return fo===null?xs(n,e,t):Ss(n,fo.memoizedState,e,t)},useTransition:function(){var e=zo(Io)[0],t=jo().memoizedState;return[typeof e==`boolean`?e:No(e),t]},useSyncExternalStore:Bo,useId:Os,useHostTransitionStatus:Ds,useFormState:as,useActionState:as,useOptimistic:function(e,t){var n=jo();return fo===null?(n.baseState=e,[e,n.queue.dispatch]):qo(n,fo,e,t)},useMemoCache:Fo,useCacheRefresh:ks};Vs.useEffectEvent=ps;function Hs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:h({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Us={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=_u(),i=Va(r);i.payload=t,n!=null&&(i.callback=n),t=Ha(e,i,r),t!==null&&(yu(t,e,r),Ua(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=_u(),i=Va(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ha(e,i,r),t!==null&&(yu(t,e,r),Ua(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=_u(),r=Va(n);r.tag=2,t!=null&&(r.callback=t),t=Ha(e,r,n),t!==null&&(yu(t,e,n),Ua(t,e,n))}};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?!br(n,r)||!br(i,a):!0}function Gs(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&&Us.enqueueReplaceState(t,t.state,null)}function Ks(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=h({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function qs(e){qr(e)}function Js(e){console.error(e)}function Ys(e){qr(e)}function Xs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Zs(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Qs(e,t,n){return n=Va(n),n.tag=3,n.payload={element:null},n.callback=function(){Xs(e,t)},n}function $s(e){return e=Va(e),e.tag=3,e}function ec(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Zs(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Zs(t,n,r),typeof i!=`function`&&(cu===null?cu=new Set([this]):cu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function tc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Xi(t,n,a,!0),n=eo.current,n!==null){switch(n.tag){case 31:case 13:return to===null?ju():n.alternate===null&&Yl===0&&(Yl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ca?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Ju(e,r,a)),!1;case 22:return n.flags|=65536,r===Ca?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Ju(e,r,a)),!1}throw Error(i(435,n.tag))}return Ju(e,r,a),ju(),!1}if(Mi)return t=eo.current,t===null?(r!==Fi&&(t=Error(i(423),{cause:r}),Hi(hi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=hi(r,n),a=Qs(e.stateNode,r,a),Wa(e,a),Yl!==4&&(Yl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Fi&&(e=Error(i(422),{cause:r}),Hi(hi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=hi(o,n),tu===null?tu=[o]:tu.push(o),Yl!==4&&(Yl=2),t===null)return!0;r=hi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Qs(n.stateNode,r,e),Wa(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(cu===null||!cu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=$s(a),ec(a,e,n,r),Wa(n,a),!1}n=n.return}while(n!==null);return!1}var nc=Error(i(461)),rc=!1;function ic(e,t,n,r){t.child=e===null?La(t,null,n,r):Ia(t,e.child,n,r)}function ac(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Qi(t),r=Co(e,t,n,o,a,i),s=Do(),e!==null&&!rc?(Oo(e,t,i),kc(e,t,i)):(Mi&&s&&Di(t),t.flags|=1,ic(e,t,r,i),t.child)}function oc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!oi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,sc(e,t,a,r,i)):(e=li(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Ac(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?br:n,n(o,r)&&e.ref===t.ref)return kc(e,t,i)}return t.flags|=1,e=si(a,r),e.ref=t.ref,e.return=t,t.child=e}function sc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(br(a,r)&&e.ref===t.ref)if(rc=!1,t.pendingProps=r=a,Ac(e,i))e.flags&131072&&(rc=!0);else return t.lanes=e.lanes,kc(e,t,i)}return hc(e,t,n,r,i)}function cc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return uc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&va(t,a===null?null:a.cachePool),a===null?Qa():Za(t,a),io(t);else return r=t.lanes=536870912,uc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&va(t,null),Qa(),ao(t)):(va(t,a.cachePool),Za(t,a),ao(t),t.memoizedState=null);return ic(e,t,i,n),t.child}function lc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function uc(e,t,n,r,i){var a=_a();return a=a===null?null:{parent:aa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&va(t,null),Qa(),io(t),e!==null&&Xi(e,t,r,!0),t.childLanes=i,null}function dc(e,t){return t=wc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function fc(e,t,n){return Ia(t,e.child,null,n),e=dc(t,t.pendingProps),e.flags|=2,oo(t),t.memoizedState=null,e}function pc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(Mi){if(r.mode===`hidden`)return e=dc(t,r),t.lanes=536870912,lc(null,e);if(ro(t),(e=ji)?(e=lf(e,Pi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Si===null?null:{id:Ci,overflow:wi},retryLane:536870912,hydrationErrors:null},n=fi(e),n.return=t,t.child=n,Ai=t,ji=null)):e=null,e===null)throw Ii(t);return t.lanes=536870912,null}return dc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(ro(t),a)if(t.flags&256)t.flags&=-257,t=fc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(rc||Xi(e,t,n,!1),a=(n&e.childLanes)!==0,rc||a){if(r=Vl,r!==null&&(s=Qe(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ei(e,s),yu(r,e,s),nc;ju(),t=fc(e,t,n)}else e=o.treeContext,ji=pf(s.nextSibling),Ai=t,Mi=!0,Ni=null,Pi=!1,e!==null&&ki(t,e),t=dc(t,r),t.flags|=4096;return t}return e=si(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function mc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function hc(e,t,n,r,i){return Qi(t),n=Co(e,t,n,r,void 0,i),r=Do(),e!==null&&!rc?(Oo(e,t,i),kc(e,t,i)):(Mi&&r&&Di(t),t.flags|=1,ic(e,t,n,i),t.child)}function gc(e,t,n,r,i,a){return Qi(t),t.updateQueue=null,n=To(t,r,n,i),wo(e),r=Do(),e!==null&&!rc?(Oo(e,t,a),kc(e,t,a)):(Mi&&r&&Di(t),t.flags|=1,ic(e,t,n,a),t.child)}function _c(e,t,n,r,i){if(Qi(t),t.stateNode===null){var a=ri,o=n.contextType;typeof o==`object`&&o&&(a=$i(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Us,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},za(t),o=n.contextType,a.context=typeof o==`object`&&o?$i(o):ri,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Hs(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Us.enqueueReplaceState(a,a.state,null),qa(t,r,a,i),Ka(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Ks(n,s);a.props=c;var l=a.context,u=n.contextType;o=ri,typeof u==`object`&&u&&(o=$i(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Gs(t,a,r,o),Ra=!1;var f=t.memoizedState;a.state=f,qa(t,r,a,i),Ka(),l=t.memoizedState,s||f!==l||Ra?(typeof d==`function`&&(Hs(t,n,d,r),l=t.memoizedState),(c=Ra||Ws(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ba(e,t),o=t.memoizedProps,u=Ks(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ri,typeof l==`object`&&l&&(c=$i(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Gs(t,a,r,c),Ra=!1,f=t.memoizedState,a.state=f,qa(t,r,a,i),Ka();var p=t.memoizedState;o!==d||f!==p||Ra||e!==null&&e.dependencies!==null&&Zi(e.dependencies)?(typeof s==`function`&&(Hs(t,n,s,r),p=t.memoizedState),(u=Ra||Ws(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Zi(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,mc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Ia(t,e.child,null,i),t.child=Ia(t,null,n,i)):ic(e,t,n,i),t.memoizedState=a.state,e=t.child):e=kc(e,t,i),e}function vc(e,t,n,r){return Bi(),t.flags|=256,ic(e,t,n,r),t.child}var yc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function bc(e){return{baseLanes:e,cachePool:ya()}}function xc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=$l),e}function Sc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(so.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(Mi){if(a?no(t):ao(t),(e=ji)?(e=lf(e,Pi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Si===null?null:{id:Ci,overflow:wi},retryLane:536870912,hydrationErrors:null},n=fi(e),n.return=t,t.child=n,Ai=t,ji=null)):e=null,e===null)throw Ii(t);return df(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(ao(t),a=t.mode,c=wc({mode:`hidden`,children:c},a),r=ui(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=bc(n),r.childLanes=xc(e,s,n),t.memoizedState=yc,lc(null,r)):(no(t),Cc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(no(t),t.flags&=-257,t=Tc(e,t,n)):t.memoizedState===null?(ao(t),c=r.fallback,a=t.mode,r=wc({mode:`visible`,children:r.children},a),c=ui(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ia(t,e.child,null,n),r=t.child,r.memoizedState=bc(n),r.childLanes=xc(e,s,n),t.memoizedState=yc,t=lc(null,r)):(ao(t),t.child=e.child,t.flags|=128,t=null);else if(no(t),df(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Hi({value:r,source:null,stack:null}),t=Tc(e,t,n)}else if(rc||Xi(e,t,n,!1),s=(n&e.childLanes)!==0,rc||s){if(s=Vl,s!==null&&(r=Qe(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ei(e,r),yu(s,e,r),nc;uf(c)||ju(),t=Tc(e,t,n)}else uf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,ji=pf(c.nextSibling),Ai=t,Mi=!0,Ni=null,Pi=!1,e!==null&&ki(t,e),t=Cc(t,r.children),t.flags|=4096);return t}return a?(ao(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=si(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=ui(c,a,n,null),c.flags|=2):c=si(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,lc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=bc(n):(a=c.cachePool,a===null?a=ya():(l=aa._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=xc(e,s,n),t.memoizedState=yc,lc(e.child,r)):(no(t),n=e.child,e=n.sibling,n=si(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function Cc(e,t){return t=wc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function wc(e,t){return e=ai(22,e,null,t),e.lanes=0,e}function Tc(e,t,n){return Ia(t,e.child,null,n),e=Cc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Ec(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ji(e.return,t,n)}function Dc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Oc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=so.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,B(so,o),ic(e,t,r,n),r=Mi?yi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ec(e,n,t);else if(e.tag===19)Ec(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&co(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Dc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&co(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Dc(t,!0,n,null,a,r);break;case`together`:Dc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function kc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Xl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Xi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=si(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=si(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Ac(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Zi(e))):!0}function jc(e,t,n){switch(t.tag){case 3:se(t,t.stateNode.containerInfo),Ki(t,aa,e.memoizedState.cache),Bi();break;case 27:case 5:le(t);break;case 4:se(t,t.stateNode.containerInfo);break;case 10:Ki(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ro(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(no(t),e=kc(e,t,n),e===null?null:e.sibling):Sc(e,t,n):(no(t),t.flags|=128,null);no(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Xi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Oc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),B(so,so.current),r)break;return null;case 22:return t.lanes=0,cc(e,t,n,t.pendingProps);case 24:Ki(t,aa,e.memoizedState.cache)}return kc(e,t,n)}function Mc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)rc=!0;else{if(!Ac(e,n)&&!(t.flags&128))return rc=!1,jc(e,t,n);rc=!!(e.flags&131072)}else rc=!1,Mi&&t.flags&1048576&&Ei(t,yi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Ea(t.elementType),t.type=e,typeof e==`function`)oi(e)?(r=Ks(e,r),t.tag=1,t=_c(null,t,e,r,n)):(t.tag=0,t=hc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=ac(null,t,e,r,n);break a}else if(a===D){t.tag=14,t=oc(null,t,e,r,n);break a}}throw t=ee(e)||e,Error(i(306,t,``))}}return t;case 0:return hc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Ks(r,t.pendingProps),_c(e,t,r,a,n);case 3:a:{if(se(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ba(e,t),qa(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Ki(t,aa,r),r!==o.cache&&Yi(t,[aa],n,!0),Ka(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=vc(e,t,r,n);break a}else if(r!==a){a=hi(Error(i(424)),t),Hi(a),t=vc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(ji=pf(e.firstChild),Ai=t,Mi=!0,Ni=null,Pi=!0,n=La(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Bi(),r===a){t=kc(e,t,n);break a}ic(e,t,r,n)}t=t.child}return t;case 26:return mc(e,t),e===null?(n=Pf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Mi||(n=t.type,e=t.pendingProps,r=Gd(ae.current).createElement(n),r[it]=t,r[at]=e,zd(r,n,e),_t(r),t.stateNode=r):t.memoizedState=Pf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return le(t),e===null&&Mi&&(r=t.stateNode=_f(t.type,t.pendingProps,ae.current),Ai=t,Pi=!0,a=ji,nf(t.type)?(mf=a,ji=pf(r.firstChild)):ji=a),ic(e,t,t.pendingProps.children,n),mc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Mi&&((a=r=ji)&&(r=sf(r,t.type,t.pendingProps,Pi),r===null?a=!1:(t.stateNode=r,Ai=t,ji=pf(r.firstChild),Pi=!1,a=!0)),a||Ii(t)),le(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Jd(a,o)?r=null:s!==null&&Jd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Co(e,t,Eo,null,null,n),rp._currentValue=a),mc(e,t),ic(e,t,r,n),t.child;case 6:return e===null&&Mi&&((e=n=ji)&&(n=cf(n,t.pendingProps,Pi),n===null?e=!1:(t.stateNode=n,Ai=t,ji=null,e=!0)),e||Ii(t)),null;case 13:return Sc(e,t,n);case 4:return se(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ia(t,null,r,n):ic(e,t,r,n),t.child;case 11:return ac(e,t,t.type,t.pendingProps,n);case 7:return ic(e,t,t.pendingProps,n),t.child;case 8:return ic(e,t,t.pendingProps.children,n),t.child;case 12:return ic(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Ki(t,t.type,r.value),ic(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Qi(t),a=$i(a),r=r(a),t.flags|=1,ic(e,t,r,n),t.child;case 14:return oc(e,t,t.type,t.pendingProps,n);case 15:return sc(e,t,t.type,t.pendingProps,n);case 19:return Oc(e,t,n);case 31:return pc(e,t,n);case 22:return cc(e,t,n,t.pendingProps);case 24:return Qi(t),r=$i(aa),e===null?(a=_a(),a===null&&(a=Vl,o=oa(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},za(t),Ki(t,aa,a)):((e.lanes&n)!==0&&(Ba(e,t),qa(t,null,null,n),Ka()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Ki(t,aa,r),r!==a.cache&&Yi(t,[aa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Ki(t,aa,r))),ic(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Nc(e){e.flags|=4}function Pc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Ou())e.flags|=8192;else throw Da=Ca,xa}else e.flags&=-16777217}function Fc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Yf(t))if(Ou())e.flags|=8192;else throw Da=Ca,xa}function Ic(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Ke(),e.lanes|=t,eu|=t)}function Lc(e,t){if(!Mi)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 Rc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function zc(e,t,n){var r=t.pendingProps;switch(Oi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Rc(t),null;case 1:return Rc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),qi(aa),ce(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(zi(t)?Nc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Vi())),Rc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Nc(t),o===null?(Rc(t),Pc(t,a,null,r,n)):(Rc(t),Fc(t,o))):o?o===e.memoizedState?(Rc(t),t.flags&=-16777217):(Nc(t),Rc(t),Fc(t,o)):(e=e.memoizedProps,e!==r&&Nc(t),Rc(t),Pc(t,a,e,r,n)),null;case 27:if(ue(t),n=ae.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Nc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Rc(t),null}e=re.current,zi(t)?Li(t,e):(e=_f(a,r,n),t.stateNode=e,Nc(t))}return Rc(t),null;case 5:if(ue(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Nc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Rc(t),null}if(o=re.current,zi(t))Li(t,o);else{var s=Gd(ae.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[it]=t,o[at]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(zd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Nc(t)}}return Rc(t),Pc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Nc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ae.current,zi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ai,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[it]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Id(e.nodeValue,n)),e||Ii(t,!0)}else e=Gd(e).createTextNode(r),e[it]=t,t.stateNode=e}return Rc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=zi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[it]=t}else Bi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Rc(t),e=!1}else n=Vi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(oo(t),t):(oo(t),null);if(t.flags&128)throw Error(i(558))}return Rc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=zi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[it]=t}else Bi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Rc(t),a=!1}else a=Vi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(oo(t),t):(oo(t),null)}return oo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Ic(t,t.updateQueue),Rc(t),null);case 4:return ce(),e===null&&Ed(t.stateNode.containerInfo),Rc(t),null;case 10:return qi(t.type),Rc(t),null;case 19:if(z(so),r=t.memoizedState,r===null)return Rc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Lc(r,!1);else{if(Yl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=co(e),o!==null){for(t.flags|=128,Lc(r,!1),e=o.updateQueue,t.updateQueue=e,Ic(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ci(n,e),n=n.sibling;return B(so,so.current&1|2),Mi&&Ti(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ce()>ou&&(t.flags|=128,a=!0,Lc(r,!1),t.lanes=4194304)}else{if(!a)if(e=co(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Ic(t,e),Lc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Mi)return Rc(t),null}else 2*Ce()-r.renderingStartTime>ou&&n!==536870912&&(t.flags|=128,a=!0,Lc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Rc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ce(),e.sibling=null,n=so.current,B(so,a?n&1|2:n&1),Mi&&Ti(t,r.treeForkCount),e);case 22:case 23:return oo(t),$a(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Rc(t),t.subtreeFlags&6&&(t.flags|=8192)):Rc(t),n=t.updateQueue,n!==null&&Ic(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&z(ga),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),qi(aa),Rc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Bc(e,t){switch(Oi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return qi(aa),ce(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ue(t),null;case 31:if(t.memoizedState!==null){if(oo(t),t.alternate===null)throw Error(i(340));Bi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(oo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Bi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return z(so),null;case 4:return ce(),null;case 10:return qi(t.type),null;case 22:case 23:return oo(t),$a(),e!==null&&z(ga),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return qi(aa),null;case 25:return null;default:return null}}function Vc(e,t){switch(Oi(t),t.tag){case 3:qi(aa),ce();break;case 26:case 27:case 5:ue(t);break;case 4:ce();break;case 31:t.memoizedState!==null&&oo(t);break;case 13:oo(t);break;case 19:z(so);break;case 10:qi(t.type);break;case 22:case 23:oo(t),$a(),e!==null&&z(ga);break;case 24:qi(aa)}}function Hc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){qu(t,t.return,e)}}function Uc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){qu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){qu(t,t.return,e)}}function Wc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ya(t,n)}catch(t){qu(e,e.return,t)}}}function Gc(e,t,n){n.props=Ks(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){qu(e,t,n)}}function Kc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){qu(e,t,n)}}function qc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){qu(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){qu(e,t,n)}else n.current=null}function Jc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){qu(e,e.return,t)}}function Yc(e,t,n){try{var r=e.stateNode;Bd(r,e.type,n,t),r[at]=t}catch(t){qu(e,e.return,t)}}function Xc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&nf(e.type)||e.tag===4}function Zc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Xc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&nf(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Qc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Xt));else if(r!==4&&(r===27&&nf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Qc(e,t,n),e=e.sibling;e!==null;)Qc(e,t,n),e=e.sibling}function $c(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&nf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for($c(e,t,n),e=e.sibling;e!==null;)$c(e,t,n),e=e.sibling}function el(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);zd(t,r,n),t[it]=e,t[at]=n}catch(t){qu(e,e.return,t)}}var tl=!1,nl=!1,rl=!1,il=typeof WeakSet==`function`?WeakSet:Set,al=null;function ol(e,t){if(e=e.containerInfo,Ud=fp,e=wr(e),Tr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Wd={focusedElem:e,selectionRange:n},fp=!1,al=t;al!==null;)if(t=al,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,al=e;else for(;al!==null;){switch(t=al,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Ks(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){qu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)of(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:of(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,al=e;break}al=t.return}}function sl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Sl(e,n),r&4&&Hc(5,n);break;case 1:if(Sl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){qu(n,n.return,e)}else{var i=Ks(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){qu(n,n.return,e)}}r&64&&Wc(n),r&512&&Kc(n,n.return);break;case 3:if(Sl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Ya(e,t)}catch(e){qu(n,n.return,e)}}break;case 27:t===null&&r&4&&el(n);case 26:case 5:Sl(e,n),t===null&&r&4&&Jc(n),r&512&&Kc(n,n.return);break;case 12:Sl(e,n);break;case 31:Sl(e,n),r&4&&pl(e,n);break;case 13:Sl(e,n),r&4&&ml(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Zu.bind(null,n),ff(e,n))));break;case 22:if(r=n.memoizedState!==null||tl,!r){t=t!==null&&t.memoizedState!==null||nl,i=tl;var a=nl;tl=r,(nl=t)&&!a?wl(e,n,(n.subtreeFlags&8772)!=0):Sl(e,n),tl=i,nl=a}break;case 30:break;default:Sl(e,n)}}function cl(e){var t=e.alternate;t!==null&&(e.alternate=null,cl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ft(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var ll=null,ul=!1;function dl(e,t,n){for(n=n.child;n!==null;)fl(e,t,n),n=n.sibling}function fl(e,t,n){if(Ne&&typeof Ne.onCommitFiberUnmount==`function`)try{Ne.onCommitFiberUnmount(Me,n)}catch{}switch(n.tag){case 26:nl||qc(n,t),dl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:nl||qc(n,t);var r=ll,i=ul;nf(n.type)&&(ll=n.stateNode,ul=!1),dl(e,t,n),vf(n.stateNode),ll=r,ul=i;break;case 5:nl||qc(n,t);case 6:if(r=ll,i=ul,ll=null,dl(e,t,n),ll=r,ul=i,ll!==null)if(ul)try{(ll.nodeType===9?ll.body:ll.nodeName===`HTML`?ll.ownerDocument.body:ll).removeChild(n.stateNode)}catch(e){qu(n,t,e)}else try{ll.removeChild(n.stateNode)}catch(e){qu(n,t,e)}break;case 18:ll!==null&&(ul?(e=ll,rf(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Rp(e)):rf(ll,n.stateNode));break;case 4:r=ll,i=ul,ll=n.stateNode.containerInfo,ul=!0,dl(e,t,n),ll=r,ul=i;break;case 0:case 11:case 14:case 15:Uc(2,n,t),nl||Uc(4,n,t),dl(e,t,n);break;case 1:nl||(qc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Gc(n,t,r)),dl(e,t,n);break;case 21:dl(e,t,n);break;case 22:nl=(r=nl)||n.memoizedState!==null,dl(e,t,n),nl=r;break;default:dl(e,t,n)}}function pl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Rp(e)}catch(e){qu(t,t.return,e)}}}function ml(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Rp(e)}catch(e){qu(t,t.return,e)}}function hl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new il),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new il),t;default:throw Error(i(435,e.tag))}}function gl(e,t){var n=hl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Qu.bind(null,e,t);t.then(r,r)}})}function _l(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(nf(c.type)){ll=c.stateNode,ul=!1;break a}break;case 5:ll=c.stateNode,ul=!1;break a;case 3:case 4:ll=c.stateNode.containerInfo,ul=!0;break a}c=c.return}if(ll===null)throw Error(i(160));fl(o,s,a),ll=null,ul=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)yl(t,e),t=t.sibling}var vl=null;function yl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:_l(t,e),bl(e),r&4&&(Uc(3,e,e.return),Hc(3,e),Uc(5,e,e.return));break;case 1:_l(t,e),bl(e),r&512&&(nl||n===null||qc(n,n.return)),r&64&&tl&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=vl;if(_l(t,e),bl(e),r&512&&(nl||n===null||qc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[dt]||o[it]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head >
9 title`))),zd(o,r,n),o[it]=e,_t(o),r=o;break a;case`link`:var s=Kf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),zd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Kf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),zd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[it]=e,_t(o),r=o}e.stateNode=r}else qf(a,e.type,e.stateNode);else e.stateNode=Vf(a,r,e.memoizedProps);
vendor: 66,024 bytes, lines 9-10
9else o===r?r===null&&e.stateNode!==null&&Yc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?qf(a,e.type,e.stateNode):Vf(a,r,e.memoizedProps))}break;case 27:_l(t,e),bl(e),r&512&&(nl||n===null||qc(n,n.return)),n!==null&&r&4&&Yc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(_l(t,e),bl(e),r&512&&(nl||n===null||qc(n,n.return)),e.flags&32){a=e.stateNode;try{Ht(a,``)}catch(t){qu(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Yc(e,a,n===null?a:n.memoizedProps)),r&1024&&(rl=!0);break;case 6:if(_l(t,e),bl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){qu(e,e.return,t)}}break;case 3:if(Gf=null,a=vl,vl=xf(t.containerInfo),_l(t,e),vl=a,bl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Rp(t.containerInfo)}catch(t){qu(e,e.return,t)}rl&&(rl=!1,xl(e));break;case 4:r=vl,vl=xf(e.stateNode.containerInfo),_l(t,e),bl(e),vl=r;break;case 12:_l(t,e),bl(e);break;case 31:_l(t,e),bl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,gl(e,r)));break;case 13:_l(t,e),bl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(iu=Ce()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,gl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=tl,d=nl;if(tl=u||a,nl=d||l,_l(t,e),nl=d,tl=u,bl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||tl||nl||Cl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){qu(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){qu(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?af(m,!0):af(l.stateNode,!1)}catch(e){qu(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,gl(e,n))));break;case 19:_l(t,e),bl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,gl(e,r)));break;case 30:break;case 21:break;default:_l(t,e),bl(e)}}function bl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Xc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;$c(e,Zc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Ht(o,``),n.flags&=-33),$c(e,Zc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Qc(e,Zc(e),s);break;default:throw Error(i(161))}}catch(t){qu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function xl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;xl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Sl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)sl(e,t.alternate,t),t=t.sibling}function Cl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Uc(4,t,t.return),Cl(t);break;case 1:qc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Gc(t,t.return,n),Cl(t);break;case 27:vf(t.stateNode);case 26:case 5:qc(t,t.return),Cl(t);break;case 22:t.memoizedState===null&&Cl(t);break;case 30:Cl(t);break;default:Cl(t)}e=e.sibling}}function wl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:wl(i,a,n),Hc(4,a);break;case 1:if(wl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){qu(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Ja(c[i],s)}catch(e){qu(r,r.return,e)}}n&&o&64&&Wc(a),Kc(a,a.return);break;case 27:el(a);case 26:case 5:wl(i,a,n),n&&r===null&&o&4&&Jc(a),Kc(a,a.return);break;case 12:wl(i,a,n);break;case 31:wl(i,a,n),n&&o&4&&pl(i,a);break;case 13:wl(i,a,n),n&&o&4&&ml(i,a);break;case 22:a.memoizedState===null&&wl(i,a,n),Kc(a,a.return);break;case 30:break;default:wl(i,a,n)}t=t.sibling}}function Tl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&sa(n))}function El(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&sa(e))}function Dl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Ol(e,t,n,r),t=t.sibling}function Ol(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Dl(e,t,n,r),i&2048&&Hc(9,t);break;case 1:Dl(e,t,n,r);break;case 3:Dl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&sa(e)));break;case 12:if(i&2048){Dl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){qu(t,t.return,e)}}else Dl(e,t,n,r);break;case 31:Dl(e,t,n,r);break;case 13:Dl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Dl(e,t,n,r):(a._visibility|=2,kl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?Dl(e,t,n,r):Al(e,t),i&2048&&Tl(o,t);break;case 24:Dl(e,t,n,r),i&2048&&El(t.alternate,t);break;default:Dl(e,t,n,r)}}function kl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:kl(a,o,s,c,i),Hc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,kl(a,o,s,c,i)):u._visibility&2?kl(a,o,s,c,i):Al(a,o),i&&l&2048&&Tl(o.alternate,o);break;case 24:kl(a,o,s,c,i),i&&l&2048&&El(o.alternate,o);break;default:kl(a,o,s,c,i)}t=t.sibling}}function Al(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Al(n,r),i&2048&&Tl(r.alternate,r);break;case 24:Al(n,r),i&2048&&El(r.alternate,r);break;default:Al(n,r)}t=t.sibling}}var jl=8192;function Ml(e,t,n){if(e.subtreeFlags&jl)for(e=e.child;e!==null;)Nl(e,t,n),e=e.sibling}function Nl(e,t,n){switch(e.tag){case 26:Ml(e,t,n),e.flags&jl&&e.memoizedState!==null&&Xf(n,vl,e.memoizedState,e.memoizedProps);break;case 5:Ml(e,t,n);break;case 3:case 4:var r=vl;vl=xf(e.stateNode.containerInfo),Ml(e,t,n),vl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=jl,jl=16777216,Ml(e,t,n),jl=r):Ml(e,t,n));break;default:Ml(e,t,n)}}function Pl(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Fl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];al=r,Rl(r,e)}Pl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Il(e),e=e.sibling}function Il(e){switch(e.tag){case 0:case 11:case 15:Fl(e),e.flags&2048&&Uc(9,e,e.return);break;case 3:Fl(e);break;case 12:Fl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ll(e)):Fl(e);break;default:Fl(e)}}function Ll(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];al=r,Rl(r,e)}Pl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Uc(8,t,t.return),Ll(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Ll(t));break;default:Ll(t)}e=e.sibling}}function Rl(e,t){for(;al!==null;){var n=al;switch(n.tag){case 0:case 11:case 15:Uc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:sa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,al=r;else a:for(n=e;al!==null;){r=al;var i=r.sibling,a=r.return;if(cl(r),r===n){al=null;break a}if(i!==null){i.return=a,al=i;break a}al=a}}}var W={getCacheForType:function(e){var t=$i(aa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return $i(aa).controller.signal}},zl=typeof WeakMap==`function`?WeakMap:Map,Bl=0,Vl=null,Hl=null,Ul=0,Wl=0,Gl=null,G=!1,Kl=!1,ql=!1,Jl=0,Yl=0,Xl=0,Zl=0,Ql=0,$l=0,eu=0,tu=null,nu=null,ru=!1,iu=0,au=0,ou=1/0,su=null,cu=null,lu=0,K=null,uu=null,du=0,fu=0,pu=null,mu=null,hu=0,gu=null;function _u(){return Bl&2&&Ul!==0?Ul&-Ul:F.T===null?tt():md()}function vu(){if($l===0)if(!(Ul&536870912)||Mi){var e=Be;Be<<=1,!(Be&3932160)&&(Be=262144),$l=e}else $l=536870912;return e=eo.current,e!==null&&(e.flags|=32),$l}function yu(e,t,n){(e===Vl&&(Wl===2||Wl===9)||e.cancelPendingCommit!==null)&&(Eu(e,0),Cu(e,Ul,$l,!1)),Je(e,n),(!(Bl&2)||e!==Vl)&&(e===Vl&&(!(Bl&2)&&(Zl|=n),Yl===4&&Cu(e,Ul,$l,!1)),od(e))}function bu(e,t,n){if(Bl&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||We(e,t),a=r?Pu(e,t):Mu(e,t,!0),o=r;do{if(a===0){Kl&&!r&&Cu(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!Su(n)){a=Mu(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=tu;var l=c.current.memoizedState.isDehydrated;if(l&&(Eu(c,s).flags|=256),s=Mu(c,s,!1),s!==2){if(ql&&!l){c.errorRecoveryDisabledLanes|=o,Zl|=o,a=4;break a}o=nu,nu=a,o!==null&&(nu===null?nu=o:nu.push.apply(nu,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Eu(e,0),Cu(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:Cu(r,t,$l,!G);break a;case 2:nu=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=iu+300-Ce(),10<a)){if(Cu(r,t,$l,!G),Ue(r,0,!0)!==0)break a;du=t,r.timeoutHandle=Zd(xu.bind(null,r,n,nu,su,ru,t,$l,Zl,eu,G,o,`Throttled`,-0,0),a);break a}xu(r,n,nu,su,ru,t,$l,Zl,eu,G,o,null,-0,0)}}break}while(1);od(e)}function xu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Xt},Nl(t,a,d);var m=(a&62914560)===a?iu-Ce():(a&4194048)===a?au-Ce():0;if(m=Qf(d,m),m!==null){du=a,e.cancelPendingCommit=m(Bu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),Cu(e,a,o,!l);return}}Bu(e,t,a,n,r,i,o,s,c)}function Su(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!yr(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 Cu(e,t,n,r){t&=~Ql,t&=~Zl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Fe(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Xe(e,n,t)}function wu(){return Bl&6?!0:(sd(0,!1),!1)}function Tu(){if(Hl!==null){if(Wl===0)var e=Hl.return;else e=Hl,Gi=Wi=null,ko(e),Aa=null,ja=0,e=Hl;for(;e!==null;)Vc(e.alternate,e),e=e.return;Hl=null}}function Eu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Qd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),du=0,Tu(),Vl=e,Hl=n=si(e.current,null),Ul=t,Wl=0,Gl=null,G=!1,Kl=We(e,t),ql=!1,eu=$l=Ql=Zl=Xl=Yl=0,nu=tu=null,ru=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Fe(r),a=1<<i;t|=e[i],r&=~a}return Jl=t,Zr(),n}function Du(e,t){uo=null,F.H=Rs,t===ba||t===Sa?(t=Oa(),Wl=3):t===xa?(t=Oa(),Wl=4):Wl=t===nc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Gl=t,Hl===null&&(Yl=1,Xs(e,hi(t,e.current)))}function Ou(){var e=eo.current;return e===null?!0:(Ul&4194048)===Ul?to===null:(Ul&62914560)===Ul||Ul&536870912?e===to:!1}function ku(){var e=F.H;return F.H=Rs,e===null?Rs:e}function Au(){var e=F.A;return F.A=W,e}function ju(){Yl=4,G||(Ul&4194048)!==Ul&&eo.current!==null||(Kl=!0),!(Xl&134217727)&&!(Zl&134217727)||Vl===null||Cu(Vl,Ul,$l,!1)}function Mu(e,t,n){var r=Bl;Bl|=2;var i=ku(),a=Au();(Vl!==e||Ul!==t)&&(su=null,Eu(e,t)),t=!1;var o=Yl;a:do try{if(Wl!==0&&Hl!==null){var s=Hl,c=Gl;switch(Wl){case 8:Tu(),o=6;break a;case 3:case 2:case 9:case 6:eo.current===null&&(t=!0);var l=Wl;if(Wl=0,Gl=null,Ru(e,s,c,l),n&&Kl){o=0;break a}break;default:l=Wl,Wl=0,Gl=null,Ru(e,s,c,l)}}Nu(),o=Yl;break}catch(t){Du(e,t)}while(1);return t&&e.shellSuspendCounter++,Gi=Wi=null,Bl=r,F.H=i,F.A=a,Hl===null&&(Vl=null,Ul=0,Zr()),o}function Nu(){for(;Hl!==null;)Iu(Hl)}function Pu(e,t){var n=Bl;Bl|=2;var r=ku(),a=Au();Vl!==e||Ul!==t?(su=null,ou=Ce()+500,Eu(e,t)):Kl=We(e,t);a:do try{if(Wl!==0&&Hl!==null){t=Hl;var o=Gl;b:switch(Wl){case 1:Wl=0,Gl=null,Ru(e,t,o,1);break;case 2:case 9:if(wa(o)){Wl=0,Gl=null,Lu(t);break}t=function(){Wl!==2&&Wl!==9||Vl!==e||(Wl=7),od(e)},o.then(t,t);break a;case 3:Wl=7;break a;case 4:Wl=5;break a;case 7:wa(o)?(Wl=0,Gl=null,Lu(t)):(Wl=0,Gl=null,Ru(e,t,o,7));break;case 5:var s=null;switch(Hl.tag){case 26:s=Hl.memoizedState;case 5:case 27:var c=Hl;if(s?Yf(s):c.stateNode.complete){Wl=0,Gl=null;var l=c.sibling;if(l!==null)Hl=l;else{var u=c.return;u===null?Hl=null:(Hl=u,zu(u))}break b}}Wl=0,Gl=null,Ru(e,t,o,5);break;case 6:Wl=0,Gl=null,Ru(e,t,o,6);break;case 8:Tu(),Yl=6;break a;default:throw Error(i(462))}}Fu();break}catch(t){Du(e,t)}while(1);return Gi=Wi=null,F.H=r,F.A=a,Bl=n,Hl===null?(Vl=null,Ul=0,Zr(),Yl):0}function Fu(){for(;Hl!==null&&!xe();)Iu(Hl)}function Iu(e){var t=Mc(e.alternate,e,Jl);e.memoizedProps=e.pendingProps,t===null?zu(e):Hl=t}function Lu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=gc(n,t,t.pendingProps,t.type,void 0,Ul);break;case 11:t=gc(n,t,t.pendingProps,t.type.render,t.ref,Ul);break;case 5:ko(t);default:Vc(n,t),t=Hl=ci(t,Jl),t=Mc(n,t,Jl)}e.memoizedProps=e.pendingProps,t===null?zu(e):Hl=t}function Ru(e,t,n,r){Gi=Wi=null,ko(t),Aa=null,ja=0;var i=t.return;try{if(tc(e,i,t,n,Ul)){Yl=1,Xs(e,hi(n,e.current)),Hl=null;return}}catch(t){if(i!==null)throw Hl=i,t;Yl=1,Xs(e,hi(n,e.current)),Hl=null;return}t.flags&32768?(Mi||r===1?e=!0:Kl||Ul&536870912?e=!1:(G=e=!0,(r===2||r===9||r===3||r===6)&&(r=eo.current,r!==null&&r.tag===13&&(r.flags|=16384))),q(t,e)):zu(t)}function zu(e){var t=e;do{if(t.flags&32768){q(t,G);return}e=t.return;var n=zc(t.alternate,t,Jl);if(n!==null){Hl=n;return}if(t=t.sibling,t!==null){Hl=t;return}Hl=t=e}while(t!==null);Yl===0&&(Yl=5)}function q(e,t){do{var n=Bc(e.alternate,e);if(n!==null){n.flags&=32767,Hl=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Hl=e;return}Hl=e=n}while(e!==null);Yl=6,Hl=null}function Bu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Wu();while(lu!==0);if(Bl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Xr,Ye(e,n,o,s,c,l),e===Vl&&(Hl=Vl=null,Ul=0),uu=t,K=e,du=n,fu=o,pu=a,mu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,$u(De,function(){return Gu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=F.T,F.T=null,a=I.p,I.p=2,s=Bl,Bl|=4;try{ol(e,t,n)}finally{Bl=s,I.p=a,F.T=r}}lu=1,J(),Vu(),Hu()}}function J(){if(lu===1){lu=0;var e=K,t=uu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=F.T,F.T=null;var r=I.p;I.p=2;var i=Bl;Bl|=4;try{yl(t,e);var a=Wd,o=wr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Cr(s.ownerDocument.documentElement,s)){if(c!==null&&Tr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Sr(s,h),v=Sr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}fp=!!Ud,Wd=Ud=null}finally{Bl=i,I.p=r,F.T=n}}e.current=t,lu=2}}function Vu(){if(lu===2){lu=0;var e=K,t=uu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=F.T,F.T=null;var r=I.p;I.p=2;var i=Bl;Bl|=4;try{sl(e,t.alternate,t)}finally{Bl=i,I.p=r,F.T=n}}lu=3}}function Hu(){if(lu===4||lu===3){lu=0,Se();var e=K,t=uu,n=du,r=mu;t.subtreeFlags&10256||t.flags&10256?lu=5:(lu=0,uu=K=null,Uu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(cu=null),et(n),t=t.stateNode,Ne&&typeof Ne.onCommitFiberRoot==`function`)try{Ne.onCommitFiberRoot(Me,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=F.T,i=I.p,I.p=2,F.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{F.T=t,I.p=i}}du&3&&Wu(),od(e),i=e.pendingLanes,n&261930&&i&42?e===gu?hu++:(hu=0,gu=e):hu=0,sd(0,!1)}}function Uu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,sa(t)))}function Wu(){return J(),Vu(),Hu(),Gu()}function Gu(){if(lu!==5)return!1;var e=K,t=fu;fu=0;var n=et(du),r=F.T,a=I.p;try{I.p=32>n?32:n,F.T=null,n=pu,pu=null;var o=K,s=du;if(lu=0,uu=K=null,du=0,Bl&6)throw Error(i(331));var c=Bl;if(Bl|=4,Il(o.current),Ol(o,o.current,s,n),Bl=c,sd(0,!1),Ne&&typeof Ne.onPostCommitFiberRoot==`function`)try{Ne.onPostCommitFiberRoot(Me,o)}catch{}return!0}finally{I.p=a,F.T=r,Uu(e,t)}}function Ku(e,t,n){t=hi(n,t),t=Qs(e.stateNode,t,2),e=Ha(e,t,2),e!==null&&(Je(e,2),od(e))}function qu(e,t,n){if(e.tag===3)Ku(e,e,n);else for(;t!==null;){if(t.tag===3){Ku(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(cu===null||!cu.has(r))){e=hi(n,e),n=$s(2),r=Ha(t,n,2),r!==null&&(ec(n,r,t,e),Je(r,2),od(r));break}}t=t.return}}function Ju(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new zl;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)||(ql=!0,i.add(n),e=Yu.bind(null,e,t,n),t.then(e,e))}function Yu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Vl===e&&(Ul&n)===n&&(Yl===4||Yl===3&&(Ul&62914560)===Ul&&300>Ce()-iu?!(Bl&2)&&Eu(e,0):Ql|=n,eu===Ul&&(eu=0)),od(e)}function Xu(e,t){t===0&&(t=Ke()),e=ei(e,t),e!==null&&(Je(e,t),od(e))}function Zu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Xu(e,n)}function Qu(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Xu(e,n)}function $u(e,t){return ye(e,t)}var ed=null,td=null,nd=!1,rd=!1,id=!1,ad=0;function od(e){e!==td&&e.next===null&&(td===null?ed=td=e:td=td.next=e),rd=!0,nd||(nd=!0,pd())}function sd(e,t){if(!id&&rd){id=!0;do for(var n=!1,r=ed;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Fe(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,fd(r,a))}else a=Ul,a=Ue(r,r===Vl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||We(r,a)||(n=!0,fd(r,a));r=r.next}while(n);id=!1}}function cd(){ld()}function ld(){rd=nd=!1;var e=0;ad!==0&&Xd()&&(e=ad);for(var t=Ce(),n=null,r=ed;r!==null;){var i=r.next,a=ud(r,t);a===0?(r.next=null,n===null?ed=i:n.next=i,i===null&&(td=n)):(n=r,(e!==0||a&3)&&(rd=!0)),r=i}lu!==0&&lu!==5||sd(e,!1),ad!==0&&(ad=0)}function ud(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Fe(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Ge(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Vl,n=Ul,n=Ue(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Wl===2||Wl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&be(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||We(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&be(r),et(n)){case 2:case 8:n=Ee;break;case 32:n=De;break;case 268435456:n=ke;break;default:n=De}return r=dd.bind(null,e),n=ye(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&be(r),e.callbackPriority=2,e.callbackNode=null,2}function dd(e,t){if(lu!==0&&lu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Wu()&&e.callbackNode!==n)return null;var r=Ul;return r=Ue(e,e===Vl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(bu(e,r,t),ud(e,Ce()),e.callbackNode!=null&&e.callbackNode===n?dd.bind(null,e):null)}function fd(e,t){if(Wu())return null;bu(e,t,!0)}function pd(){ef(function(){Bl&6?ye(Te,cd):ld()})}function md(){if(ad===0){var e=ua;e===0&&(e=ze,ze<<=1,!(ze&261888)&&(ze=256)),ad=e}return ad}function hd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Yt(``+e)}function gd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function _d(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=hd((i[at]||null).action),o=r.submitter;o&&(t=(t=o[at]||null)?hd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new vn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(ad!==0){var e=o?gd(i,o):new FormData(i);Ts(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?gd(i,o):new FormData(i),Ts(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var vd=0;vd<Gr.length;vd++){var yd=Gr[vd];Kr(yd.toLowerCase(),`on`+(yd[0].toUpperCase()+yd.slice(1)))}Kr(Lr,`onAnimationEnd`),Kr(Rr,`onAnimationIteration`),Kr(zr,`onAnimationStart`),Kr(`dblclick`,`onDoubleClick`),Kr(`focusin`,`onFocus`),Kr(`focusout`,`onBlur`),Kr(Br,`onTransitionRun`),Kr(Vr,`onTransitionStart`),Kr(Hr,`onTransitionCancel`),Kr(Ur,`onTransitionEnd`),V(`onMouseEnter`,[`mouseout`,`mouseover`]),V(`onMouseLeave`,[`mouseout`,`mouseover`]),V(`onPointerEnter`,[`pointerout`,`pointerover`]),V(`onPointerLeave`,[`pointerout`,`pointerover`]),bt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),bt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),bt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),bt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),bt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),bt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var bd=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),xd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(bd));function Sd(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){qr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){qr(e)}i.currentTarget=null,a=c}}}}function Cd(e,t){var n=t[st];n===void 0&&(n=t[st]=new Set);var r=e+`__bubble`;n.has(r)||(Dd(t,e,2,!1),n.add(r))}function wd(e,t,n){var r=0;t&&(r|=4),Dd(n,e,r,t)}var Td=`_reactListening`+Math.random().toString(36).slice(2);function Ed(e){if(!e[Td]){e[Td]=!0,vt.forEach(function(t){t!==`selectionchange`&&(xd.has(t)||wd(t,!1,e),wd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Td]||(t[Td]=!0,wd(`selectionchange`,!1,t))}}function Dd(e,t,n,r){switch(yp(t)){case 2:var i=pp;break;case 8:i=mp;break;default:i=hp}n=i.bind(null,t,n,e),i=void 0,!sn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Od(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;s!==null;){if(o=pt(s),o===null)return;if(l=o.tag,l===5||l===6||l===26||l===27){r=a=o;continue a}s=s.parentNode}}r=r.return}rn(function(){var r=a,i=Qt(n),o=[];a:{var s=Wr.get(e);if(s!==void 0){var l=vn,u=e;switch(e){case`keypress`:if(pn(n)===0)break a;case`keydown`:case`keyup`:l=In;break;case`focusin`:u=`focus`,l=Dn;break;case`focusout`:u=`blur`,l=Dn;break;case`beforeblur`:case`afterblur`:l=Dn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Tn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=En;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Rn;break;case Lr:case Rr:case zr:l=On;break;case Ur:l=zn;break;case`scroll`:case`scrollend`:l=bn;break;case`wheel`:l=Bn;break;case`copy`:case`cut`:case`paste`:l=kn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Ln;break;case`toggle`:case`beforetoggle`:l=Vn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?s===null?null:s+`Capture`:s;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=an(m,p),g!=null&&d.push(kd(m,g,h))),f)break;m=m.return}0<d.length&&(s=new l(s,u,null,n,i),o.push({event:s,listeners:d}))}}if(!(t&7)){a:{if(s=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,s&&n!==Zt&&(u=n.relatedTarget||n.fromElement)&&(pt(u)||u[ot]))break a;if((l||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?pt(u):null,u!==null&&(f=c(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=Tn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Ln,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?s:ht(l),h=u==null?s:ht(u),s=new d(g,m+`leave`,l,n,i),s.target=f,s.relatedTarget=h,g=null,pt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=jd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Md(o,s,l,d,!1),u!==null&&f!==null&&Md(o,f,u,d,!0)}}a:{if(s=r?ht(r):window,l=s.nodeName&&s.nodeName.toLowerCase(),l===`select`||l===`input`&&s.type===`file`)var v=sr;else if(tr(s))if(cr)v=_r;else{v=hr;var y=mr}else l=s.nodeName,!l||l.toLowerCase()!==`input`||s.type!==`checkbox`&&s.type!==`radio`?r&&Kt(r.elementType)&&(v=sr):v=gr;if(v&&=v(e,r)){nr(o,v,n,i);break a}y&&y(e,s,r),e===`focusout`&&r&&s.type===`number`&&r.memoizedProps.value!=null&&Rt(s,`number`,s.value)}switch(y=r?ht(r):window,e){case`focusin`:(tr(y)||y.contentEditable===`true`)&&(Dr=y,Or=r,kr=null);break;case`focusout`:kr=Or=Dr=null;break;case`mousedown`:Ar=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Ar=!1,jr(o,n,i);break;case`selectionchange`:if(Er)break;case`keydown`:case`keyup`:jr(o,n,i)}var b;if(Un)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else Zn?Yn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Kn&&n.locale!==`ko`&&(Zn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Zn&&(b=fn()):(ln=i,un=`value`in ln?ln.value:ln.textContent,Zn=!0)),y=Ad(r,x),0<y.length&&(x=new An(x,e,null,n,i),o.push({event:x,listeners:y}),b?x.data=b:(b=Xn(n),b!==null&&(x.data=b)))),(b=Gn?Qn(e,n):$n(e,n))&&(x=Ad(r,`onBeforeInput`),0<x.length&&(y=new An(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:y,listeners:x}),y.data=b)),_d(o,e,r,n,i)}Sd(o,t)})}function kd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ad(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=an(e,n),i!=null&&r.unshift(kd(e,i,a)),i=an(e,t),i!=null&&r.push(kd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function jd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Md(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=an(n,a),l!=null&&o.unshift(kd(n,l,c))):i||(l=an(n,a),l!=null&&o.push(kd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Nd=/\r\n?/g,Pd=/\u0000|\uFFFD/g;function Fd(e){return(typeof e==`string`?e:``+e).replace(Nd,` 10`).replace(Pd,``)}function Id(e,t){return t=Fd(t),Fd(e)===t}function Ld(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Ht(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Ht(e,``+r);break;case`className`:Et(e,`class`,r);break;case`tabIndex`:Et(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Et(e,n,r);break;case`style`:Gt(e,r,o);break;case`data`:if(t!==`object`){Et(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Yt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&Ld(e,t,`name`,a.name,a,null),Ld(e,t,`formEncType`,a.formEncType,a,null),Ld(e,t,`formMethod`,a.formMethod,a,null),Ld(e,t,`formTarget`,a.formTarget,a,null)):(Ld(e,t,`encType`,a.encType,a,null),Ld(e,t,`method`,a.method,a,null),Ld(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Yt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Xt);break;case`onScroll`:r!=null&&Cd(`scroll`,e);break;case`onScrollEnd`:r!=null&&Cd(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Yt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Cd(`beforetoggle`,e),Cd(`toggle`,e),Tt(e,`popover`,r);break;case`xlinkActuate`:Dt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Dt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Dt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Dt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Dt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Dt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Dt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Dt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Dt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Tt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=qt.get(n)||n,Tt(e,n,r))}}function Rd(e,t,n,r,a,o){switch(n){case`style`:Gt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Ht(e,r):(typeof r==`number`||typeof r==`bigint`)&&Ht(e,``+r);break;case`onScroll`:r!=null&&Cd(`scroll`,e);break;case`onScrollEnd`:r!=null&&Cd(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Xt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!yt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[at]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Tt(e,n,r)}}}function zd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Cd(`error`,e),Cd(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Ld(e,t,o,s,n,null)}}a&&Ld(e,t,`srcSet`,n.srcSet,n,null),r&&Ld(e,t,`src`,n.src,n,null);return;case`input`:Cd(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Ld(e,t,r,d,n,null)}}Lt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Cd(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Ld(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&zt(e,!!r,n,!0):zt(e,!!r,t,!1);return;case`textarea`:for(s in Cd(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Ld(e,t,s,c,n,null)}Vt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Ld(e,t,l,r,n,null)}return;case`dialog`:Cd(`beforetoggle`,e),Cd(`toggle`,e),Cd(`cancel`,e),Cd(`close`,e);break;case`iframe`:case`object`:Cd(`load`,e);break;case`video`:case`audio`:for(r=0;r<bd.length;r++)Cd(bd[r],e);break;case`image`:Cd(`error`,e),Cd(`load`,e);break;case`details`:Cd(`toggle`,e);break;case`embed`:case`source`:case`link`:Cd(`error`,e),Cd(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Ld(e,t,u,r,n,null)}return;default:if(Kt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Rd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Ld(e,t,c,r,n,null))}function Bd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Ld(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Ld(e,t,p,m,r,f)}}It(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Ld(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Ld(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?zt(e,!!n,n?[]:``,!1):zt(e,!!n,t,!0)):zt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Ld(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Ld(e,t,s,a,r,o)}Bt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Ld(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Ld(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Ld(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Ld(e,t,u,p,r,m)}return;default:if(Kt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Rd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Rd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Ld(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Ld(e,t,f,p,r,m)}function Vd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Hd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Vd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Vd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Ud=null,Wd=null;function Gd(e){return e.nodeType===9?e:e.ownerDocument}function Kd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function qd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Jd(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Yd=null;function Xd(){var e=window.event;return e&&e.type===`popstate`?e===Yd?!1:(Yd=e,!0):(Yd=null,!1)}var Zd=typeof setTimeout==`function`?setTimeout:void 0,Qd=typeof clearTimeout==`function`?clearTimeout:void 0,$d=typeof Promise==`function`?Promise:void 0,ef=typeof queueMicrotask==`function`?queueMicrotask:$d===void 0?Zd:function(e){return $d.resolve(null).then(e).catch(tf)};function tf(e){setTimeout(function(){throw e})}function nf(e){return e===`head`}function rf(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Rp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)vf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,vf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[dt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&vf(e.ownerDocument.body);n=i}while(n);Rp(t)}function af(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function of(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:of(n),ft(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function sf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[dt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=pf(e.nextSibling),e===null)break}return null}function cf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=pf(e.nextSibling),e===null))return null;return e}function lf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=pf(e.nextSibling),e===null))return null;return e}function uf(e){return e.data===`$?`||e.data===`$~`}function df(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function ff(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function pf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var mf=null;function hf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return pf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function gf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function _f(e,t,n){switch(t=Gd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function vf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ft(e)}var yf=new Map,bf=new Set;function xf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Sf=I.d;I.d={f:Cf,r:wf,D:Df,C:Of,L:kf,m:Af,X:Mf,S:jf,M:Nf};function Cf(){var e=Sf.f(),t=wu();return e||t}function wf(e){var t=mt(e);t!==null&&t.tag===5&&t.type===`form`?Es(t):Sf.r(e)}var Tf=typeof document>`u`?null:document;function Ef(e,t,n){var r=Tf;if(r&&typeof t==`string`&&t){var i=Ft(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),bf.has(i)||(bf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),zd(t,`link`,e),_t(t),r.head.appendChild(t)))}}function Df(e){Sf.D(e),Ef(`dns-prefetch`,e,null)}function Of(e,t){Sf.C(e,t),Ef(`preconnect`,e,t)}function kf(e,t,n){Sf.L(e,t,n);var r=Tf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Ft(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Ft(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Ft(n.imageSizes)+`"]`)):i+=`[href="`+Ft(e)+`"]`;var a=i;switch(t){case`style`:a=Ff(e);break;case`script`:a=zf(e)}yf.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),yf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(If(a))||t===`script`&&r.querySelector(Bf(a))||(t=r.createElement(`link`),zd(t,`link`,e),_t(t),r.head.appendChild(t)))}}function Af(e,t){Sf.m(e,t);var n=Tf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Ft(r)+`"][href="`+Ft(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=zf(e)}if(!yf.has(a)&&(e=h({rel:`modulepreload`,href:e},t),yf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Bf(a)))return}r=n.createElement(`link`),zd(r,`link`,e),_t(r),n.head.appendChild(r)}}}function jf(e,t,n){Sf.S(e,t,n);var r=Tf;if(r&&e){var i=gt(r).hoistableStyles,a=Ff(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(If(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=yf.get(a))&&Uf(e,n);var c=o=r.createElement(`link`);_t(c),zd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Hf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Mf(e,t){Sf.X(e,t);var n=Tf;if(n&&e){var r=gt(n).hoistableScripts,i=zf(e),a=r.get(i);a||(a=n.querySelector(Bf(i)),a||(e=h({src:e,async:!0},t),(t=yf.get(i))&&Wf(e,t),a=n.createElement(`script`),_t(a),zd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nf(e,t){Sf.M(e,t);var n=Tf;if(n&&e){var r=gt(n).hoistableScripts,i=zf(e),a=r.get(i);a||(a=n.querySelector(Bf(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=yf.get(i))&&Wf(e,t),a=n.createElement(`script`),_t(a),zd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Pf(e,t,n,r){var a=(a=ae.current)?xf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Ff(n.href),n=gt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Ff(n.href);var o=gt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(If(e)))&&!o._p&&(s.instance=o,s.state.loading=5),yf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},yf.set(e,n),o||Rf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=zf(n),n=gt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Ff(e){return`href="`+Ft(e)+`"`}function If(e){return`link[rel="stylesheet"][`+e+`]`}function Lf(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function Rf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),zd(t,`link`,n),_t(t),e.head.appendChild(t))}function zf(e){return`[src="`+Ft(e)+`"]`}function Bf(e){return`script[async]`+e}function Vf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Ft(n.href)+`"]`);if(r)return t.instance=r,_t(r),r;var a=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),_t(r),zd(r,`style`,a),Hf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Ff(n.href);var o=e.querySelector(If(a));if(o)return t.state.loading|=4,t.instance=o,_t(o),o;r=Lf(n),(a=yf.get(a))&&Uf(r,a),o=(e.ownerDocument||e).createElement(`link`),_t(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),zd(o,`link`,r),t.state.loading|=4,Hf(o,n.precedence,e),t.instance=o;case`script`:return o=zf(n.src),(a=e.querySelector(Bf(o)))?(t.instance=a,_t(a),a):(r=n,(a=yf.get(o))&&(r=h({},n),Wf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),_t(a),zd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Hf(r,n.precedence,e));return t.instance}function Hf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Uf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Wf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Gf=null;function Kf(e,t,n){if(Gf===null){var r=new Map,i=Gf=new Map;i.set(n,r)}else i=Gf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[dt]||a[it]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function qf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Jf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Yf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Xf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Ff(r.href),a=t.querySelector(If(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=$f.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,_t(a);return}a=t.ownerDocument||t,r=Lf(r),(i=yf.get(i))&&Uf(r,i),a=a.createElement(`link`),_t(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),zd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=$f.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Zf=0;function Qf(e,t){return e.stylesheets&&e.count===0&&tp(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&tp(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Zf===0&&(Zf=62500*Hd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&tp(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Zf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function $f(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)tp(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ep=null;function tp(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ep=new Map,t.forEach(np,e),ep=null,$f.call(e))}function np(e,t){if(!(t.state.loading&4)){var n=ep.get(e);if(n)var r=n.get(null);else{n=new Map,ep.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=$f.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var rp={$$typeof:C,Provider:null,Consumer:null,_currentValue:te,_currentValue2:te,_threadCount:0};function ip(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=qe(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=qe(0),this.hiddenUpdates=qe(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function ap(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ip(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ai(3,null,null,t),e.current=a,a.stateNode=e,t=oa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},za(a),e}function op(e){return e?(e=ri,e):ri}function sp(e,t,n,r,i,a){i=op(i),r.context===null?r.context=i:r.pendingContext=i,r=Va(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ha(e,r,t),n!==null&&(yu(n,e,t),Ua(n,e,t))}function cp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function lp(e,t){cp(e,t),(e=e.alternate)&&cp(e,t)}function up(e){if(e.tag===13||e.tag===31){var t=ei(e,67108864);t!==null&&yu(t,e,67108864),lp(e,67108864)}}function dp(e){if(e.tag===13||e.tag===31){var t=_u();t=$e(t);var n=ei(e,t);n!==null&&yu(n,e,t),lp(e,t)}}var fp=!0;function pp(e,t,n,r){var i=F.T;F.T=null;var a=I.p;try{I.p=2,hp(e,t,n,r)}finally{I.p=a,F.T=i}}function mp(e,t,n,r){var i=F.T;F.T=null;var a=I.p;try{I.p=8,hp(e,t,n,r)}finally{I.p=a,F.T=i}}function hp(e,t,n,r){if(fp){var i=gp(r);if(i===null)Od(e,t,r,_p,n),Op(e,r);else if(Ap(i,e,t,n,r))r.stopPropagation();else if(Op(e,r),t&4&&-1<Dp.indexOf(e)){for(;i!==null;){var a=mt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=He(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Fe(o);s.entanglements[1]|=c,o&=~c}od(a),!(Bl&6)&&(ou=Ce()+500,sd(0,!1))}}break;case 31:case 13:s=ei(a,2),s!==null&&yu(s,a,2),wu(),lp(a,2)}if(a=gp(r),a===null&&Od(e,t,r,_p,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Od(e,t,r,null,n)}}function gp(e){return e=Qt(e),vp(e)}var _p=null;function vp(e){if(_p=null,e=pt(e),e!==null){var t=c(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=u(t),e!==null)return e;e=null}else if(n===31){if(e=d(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 _p=e,null}function yp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(we()){case Te:return 2;case Ee:return 8;case De:case Oe:return 32;case ke:return 268435456;default:return 32}default:return 32}}var bp=!1,xp=null,Sp=null,Cp=null,wp=new Map,Tp=new Map,Ep=[],Dp=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Op(e,t){switch(e){case`focusin`:case`focusout`:xp=null;break;case`dragenter`:case`dragleave`:Sp=null;break;case`mouseover`:case`mouseout`:Cp=null;break;case`pointerover`:case`pointerout`:wp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Tp.delete(t.pointerId)}}function kp(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=mt(t),t!==null&&up(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ap(e,t,n,r,i){switch(t){case`focusin`:return xp=kp(xp,e,t,n,r,i),!0;case`dragenter`:return Sp=kp(Sp,e,t,n,r,i),!0;case`mouseover`:return Cp=kp(Cp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return wp.set(a,kp(wp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Tp.set(a,kp(Tp.get(a)||null,e,t,n,r,i)),!0}return!1}function jp(e){var t=pt(e.target);if(t!==null){var n=c(t);if(n!==null){if(t=n.tag,t===13){if(t=u(n),t!==null){e.blockedOn=t,nt(e.priority,function(){dp(n)});return}}else if(t===31){if(t=d(n),t!==null){e.blockedOn=t,nt(e.priority,function(){dp(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 Mp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=gp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Zt=r,n.target.dispatchEvent(r),Zt=null}else return t=mt(n),t!==null&&up(t),e.blockedOn=n,!1;t.shift()}return!0}function Np(e,t,n){Mp(e)&&n.delete(t)}function Pp(){bp=!1,xp!==null&&Mp(xp)&&(xp=null),Sp!==null&&Mp(Sp)&&(Sp=null),Cp!==null&&Mp(Cp)&&(Cp=null),wp.forEach(Np),Tp.forEach(Np)}function Fp(e,n){e.blockedOn===n&&(e.blockedOn=null,bp||(bp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Pp)))}var Ip=null;function Lp(e){Ip!==e&&(Ip=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Ip===e&&(Ip=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(vp(r||n)===null)continue;break}var a=mt(n);a!==null&&(e.splice(t,3),t-=3,Ts(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Rp(e){function t(t){return Fp(t,e)}xp!==null&&Fp(xp,e),Sp!==null&&Fp(Sp,e),Cp!==null&&Fp(Cp,e),wp.forEach(t),Tp.forEach(t);for(var n=0;n<Ep.length;n++){var r=Ep[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ep.length&&(n=Ep[0],n.blockedOn===null);)jp(n),n.blockedOn===null&&Ep.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[at]||null;if(typeof a==`function`)o||Lp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[at]||null)s=o.formAction;else if(vp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Lp(n)}}}function zp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Bp(e){this._internalRoot=e}Vp.prototype.render=Bp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;sp(n,_u(),e,t,null,null)},Vp.prototype.unmount=Bp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;sp(e.current,2,null,e,null,null),wu(),t[ot]=null}};function Vp(e){this._internalRoot=e}Vp.prototype.unstable_scheduleHydration=function(e){if(e){var t=tt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ep.length&&t!==0&&t<Ep[n].priority;n++);Ep.splice(n,0,e),n===0&&jp(e)}};var Hp=n.version;if(Hp!==`19.2.5`)throw Error(i(527,Hp,`19.2.5`));I.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=p(t),e=e===null?null:m(e),e=e===null?null:e.stateNode,e};var Up={bundleType:0,version:`19.2.5`,rendererPackageName:`react-dom`,currentDispatcherRef:F,reconcilerVersion:`19.2.5`};
10if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Wp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Wp.isDisabled&&Wp.supportsFiber)try{Me=Wp.inject(Up),Ne=Wp}catch{}}e.createRoot=function(e,t){if(!o(e))throw Error(i(299));var n=!1,r=``,a=qs,s=Js,c=Ys;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(a=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=ap(e,1,!1,null,null,n,r,null,a,s,c,zp),e[ot]=t.current,Ed(e),new Bp(t)}})),d=n(((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=u()})),f=t(a()),p=d(),m=(e,t,n)=>{let r=t.lastIndexOf(`?`),i=e[r===-1||r<t.lastIndexOf(`/`)?t:t.slice(0,r)];return i?typeof i==`function`?i():Promise.resolve(i):new Promise((e,r)=>{(typeof queueMicrotask==`function`?queueMicrotask:setTimeout)(r.bind(null,Error(`Unknown variable dynamic import: `+t+(t.split(`/`).length===n?``:`. Note that variables only represent file names one level deep.`))))})},h=e=>typeof e==`string`,g=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},_=e=>e==null?``:String(e),v=(e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})},y=/###/g,b=e=>e&&e.includes(`###`)?e.replace(y,`.`):e,x=e=>!e||h(e),S=(e,t,n)=>{let r=h(t)?t.split(`.`):t,i=0;for(;i<r.length-1;){if(x(e))return{};let t=b(r[i]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return x(e)?{}:{obj:e,k:b(r[i])}},C=(e,t,n)=>{let{obj:r,k:i}=S(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let a=t[t.length-1],o=t.slice(0,t.length-1),s=S(e,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=S(e,o,Object),s?.obj&&s.obj[`${s.k}.${a}`]!==void 0&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},w=(e,t,n,r)=>{let{obj:i,k:a}=S(e,t,Object);i[a]=i[a]||[],i[a].push(n)},T=(e,t)=>{let{obj:n,k:r}=S(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},E=(e,t,n)=>{let r=T(e,n);return r===void 0?T(t,n):r},D=(e,t,n)=>{for(let r in t)r!==`__proto__`&&r!==`constructor`&&(r in e?h(e[r])||e[r]instanceof String||h(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):D(e[r],t[r],n):e[r]=t[r]);return e},O=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,`\\$&`),k={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`,"/":`/`},A=e=>h(e)?e.replace(/[&<>"'\/]/g,e=>k[e]):e,j=class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(t!==void 0)return t;let n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}},M=[` `,`,`,`?`,`!`,`;`],N=new j(20),ee=(e,t,n)=>{t||=``,n||=``;let r=M.filter(e=>!t.includes(e)&&!n.includes(e));if(r.length===0)return!0;let i=N.getRegExp(`(${r.map(e=>e===`?`?`\\?`:e).join(`|`)})`),a=!i.test(e);if(!a){let t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(a=!0)}return a},P=(e,t,n=`.`)=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;let r=t.split(n),i=e;for(let e=0;e<r.length;){if(!i||typeof i!=`object`)return;let t,a=``;for(let o=e;o<r.length;++o)if(o!==e&&(a+=n),a+=r[o],t=i[a],t!==void 0){if([`string`,`number`,`boolean`].includes(typeof t)&&o<r.length-1)continue;e+=o-e+1;break}i=t}return i},F=e=>e?.replace(/_/g,`-`),I={type:`logger`,log(e){this.output(`log`,e)},warn(e){this.output(`warn`,e)},error(e){this.output(`error`,e)},output(e,t){console?.[e]?.apply?.(console,t)}},te=new class e{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||`i18next:`,this.logger=e||I,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,`log`,``,!0)}warn(...e){return this.forward(e,`warn`,``,!0)}error(...e){return this.forward(e,`error`,``)}deprecate(...e){return this.forward(e,`warn`,`WARNING DEPRECATED: `,!0)}forward(e,t,n,r){return r&&!this.debug?null:(h(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(t){return new e(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t||=this.options,t.prefix=t.prefix||this.prefix,new e(this.logger,t)}},L=class{constructor(){this.observers={}}
10on(e,t){return e.split(` `).forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}once(e,t){let n=(...r)=>{t(...r),this.off(e,n)};return this.on(e,n),this}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let r=0;r<n;r++)e(...t)}),this.observers[`*`]&&Array.from(this.observers[`*`].entries()).forEach(([n,r])=>{for(let i=0;i<r;i++)n(e,...t)})}},ne=class extends L{constructor(e,t={ns:[`translation`],defaultNS:`translation`}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.includes(e)||this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,r={}){let i=r.keySeparator===void 0?this.options.keySeparator:r.keySeparator,a=r.ignoreJSONStructure===void 0?this.options.ignoreJSONStructure:r.ignoreJSONStructure,o;e.includes(`.`)?o=e.split(`.`):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):h(n)&&i?o.push(...n.split(i)):o.push(n)));let s=T(this.data,o);return!s&&!t&&!n&&e.includes(`.`)&&(e=o[0],t=o[1],n=o.slice(2).join(`.`)),s||!a||!h(n)?s:P(this.data?.[e]?.[t],n,i)}addResource(e,t,n,r,i={silent:!1}){let a=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,o=[e,t];
10n&&(o=o.concat(a?n.split(a):n)),e.includes(`.`)&&(o=e.split(`.`),r=t,t=o[1]),this.addNamespaces(t),C(this.data,o,r),i.silent||this.emit(`added`,e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(let r in n)(h(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit(`added`,e,t,n)}addResourceBundle(e,t,n,r,i,a={silent:!1,skipCopy:!1}){let o=[e,t];e.includes(`.`)&&(o=e.split(`.`),r=n,n=t,t=o[1]),this.addNamespaces(t);let s=T(this.data,o)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?D(s,n,i):s={...s,...n},C(this.data,o,s),a.silent||this.emit(`added`,e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit(`removed`,e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||=this.options.defaultNS,this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}},R={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(e=>{t=this.processors[e]?.process(t,n,r,i)??t}),t}},z=Symbol(`i18next/PATH_KEY`);function B(){let e=[],t=Object.create(null),n;return t.get=(r,i)=>(n?.revoke?.(),i===z?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}function re(e,t){let{[z]:n}=e(B()),r=t?.keySeparator??`.`,i=t?.nsSeparator??`:`;if(n.length>1&&i){let e=t?.ns,a=Array.isArray(e)?e:null;if(a&&a.length>1&&a.slice(1).includes(n[0]))return`${n[0]}${i}${n.slice(1).join(r)}`}return n.join(r)}var ie=e=>!h(e)&&typeof e!=`boolean`&&typeof e!=`number`,ae=class e extends L{constructor(e,t={}){super(),v([`resourceStore`,`languageUtils`,`pluralResolver`,`interpolator`,`backendConnector`,`i18nFormat`,`utils`],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.logger=te.create(`translator`),this.checkedLoadedFor={}}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let n={...t};if(e==null)return!1;let r=this.resolve(e,n);if(r?.res===void 0)return!1;let i=ie(r.res);return!(n.returnObjects===!1&&i)}extractFromKey(e,t){let n=t.nsSeparator===void 0?this.options.nsSeparator:t.nsSeparator;n===void 0&&(n=`:`);let r=t.keySeparator===void 0?this.options.keySeparator:t.keySeparator,i=t.ns||this.options.defaultNS||[],a=n&&e.includes(n),o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!ee(e,n,r);if(a&&!o){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:h(i)?[i]:i};let a=e.split(n);(n!==r||n===r&&this.options.ns.includes(a[0]))&&(i=a.shift()),e=a.join(r)}return{key:e,namespaces:h(i)?[i]:i}}translate(t,n,r){let i=typeof n==`object`?{...n}:n;if(typeof i!=`object`&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i==`object`&&(i={...i}),i||={},t==null)return``;typeof t==`function`&&(t=re(t,{...this.options,...i})),Array.isArray(t)||(t=[String(t)]),t=t.map(e=>typeof e==`function`?re(e,{...this.options,...i}):String(e));let a=i.returnDetails===void 0?this.options.returnDetails:i.returnDetails,o=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,{key:s,namespaces:c}=this.extractFromKey(t[t.length-1],i),l=c[c.length-1],u=i.nsSeparator===void 0?this.options.nsSeparator:i.nsSeparator;u===void 0&&(u=`:`);let d=i.lng||this.language,f=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d?.toLowerCase()===`cimode`)return f?a?{res:`${l}${u}${s}`,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:`${l}${u}${s}`:a?{res:s,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:s;let p=this.resolve(t,i),m=p?.res,g=p?.usedKey||s,_=p?.exactUsedKey||s,v=[`[object Number]`,`[object Function]`,`[object RegExp]`],y=i.joinArrays===void 0?this.options.joinArrays:i.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject,x=i.count!==void 0&&!h(i.count),S=e.hasDefaultValue(i),C=x?this.pluralResolver.getSuffix(d,i.count,i):``,w=i.ordinal&&x?this.pluralResolver.getSuffix(d,i.count,{ordinal:!1}):``,T=x&&!i.ordinal&&i.count===0,E=T&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${C}`]||i[`defaultValue${w}`]||i.defaultValue,D=m;b&&!m&&S&&(D=E);let O=ie(D),k=Object.prototype.toString.apply(D);
10if(b&&D&&O&&!v.includes(k)&&!(h(y)&&Array.isArray(D))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn(`accessing an object - but returnObjects options is not enabled!`);let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,D,{...i,ns:c}):`key '${s} (${this.language})' returned an object instead of string.`;return a?(p.res=e,p.usedParams=this.getUsedParamsDetails(i),p):e}if(o){let e=Array.isArray(D),t=e?[]:{},n=e?_:g;for(let e in D)if(Object.prototype.hasOwnProperty.call(D,e)){let r=`${n}${o}${e}`;S&&!m?t[e]=this.translate(r,{...i,defaultValue:ie(E)?E[e]:void 0,joinArrays:!1,ns:c}):t[e]=this.translate(r,{...i,joinArrays:!1,ns:c}),t[e]===r&&(t[e]=D[e])}m=t}}else if(b&&h(y)&&Array.isArray(m))m=m.join(y),m&&=this.extendTranslation(m,t,i,r);else{let e=!1,n=!1;!this.isValidLookup(m)&&S&&(e=!0,m=E),this.isValidLookup(m)||(n=!0,m=s);let a=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&n?void 0:m,c=S&&E!==m&&this.options.updateMissing;if(n||e||c){if(this.logger.log(c?`updateKey`:`missingKey`,d,l,s,c?E:m),o){let e=this.resolve(s,{...i,keySeparator:!1});e&&e.res&&this.logger.warn(`Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.`)}let e=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo===`fallback`&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else this.options.saveMissingTo===`all`?e=this.languageUtils.toResolveHierarchy(i.lng||this.language):e.push(i.lng||this.language);let n=(e,t,n)=>{let r=S&&n!==m?n:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,r,c,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,r,c,i),this.emit(`missingKey`,e,l,t,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&x?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,i);T&&i[`defaultValue${this.options.pluralSeparator}zero`]&&!t.includes(`${this.options.pluralSeparator}zero`)&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],s+t,i[`defaultValue${t}`]||E)})}):n(e,s,E))}m=this.extendTranslation(m,t,i,p,r),n&&m===s&&this.options.appendNamespaceToMissingKey&&(m=`${l}${u}${s}`),(n||e)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${u}${s}`:s,e?m:void 0,i))}return a?(p.res=m,p.usedParams=this.getUsedParamsDetails(i),p):m}extendTranslation(e,t,n,r,i){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});let a=h(e)&&(n?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:n.interpolation.skipOnVariables),o;if(a){let t=e.match(this.interpolator.nestingRegexp);o=t&&t.length}let s=n.replace&&!h(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language||r.usedLng,n),a){let t=e.match(this.interpolator.nestingRegexp),r=t&&t.length;o<r&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,(...e)=>i?.[0]===e[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null):this.translate(...e,t),n)),n.interpolation&&this.interpolator.reset()}let a=n.postProcess||this.options.postProcess,o=h(a)?[a]:a;return e!=null&&o?.length&&n.applyPostProcessor!==!1&&(e=R.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,r,i,a,o;return h(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(e=>typeof e==`function`?re(e,{...this.options,...t}
10):e)),e.forEach(e=>{if(this.isValidLookup(n))return;let s=this.extractFromKey(e,t),c=s.key;r=c;let l=s.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));let u=t.count!==void 0&&!h(t.count),d=u&&!t.ordinal&&t.count===0,f=t.context!==void 0&&(h(t.context)||typeof t.context==`number`)&&t.context!==``,p=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);l.forEach(e=>{this.isValidLookup(n)||(o=e,!this.checkedLoadedFor[`${p[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(o)&&(this.checkedLoadedFor[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${p.join(`, `)}" won't get resolved as namespace "${o}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`)),p.forEach(r=>{if(this.isValidLookup(n))return;a=r;let o=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(o,c,r,e,t);else{let e;u&&(e=this.pluralResolver.getSuffix(r,t.count,t));let n=`${this.options.pluralSeparator}zero`,i=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(t.ordinal&&e.startsWith(i)&&o.push(c+e.replace(i,this.options.pluralSeparator)),o.push(c+e),d&&o.push(c+n)),f){let r=`${c}${this.options.contextSeparator||`_`}${t.context}`;o.push(r),u&&(t.ordinal&&e.startsWith(i)&&o.push(r+e.replace(i,this.options.pluralSeparator)),o.push(r+e),d&&o.push(r+n))}}let s;for(;s=o.pop();)this.isValidLookup(n)||(i=s,n=this.getResource(r,e,s,t))}))})}),{res:n,usedKey:r,exactUsedKey:i,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e===``)}getResource(e,t,n,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){let t=[`defaultValue`,`ordinal`,`context`,`replace`,`lng`,`lngs`,`fallbackLng`,`ns`,`keySeparator`,`nsSeparator`,`returnObjects`,`returnDetails`,`joinArrays`,`postProcess`,`interpolation`],n=e.replace&&!h(e.replace),r=n?e.replace:e;if(n&&e.count!==void 0&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(let e of t)delete r[e]}return r}static hasDefaultValue(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.startsWith(`defaultValue`)&&e[t]!==void 0)return!0;return!1}},oe=class{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=te.create(`languageUtils`)}getScriptPartFromCode(e){if(e=F(e),!e||!e.includes(`-`))return null;let t=e.split(`-`);return t.length===2||(t.pop(),t[t.length-1].toLowerCase()===`x`)?null:this.formatLanguageCode(t.join(`-`))}getLanguagePartFromCode(e){if(e=F(e),!e||!e.includes(`-`))return e;let t=e.split(`-`);return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(h(e)&&e.includes(`-`)){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load===`languageOnly`||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(e)}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;let r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>e===r?!0:!e.includes(`-`)&&!r.includes(`-`)?!1:!!(e.includes(`-`)&&!r.includes(`-`)&&e.slice(0,e.indexOf(`-`))===r||e.startsWith(r)&&r.length>1))}),t||=this.getFallbackCodes(this.options.fallbackLng)[0],t}getFallbackCodes(e,t){if(!e)return[];if(typeof e==`function`&&(e=e(t)),h(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];
10return n||=e[this.getScriptPartFromCode(t)],n||=e[this.formatLanguageCode(t)],n||=e[this.getLanguagePartFromCode(t)],n||=e.default,n||[]}toResolveHierarchy(e,t){let n=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),r=[],i=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return h(e)&&(e.includes(`-`)||e.includes(`_`))?(this.options.load!==`languageOnly`&&i(this.formatLanguageCode(e)),this.options.load!==`languageOnly`&&this.options.load!==`currentOnly`&&i(this.getScriptPartFromCode(e)),this.options.load!==`currentOnly`&&i(this.getLanguagePartFromCode(e))):h(e)&&i(this.formatLanguageCode(e)),n.forEach(e=>{r.includes(e)||i(this.formatLanguageCode(e))}),r}},se={zero:0,one:1,two:2,few:3,many:4,other:5},ce={select:e=>e===1?`one`:`other`,resolvedOptions:()=>({pluralCategories:[`one`,`other`]})},le=class{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=te.create(`pluralResolver`),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let n=F(e===`dev`?`en`:e),r=t.ordinal?`ordinal`:`cardinal`,i=JSON.stringify({cleanedCode:n,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(n,{type:r})}catch{if(typeof Intl>`u`)return this.logger.error(`No Intl support, please use an Intl polyfill!`),ce;if(!e.match(/-|_/))return ce;let n=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(n,t)}return this.pluralRulesCache[i]=a,a}needsPlural(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?n.resolvedOptions().pluralCategories.sort((e,t)=>se[e]-se[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:``}${e}`):[]}getSuffix(e,t,n={}){let r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:``}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix(`dev`,t,n))}},ue=(e,t,n,r=`.`,i=!0)=>{let a=E(e,t,n);return!a&&i&&h(n)&&(a=P(e,n,r),a===void 0&&(a=P(t,n,r))),a},de=e=>e.replace(/\$/g,`$$$$`),fe=class{constructor(e={}){this.logger=te.create(`interpolator`),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||={escapeValue:!0};let{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:i,prefixEscaped:a,suffix:o,suffixEscaped:s,formatSeparator:c,unescapeSuffix:l,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:m,nestingOptionsSeparator:h,maxReplaces:g,alwaysFormat:_}=e.interpolation;this.escape=t===void 0?A:t,this.escapeValue=n===void 0?!0:n,this.useRawValueToEscape=r===void 0?!1:r,this.prefix=i?O(i):a||`{{`,this.suffix=o?O(o):s||`}}`,this.formatSeparator=c||`,`,this.unescapePrefix=l?``:u||`-`,this.unescapeSuffix=this.unescapePrefix?``:l||``,this.nestingPrefix=d?O(d):f||O(`$t(`),this.nestingSuffix=p?O(p):m||O(`)`),this.nestingOptionsSeparator=h||`,`,this.maxReplaces=g||1e3,this.alwaysFormat=_===void 0?!1:_,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,`g`);this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let i,a,o,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=e=>{if(!e.includes(this.formatSeparator)){let i=ue(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,{...r,...t,interpolationkey:e}):i}let i=e.split(this.formatSeparator),a=i.shift().trim(),o=i.join(this.formatSeparator).trim();return this.format(ue(t,s,a,this.options.keySeparator,this.options.ignoreJSONStructure),o,n,{...r,...t,interpolationkey:a})};this.resetRegExp();let l=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=r?.interpolation?.ski
10pOnVariables===void 0?this.options.interpolation.skipOnVariables:r.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>de(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?de(this.escape(e)):de(e)}].forEach(t=>{for(o=0;i=t.regex.exec(e);){let n=i[1].trim();if(a=c(n),a===void 0)if(typeof l==`function`){let t=l(e,i,r);a=h(t)?t:``}else if(r&&Object.prototype.hasOwnProperty.call(r,n))a=``;else if(u){a=i[0];continue}else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),a=``;else !h(a)&&!this.useRawValueToEscape&&(a=_(a));let s=t.safeValue(a);if(e=e.replace(i[0],s),u?(t.regex.lastIndex+=a.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,i,a,o=(e,t)=>{let n=this.nestingOptionsSeparator;if(!e.includes(n))return e;let r=e.split(RegExp(`${O(n)}[ ]*{`)),i=`{${r[1]}`;e=r[0],i=this.interpolate(i,a);let o=i.match(/'/g),s=i.match(/"/g);((o?.length??0)%2==0&&!s||(s?.length??0)%2!=0)&&(i=i.replace(/'/g,`"`));try{a=JSON.parse(i),t&&(a={...t,...a})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return a.defaultValue&&a.defaultValue.includes(this.prefix)&&delete a.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let s=[];a={...n},a=a.replace&&!h(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=/{.*}/.test(r[1])?r[1].lastIndexOf(`}`)+1:r[1].indexOf(this.formatSeparator);if(c!==-1&&(s=r[1].slice(c).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),r[1]=r[1].slice(0,c)),i=t(o.call(this,r[1].trim(),a),a),i&&r[0]===e&&!h(i))return i;h(i)||(i=_(i)),i||=(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),``),s.length&&(i=s.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()}),i.trim())),e=e.replace(r[0],i),this.regexp.lastIndex=0}return e}},pe=e=>{let t=e.toLowerCase().trim(),n={};if(e.includes(`(`)){let r=e.split(`(`);t=r[0].toLowerCase().trim();let i=r[1].slice(0,-1);t===`currency`&&!i.includes(`:`)?n.currency||=i.trim():t===`relativetime`&&!i.includes(`:`)?n.range||=i.trim():i.split(`;`).forEach(e=>{if(e){let[t,...r]=e.split(`:`),i=r.join(`:`).trim().replace(/^'+|'+$/g,``),a=t.trim();n[a]||(n[a]=i),i===`false`&&(n[a]=!1),i===`true`&&(n[a]=!0),isNaN(i)||(n[a]=parseInt(i,10))}})}return{formatName:t,formatOptions:n}},me=e=>{let t={};return(n,r,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});let o=r+JSON.stringify(a),s=t[o];return s||(s=e(F(r),i),t[o]=s),s(n)}},he=e=>(t,n,r)=>e(F(n),r)(t),ge=class{constructor(e={}){this.logger=te.create(`formatter`),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||`,`;let n=t.cacheInBuiltFormats?me:he;this.formats={number:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:`currency`});return e=>n.format(e)}),datetime:n((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||`day`)}),list:n((e,t)=>{let n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=me(t)}format(e,t,n,r={}){if(!t||e==null)return e;let i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf(`(`)>1&&!i[0].includes(`)`)&&i.find(e=>e.includes(`)`))){let e=i.findIndex(e=>e.includes(`)`));i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}return i.reduce((e,t)=>{let{formatName:i,formatOptions:a}=pe(t);if(this.formats[i]){let t=e;try{let o=r?.formatParams?.[r.interpolationkey]||{},s=o.locale||o.lng||r.locale||r.lng||n;t=this.formats[i](e,s,{...a,...r,...o})}catch(e){this.logger.warn(e)}return t}else this.logger.warn(`there was no format function for ${i}`);return e},e)}},_e=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)},ve=class extends L{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=te.create(`backendConnector`),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,r.backend,r)}queueLoad(e,t,n,r){let i={},a={},o={},s={};
10return e.forEach(e=>{let r=!0;t.forEach(t=>{let o=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[o]=2:this.state[o]<0||(this.state[o]===1?a[o]===void 0&&(a[o]=!0):(this.state[o]=1,r=!1,a[o]===void 0&&(a[o]=!0),i[o]===void 0&&(i[o]=!0),s[t]===void 0&&(s[t]=!0)))}),r||(o[e]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){let r=e.split(`|`),i=r[0],a=r[1];t&&this.emit(`failedLoading`,i,a,t),!t&&n&&this.store.addResourceBundle(i,a,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);let o={};this.queue.forEach(n=>{w(n.loaded,[i],a),_e(n,e),t&&n.errors.push(t),n.pendingCount===0&&!n.done&&(Object.keys(n.loaded).forEach(e=>{o[e]||(o[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{o[e][t]===void 0&&(o[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit(`loaded`,o),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,i=this.retryTimeout,a){if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:i,callback:a});return}this.readingCalls++;let o=(o,s)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}if(o&&s&&r<this.maxRetries){setTimeout(()=>{this.read(e,t,n,r+1,i*2,a)},i);return}a(o,s)},s=this.backend[n].bind(this.backend);if(s.length===2){try{let n=s(e,t);n&&typeof n.then==`function`?n.then(e=>o(null,e)).catch(o):o(null,n)}catch(e){o(e)}return}return s(e,t,o)}prepareLoading(e,t,n={},r){if(!this.backend)return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`),r&&r();h(e)&&(e=this.languageUtils.toResolveHierarchy(e)),h(t)&&(t=[t]);let i=this.queueLoad(e,t,n,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=``){let n=e.split(`|`),r=n[0],i=n[1];this.read(r,i,`read`,void 0,void 0,(n,a)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`,n),!n&&a&&this.logger.log(`${t}loaded namespace ${i} for language ${r}`,a),this.loaded(e,n,a)})}saveMissing(e,t,n,r,i,a={},o=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`);return}if(!(n==null||n===``)){if(this.backend?.create){let s={...a,isUpdate:i},c=this.backend.create.bind(this.backend);if(c.length<6)try{let i;i=c.length===5?c(e,t,n,r,s):c(e,t,n,r),i&&typeof i.then==`function`?i.then(e=>o(null,e)).catch(o):o(null,i)}catch(e){o(e)}else c(e,t,n,r,o,s)}!e||!e[0]||this.store.addResource(e[0],t,n,r)}}},ye=()=>({debug:!1,initAsync:!0,ns:[`translation`],defaultNS:[`translation`],fallbackLng:[`dev`],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:`all`,preload:!1,keySeparator:`.`,nsSeparator:`:`,pluralSeparator:`_`,contextSeparator:`_`,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:`fallback`,saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]==`object`&&(t=e[1]),h(e[1])&&(t.defaultValue=e[1]),h(e[2])&&(t.tDescription=e[2]),typeof e[2]==`object`||typeof e[3]==`object`){let n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,prefix:`{{`,suffix:`}}`,formatSeparator:`,`,unescapePrefix:`-`,nestingPrefix:`$t(`,nestingSuffix:`)`,nestingOptionsSeparator:`,`,maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),be=e=>(h(e.ns)&&(e.ns=[e.ns]),h(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),h(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes(`cimode`)&&(e.supportedLngs=e.supportedLngs.concat([`cimode`])),e),xe=()=>{},Se=e=>
10{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]==`function`&&(e[t]=e[t].bind(e))})},Ce=class e extends L{constructor(e={},t){if(super(),this.options=be(e),this.services={},this.logger=te,this.modules={external:[]},Se(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e==`function`&&(t=e,e={}),e.defaultNS==null&&e.ns&&(h(e.ns)?e.defaultNS=e.ns:e.ns.includes(`translation`)||(e.defaultNS=e.ns[0]));let n=ye();this.options={...n,...this.options,...be(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!=`function`&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler);let r=e=>e?typeof e==`function`?new e:e:null;if(!this.options.isClone){this.modules.logger?te.init(r(this.modules.logger),this.options):te.init(null,this.options);let e;e=this.modules.formatter?this.modules.formatter:ge;let t=new oe(this.options);this.store=new ne(this.options.resources,this.options);let n=this.services;n.logger=te,n.resourceStore=this.store,n.languageUtils=t,n.pluralResolver=new le(t,{prepend:this.options.pluralSeparator}),e&&(n.formatter=r(e),n.formatter.init&&n.formatter.init(n,this.options),this.options.interpolation.format=n.formatter.format.bind(n.formatter)),n.interpolator=new fe(this.options),n.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},n.backendConnector=new ve(r(this.modules.backend),n.resourceStore,n,this.options),n.backendConnector.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(n.languageDetector=r(this.modules.languageDetector),n.languageDetector.init&&n.languageDetector.init(n,this.options.detection,this.options)),this.modules.i18nFormat&&(n.i18nFormat=r(this.modules.i18nFormat),n.i18nFormat.init&&n.i18nFormat.init(this)),this.translator=new ae(this.services,this.options),this.translator.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||=xe,this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&e[0]!==`dev`&&(this.options.lng=e[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn(`init: no languageDetector is used and no lng is defined`),[`getResource`,`hasResourceBundle`,`getResourceBundle`,`getDataByLanguage`].forEach(e=>{this[e]=(...t)=>this.store[e](...t)}),[`addResource`,`addResources`,`addResourceBundle`,`removeResourceBundle`].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});let i=g(),a=()=>{let e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn(`init: i18next is already initialized. You should call init just once!`),this.isInitialized=!0,this.options.isClone||this.logger.log(`initialized`,this.options),this.emit(`initialized`,this.options),i.resolve(n),t(e,n)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?a():setTimeout(a,0),i}loadResources(e,t=xe){let n=t,r=h(e)?e:this.language;if(typeof e==`function`&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r?.toLowerCase()===`cimode`&&(!this.options.preload||this.options.preload.length===0))return n();let e=[],t=t=>{t&&t!==`cimode`&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{t!==`cimode`&&(e.includes(t)||e.push(t))})};r?t(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{!e&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){let r=g();return typeof e==`function`&&(n=e,e=void 0),typeof t==`function`&&(n=t,t=void 0),e||=this.languages,t||=this.options.ns,n||=xe,this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw Error(`You are passing an undefined module! Please check the object you are passing to i18next.use()`);
10if(!e.type)throw Error(`You are passing a wrong module! Please check the object you are passing to i18next.use()`);return e.type===`backend`&&(this.modules.backend=e),(e.type===`logger`||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type===`languageDetector`&&(this.modules.languageDetector=e),e.type===`i18nFormat`&&(this.modules.i18nFormat=e),e.type===`postProcessor`&&R.addPostProcessor(e),e.type===`formatter`&&(this.modules.formatter=e),e.type===`3rdParty`&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&![`cimode`,`dev`].includes(e)){for(let e=0;e<this.languages.length;e++){let t=this.languages[e];if(![`cimode`,`dev`].includes(t)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&!this.languages.includes(e)&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;let n=g();this.emit(`languageChanging`,e);let r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(i,a)=>{a?this.isLanguageChangingTo===e&&(r(a),this.translator.changeLanguage(a),this.isLanguageChangingTo=void 0,this.emit(`languageChanged`,a),this.logger.log(`languageChanged`,a)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(i,(...e)=>this.t(...e))},a=t=>{!e&&!t&&this.services.languageDetector&&(t=[]);let n=h(t)?t:t&&t[0],a=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(h(t)?[t]:t);a&&(this.language||r(a),this.translator.language||this.translator.changeLanguage(a),this.services.languageDetector?.cacheUserLanguage?.(a)),this.loadResources(a,e=>{i(e,a)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),n}getFixedT(e,t,n){let r=(e,t,...i)=>{let a;a=typeof t==`object`?{...t}:this.options.overloadTranslationOptionHandler([e,t].concat(i)),a.lng=a.lng||r.lng,a.lngs=a.lngs||r.lngs,a.ns=a.ns||r.ns,a.keyPrefix!==``&&(a.keyPrefix=a.keyPrefix||n||r.keyPrefix);let o={...this.options,...a};typeof a.keyPrefix==`function`&&(a.keyPrefix=re(a.keyPrefix,o));let s=this.options.keySeparator||`.`,c;return a.keyPrefix&&Array.isArray(e)?c=e.map(e=>(typeof e==`function`&&(e=re(e,o)),`${a.keyPrefix}${s}${e}`)):(typeof e==`function`&&(e=re(e,o)),c=a.keyPrefix?`${a.keyPrefix}${s}${e}`:e),this.t(c,a)};return h(e)?r.lng=e:r.lngs=e,r.ns=t,r.keyPrefix=n,r}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn(`hasLoadedNamespace: i18next was not initialized`,this.languages),!1;
10if(!this.languages||!this.languages.length)return this.logger.warn(`hasLoadedNamespace: i18n.languages were undefined or empty`,this.languages),!1;let n=t.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(n.toLowerCase()===`cimode`)return!0;let a=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return n===-1||n===0||n===2};if(t.precheck){let e=t.precheck(this,a);if(e!==void 0)return e}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(n,e)&&(!r||a(i,e)))}loadNamespaces(e,t){let n=g();return this.options.ns?(h(e)&&(e=[e]),e.forEach(e=>{this.options.ns.includes(e)||this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){let n=g();h(e)&&(e=[e]);let r=this.options.preload||[],i=e.filter(e=>!r.includes(e)&&this.services.languageUtils.isSupportedCode(e));return i.length?(this.options.preload=r.concat(i),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language),!e)return`rtl`;try{let t=new Intl.Locale(e);if(t&&t.getTextInfo){let e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch{}let t=`ar.shu.sqr.ssh.xaa.yhd.yud.aao.abh.abv.acm.acq.acw.acx.acy.adf.ads.aeb.aec.afb.ajp.apc.apd.arb.arq.ars.ary.arz.auz.avl.ayh.ayl.ayn.ayp.bbz.pga.he.iw.ps.pbt.pbu.pst.prp.prd.ug.ur.ydd.yds.yih.ji.yi.hbo.men.xmn.fa.jpr.peo.pes.prs.dv.sam.ckb`.split(`.`),n=this.services?.languageUtils||new oe(ye());return e.toLowerCase().indexOf(`-latn`)>1?`ltr`:t.includes(n.getLanguagePartFromCode(e))||e.toLowerCase().indexOf(`-arab`)>1?`rtl`:`ltr`}static createInstance(t={},n){let r=new e(t,n);return r.createInstance=e.createInstance,r}cloneInstance(t={},n=xe){let r=t.forkResourceStore;r&&delete t.forkResourceStore;let i={...this.options,...t,isClone:!0},a=new e(i);if((t.debug!==void 0||t.prefix!==void 0)&&(a.logger=a.logger.clone(t)),[`store`,`services`,`language`].forEach(e=>{a[e]=this[e]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r&&(a.store=new ne(Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,r)=>(n[r]={...e[t][r]},n),e[t]),e),{}),i),a.services.resourceStore=a.store),t.interpolation){let e={...ye().interpolation,...this.options.interpolation,...t.interpolation},n={...i,interpolation:e};a.services.interpolator=new fe(n)}return a.translator=new ae(a.services,i),a.translator.on(`*`,(e,...t)=>{a.emit(e,...t)}),a.init(i,n),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}.createInstance();Ce.createInstance,Ce.dir,Ce.init,Ce.loadResources,Ce.reloadResources,Ce.use,Ce.changeLanguage,Ce.getFixedT,Ce.t,Ce.exists,Ce.setDefaultNamespace,Ce.hasLoadedNamespace,Ce.loadNamespaces,Ce.loadLanguages;var we=t(n(((e,t)=>{t.exports={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}}))()),Te=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function Ee(e){var t={type:`tag`,name:``,voidElement:!1,attrs:{},children:[]},n=e.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(t.name=n[1],(we.default[n[1]]||e.charAt(e.length-2)===`/`)&&(t.voidElement=!0),t.name.startsWith(`!--`))){var r=e.indexOf(`-->`);return{type:`comment`,comment:r===-1?``:e.slice(4,r)}}for(var i=new RegExp(Te),a=null;(a=i.exec(e))!==null;)if(a[0].trim())if(a[1]){var o=a[1].trim(),s=[o,``];o.indexOf(`=`)>-1&&(s=o.split(`=`)),t.attrs[s[0]]=s[1],i.lastIndex--}else a[2]&&(t.attrs[a[2]]=a[3].trim().substring(1,a[3].length-1));return t}var De=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,Oe=/^\s*$/,ke=Object.create(null);function Ae(e,t){switch(t.type){case`text`:return e+t.content;case`tag`:return e+=`<`+t.name+(t.attrs?function(e){var t=[];for(var n in e)t.push(n+`="`+e[n]+`"`);return t.length?` `+t.join(` `):``}(t.attrs):``)+(t.voidElement?`/>`:`>
10`),t.voidElement?e:e+t.children.reduce(Ae,``)+`</`+t.name+`>`;case`comment`:return e+`<!--`+t.comment+`-->`}}var je={parse:function(e,t){t||={},t.components||=ke;var n,r=[],i=[],a=-1,o=!1;if(e.indexOf(`<`)!==0){var s=e.indexOf(`<`);r.push({type:`text`,content:s===-1?e:e.substring(0,s)})}return e.replace(De,function(s,c){if(o){if(s!==`</`+n.name+`>`)return;o=!1}var l,u=s.charAt(1)!==`/`,d=s.startsWith(`<!--`),f=c+s.length,p=e.charAt(f);if(d){var m=Ee(s);return a<0?(r.push(m),r):((l=i[a]).children.push(m),r)}if(u&&(a++,(n=Ee(s)).type===`tag`&&t.components[n.name]&&(n.type=`component`,o=!0),n.voidElement||o||!p||p===`<`||n.children.push({type:`text`,content:e.slice(f,e.indexOf(`<`,f))}),a===0&&r.push(n),(l=i[a-1])&&l.children.push(n),i[a]=n),(!u||n.voidElement)&&(a>-1&&(n.voidElement||n.name===s.slice(2,-1))&&(a--,n=a===-1?r:i[a]),!o&&p!==`<`&&p)){l=a===-1?r:i[a].children;var h=e.indexOf(`<`,f),g=e.slice(f,h===-1?void 0:h);Oe.test(g)&&(g=` `),(h>-1&&a+l.length>=0||g!==` `)&&l.push({type:`text`,content:g})}}),r},stringify:function(e){return e.reduce(function(e,t){return e+Ae(``,t)},``)}},Me=(e,t,n,r)=>{let i=[n,{code:t,...r||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(i,`warn`,`react-i18next::`,!0);ze(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...i):console?.warn&&console.warn(...i)},Ne={},Pe=(e,t,n,r)=>{ze(n)&&Ne[n]||(ze(n)&&(Ne[n]=new Date),Me(e,t,n,r))},Fe=(e,t)=>()=>{if(e.isInitialized)t();else{let n=()=>{setTimeout(()=>{e.off(`initialized`,n)},0),t()};e.on(`initialized`,n)}},Ie=(e,t,n)=>{e.loadNamespaces(t,Fe(e,n))},Le=(e,t,n,r)=>{if(ze(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return Ie(e,n,r);n.forEach(t=>{e.options.ns.indexOf(t)<0&&e.options.ns.push(t)}),e.loadLanguages(t,Fe(e,r))},Re=(e,t,n={})=>!t.languages||!t.languages.length?(Pe(t,`NO_LANGUAGES`,`i18n.languages were undefined or empty`,{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(t,r)=>{if(n.bindI18n&&n.bindI18n.indexOf(`languageChanging`)>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!r(t.isLanguageChangingTo,e))return!1}}),ze=e=>typeof e==`string`,Be=e=>typeof e==`object`&&!!e,Ve=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,He={"&":`&`,"&":`&`,"<":`<`,"<":`<`,">":`>`,">":`>`,"'":`'`,"'":`'`,""":`"`,""":`"`," ":` `," ":` `,"©":`©`,"©":`©`,"®":`®`,"®":`®`,"…":`â¦`,"…":`â¦`,"/":`/`,"/":`/`},Ue=e=>He[e],We=e=>e.replace(Ve,Ue),Ge={bindI18n:`languageChanged`,bindI18nStore:``,transEmptyNodeValue:``,transSupportBasicHtmlNodes:!0,transWrapTextNodes:``,transKeepBasicHtmlNodesFor:[`br`,`strong`,`i`,`p`],useSuspense:!0,unescape:We,transDefaultProps:void 0},Ke=(e={})=>{Ge={...Ge,...e}},qe=()=>Ge,Je,Ye=e=>{Je=e},Xe=()=>Je,Ze=(e,t)=>{if(!e)return!1;let n=e.props?.children??e.children;return t?n.length>0:!!n},Qe=e=>{if(!e)return[];let t=e.props?.children??e.children;return e.props?.i18nIsDynamicList?et(t):t},$e=e=>Array.isArray(e)&&e.every(f.isValidElement),et=e=>Array.isArray(e)?e:[e],tt=(e,t)=>{let n={...t};return n.props={...t.props,...e.props},n},nt=e=>{let t={};if(!e)return t;let n=e=>{et(e).forEach(e=>{ze(e)||(Ze(e)?n(Qe(e)):Be(e)&&!(0,f.isValidElement)(e)&&Object.assign(t,e))})};return n(e),t},rt=(e,t,n,r)=>{if(!e)return``;let i=``,a=et(e),o=t?.transSupportBasicHtmlNodes?t.transKeepBasicHtmlNodesFor??[]:[];return a.forEach((e,a)=>{if(ze(e)){i+=`${e}`;return}if((0,f.isValidElement)(e)){let{props:s,type:c}=e,l=Object.keys(s).length,u=o.indexOf(c)>-1,d=s.children;if(!d&&u&&!l){i+=`<${c}/>`;return}if(!d&&(!u||l)||s.i18nIsDynamicList){i+=`<${a}></${a}>`;return}if(u&&l<=1){let e=ze(d)?d:rt(d,t,n,r);i+=`<${c}>${e}</${c}>`;return}let f=rt(d,t,n,r);i+=`<${a}>${f}</${a}>`;return}if(e===null){Me(n,`TRANS_NULL_VALUE`,`Passed in a null value as child`,{i18nKey:r});return}if(Be(e)){let{format:t,...a}=e,o=Object.keys(a);if(o.length===1){let e=t?`${o[0]}, ${t}`:o[0];i+=`{{${e}}}`;return}Me(n,`TRANS_INVALID_OBJ`,`Invalid child - Object should only have keys {{ value, format }} (format is optional).`,{i18nKey:r,child:e});return}Me(n,`TRANS_INVALID_VAR`,`Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.`,{i18nKey:r,child:e})}),i},it=(e,t=[],n={})=>
10{if(!e)return e;let r=Object.keys(n),i=[...t,...r],a=``,o=0;for(;o<e.length;)if(e[o]===`<`){let t=!1,n=e.slice(o).match(/^<\/(\d+|[a-zA-Z][a-zA-Z0-9_-]*)>/);if(n){let e=n[1];(/^\d+$/.test(e)||i.includes(e))&&(t=!0,a+=n[0],o+=n[0].length)}if(!t){let n=e.slice(o).match(/^<(\d+|[a-zA-Z][a-zA-Z0-9_-]*)(\s+[\w-]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]+))?)*\s*(\/)?>/);if(n){let e=n[1];(/^\d+$/.test(e)||i.includes(e))&&(t=!0,a+=n[0],o+=n[0].length)}}t||(a+=`<`,o+=1)}else a+=e[o],o+=1;return a},at=(e,t,n,r,i,a,o)=>{if(n===``)return[];let s=i.transKeepBasicHtmlNodesFor||[],c=n&&new RegExp(s.map(e=>`<${e}`).join(`|`)).test(n);if(!e&&!t&&!c&&!o)return[n];let l=t??{},u=e=>{et(e).forEach(e=>{ze(e)||(Ze(e)?u(Qe(e)):Be(e)&&!(0,f.isValidElement)(e)&&Object.assign(l,e))})};u(e);let d=it(n,s,l),p=je.parse(`<0>${d}</0>`),m={...l,...a},h=(e,t,n)=>{let r=Qe(e),i=_(r,t.children,n);return $e(r)&&i.length===0||e.props?.i18nIsDynamicList?r:i},g=(e,t,n,r,i)=>{e.dummy?(e.children=t,n.push((0,f.cloneElement)(e,{key:r},i?void 0:t))):n.push(...f.Children.map([e],e=>{let n=`data-i18n-is-dynamic-list`,a={key:r,[n]:void 0};return e&&e.props&&Object.keys(e.props).forEach(t=>{t===`ref`||t===`children`||t===`i18nIsDynamicList`||t===n||(a[t]=e.props[t])}),(0,f.cloneElement)(e,a,i?null:t)}))},_=(e,n,a)=>{let l=et(e);return et(n).reduce((e,n,u)=>{let d=n.children?.[0]?.content&&r.services.interpolator.interpolate(n.children[0].content,m,r.language);if(n.type===`tag`){let p=l[parseInt(n.name,10)];!p&&t&&(p=t[n.name]),a.length===1&&!p&&(p=a[0][n.name]),p||={};let v={...n.attrs};o&&Object.keys(v).forEach(e=>{let t=v[e];ze(t)&&(v[e]=We(t))});let y=Object.keys(v).length===0?p:tt({props:v},p),b=(0,f.isValidElement)(y),x=b&&Ze(n,!0)&&!n.voidElement,S=c&&Be(y)&&y.dummy&&!b,C=Be(t)&&Object.hasOwnProperty.call(t,n.name);if(ze(y)){let t=r.services.interpolator.interpolate(y,m,r.language);e.push(t)}else if(Ze(y)||x)g(y,h(y,n,a),e,u);else if(S)g(y,_(l,n.children,a),e,u);else if(Number.isNaN(parseFloat(n.name)))if(C)g(y,h(y,n,a),e,u,n.voidElement);else if(i.transSupportBasicHtmlNodes&&s.indexOf(n.name)>-1)if(n.voidElement)e.push((0,f.createElement)(n.name,{key:`${n.name}-${u}`}));else{let t=_(l,n.children,a);e.push((0,f.createElement)(n.name,{key:`${n.name}-${u}`},t))}else if(n.voidElement)e.push(`<${n.name} />`);else{let t=_(l,n.children,a);e.push(`<${n.name}>${t}</${n.name}>`)}else if(Be(y)&&!b){let t=n.children[0]?d:null;t&&e.push(t)}else g(y,d,e,u,n.children.length!==1||!d)}else if(n.type===`text`){let t=i.transWrapTextNodes,a=typeof i.unescape==`function`?i.unescape:qe().unescape,s=o?a(r.services.interpolator.interpolate(n.content,m,r.language)):r.services.interpolator.interpolate(n.content,m,r.language);t?e.push((0,f.createElement)(t,{key:`${n.name}-${u}`},s)):e.push(s)}return e},[])};return Qe(_([{dummy:!0,children:e||[]}],p,et(e||[]))[0])},ot=(e,t,n)=>{let r=e.key||t,i=(0,f.cloneElement)(e,{key:r});if(!i.props||!i.props.children||n.indexOf(`${t}/>`)<0&&n.indexOf(`${t} />`)<0)return i;function a(){return(0,f.createElement)(f.Fragment,null,i)}return(0,f.createElement)(a,{key:r})},st=(e,t)=>e.map((e,n)=>ot(e,n,t)),ct=(e,t)=>{let n={};return Object.keys(e).forEach(r=>{Object.assign(n,{[r]:ot(e[r],r,t)})}),n},lt=(e,t,n,r)=>e?Array.isArray(e)?st(e,t):Be(e)?ct(e,t):(Pe(n,`TRANS_INVALID_COMPONENTS`,`<Trans /> "components" prop expects an object or array`,{i18nKey:r}),null):null,ut=e=>!Be(e)||Array.isArray(e)?!1:Object.keys(e).reduce((e,t)=>e&&Number.isNaN(Number.parseFloat(t)),!0);function dt({children:e,count:t,parent:n,i18nKey:r,context:i,tOptions:a={},values:o,defaults:s,components:c,ns:l,i18n:u,t:d,shouldUnescape:p,...m}){let h=u||Xe();if(!h)return Pe(h,`NO_I18NEXT_INSTANCE`,`Trans: You need to pass in an i18next instance using i18nextReactModule`,{i18nKey:r}),e;let g=d||h.t.bind(h)||(e=>e),_={...qe(),...h.options?.react},v=l||g.ns||h.options?.defaultNS;v=ze(v)?[v]:v||[`translation`];let{transDefaultProps:y}=_,b=y?.tOptions?{...y.tOptions,...a}:a,x=p??y?.shouldUnescape,S=y?.values?{...y.values,...o}:o,C=y?.components?{...y.components,...c}:c,w=rt(e,_,h,r),T=s||b?.defaultValue||w||_.transEmptyNodeValue||(typeof r==`function`?re(r):r),{hashTransKey:E}=_,D=r||(E?E(w||T):w||T);o=h.options?.interpolation?.defaultVariables?S&&Object.keys(S).length>0?{...S,...h.options.interpolation.defaultVariables}:{...h.options.interpolation.defaultVariables}:S;let O=nt(e);O&&typeof O.count==`number`&&t===void 0&&(t=O.count);let k=o||t!==void 0&&!h.options?.interpolation?.alwaysFormat||!e?b.interpolation:{interpolation:{...b.interpolation,prefix:`#$?`,suffix:`?$#`}},A={...b,context:i||b.context,count:t,...o,...k,defaultValue:T,ns:v},j=D?g(D,A):T;j===D&&T&&(j=T);let M=lt(C,j,h,r),N=M||e,ee=null;ut(M)&&(ee=M,N=e);let P=at(N,ee,j,h,_,A,x),F=n??_.defaultTransParent;return F?(0,f.createElement)(F,m,P):P}var ft={type:`3rdParty`,init(e){Ke(e.options.react),Ye(e)}},pt=(0,f.createContext)(),mt=class{constructor(){this.usedNamespaces={}}
10addUsedNamespaces(e){e.forEach(e=>{this.usedNamespaces[e]||(this.usedNamespaces[e]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}};function ht({children:e,count:t,parent:n,i18nKey:r,context:i,tOptions:a={},values:o,defaults:s,components:c,ns:l,i18n:u,t:d,shouldUnescape:p,...m}){let{i18n:h,defaultNS:g}=(0,f.useContext)(pt)||{},_=u||h||Xe(),v=d||_?.t.bind(_);return dt({children:e,count:t,parent:n,i18nKey:r,context:i,tOptions:a,values:o,defaults:s,components:c,ns:l||v?.ns||g||_?.options?.defaultNS,i18n:_,t:d,shouldUnescape:p,...m})}var gt=n((e=>{var t=a();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,o=t.useEffect,s=t.useLayoutEffect,c=t.useDebugValue;function l(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),a=r[0].inst,l=r[1];return s(function(){a.value=n,a.getSnapshot=t,u(a)&&l({inst:a})},[e,n,t]),o(function(){return u(a)&&l({inst:a}),e(function(){u(a)&&l({inst:a})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),_t=n(((e,t)=>{t.exports=gt()})),vt=_t(),yt={t:(e,t)=>{if(ze(t))return t;if(Be(t)&&ze(t.defaultValue))return t.defaultValue;if(typeof e==`function`)return``;if(Array.isArray(e)){let t=e[e.length-1];return typeof t==`function`?``:t}return e},ready:!1},bt=()=>()=>{},V=(e,t={})=>{let{i18n:n}=t,{i18n:r,defaultNS:i}=(0,f.useContext)(pt)||{},a=n||r||Xe();a&&!a.reportNamespaces&&(a.reportNamespaces=new mt),a||Pe(a,`NO_I18NEXT_INSTANCE`,`useTranslation: You will need to pass in an i18next instance by using initReactI18next`);let o=(0,f.useMemo)(()=>({...qe(),...a?.options?.react,...t}),[a,t]),{useSuspense:s,keyPrefix:c}=o,l=e||i||a?.options?.defaultNS,u=ze(l)?[l]:l||[`translation`],d=(0,f.useMemo)(()=>u,u);a?.reportNamespaces?.addUsedNamespaces?.(d);let p=(0,f.useRef)(0),m=(0,f.useCallback)(e=>{if(!a)return bt;let{bindI18n:t,bindI18nStore:n}=o,r=()=>{p.current+=1,e()};return t&&a.on(t,r),n&&a.store.on(n,r),()=>{t&&t.split(` `).forEach(e=>a.off(e,r)),n&&n.split(` `).forEach(e=>a.store.off(e,r))}},[a,o]),h=(0,f.useRef)(),g=(0,f.useCallback)(()=>{if(!a)return yt;let e=!!(a.isInitialized||a.initializedStoreOnce)&&d.every(e=>Re(e,a,o)),n=t.lng||a.language,r=p.current,i=h.current;if(i&&i.ready===e&&i.lng===n&&i.keyPrefix===c&&i.revision===r)return i;let s={t:a.getFixedT(n,o.nsMode===`fallback`?d:d[0],c),ready:e,lng:n,keyPrefix:c,revision:r};return h.current=s,s},[a,d,c,o,t.lng]),[_,v]=(0,f.useState)(0),{t:y,ready:b}=(0,vt.useSyncExternalStore)(m,g,g);(0,f.useEffect)(()=>{if(a&&!b&&!s){let e=()=>v(e=>e+1);t.lng?Le(a,t.lng,d,e):Ie(a,d,e)}},[a,t.lng,d,b,s,_]);let x=a||{},S=(0,f.useRef)(null),C=(0,f.useRef)(),w=e=>{let t=Object.getOwnPropertyDescriptors(e);t.__original&&delete t.__original;let n=Object.create(Object.getPrototypeOf(e),t);if(!Object.prototype.hasOwnProperty.call(n,`__original`))try{Object.defineProperty(n,`__original`,{value:e,writable:!1,enumerable:!1,configurable:!1})}catch{}return n},T=(0,f.useMemo)(()=>{let e=x,t=e?.language,n=e;e&&(S.current&&S.current.__original===e&&C.current===t?n=S.current:(n=w(e),S.current=n,C.current=t));let r=!b&&!s?(...e)=>(Pe(a,`USE_T_BEFORE_READY`,`useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t.`),y(...e)):y,i=[r,n,b];return i.t=r,i.i18n=n,i.ready=b,i},[y,x,b,x.resolvedLanguage,x.language,x.languages]);if(a&&s&&!b)throw new Promise(e=>{let n=()=>e();t.lng?Le(a,t.lng,d,n):Ie(a,d,n)});return T},{slice:xt,forEach:St}=[];function Ct(e){return St.call(xt.call(arguments,1),t=>{if(t)for(let n in t)e[n]===void 0&&(e[n]=t[n])}),e}function wt(e){return typeof e==`string`?[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(t=>t.test(e)):!1}var Tt=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Et=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:`/`},r=`${e}=${encodeURIComponent(t)}`;if(n.maxAge>0){let e=n.maxAge-0;if(Number.isNaN(e))throw Error(`maxAge should be a Number`);r+=`; Max-Age=${Math.floor(e)}`}if(n.domain){if(!Tt.test(n.domain))throw TypeError(`option domain is invali
10d`);r+=`; Domain=${n.domain}`}if(n.path){if(!Tt.test(n.path))throw TypeError(`option path is invalid`);r+=`; Path=${n.path}`}if(n.expires){if(typeof n.expires.toUTCString!=`function`)throw TypeError(`option expires is invalid`);r+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(r+=`; HttpOnly`),n.secure&&(r+=`; Secure`),n.sameSite)switch(typeof n.sameSite==`string`?n.sameSite.toLowerCase():n.sameSite){case!0:r+=`; SameSite=Strict`;break;case`lax`:r+=`; SameSite=Lax`;break;case`strict`:r+=`; SameSite=Strict`;break;case`none`:r+=`; SameSite=None`;break;default:throw TypeError(`option sameSite is invalid`)}return n.partitioned&&(r+=`; Partitioned`),r},Dt={create(e,t,n,r){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:`/`,sameSite:`strict`};n&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+n*60*1e3)),r&&(i.domain=r),document.cookie=Et(e,t,i)},read(e){let t=`${e}=`,n=document.cookie.split(`;`);for(let e=0;e<n.length;e++){let r=n[e];for(;r.charAt(0)===` `;)r=r.substring(1,r.length);if(r.indexOf(t)===0)return r.substring(t.length,r.length)}return null},remove(e,t){this.create(e,``,-1,t)}},Ot={name:`cookie`,lookup(e){let{lookupCookie:t}=e;if(t&&typeof document<`u`)return Dt.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:n,cookieMinutes:r,cookieDomain:i,cookieOptions:a}=t;n&&typeof document<`u`&&Dt.create(n,e,r,i,a)}},kt={name:`querystring`,lookup(e){let{lookupQuerystring:t}=e,n;if(typeof window<`u`){let{search:e}=window.location;!window.location.search&&window.location.hash?.indexOf(`?`)>-1&&(e=window.location.hash.substring(window.location.hash.indexOf(`?`)));let r=e.substring(1).split(`&`);for(let e=0;e<r.length;e++){let i=r[e].indexOf(`=`);i>0&&r[e].substring(0,i)===t&&(n=r[e].substring(i+1))}}return n}},At={name:`hash`,lookup(e){let{lookupHash:t,lookupFromHashIndex:n}=e,r;if(typeof window<`u`){let{hash:e}=window.location;if(e&&e.length>2){let i=e.substring(1);if(t){let e=i.split(`&`);for(let n=0;n<e.length;n++){let i=e[n].indexOf(`=`);i>0&&e[n].substring(0,i)===t&&(r=e[n].substring(i+1))}}if(r)return r;if(!r&&n>-1){let t=e.match(/\/([a-zA-Z-]*)/g);
10return Array.isArray(t)?t[typeof n==`number`?n:0]?.replace(`/`,``):void 0}}}return r}},jt=null,Mt=()=>{if(jt!==null)return jt;try{if(jt=typeof window<`u`&&window.localStorage!==null,!jt)return!1;let e=`i18next.translate.boo`;window.localStorage.setItem(e,`foo`),window.localStorage.removeItem(e)}catch{jt=!1}return jt},Nt={name:`localStorage`,lookup(e){let{lookupLocalStorage:t}=e;if(t&&Mt())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&Mt()&&window.localStorage.setItem(n,e)}},Pt=null,Ft=()=>{if(Pt!==null)return Pt;try{if(Pt=typeof window<`u`&&window.sessionStorage!==null,!Pt)return!1;let e=`i18next.translate.boo`;window.sessionStorage.setItem(e,`foo`),window.sessionStorage.removeItem(e)}catch{Pt=!1}return Pt},It={name:`sessionStorage`,lookup(e){let{lookupSessionStorage:t}=e;if(t&&Ft())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&Ft()&&window.sessionStorage.setItem(n,e)}},Lt={name:`navigator`,lookup(e){let t=[];if(typeof navigator<`u`){let{languages:e,userLanguage:n,language:r}=navigator;if(e)for(let n=0;n<e.length;n++)t.push(e[n]);n&&t.push(n),r&&t.push(r)}return t.length>0?t:void 0}},Rt={name:`htmlTag`,lookup(e){let{htmlTag:t}=e,n,r=t||(typeof document<`u`?document.documentElement:null);return r&&typeof r.getAttribute==`function`&&(n=r.getAttribute(`lang`)),n}},zt={name:`path`,lookup(e){let{lookupFromPathIndex:t}=e;if(typeof window>`u`)return;let n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(Array.isArray(n))return n[typeof t==`number`?t:0]?.replace(`/`,``)}},Bt={name:`subdomain`,lookup(e){let{lookupFromSubdomainIndex:t}=e,n=typeof t==`number`?t+1:1,r=typeof window<`u`&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[n]}},Vt=!1;try{document.cookie,Vt=!0}catch{}var Ht=[`querystring`,`cookie`,`localStorage`,`sessionStorage`,`navigator`,`htmlTag`];Vt||Ht.splice(1,1);var Ut=()=>({order:Ht,lookupQuerystring:`lng`,lookupCookie:`i18next`,lookupLocalStorage:`i18nextLng`,lookupSessionStorage:`i18nextLng`,caches:[`localStorage`],excludeCacheFor:[`cimode`],convertDetectedLanguage:e=>e}),Wt=class{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type=`languageDetector`,this.detectors={},this.init(e,t)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=e,this.options=Ct(t,this.options||{},Ut()),typeof this.options.convertDetectedLanguage==`string`&&this.options.convertDetectedLanguage.indexOf(`15897`)>-1&&(this.options.convertDetectedLanguage=e=>e.replace(`-`,`_`)),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(Ot),this.addDetector(kt),this.addDetector(Nt),this.addDetector(It),this.addDetector(Lt),this.addDetector(Rt),this.addDetector(zt),this.addDetector(Bt),this.addDetector(At)}addDetector(e){return this.detectors[e.name]=e,this}detect(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,t=[];return e.forEach(e=>{if(this.detectors[e]){let n=this.detectors[e].lookup(this.options);n&&typeof n==`string`&&(n=[n]),n&&(t=t.concat(n))}}),t=t.filter(e=>e!=null&&!wt(e)).map(e=>this.options.convertDetectedLanguage(e)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?t:t.length>0?t[0]:null}cacheUserLanguage(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach(t=>{this.detectors[t]&&this.detectors[t].cacheUserLanguage(e,this.options)}))}};Wt.type=`languageDetector`;var Gt=function(e){return{type:`backend`,init:function(e,t,n){},read:function(t,n,r){if(typeof e==`function`){if(e.length<3){try{var i=e(t,n);i&&typeof i.then==`function`?i.then(function(e){return r(null,e&&e.default||e)}).catch(r):r(null,i)}catch(e){r(e)}return}e(t,n,r);return}r(null,e&&e[t]&&e[t][n])}}}
10,Kt=[`zh-TW`,`zh-CN`,`en`,`fr`,`ja`,`ko`,`es`,`pt-BR`,`ro`,`de`,`vi`,`th`];Kt.map(e=>e.toLowerCase());var qt=[{code:`zh-TW`,label:`ç¹é«ä¸æ`},{code:`zh-CN`,label:`ç®ä½ä¸æ`},{code:`en`,label:`English`},{code:`ja`,label:`æ¥æ¬èª`},{code:`ko`,label:`íêµì´`},{code:`fr`,label:`Français`},{code:`de`,label:`Deutsch`},{code:`es`,label:`Español`},{code:`pt-BR`,label:`Português (Brasil)`},{code:`ro`,label:`RomânÄ`},{code:`vi`,label:`Tiếng Viá»t`},{code:`th`,label:`ภาษาà¹à¸à¸¢`}];Ce.use(Wt).use(Gt((e,t)=>m(Object.assign({
10"./locales/de/account.json":()=>r(()=>import(`./account-Cze5xwkB.js`),[]),
10"./locales/de/analytics.json":()=>r(()=>import(`./analytics-Dcs_PuSP.js`),[]),
10"./locales/de/billing.json":()=>r(()=>import(`./billing-VXYtgGrn.js`),[]),
10"./locales/de/common.json":()=>r(()=>import(`./common-C_a2kB3o.js`),[]),
10"./locales/de/landing.json":()=>r(()=>import(`./landing-C2-HRVZ9.js`),[]),
10"./locales/de/mobile.json":()=>r(()=>import(`./mobile-BiYg-N3D.js`),[]),
10"./locales/de/myLinks.json":()=>r(()=>import(`./myLinks-DwMep2x5.js`),[]),
10"./locales/de/settings.json":()=>r(()=>import(`./settings-Cv1CNM3e.js`),[]),
10"./locales/de/workspace.json":()=>r(()=>import(`./workspace-DjqHehz7.js`),[]),
10"./locales/en/account.json":()=>r(()=>import(`./account-C-Rfr5XN.js`),[]),
10"./locales/en/analytics.json":()=>r(()=>import(`./analytics-BKVmBxst.js`),[]),
10"./locales/en/billing.json":()=>r(()=>import(`./billing-D06onVHN.js`),[]),
10"./locales/en/common.json":()=>r(()=>import(`./common-DGmA6fJF.js`),[]),
10"./locales/en/landing.json":()=>r(()=>import(`./landing-6YG6IyYE.js`),[]),
10"./locales/en/mobile.json":()=>r(()=>import(`./mobile-BoAv3jVB.js`),[]),
10"./locales/en/myLinks.json":()=>r(()=>import(`./myLinks-D9s0QUXS.js`),[]),
10"./locales/en/settings.json":()=>r(()=>import(`./settings-D1x4k1j2.js`),[]),
10"./locales/en/workspace.json":()=>r(()=>import(`./workspace-B0k3GfOd.js`),[]),
10"./locales/es/account.json":()=>r(()=>import(`./account-B-EPrs51.js`),[]),
10"./locales/es/analytics.json":()=>r(()=>import(`./analytics-Dx6fd0EI.js`),[]),
10"./locales/es/billing.json":()=>r(()=>import(`./billing-CNK_CcUP.js`),[]),
10"./locales/es/common.json":()=>r(()=>import(`./common-CeQHwqq2.js`),[]),
10"./locales/es/landing.json":()=>r(()=>import(`./landing-awBA-Wcz.js`),[]),
10"./locales/es/mobile.json":()=>r(()=>import(`./mobile-BRIp0Z_F.js`),[]),
10"./locales/es/myLinks.json":()=>r(()=>import(`./myLinks-s4HHjFCl.js`),[]),
10"./locales/es/settings.json":()=>r(()=>import(`./settings-DDO8bndr.js`),[]),
10"./locales/es/workspace.json":()=>r(()=>import(`./workspace-9oJ5o1y-.js`),[]),
10"./locales/fr/account.json":()=>r(()=>import(`./account-3xPJBe4L.js`),[]),
10"./locales/fr/analytics.json":()=>r(()=>import(`./analytics-BcYoBeRc.js`),[]),
10"./locales/fr/billing.json":()=>r(()=>import(`./billing-D3ETRv2P.js`),[]),
10"./locales/fr/common.json":()=>r(()=>import(`./common-DapJv-u0.js`),[]),
10"./locales/fr/landing.json":()=>r(()=>import(`./landing-BAI68USu.js`),[]),
10"./locales/fr/mobile.json":()=>r(()=>import(`./mobile-D9Wl9UTz.js`),[]),
10"./locales/fr/myLinks.json":()=>r(()=>import(`./myLinks-92pbUirf.js`),[]),
10"./locales/fr/settings.json":()=>r(()=>import(`./settings-CnXNvaif.js`),[]),
10"./locales/fr/workspace.json":()=>r(()=>import(`./workspace-CVT0q1XC.js`),[]),
10"./locales/ja/account.json":()=>r(()=>import(`./account-G4ZVsWMc.js`),[]),
10"./locales/ja/analytics.json":()=>r(()=>import(`./analytics-D_p4fFis.js`),[]),
10"./locales/ja/billing.json":()=>r(()=>import(`./billing-wnVOEa2B.js`),[]),
10"./locales/ja/common.json":()=>r(()=>import(`./common-ByRCNWRV.js`),[]),
10"./locales/ja/landing.json":()=>r(()=>import(`./landing-CiGFBDs_.js`),[]),
10"./locales/ja/mobile.json":()=>r(()=>import(`./mobile-D32QAZK1.js`),[]),
10"./locales/ja/myLinks.json":()=>r(()=>import(`./myLinks-DWQRxTm3.js`),[]),
10"./locales/ja/settings.json":()=>r(()=>import(`./settings-CQd0Q_gp.js`),[]),
10"./locales/ja/workspace.json":()=>r(()=>import(`./workspace-DuZX3dKd.js`),[]),
10"./locales/ko/account.json":()=>r(()=>import(`./account-Bfd9Elak.js`),[]),
10"./locales/ko/analytics.json":()=>r(()=>import(`./analytics-DmeEzfjw.js`),[]),
10"./locales/ko/billing.json":()=>r(()=>import(`./billing-BjryMO_X.js`),[]),
10"./locales/ko/common.json":()=>r(()=>import(`./common-BjZ2xcsl.js`),[]),
10"./locales/ko/landing.json":()=>r(()=>import(`./landing-CjlEMFwz.js`),[]),
10"./locales/ko/mobile.json":()=>r(()=>import(`./mobile-Cib2cQDo.js`),[]),
10"./locales/ko/myLinks.json":()=>r(()=>import(`./myLinks-aDSQzqnR.js`),[]),
10"./locales/ko/settings.json":()=>r(()=>import(`./settings-B2x54feC.js`),[]),
10"./locales/ko/workspace.json":()=>r(()=>import(`./workspace-Mldvh5zK.js`),[]),
10"./locales/pt-BR/account.json":()=>r(()=>import(`./account-CnOMXWbj.js`),[]),
10"./locales/pt-BR/analytics.json":()=>r(()=>import(`./analytics-yRZPnl-n.js`),[]),
10"./locales/pt-BR/billing.json":()=>r(()=>import(`./billing-eqgF-5Pf.js`),[]),
10"./locales/pt-BR/common.json":()=>r(()=>import(`./common-C8d92Uu5.js`),[]),
10"./locales/pt-BR/landing.json":()=>r(()=>import(`./landing-mU1rK3AO.js`),[]),
10"./locales/pt-BR/mobile.json":()=>r(()=>import(`./mobile-cneeWmlR.js`),[]),
10"./locales/pt-BR/myLinks.json":()=>r(()=>import(`./myLinks-BoUwI2zs.js`),[]),
10"./locales/pt-BR/settings.json":()=>r(()=>import(`./settings-C5jG0kio.js`),[]),
10"./locales/pt-BR/workspace.json":()=>r(()=>import(`./workspace-DNkLUWcU.js`),[]),
10"./locales/ro/account.json":()=>r(()=>import(`./account-DWzxJmUp.js`),[]),
10"./locales/ro/analytics.json":()=>r(()=>import(`./analytics-DHfNNi22.js`),[]),
10"./locales/ro/billing.json":()=>r(()=>import(`./billing-Dm0a8AwQ.js`),[]),
10"./locales/ro/common.json":()=>r(()=>import(`./common-DuVUSeJf.js`),[]),
10"./locales/ro/landing.json":()=>r(()=>import(`./landing-CD7RFGQW.js`),[]),
10"./locales/ro/mobile.json":()=>r(()=>import(`./mobile-BeOGcyt0.js`),[]),
10"./locales/ro/myLinks.json":()=>r(()=>import(`./myLinks-C3AqIYqk.js`),[]),
10"./locales/ro/settings.json":()=>r(()=>import(`./settings-CiyNE4uN.js`),[]),
10"./locales/ro/workspace.json":()=>r(()=>import(`./workspace-CSxRYBPJ.js`),[]),
10"./locales/th/account.json":()=>r(()=>import(`./account-DFYE7ogG.js`),[]),
10"./locales/th/analytics.json":()=>r(()=>import(`./analytics-D8VyERHF.js`),[]),
10"./locales/th/billing.json":()=>r(()=>import(`./billing-LLK3ik0R.js`),[]),
10"./locales/th/common.json":()=>r(()=>import(`./common-BBcGe8as.js`),[]),
10"./locales/th/landing.json":()=>r(()=>import(`./landing-BbBFXFHQ.js`),[]),
10"./locales/th/mobile.json":()=>r(()=>import(`./mobile-BG6pk6q3.js`),[]),
10"./locales/th/myLinks.json":()=>r(()=>import(`./myLinks-D9ly3iZo.js`),[]),
10"./locales/th/settings.json":()=>r(()=>import(`./settings-BtCe2WLb.js`),[]),
10"./locales/th/workspace.json":()=>r(()=>import(`./workspace-Dpv0AZ1E.js`),[]),
10"./locales/vi/account.json":()=>r(()=>import(`./account-CafwGBet.js`),[]),
10"./locales/vi/analytics.json":()=>r(()=>import(`./analytics-BrVHlDvo.js`),[]),
10"./locales/vi/billing.json":()=>r(()=>import(`./billing-DXJMetdr.js`),[]),
10"./locales/vi/common.json":()=>r(()=>import(`./common-B4SrcbWS.js`),[]),
10"./locales/vi/landing.json":()=>r(()=>import(`./landing-Df1Uv7mS.js`),[]),
10"./locales/vi/mobile.json":()=>r(()=>import(`./mobile-CzEEecEM.js`),[]),
10"./locales/vi/myLinks.json":()=>r(()=>import(`./myLinks-BiLj_Qv0.js`),[]),
10"./locales/vi/settings.json":()=>r(()=>import(`./settings-DJSXgjdS.js`),[]),
10"./locales/vi/workspace.json":()=>r(()=>import(`./workspace-DiE91jt2.js`),[]),
10"./locales/zh-CN/account.json":()=>r(()=>import(`./account-D4ktLqtj.js`),[]),
10"./locales/zh-CN/analytics.json":()=>r(()=>import(`./analytics-CQgt_seg.js`),[]),
10"./locales/zh-CN/billing.json":()=>r(()=>import(`./billing-BQS71Z4Q.js`),[]),
10"./locales/zh-CN/common.json":()=>r(()=>import(`./common-e5Tm77FE.js`),[]),
10"./locales/zh-CN/landing.json":()=>r(()=>import(`./landing-CSf2-ykh.js`),[]),
10"./locales/zh-CN/mobile.json":()=>r(()=>import(`./mobile-QvYlhCa5.js`),[]),
10"./locales/zh-CN/myLinks.json":()=>r(()=>import(`./myLinks-0-vfEoEY.js`),[]),
10"./locales/zh-CN/settings.json":()=>r(()=>import(`./settings-BDW5Boux.js`),[]),
10"./locales/zh-CN/workspace.json":()=>r(()=>import(`./workspace-Don2QF-i.js`),[]),
10"./locales/zh-TW/account.json":()=>r(()=>import(`./account-CosmEryG.js`),[]),
10"./locales/zh-TW/analytics.json":()=>r(()=>import(`./analytics-Do098BdK.js`),[]),
10"./locales/zh-TW/billing.json":()=>r(()=>import(`./billing-BqbVadVV.js`),[]),
10"./locales/zh-TW/common.json":()=>r(()=>import(`./common-CYcNarvi.js`),[]),
10"./locales/zh-TW/landing.json":()=>r(()=>import(`./landing-WUAsu_oj.js`),[]),
10"./locales/zh-TW/mobile.json":()=>r(()=>import(`./mobile-BoK-5xRa.js`),[]),
10"./locales/zh-TW/myLinks.json":()=>r(()=>import(`./myLinks-PenNiLzQ.js`),[]),
10"./locales/zh-TW/settings.json":()=>r(()=>import(`./settings-DjS2fKeS.js`),[]),
10"./locales/zh-TW/workspace.json":()=>r(()=>import(`./workspace-BJdGG2PB.js`),[])
10}),`./locales/${e}/${t}.json`,4))).use(ft).init({fallbackLng:`zh-TW`,supportedLngs:Kt,defaultNS:`common`,ns:[`common`,`myLinks`,`analytics`,`settings`,`workspace`,`account`,`billing`,`landing`,`mobile`],detection:{order:[`localStorage`,`navigator`],caches:[`localStorage`],lookupLocalStorage:`i18nextLng`},interpolation:{escapeValue:!1}});var Jt=Ce,Yt=e=>{throw TypeError(e)},Xt=(e,t,n)=>t.has(e)||Yt(`Cannot `+n),Zt=(e,t,n)=>(Xt(e,t,`read from private field`),n?n.call(e):t.get(e)),Qt=(e,t,n)=>t.has(e)?Yt(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),$t=`popstate`;function en(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function tn(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return sn(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:cn(t)}return un(t,n,null,e)}function nn(e,t){if(e===!1||e==null)throw Error(t)}function rn(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function an(){return Math.random().toString(36).substring(2,10)}function on(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function sn(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?ln(t):t,state:n,key:t&&t.key||r||an(),unstable_mask:i}}function cn({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function ln(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function un(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=en(e)?e:sn(h.location,e,t);n&&n(r,e),l=u()+1;let d=on(r,l),f=h.createHref(r.unstable_mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=en(e)?e:sn(h.location,e,t);n&&n(r,e),l=u();let i=on(r,l),d=h.createHref(r.unstable_mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return dn(e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener($t,d),c=e,()=>{i.removeEventListener($t,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function dn(e,t=!1){let n=`http://localhost`;typeof window<`u`&&(n=window.location.origin===`null`?window.location.href:window.location.origin),nn(n,`No window.location.(origin|href) available to create URL`);let r=typeof e==`string`?e:cn(e);return r=r.replace(/ $/,`%20`),!t&&r.startsWith(`//`)&&(r=n+r),new URL(r,n)}var fn,pn=class{constructor(e){if(Qt(this,fn,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(Zt(this,fn).has(e))return Zt(this,fn).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw Error(`No value found for context`)}set(e,t){Zt(this,fn).set(e,t)}};fn=new WeakMap;var mn=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`]);function hn(e){return mn.has(e)}var gn=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`middleware`,`children`]);function _n(e){return gn.has(e)}function vn(e){return e.index===!0}function yn(e,t,n=[],r={},i=!1){return e.map((e,a)=>{let o=[...n,String(a)],s=typeof e.id==`string`?e.id:o.join(`-`);
10if(nn(e.index!==!0||!e.children,`Cannot specify children on an index route`),nn(i||!r[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),vn(e)){let n={...e,id:s};return r[s]=bn(n,t(n)),n}else{let n={...e,id:s,children:void 0};return r[s]=bn(n,t(n)),e.children&&(n.children=yn(e.children,t,o,r,i)),n}})}function bn(e,t){return Object.assign(e,{...t,...typeof t.lazy==`object`&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function xn(e,t,n=`/`){return Sn(e,t,n,!1)}function Sn(e,t,n,r){let i=Bn((typeof t==`string`?ln(t):t).pathname||`/`,n);if(i==null)return null;let a=wn(e);En(a);let o=null;for(let e=0;o==null&&e<a.length;++e){let t=zn(i);o=In(a[e],t,r)}return o}function Cn(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function wn(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;nn(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=Xn([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(nn(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),wn(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:Pn(l,e.index),routesMeta:u})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);
10else for(let n of Tn(e.path))a(e,t,!0,n)}),t}function Tn(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=Tn(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function En(e){e.sort((e,t)=>e.score===t.score?Fn(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var Dn=/^:[\w-]+$/,On=3,kn=2,An=1,jn=10,Mn=-2,Nn=e=>e===`*`;function Pn(e,t){let n=e.split(`/`),r=n.length;return n.some(Nn)&&(r+=Mn),t&&(r+=kn),n.filter(e=>!Nn(e)).reduce((e,t)=>e+(Dn.test(t)?On:t===``?An:jn),r)}function Fn(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function In(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u=Ln({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},l),d=s.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=Ln({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!u)return null;
10Object.assign(i,u.params),o.push({params:i,pathname:Xn([a,u.pathname]),pathnameBase:Zn(Xn([a,u.pathnameBase])),route:d}),u.pathnameBase!==`/`&&(a=Xn([a,u.pathnameBase]))}return o}function Ln(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Rn(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function Rn(e,t=!1,n=!0){rn(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function zn(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return rn(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Bn(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function Vn({basename:e,pathname:t}){return t===`/`?e:Xn([e,t])}var Hn=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Un=e=>Hn.test(e);function Wn(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?ln(e):e,a;return n?(n=n.replace(/\/\/+/g,`/`),a=n.startsWith(`/`)?Gn(n.substring(1),`/`):Gn(n,t)):a=t,{pathname:a,search:Qn(r),hash:$n(i)}}function Gn(e,t){let n=t.replace(/\/+$/,``).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Kn(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function qn(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Jn(e){let t=qn(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function Yn(e,t,n,r=!1){let i;typeof e==`string`?i=ln(e):(i={...e},nn(!i.pathname||!i.pathname.includes(`?`),Kn(`?`,`pathname`,`search`,i)),nn(!i.pathname||!i.pathname.includes(`#`),Kn(`#`,`pathname`,`hash`,i)),nn(!i.search||!i.search.includes(`#`),Kn(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=Wn(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Xn=e=>e.join(`/`).replace(/\/\/+/g,`/`),Zn=e=>e.replace(/\/+$/,``).replace(/^\/*/,`/`),Qn=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,$n=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,er=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function tr(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function nr(e){return e.map(e=>e.route.path).filter(Boolean).join(`/`).replace(/\/\/*/g,`/`)||`/`}var rr=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function ir(e,t){let n=e;if(typeof n!=`string`||!Hn.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(rr)try{let e=new URL(window.location.href),r=n.startsWith(`//`)?new URL(e.protocol+n):new URL(n),a=Bn(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{rn(!1,`<Link to="${n}">
10 contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}var ar=Symbol(`Uninstrumented`);function or(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(e=>e({id:t.id,index:t.index,path:t.path,instrument(e){let t=Object.keys(n);for(let r of t)e[r]&&n[r].push(e[r])}}));let r={};if(typeof t.lazy==`function`&&n.lazy.length>0){let e=cr(n.lazy,t.lazy,()=>void 0);e&&(r.lazy=e)}if(typeof t.lazy==`object`){let e=t.lazy;[`middleware`,`loader`,`action`].forEach(t=>{let i=e[t],a=n[`lazy.${t}`];if(typeof i==`function`&&a.length>0){let e=cr(a,i,()=>void 0);e&&(r.lazy=Object.assign(r.lazy||{},{[t]:e}))}})}return[`loader`,`action`].forEach(e=>{let i=t[e];if(typeof i==`function`&&n[e].length>0){let t=i[ar]??i,a=cr(n[e],t,(...e)=>ur(e[0]));a&&(e===`loader`&&t.hydrate===!0&&(a.hydrate=!0),a[ar]=t,r[e]=a)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=e[ar]??e,r=cr(n.middleware,t,(...e)=>ur(e[0]));return r?(r[ar]=t,r):e})),r}function sr(e,t){let n={navigate:[],fetch:[]};if(t.forEach(e=>e({instrument(e){let t=Object.keys(e);for(let r of t)e[r]&&n[r].push(e[r])}})),n.navigate.length>0){let t=e.navigate[ar]??e.navigate,r=cr(n.navigate,t,(...t)=>{let[n,r]=t;return{to:typeof n==`number`||typeof n==`string`?n:n?cn(n):`.`,...dr(e,r??{})}});r&&(r[ar]=t,e.navigate=r)}if(n.fetch.length>0){let t=e.fetch[ar]??e.fetch,r=cr(n.fetch,t,(...t)=>{let[n,,r,i]=t;return{href:r??`.`,fetcherKey:n,...dr(e,i??{})}});r&&(r[ar]=t,e.fetch=r)}return e}function cr(e,t,n){return e.length===0?null:async(...r)=>{let i=await lr(e,n(...r),()=>t(...r),e.length-1);if(i.type===`error`)throw i.value;return i.value}}async function lr(e,t,n,r){let i=e[r],a;if(i){let o,s=async()=>(o?console.error(`You cannot call instrumented handlers more than once`):o=lr(e,t,n,r-1),a=await o,nn(a,`Expected a result`),a.type===`error`&&a.value instanceof Error?{status:`error`,error:a.value}:{status:`success`,error:void 0});try{await i(s,t)}catch(e){console.error(`An instrumentation function threw an error:`,e)}o||await s(),await o}else try{a={type:`success`,value:await n()}}catch(e){a={type:`error`,value:e}}return a||{type:`error`,value:Error(`No result assigned in instrumentation chain.`)}}function ur(e){let{request:t,context:n,params:r,unstable_pattern:i}=e;return{request:fr(t),params:{...r},unstable_pattern:i,context:pr(n)}}function dr(e,t){return{currentUrl:cn(e.state.location),...`formMethod`in t?{formMethod:t.formMethod}:{},...`formEncType`in t?{formEncType:t.formEncType}:{},...`formData`in t?{formData:t.formData}:{},...`body`in t?{body:t.body}:{}}}function fr(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function pr(e){if(hr(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var mr=Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function hr(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join(`\0`)===mr}var gr=[`POST`,`PUT`,`PATCH`,`DELETE`],_r=new Set(gr),vr=[`GET`,...gr],yr=new Set(vr),br=new Set([301,302,303,307,308]),xr=new Set([307,308]),Sr={state:`idle`,location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Cr={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},wr={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},Tr=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Er=`remix-router-transitions`,Dr=Symbol(`ResetLoaderData`);function Or(e){let t=e.window?e.window:typeof window<`u`?window:void 0,n=t!==void 0&&t.document!==void 0&&t.document.createElement!==void 0;nn(e.routes.length>0,`You must provide a non-empty routes array to createRouter`);let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties||Tr,a=i;if(e.unstable_instrumentations){let t=e.unstable_instrumentations;a=e=>({...i(e),...or(t.map(e=>
10e.route).filter(Boolean),e)})}let o={},s=yn(e.routes,a,void 0,o),c,l=e.basename||`/`;l.startsWith(`/`)||(l=`/${l}`);let u=e.dataStrategy||Gr,d={unstable_passThroughRequests:!1,...e.future},f=null,p=new Set,m=null,h=null,g=null,_=e.hydrationData!=null,v=xn(s,e.history.location,l),y=!1,b=null,x,S;if(v==null&&!e.patchRoutesOnNavigation){let t=hi(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=mi(s);x=!0,S=!x,v=n,b={[r.id]:t}}else if(v&&!e.hydrationData&&Ue(v,s,e.history.location.pathname).active&&(v=null),!v){x=!1,S=!x,v=[];let t=Ue(null,s,e.history.location.pathname);t.active&&t.matches&&(y=!0,v=t.matches)}else if(v.some(e=>e.route.lazy))x=!1,S=!x;else if(!v.some(e=>Nr(e.route)))x=!0,S=!x;else{let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null,r=v;if(n){let e=v.findIndex(e=>n[e.route.id]!==void 0);r=r.slice(0,e+1)}S=!1,x=!0,r.forEach(e=>{let r=Pr(e.route,t,n);S||=r.renderFallback,x&&=!r.shouldLoad})}let C,w={historyAction:e.history.action,location:e.history.location,matches:v,initialized:x,renderFallback:S,navigation:Sr,restoreScrollPosition:e.hydrationData==null?null:!1,preventScrollReset:!1,revalidation:`idle`,loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||b,fetchers:new Map,blockers:new Map},T=`POP`,E=null,D=!1,O,k=!1,A=new Map,j=null,M=!1,N=!1,ee=new Set,P=new Map,F=0,I=-1,te=new Map,L=new Set,ne=new Map,R=new Map,z=new Set,B=new Map,re,ie=null;function ae(){if(f=e.history.listen(({action:t,location:n,delta:r})=>{if(re){re(),re=void 0;return}rn(B.size===0||r!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let i=Le({currentLocation:w.location,nextLocation:n,historyAction:t});if(i&&r!=null){let t=new Promise(e=>{re=e});e.history.go(r*-1),Ie(i,{state:`blocked`,location:n,proceed(){Ie(i,{state:`proceeding`,proceed:void 0,reset:void 0,location:n}),t.then(()=>e.history.go(r))},reset(){let e=new Map(w.blockers);e.set(i,wr),ce({blockers:e})}}),E?.resolve(),E=null;return}return fe(t,n)}),n){zi(t,A);let e=()=>Bi(t,A);t.addEventListener(`pagehide`,e),j=()=>t.removeEventListener(`pagehide`,e)}return w.initialized||fe(`POP`,w.location,{initialHydration:!0}),C}function oe(){f&&f(),j&&j(),p.clear(),O&&O.abort(),w.fetchers.forEach((e,t)=>Oe(t)),w.blockers.forEach((e,t)=>Fe(t))}function se(e){return p.add(e),()=>p.delete(e)}function ce(e,t={}){e.matches&&=e.matches.map(e=>{let t=o[e.route.id],n=e.route;return n.element!==t.element||n.errorElement!==t.errorElement||n.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e}),w={...w,...e};let n=[],r=[];w.fetchers.forEach((e,t)=>{e.state===`idle`&&(z.has(t)?n.push(t):r.push(t))}),z.forEach(e=>{!w.fetchers.has(e)&&!P.has(e)&&n.push(e)}),[...p].forEach(r=>r(w,{deletedFetchers:n,newErrors:e.errors??null,viewTransitionOpts:t.viewTransitionOpts,flushSync:t.flushSync===!0})),n.forEach(e=>Oe(e)),r.forEach(e=>w.fetchers.delete(e))}function le(t,n,{flushSync:r}={}){let i=w.actionData!=null&&w.navigation.formMethod!=null&&Ai(w.navigation.formMethod)&&w.navigation.state===`loading`&&t.state?._isRedirect!==!0,a;a=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:i?w.actionData:null;let o=n.loaderData?di(w.loaderData,n.loaderData,n.matches||[],n.errors):w.loaderData,l=w.blockers;l.size>0&&(l=new Map(l),l.forEach((e,t)=>l.set(t,wr)));let u=M?!1:He(t,n.matches||w.matches),d=D===!0||w.navigation.formMethod!=null&&Ai(w.navigation.formMethod)&&t.state?._isRedirect!==!0;c&&=(s=c,void 0),M||T===`POP`||(T===`PUSH`?e.history.push(t,t.state):T===`REPLACE`&&e.history.replace(t,t.state));let f;if(T===`POP`){let e=A.get(w.location.pathname);e&&e.has(t.pathname)?f={currentLocation:w.location,nextLocation:t}:A.has(t.pathname)&&(f={currentLocation:t,nextLocation:w.location})}else if(k){let e=A.get(w.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),A.set(w.location.pathname,e)),f={currentLocation:w.location,nextLocation:t}}ce({...n,actionData:a,loaderData:o,historyAction:T,location:t,initialized:!0,renderFallback:!1,navigation:Sr,revalidation:`idle`,restoreScrollPosition:u,preventScrollReset:d,blockers:l},{viewTransitionOpts:f,flushSync:r===!0}),T=`POP`,D=!1,k=!1,M=!1,N=!1,E?.resolve(),E=null,ie?.resolve(),ie=null}async function ue(t,n){if(E?.resolve(),E=null,typeof t==`number`){E||=Vi();let n=E.promise;return e.history.go(t),n}let{path:r,submission:i,error:a}=jr(!1,Ar(w.location,w.matches,l,t,n?.fromRouteId,n?.relative),n),o;n?.unstable_mask&&(o={pathname:``,search:``,hash:``,...typeof n.unstable_mask==`string`?ln(n.unstable_mask):{...w.location.unstable_mask,...n.unstable_mask}});let s=w.location,c=sn(s,r,n&&n.state,void 0,o);c={...c,...e.history.encodeLocation(c)};let u=n&&n.replace!=null?n.replace:void 0,d=`PUSH`;u===!0?d=`REPLACE`:u===!1||i!=null&&Ai(i.formMethod)&&i.formAction===w.location.pathname+w.location.search&&(d=`REPLACE`);let f=n&&`preventScrollReset`in n?n.preventScrollReset===!0:void 0,p=(n&&n.flushSync)===!0,m=Le({currentLocation:s,nextLocation:c,historyAction:d});if(m){Ie(m,{state:`blocked`,location:c,proceed(){Ie(m,{state:`proceeding`,proceed:void 0,reset:void 0,location:c}),ue(t,n)},reset(){let e=new Map(w.blockers);e.set(m,wr),ce({blockers:e})}});return}await fe(d,c,{submission:i,pendingError:a,preventScrollReset:f,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:p,callSiteDefaultShouldRevalidate:n&&n.unstable_defaultShouldRevalidate})}function de(){ie||=Vi(),Ce(),ce({revalidation:`loading`});let e=ie.promise;return w.navigation.state===`submitting`?e:w.navigation.state===`idle`?(fe(w.historyAction,w.location,{startUninterruptedRevalidation:!0}
10),e):(fe(T||w.historyAction,w.navigation.location,{overrideNavigation:w.navigation,enableViewTransition:k===!0}),e)}async function fe(t,n,r){O&&O.abort(),O=null,T=t,M=(r&&r.startUninterruptedRevalidation)===!0,Ve(w.location,w.matches),D=(r&&r.preventScrollReset)===!0,k=(r&&r.enableViewTransition)===!0;let i=c||s,a=r&&r.overrideNavigation,o=r?.initialHydration&&w.matches&&w.matches.length>0&&!y?w.matches:xn(i,n,l),u=(r&&r.flushSync)===!0;if(o&&w.initialized&&!N&&vi(w.location,n)&&!(r&&r.submission&&Ai(r.submission.formMethod))){le(n,{matches:o},{flushSync:u});return}let d=Ue(o,i,n.pathname);if(d.active&&d.matches&&(o=d.matches),!o){let{error:e,notFoundMatches:t,route:r}=Re(n.pathname);le(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:u});return}O=new AbortController;let f=ai(e.history,n,O.signal,r&&r.submission),p=e.getContext?await e.getContext():new pn,m;if(r&&r.pendingError)m=[pi(o).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&Ai(r.submission.formMethod)){let t=await pe(f,n,r.submission,o,p,d.active,r&&r.initialHydration===!0,{replace:r.replace,flushSync:u});if(t.shortCircuited)return;if(t.pendingActionResult){let[e,r]=t.pendingActionResult;if(Ci(r)&&tr(r.error)&&r.error.status===404){O=null,le(n,{matches:t.matches,loaderData:{},errors:{[e]:r.error}});return}}o=t.matches||o,m=t.pendingActionResult,a=Pi(n,r.submission),u=!1,d.active=!1,f=ai(e.history,f.url,f.signal)}let{shortCircuited:h,matches:g,loaderData:_,errors:v}=await me(f,n,o,p,d.active,a,r&&r.submission,r&&r.fetcherSubmission,r&&r.replace,r&&r.initialHydration===!0,u,m,r&&r.callSiteDefaultShouldRevalidate);h||(O=null,le(n,{matches:g||o,...fi(m),loaderData:_,errors:v}))}async function pe(t,n,i,c,u,d,f,p={}){if(Ce(),ce({navigation:Fi(n,i)},{flushSync:p.flushSync===!0}),d){let e=await We(c,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=mi(s);return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=pi(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:`error`,error:e.error}]}}else if(e.matches)c=e.matches;else{let{notFoundMatches:e,error:t,route:r}=Re(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:`error`,error:t}]}}}let m,h=Mi(c,n);if(!h.route.action&&!h.route.lazy)m={type:`error`,error:hi(405,{method:t.method,pathname:n.pathname,routeId:h.route.id})};else{let e=await xe(t,n,Zr(a,o,t,n,c,h,f?[]:r,u),u,null);if(m=e[h.route.id],!m){for(let t of c)if(e[t.route.id]){m=e[t.route.id];break}}if(t.signal.aborted)return{shortCircuited:!0}}if(wi(m)){let n;return n=p&&p.replace!=null?p.replace:ii(m.response.headers.get(`Location`),new URL(t.url),l,e.history)===w.location.pathname+w.location.search,await be(t,m,!0,{submission:i,replace:n}),{shortCircuited:!0}}if(Ci(m)){let e=pi(c,h.route.id);return(p&&p.replace)!==!0&&(T=`PUSH`),{matches:c,pendingActionResult:[e.route.id,m,h.route.id]}}return{matches:c,pendingActionResult:[h.route.id,m]}}async function me(t,n,i,u,d,f,p,m,h,g,_,v,y){let b=f||Pi(n,p),x=p||m||Ni(b),S=!M&&!g;if(d){if(S){let e=he(v);ce({navigation:b,...e===void 0?{}:{actionData:e}},{flushSync:_})}let e=await We(i,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=mi(s);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=pi(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}else if(e.matches)i=e.matches;else{let{error:e,notFoundMatches:t,route:r}=Re(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let C=c||s,{dsMatches:T,revalidatingFetchers:E}=Mr(t,u,a,o,e.history,w,i,x,n,g?[]:r,g===!0,N,ee,z,ne,L,C,l,e.patchRoutesOnNavigation!=null,v,y);if(I=++F,!e.dataStrategy&&!T.some(e=>e.shouldLoad)&&!T.some(e=>e.route.middleware&&e.route.middleware.length>0)&&E.length===0){let e=Me();return le(n,{matches:i,loaderData:{},errors:v&&Ci(v[1])?{[v[0]]:v[1].error}:null,...fi(v),...e?{fetchers:new Map(w.fetchers)}:{}},{flushSync:_}),{shortCircuited:!0}}if(S){let e={};if(!d){e.navigation=b;let t=he(v);t!==void 0&&(e.actionData=t)}E.length>0&&(e.fetchers=ge(E)),ce(e,{flushSync:_})}
10E.forEach(e=>{Ae(e.key),e.controller&&P.set(e.key,e.controller)});let D=()=>E.forEach(e=>Ae(e.key));O&&O.signal.addEventListener(`abort`,D);let{loaderResults:k,fetcherResults:A}=await Se(T,E,t,n,u);if(t.signal.aborted)return{shortCircuited:!0};O&&O.signal.removeEventListener(`abort`,D),E.forEach(e=>P.delete(e.key));let j=gi(k);if(j)return await be(t,j.result,!0,{replace:h}),{shortCircuited:!0};if(j=gi(A),j)return L.add(j.key),await be(t,j.result,!0,{replace:h}),{shortCircuited:!0};let{loaderData:te,errors:R}=ui(w,i,k,v,E,A);g&&w.errors&&(R={...w.errors,...R});let B=Me(),re=Ne(I),ie=B||re||E.length>0;return{matches:i,loaderData:te,errors:R,...ie?{fetchers:new Map(w.fetchers)}:{}}}function he(e){if(e&&!Ci(e[1]))return{[e[0]]:e[1].data};if(w.actionData)return Object.keys(w.actionData).length===0?null:w.actionData}function ge(e){return e.forEach(e=>{let t=w.fetchers.get(e.key),n=Ii(void 0,t?t.data:void 0);w.fetchers.set(e.key,n)}),new Map(w.fetchers)}async function _e(t,n,r,i){Ae(t);let a=(i&&i.flushSync)===!0,o=c||s,u=Ar(w.location,w.matches,l,r,n,i?.relative),d=xn(o,u,l),f=Ue(d,o,u);if(f.active&&f.matches&&(d=f.matches),!d){Te(t,n,hi(404,{pathname:u}),{flushSync:a});return}let{path:p,submission:m,error:h}=jr(!0,u,i);if(h){Te(t,n,h,{flushSync:a});return}let g=e.getContext?await e.getContext():new pn,_=(i&&i.preventScrollReset)===!0;if(m&&Ai(m.formMethod)){await ve(t,n,p,d,g,f.active,a,_,m,i&&i.unstable_defaultShouldRevalidate);return}ne.set(t,{routeId:n,path:p}),await ye(t,n,p,d,g,f.active,a,_,m)}async function ve(t,n,i,u,d,f,p,m,h,g){Ce(),ne.delete(t),we(t,Li(h,w.fetchers.get(t)),{flushSync:p});let _=new AbortController,v=ai(e.history,i,_.signal,h);if(f){let e=await We(u,new URL(v.url).pathname,v.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){Te(t,n,e.error,{flushSync:p});return}else if(e.matches)u=e.matches;else{Te(t,n,hi(404,{pathname:i}),{flushSync:p});return}}let y=Mi(u,i);if(!y.route.action&&!y.route.lazy){Te(t,n,hi(405,{method:h.formMethod,pathname:i,routeId:n}),{flushSync:p});return}P.set(t,_);let b=F,x=Zr(a,o,v,i,u,y,r,d),S=await xe(v,i,x,d,t),C=S[y.route.id];if(!C){for(let e of x)if(S[e.route.id]){C=S[e.route.id];break}}if(v.signal.aborted){P.get(t)===_&&P.delete(t);return}if(z.has(t)){if(wi(C)||Ci(C)){we(t,Ri(void 0));return}}else{if(wi(C))if(P.delete(t),I>b){we(t,Ri(void 0));return}else return L.add(t),we(t,Ii(h)),be(v,C,!1,{fetcherSubmission:h,preventScrollReset:m});if(Ci(C)){Te(t,n,C.error);return}}let E=w.navigation.location||w.location,D=ai(e.history,E,_.signal),k=c||s,A=w.navigation.state===`idle`?w.matches:xn(k,w.navigation.location,l);nn(A,`Didn't find any matches after fetcher action`);let j=++F;te.set(t,j);let M=Ii(h,C.data);w.fetchers.set(t,M);let{dsMatches:R,revalidatingFetchers:B}=Mr(D,d,a,o,e.history,w,A,h,E,r,!1,N,ee,z,ne,L,k,l,e.patchRoutesOnNavigation!=null,[y.route.id,C],g);B.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=w.fetchers.get(t),r=Ii(void 0,n?n.data:void 0);w.fetchers.set(t,r),Ae(t),e.controller&&P.set(t,e.controller)}),ce({fetchers:new Map(w.fetchers)});let re=()=>B.forEach(e=>Ae(e.key));_.signal.addEventListener(`abort`,re);let{loaderResults:ie,fetcherResults:ae}=await Se(R,B,D,E,d);if(_.signal.aborted)return;if(_.signal.removeEventListener(`abort`,re),te.delete(t),P.delete(t),B.forEach(e=>P.delete(e.key)),w.fetchers.has(t)){let e=Ri(C.data);w.fetchers.set(t,e)}let oe=gi(ie);if(oe)return be(D,oe.result,!1,{preventScrollReset:m});if(oe=gi(ae),oe)return L.add(oe.key),be(D,oe.result,!1,{preventScrollReset:m});let{loaderData:se,errors:ue}=ui(w,A,ie,void 0,B,ae);Ne(j),w.navigation.state===`loading`&&j>I?(nn(T,`Expected pending action`),O&&O.abort(),le(w.navigation.location,{matches:A,loaderData:se,errors:ue,fetchers:new Map(w.fetchers)})):(ce({errors:ue,loaderData:di(w.loaderData,se,A,ue),fetchers:new Map(w.fetchers)}),N=!1)}async function ye(t,n,i,s,c,l,u,d,f){let p=w.fetchers.get(t);we(t,Ii(f,p?p.data:void 0),{flushSync:u});let m=new AbortController,h=ai(e.history,i,m.signal);if(l){let e=await We(s,new URL(h.url).pathname,h.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){Te(t,n,e.error,{flushSync:u});return}else if(e.matches)s=e.matches;else{Te(t,n,hi(404,{pathname:i}),{flushSync:u});return}}let g=Mi(s,i);P.set(t,m);let _=F,v=(await xe(h,i,Zr(a,o,h,i,s,g,r,c),c,t))[g.route.id];if(P.get(t)===m&&P.delete(t),!h.signal.aborted){if(z.has(t)){we(t,Ri(void 0));return}if(wi(v))if(I>_){we(t,Ri(void 0));return}else{L.add(t),await be(h,v,!1,{preventScrollReset:d});return}if(Ci(v)){Te(t,n,v.error);return}we(t,Ri(v.data))}}async function be(r,i,a,{submission:o,fetcherSubmission:s,preventScrollReset:c,replace:u}={}){a||(E?.resolve(),E=null),i.response.headers.has(`X-Remix-Revalidate`)&&(N=!0);let d=i.response.headers.get(`Location`);nn(d,`Expected a Location header on the redirect Response`),d=ii(d,new URL(r.url),l,e.history);let f=sn(w.location,d,{_isRedirect:!0});if(n){let e=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))e=!0;else if(Un(d)){let n=dn(d,!0);e=n.origin!==t.location.origin||Bn(n.pathname,l)==null}if(e){u?t.location.replace(d):t.location.assign(d);return}}O=null;let p=u===!0||i.response.headers.has(`X-Remix-Replace`)?`REPLACE`:`PUSH`,{formMethod:m,formAction:h,formEncType:g}=w.navigation;!o&&!s&&m&&h&&g&&(o=Ni(w.navigation));let _=o||s;xr.has(i.response.status)&&_&&Ai(_.formMethod)?await fe(p,f,{submission:{..._,formAction:d},preventScrollReset:c||D,enableViewTransition:a?k:void 0}):await fe(p,f,{overrideNavigation:Pi(f,o),fetcherSubmission:s,preventScrollReset:c||D,enableViewTransition:a?k:void 0})}async function xe(e,t,n,r,i){let a,o={};try{a=await Qr(u,e,t,n,i,r,!1)}catch(e){return n.filter(e=>
10e.shouldLoad).forEach(t=>{o[t.route.id]={type:`error`,error:e}}),o}if(e.signal.aborted)return o;if(!Ai(e.method))for(let e of n){if(a[e.route.id]?.type===`error`)break;!a.hasOwnProperty(e.route.id)&&!w.loaderData.hasOwnProperty(e.route.id)&&(!w.errors||!w.errors.hasOwnProperty(e.route.id))&&e.shouldCallHandler()&&(a[e.route.id]={type:`error`,result:Error(`No result returned from dataStrategy for route ${e.route.id}`)})}for(let[t,r]of Object.entries(a))if(Si(r)){let i=r.result;o[t]={type:`redirect`,response:ni(i,e,t,n,l)}}else o[t]=await ti(r);return o}async function Se(e,t,n,r,i){let a=xe(n,r,e,i,null),o=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await xe(e.request,e.path,e.matches,i,e.key))[e.match.route.id];return{[e.key]:t}}else return Promise.resolve({[e.key]:{type:`error`,error:hi(404,{pathname:e.path})}})}));return{loaderResults:await a,fetcherResults:(await o).reduce((e,t)=>Object.assign(e,t),{})}}function Ce(){N=!0,ne.forEach((e,t)=>{P.has(t)&&ee.add(t),Ae(t)})}function we(e,t,n={}){w.fetchers.set(e,t),ce({fetchers:new Map(w.fetchers)},{flushSync:(n&&n.flushSync)===!0})}function Te(e,t,n,r={}){let i=pi(w.matches,t);Oe(e),ce({errors:{[i.route.id]:n},fetchers:new Map(w.fetchers)},{flushSync:(r&&r.flushSync)===!0})}function Ee(e){return R.set(e,(R.get(e)||0)+1),z.has(e)&&z.delete(e),w.fetchers.get(e)||Cr}function De(e,t){Ae(e,t?.reason),we(e,Ri(null))}function Oe(e){let t=w.fetchers.get(e);P.has(e)&&!(t&&t.state===`loading`&&te.has(e))&&Ae(e),ne.delete(e),te.delete(e),L.delete(e),z.delete(e),ee.delete(e),w.fetchers.delete(e)}function ke(e){let t=(R.get(e)||0)-1;t<=0?(R.delete(e),z.add(e)):R.set(e,t),ce({fetchers:new Map(w.fetchers)})}function Ae(e,t){let n=P.get(e);n&&(n.abort(t),P.delete(e))}function je(e){for(let t of e){let e=Ri(Ee(t).data);w.fetchers.set(t,e)}}function Me(){let e=[],t=!1;for(let n of L){let r=w.fetchers.get(n);nn(r,`Expected fetcher: ${n}`),r.state===`loading`&&(L.delete(n),e.push(n),t=!0)}return je(e),t}function Ne(e){let t=[];for(let[n,r]of te)if(r<e){let e=w.fetchers.get(n);nn(e,`Expected fetcher: ${n}`),e.state===`loading`&&(Ae(n),te.delete(n),t.push(n))}return je(t),t.length>0}function Pe(e,t){let n=w.blockers.get(e)||wr;return B.get(e)!==t&&B.set(e,t),n}function Fe(e){w.blockers.delete(e),B.delete(e)}function Ie(e,t){let n=w.blockers.get(e)||wr;nn(n.state===`unblocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`proceeding`||n.state===`blocked`&&t.state===`unblocked`||n.state===`proceeding`&&t.state===`unblocked`,`Invalid blocker state transition: ${n.state} -> ${t.state}`);let r=new Map(w.blockers);r.set(e,t),ce({blockers:r})}function Le({currentLocation:e,nextLocation:t,historyAction:n}){if(B.size===0)return;B.size>1&&rn(!1,`A router only supports one blocker at a time`);let r=Array.from(B.entries()),[i,a]=r[r.length-1],o=w.blockers.get(i);if(!(o&&o.state===`proceeding`)&&a({currentLocation:e,nextLocation:t,historyAction:n}))return i}function Re(e){let t=hi(404,{pathname:e}),{matches:n,route:r}=mi(c||s);return{notFoundMatches:n,route:r,error:t}}function ze(e,t,n){if(m=e,g=t,h=n||null,!_&&w.navigation===Sr){_=!0;let e=He(w.location,w.matches);e!=null&&ce({restoreScrollPosition:e})}return()=>{m=null,g=null,h=null}}function Be(e,t){return h&&h(e,t.map(e=>Cn(e,w.loaderData)))||e.key}function Ve(e,t){if(m&&g){let n=Be(e,t);m[n]=g()}}function He(e,t){if(m){let n=Be(e,t),r=m[n];if(typeof r==`number`)return r}return null}function Ue(t,n,r){if(e.patchRoutesOnNavigation){if(!t)return{active:!0,matches:Sn(n,r,l,!0)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:Sn(n,r,l,!0)}}return{active:!1,matches:null}}async function We(t,n,r,i){if(!e.patchRoutesOnNavigation)return{type:`success`,matches:t};let u=t;for(;;){let t=c==null,d=c||s,f=o;try{await e.patchRoutesOnNavigation({signal:r,path:n,matches:u,fetcherKey:i,patch:(e,t)=>{r.aborted||Rr(e,t,d,f,a,!1)}})}catch(e){return{type:`error`,error:e,partialMatches:u}}finally{t&&!r.aborted&&(s=[...s])}if(r.aborted)return{type:`aborted`};let p=xn(d,n,l),m=null;if(p&&(Object.keys(p[0].params).length===0||(m=Sn(d,n,l,!0),!(m&&u.length<m.length&&Ge(u,m.
10slice(0,u.length))))))return{type:`success`,matches:p};if(m||=Sn(d,n,l,!0),!m||Ge(u,m))return{type:`success`,matches:null};u=m}}function Ge(e,t){return e.length===t.length&&e.every((e,n)=>e.route.id===t[n].route.id)}function Ke(e){o={},c=yn(e,a,void 0,o)}function qe(e,t,n=!1){let r=c==null;Rr(e,t,c||s,o,a,n),r&&(s=[...s],ce({}))}return C={get basename(){return l},get future(){return d},get state(){return w},get routes(){return s},get window(){return t},initialize:ae,subscribe:se,enableScrollRestoration:ze,navigate:ue,fetch:_e,revalidate:de,createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:Ee,resetFetcher:De,deleteFetcher:ke,dispose:oe,getBlocker:Pe,deleteBlocker:Fe,patchRoutes:qe,_internalFetchControllers:P,_internalSetRoutes:Ke,_internalSetStateDoNotUseOrYouWillBreakYourApp(e){ce(e)}},e.unstable_instrumentations&&(C=sr(C,e.unstable_instrumentations.map(e=>e.router).filter(Boolean))),C}function kr(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function Ar(e,t,n,r,i,a){let o,s;if(i){o=[];for(let e of t)if(o.push(e),e.route.id===i){s=e;break}}else o=t,s=t[t.length-1];let c=Yn(r||`.`,Jn(o),Bn(e.pathname,n)||e.pathname,a===`path`);if(r??(c.search=e.search,c.hash=e.hash),(r==null||r===``||r===`.`)&&s){let e=ji(c.search);if(s.route.index&&!e)c.search=c.search?c.search.replace(/^\?/,`?index&`):`?index`;else if(!s.route.index&&e){let e=new URLSearchParams(c.search),t=e.getAll(`index`);e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();c.search=n?`?${n}`:``}}return n!==`/`&&(c.pathname=Vn({basename:n,pathname:c.pathname})),cn(c)}function jr(e,t,n){if(!n||!kr(n))return{path:t};if(n.formMethod&&!ki(n.formMethod))return{path:t,error:hi(405,{method:n.formMethod})};let r=()=>({path:t,error:hi(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=_i(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!Ai(i))return r();let e=typeof n.body==`string`?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((e,[t,n])=>`${e}${t}=${n} 11`,``):String(n.body);return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}else if(n.formEncType===`application/json`){if(!Ai(i))return r();try{let e=typeof n.body==`string`?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch{return r()}}}nn(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=si(n.formData),s=n.formData;else if(n.body instanceof FormData)o=si(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=ci(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=ci(o)}catch{return r()}let c={formMethod:i,formAction:a,formEncType:n&&n.formEncType||`application/x-www-form-urlencoded`,formData:s,json:void 0,text:void 0};if(Ai(c.formMethod))return{path:t,submission:c};let l=ln(t);return e&&l.search&&ji(l.search)&&o.append(`index`,``),l.search=`?${o}`,{path:cn(l),submission:c}}function Mr(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b){let x=y?Ci(y[1])?y[1].error:y[1].data:void 0,S=i.createURL(a.location),C=i.createURL(c),w;if(u&&a.errors){let e=Object.keys(a.errors)[0];w=o.findIndex(t=>t.route.id===e)}else if(y&&Ci(y[1])){let e=y[0];w=o.findIndex(t=>t.route.id===e)-1}let T=y?y[1].statusCode:void 0,E=T&&T>=400,D={currentUrl:S,currentParams:a.matches[0]?.params||{},nextUrl:C,nextParams:o[0].params,...s,actionResult:x,actionStatus:T},O=nr(o),k=o.map((i,o)=>{let{route:s}=i,f=null;if(w!=null&&o>w)f=!1;else if(s.lazy)f=!0;else if(!Nr(s))f=!1;else if(u){let{shouldLoad:e}=Pr(s,a.loaderData,a.errors);f=e}else Fr(a.loaderData,a.matches[o],i)&&(f=!0);if(f!==null)return Xr(n,r,e,c,O,i,l,t,f);let p=!1;typeof b==`boolean`?p=b:E?p=!1:d||S.pathname+S.search===C.pathname+C.search?p=!0:S.search===C.search?Ir(a.matches[o],i)&&(p=!0):p=!0;let m={...D,defaultShouldRevalidate:p};return Xr(n,r,e,c,O,i,l,t,Lr(i,m),m,b)}),A=[];return m.forEach((e,s)=>{if(u||!o.some(t=>t.route.id===e.routeId)||p.has(s))return;let c=a.fetchers.get(s),m=c&&c.state!==`idle`&&c.data===void 0,y=xn(g,e.path,_);if(!y){if(v&&m)return;A.push({key:s,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null});return}if(h.has(s))return;let x=Mi(y,e.path),S=new AbortController,C=ai(i,e.path,S.signal),w=null;if(f.has(s))f.delete(s),w=Zr(n,r,C,e.path,y,x,l,t);else if(m)d&&(w=Zr(n,r,C,e.path,y,x,l,t));else{let i;i=typeof b==`boolean`?b:E?!1:d;let a={...D,defaultShouldRevalidate:i};Lr(x,a)&&(w=Zr(n,r,C,e.path,y,x,l,t,a))}w&&A.push({key:s,routeId:e.routeId,path:e.path,matches:w,match:x,request:C,controller:S})}),{dsMatches:k,revalidatingFetchers:A}}function Nr(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function Pr(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!Nr(e))return{shouldLoad:!1,renderFallback:!1};let r=t!=null&&e.id in t,i=n!=null&&n[e.id]!==void 0;if(!r&&i)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader==`function`&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!r};let a=!r&&!i;return{shouldLoad:a,renderFallback:a}}function Fr(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function Ir(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function Lr(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function Rr(e,t,n,r,i,a){let o;if(e){let t=r[e];nn(t,`No route found to patch children into: routeId = ${e}`),t.children||=[],o=t.children}else o=n;let s=[],c=[];
11if(t.forEach(e=>{let t=o.find(t=>zr(e,t));t?c.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=yn(s,i,[e||`_`,`patch`,String(o?.length||`0`)],r);o.push(...t)}if(a&&c.length>0)for(let e=0;e<c.length;e++){let{existingRoute:t,newRoute:n}=c[e],r=t,[a]=yn([n],i,[],{},!0);Object.assign(r,{element:a.element?a.element:r.element,errorElement:a.errorElement?a.errorElement:r.errorElement,hydrateFallbackElement:a.hydrateFallbackElement?a.hydrateFallbackElement:r.hydrateFallbackElement})}}function zr(e,t){return`id`in e&&`id`in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children?.every((e,n)=>t.children?.some(t=>zr(e,t)))??!1:!1}var Br=new WeakMap,Vr=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(nn(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=Br.get(i);o||(o={},Br.set(i,o));let s=o[e];if(s)return s;let c=(async()=>{let t=hn(e),n=i[e]!==void 0&&e!==`hasErrorBoundary`;if(t)rn(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)rn(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await a();t!=null&&(Object.assign(i,{[e]:t}),Object.assign(i,r(i)))}typeof i.lazy==`object`&&(i.lazy[e]=void 0,Object.values(i.lazy).every(e=>e===void 0)&&(i.lazy=void 0))})();return o[e]=c,c},Hr=new WeakMap;function Ur(e,t,n,r,i){let a=n[e.id];if(nn(a,`No route found in manifest`),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy==`function`){let t=Hr.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{nn(typeof e.lazy==`function`,`No lazy route function found`);let t=await e.lazy(),n={};for(let e in t){let r=t[e];if(r===void 0)continue;let i=_n(e),o=a[e]!==void 0&&e!==`hasErrorBoundary`;i?rn(!i,`Route property `+e+` is not a supported property to be returned from a lazy route function. This property will be ignored.`):o?rn(!o,`Route "${a.id}" has a static property "${e}" defined but its lazy function is also returning a value for this property. The lazy route property "${e}" will be ignored.`):n[e]=r}Object.assign(a,n),Object.assign(a,{...r(a),lazy:void 0})})();return Hr.set(a,n),n.catch(()=>{}),{lazyRoutePromise:n,lazyHandlerPromise:n}}let o=Object.keys(e.lazy),s=[],c;for(let a of o){if(i&&i.includes(a))continue;let o=Vr({key:a,route:e,manifest:n,mapRouteProperties:r});o&&(s.push(o),a===t&&(c=o))}let l=s.length>0?Promise.all(s).then(()=>{}):void 0;return l?.catch(()=>{}),c?.catch(()=>{}),{lazyRoutePromise:l,lazyHandlerPromise:c}}async function Wr(e){let t=e.matches.filter(e=>e.shouldLoad),n={};return(await Promise.all(t.map(e=>e.resolve()))).forEach((e,r)=>{n[t[r].route.id]=e}),n}async function Gr(e){return e.matches.some(e=>e.route.middleware)?Kr(e,()=>Wr(e)):Wr(e)}function Kr(e,t){return qr(e,t,e=>{if(Oi(e))throw e;return e},bi,n);function n(t,n,r){if(r)return Promise.resolve(Object.assign(r.value,{[n]:{type:`error`,result:t}}));{let{matches:r}=e,i=pi(r,r[Math.min(Math.max(r.findIndex(e=>e.route.id===n),0),Math.max(r.findIndex(e=>e.shouldCallHandler()),0))].route.id).route.id;return Promise.resolve({[i]:{type:`error`,result:t}})}}}async function qr(e,t,n,r,i){let{matches:a,...o}=e;return await Jr(o,a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}async function Jr(e,t,n,r,i,a,o=0){let{request:s}=e;if(s.signal.aborted)throw s.signal.reason??Error(`Request aborted: ${s.method} ${s.url}`);let c=t[o];if(!c)return await n();let[l,u]=c,d,f=async()=>{if(d)throw Error("You may only call `next()` once per middleware");try{return d={value:await Jr(e,t,n,r,i,a,o+1)},d.value}catch(e){return d={value:await a(e,l,d)},d.value}};try{let t=await u(e,f),n=t==null?void 0:r(t);return i(n)?n:d?n??d.value:(d={value:await f()},d.value)}catch(e){return await a(e,l,d)}}function Yr(e,t,n,r,i){let a=Vr({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=Ur(r.route,Ai(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function Xr(e,t,n,r,i,a,o,s,c,l=null,u){let d=!1,f=Yr(e,t,n,a,o);return{...a,_lazyPromises:f,shouldLoad:c,shouldRevalidateArgs:l,shouldCallHandler(e){return d=!0,l?typeof u==`boolean`?Lr(a,{...l,defaultShouldRevalidate:u}):typeof e==`boolean`?Lr(a,{...l,defaultShouldRevalidate:e}):Lr(a,l):c}
11,resolve(e){let{lazy:t,loader:o,middleware:l}=a.route,u=d||c||e&&!Ai(n.method)&&(t||o),p=l&&l.length>0&&!o&&!t;return u&&(Ai(n.method)||!p)?$r({request:n,path:r,unstable_pattern:i,match:a,lazyHandlerPromise:f?.handler,lazyRoutePromise:f?.route,handlerOverride:e,scopedContext:s}):Promise.resolve({type:`data`,result:void 0})}}}function Zr(e,t,n,r,i,a,o,s,c=null){return i.map(l=>l.route.id===a.route.id?Xr(e,t,n,r,nr(i),l,o,s,!0,c):{...l,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:Yr(e,t,n,l,o),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function Qr(e,t,n,r,i,a,o){r.some(e=>e._lazyPromises?.middleware)&&await Promise.all(r.map(e=>e._lazyPromises?.middleware));let s={request:t,unstable_url:oi(t,n),unstable_pattern:nr(r),params:r[0].params,context:a,matches:r},c=o?()=>{throw Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`")}:e=>{let t=s;return Kr(t,()=>e({...t,fetcherKey:i,runClientMiddleware:()=>{throw Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))},l=await e({...s,fetcherKey:i,runClientMiddleware:c});try{await Promise.all(r.flatMap(e=>[e._lazyPromises?.handler,e._lazyPromises?.route]))}catch{}return l}async function $r({request:e,path:t,unstable_pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:o,scopedContext:s}){let c,l,u=Ai(e.method),d=u?`action`:`loader`,f=i=>{let a,c=new Promise((e,t)=>a=t);l=()=>a(),e.signal.addEventListener(`abort`,l);let u=a=>typeof i==`function`?i({request:e,unstable_url:oi(e,t),unstable_pattern:n,params:r.params,context:s},...a===void 0?[]:[a]):Promise.reject(Error(`You cannot call the handler for a route which defines a boolean "${d}" [routeId: ${r.route.id}]`)),f=(async()=>{try{return{type:`data`,result:await(o?o(e=>u(e)):u())}}catch(e){return{type:`error`,result:e}}})();return Promise.race([f,c])};try{let t=u?r.route.action:r.route.loader;if(i||a)if(t){let e,[n]=await Promise.all([f(t).catch(t=>{e=t}),i,a]);if(e!==void 0)throw e;c=n}else{await i;let t=u?r.route.action:r.route.loader;if(t)[c]=await Promise.all([f(t),a]);else if(d===`action`){let t=new URL(e.url),n=t.pathname+t.search;throw hi(405,{method:e.method,pathname:n,routeId:r.route.id})}else return{type:`data`,result:void 0}}else if(t)c=await f(t);else{let t=new URL(e.url);throw hi(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{l&&e.signal.removeEventListener(`abort`,l)}return c}async function ei(e){let t=e.headers.get(`Content-Type`);return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function ti(e){let{result:t,type:n}=e;if(Ei(t)){let e;try{e=await ei(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new er(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?Ti(t)?t.data instanceof Error?{type:`error`,error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:yi(t),statusCode:tr(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:tr(t)?t.status:void 0}:Ti(t)?{type:`data`,data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`data`,data:t}}function ni(e,t,n,r,i){let a=e.headers.get(`Location`);if(nn(a,`Redirects returned/thrown from loaders/actions must have a Location header`),!Un(a)){let o=r.slice(0,r.findIndex(e=>e.route.id===n)+1);a=Ar(new URL(t.url),o,i,a),e.headers.set(`Location`,a)}return e}var ri=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function ii(e,t,n,r){if(Un(e)){let r=e,i=r.startsWith(`//`)?new URL(t.protocol+r):new URL(r);if(ri.includes(i.protocol))throw Error(`Invalid redirect location`);let a=Bn(i.pathname,n)!=null;if(i.origin===t.origin&&a)return i.pathname+i.search+i.hash}try{let t=r.createURL(e);if(ri.includes(t.protocol))throw Error(`Invalid redirect location`)}catch{}return e}function ai(e,t,n,r){let i=e.createURL(_i(t)).toString(),a={signal:n};if(r&&Ai(r.formMethod)){let{formMethod:e,formEncType:t}=r;a.method=e.toUpperCase(),t===`application/json`?(a.headers=new Headers({"Content-Type":t}),a.body=JSON.stringify(r.json)):t===`text/plain`?a.body=r.text:t===`application/x-www-form-urlencoded`&&r.formData?a.body=si(r.formData):a.body=r.formData}
11return new Request(i,a)}function oi(e,t){let n=new URL(e.url),r=typeof t==`string`?ln(t):t;if(n.pathname=r.pathname||`/`,r.search){let e=new URLSearchParams(r.search),t=e.getAll(`index`);e.delete(`index`);for(let n of t.filter(Boolean))e.append(`index`,n);n.search=e.size?`?${e.toString()}`:``}else n.search=``;return n.hash=r.hash||``,n}function si(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function ci(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function li(e,t,n,r=!1,i=!1){let a={},o=null,s,c=!1,l={},u=n&&Ci(n[1])?n[1].error:void 0;return e.forEach(n=>{if(!(n.route.id in t))return;let d=n.route.id,f=t[d];if(nn(!wi(f),`Cannot handle redirect results in processLoaderData`),Ci(f)){let t=f.error;if(u!==void 0&&(t=u,u=void 0),o||={},i)o[d]=t;else{let n=pi(e,d);o[n.route.id]??(o[n.route.id]=t)}r||(a[d]=Dr),c||(c=!0,s=tr(f.error)?f.error.status:500),f.headers&&(l[d]=f.headers)}else a[d]=f.data,f.statusCode&&f.statusCode!==200&&!c&&(s=f.statusCode),f.headers&&(l[d]=f.headers)}),u!==void 0&&n&&(o={[n[0]]:u},n[2]&&(a[n[2]]=void 0)),{loaderData:a,errors:o,statusCode:s||200,loaderHeaders:l}}function ui(e,t,n,r,i,a){let{loaderData:o,errors:s}=li(t,n,r);return i.filter(e=>!e.matches||e.matches.some(e=>e.shouldLoad)).forEach(t=>{let{key:n,match:r,controller:i}=t;if(i&&i.signal.aborted)return;let o=a[n];if(nn(o,`Did not find corresponding fetcher result`),Ci(o)){let t=pi(e.matches,r?.route.id);s&&s[t.route.id]||(s={...s,[t.route.id]:o.error}),e.fetchers.delete(n)}else if(wi(o))nn(!1,`Unhandled fetcher revalidation redirect`);else{let t=Ri(o.data);e.fetchers.set(n,t)}}),{loaderData:o,errors:s}}function di(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==Dr).reduce((e,[t,n])=>(e[t]=n,e),{});for(let a of n){let n=a.route.id;if(!t.hasOwnProperty(n)&&e.hasOwnProperty(n)&&a.route.loader&&(i[n]=e[n]),r&&r.hasOwnProperty(n))break}return i}function fi(e){return e?Ci(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function pi(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>e.route.hasErrorBoundary===!0)||e[0]}function mi(e){let t=e.length===1?e[0]:e.find(e=>e.index||!e.path||e.path===`/`)||{id:`__shim-error-route__`};return{matches:[{params:{},pathname:``,pathnameBase:``,route:t}],route:t}}function hi(e,{pathname:t,routeId:n,method:r,type:i,message:a}={}){let o=`Unknown Server Error`,s=`Unknown @remix-run/router error`;return e===400?(o=`Bad Request`,r&&t&&n?s=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:i===`invalid-body`&&(s=`Unable to encode submission body`)):e===403?(o=`Forbidden`,s=`Route "${n}" does not match URL "${t}"`):e===404?(o=`Not Found`,s=`No route matches URL "${t}"`):e===405&&(o=`Method Not Allowed`,r&&t&&n?s=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(s=`Invalid request method "${r.toUpperCase()}"`)),new er(e||500,o,Error(s),!0)}function gi(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(wi(r))return{key:n,result:r}}}function _i(e){return cn({...typeof e==`string`?ln(e):e,hash:``})}function vi(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash?!0:t.hash!==``}function yi(e){return new er(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function bi(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&xi(t))}function xi(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function Si(e){return Ei(e.result)&&br.has(e.result.status)}function Ci(e){return e.type===`error`}function wi(e){return(e&&e.type)===`redirect`}function Ti(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function Ei(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function Di(e){return br.has(e)}function Oi(e){return Ei(e)&&Di(e.status)&&e.headers.has(`Location`)}function ki(e){return yr.has(e.toUpperCase())}function Ai(e){return _r.has(e.toUpperCase())}function ji(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function Mi(e,t){let n=typeof t==`string`?ln(t).search:t.search;if(e[e.length-1].route.index&&ji(n||``))return e[e.length-1];let r=qn(e);return r[r.length-1]}function Ni(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:a,json:o}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function Pi(e,t){return t?{state:`loading`,location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:`loading`,location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Fi(e,t){return{state:`submitting`,location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Ii(e,t){return e?{state:`loading`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:`loading`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function Li(e,t){return{state:`submitting`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Ri(e){return{state:`idle`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function zi(e,t){try{let n=e.sessionStorage.getItem(Er);if(n){let e=JSON.parse(n);for(let[n,r]of Object.entries(e||{}))r&&Array.isArray(r)&&t.set(n,new Set(r||[]))}}catch{}}function Bi(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(Er,JSON.stringify(n))}catch(e){rn(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function Vi(){let e,t,n=new Promise((r,i)=>{e=async e=>{r(e);try{await n}catch{}},t=async e=>{i(e);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var Hi=f.createContext(null);Hi.displayName=`DataRouter`;var Ui=f.createContext(null);Ui.displayName=`DataRouterState`;var Wi=f.createContext(!1);function Gi(){return f.useContext(Wi)}var Ki=f.createContext({isTransitioning:!1});Ki.displayName=`ViewTransition`;var qi=f.createContext(new Map);qi.displayName=`Fetchers`;var Ji=f.createContext(null);Ji.displayName=`Await`;var Yi=f.createContext(null);Yi.displayName=`Navigation`;var Xi=f.createContext(null);Xi.displayName=`Location`;var Zi=f.createContext({outlet:null,matches:[],isDataRoute:!1});Zi.displayName=`Route`;var Qi=f.createContext(null);Qi.displayName=`RouteError`;var $i=`REACT_ROUTER_ERROR`,ea=`REDIRECT`,ta=`ROUTE_ERROR_RESPONSE`;function na(e){if(e.startsWith(`${$i}:${ea}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function ra(e){if(e.startsWith(`${$i}:${ta}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new er(t.status,t.statusText,t.data)}catch{}}function ia(e,{relative:t}={}){nn(aa(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=f.useContext(Yi),{hash:i,pathname:a,search:o}=ma(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:Xn([n,a])),r.createHref({pathname:s,search:o,hash:i})}function aa(){return f.useContext(Xi)!=null}
11function oa(){return nn(aa(),`useLocation() may be used only in the context of a <Router> component.`),f.useContext(Xi).location}var sa=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function ca(e){f.useContext(Yi).static||f.useLayoutEffect(e)}function la(){let{isDataRoute:e}=f.useContext(Zi);return e?Pa():ua()}function ua(){nn(aa(),`useNavigate() may be used only in the context of a <Router> component.`);let e=f.useContext(Hi),{basename:t,navigator:n}=f.useContext(Yi),{matches:r}=f.useContext(Zi),{pathname:i}=oa(),a=JSON.stringify(Jn(r)),o=f.useRef(!1);return ca(()=>{o.current=!0}),f.useCallback((r,s={})=>{if(rn(o.current,sa),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=Yn(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:Xn([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var da=f.createContext(null);function fa(e){let t=f.useContext(Zi).outlet;return f.useMemo(()=>t&&f.createElement(da.Provider,{value:e},t),[t,e])}function pa(){let{matches:e}=f.useContext(Zi),t=e[e.length-1];return t?t.params:{}}function ma(e,{relative:t}={}){let{matches:n}=f.useContext(Zi),{pathname:r}=oa(),i=JSON.stringify(Jn(n));return f.useMemo(()=>Yn(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function ha(e,t,n){nn(aa(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=f.useContext(Yi),{matches:i}=f.useContext(Zi),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;Ia(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. 12 13Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=oa(),d;if(t){let e=typeof t==`string`?ln(t):t;nn(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let p=d.pathname||`/`,m=p;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);m=`/`+p.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let h=xn(e,{pathname:m});rn(l||h!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),rn(h==null||h[h.length-1].route.element!==void 0||h[h.length-1].route.Component!==void 0||h[h.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let g=Sa(h&&h.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:Xn([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:Xn([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&g?f.createElement(Xi.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,unstable_mask:void 0,...d},navigationType:`POP`}},g):g}function ga(){let e=ja(),t=tr(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=f.createElement(f.Fragment,null,f.createElement(`p`,null,`ð¿ Hey developer ð`),f.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,f.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,f.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),f.createElement(f.Fragment,null,f.createElement(`h2`,null,`Unexpected Application
13Error!`),f.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?f.createElement(`pre`,{style:i},n):null,o)}var _a=f.createElement(ga,null),va=class extends f.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=ra(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:f.createElement(Zi.Provider,{value:this.props.routeContext},f.createElement(Qi.Provider,{value:e,children:this.props.component}));return this.context?f.createElement(ba,{error:e},t):t}};va.contextType=Wi;var ya=new WeakMap;function ba({children:e,error:t}){let{basename:n}=f.useContext(Yi);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=na(t.digest);if(e){let r=ya.get(t);if(r)throw r;let i=ir(e.location,n);if(rr&&!ya.get(t))if(i.isExternal||e.reloadDocument)window.location.href=i.absoluteURL||i.to;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw ya.set(t,n),n}return f.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${i.absoluteURL||i.to}`})}}return e}function xa({routeContext:e,match:t,children:n}){let r=f.useContext(Hi);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),f.createElement(Zi.Provider,{value:e},n)}function Sa(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);nn(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},unstable_pattern:nr(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,p=null,m=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,p=n.route.errorElement||_a,o&&(s<0&&c===0?(Ia(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,m=null):s===c&&(d=!0,m=n.route.hydrateFallbackElement||null)));let h=t.concat(i.slice(0,c+1)),g=()=>{let t;return t=u?p:d?m:n.route.Component?f.createElement(n.route.Component,null):n.route.element?n.route.element:e,f.createElement(xa,{match:n,routeContext:{outlet:e,matches:h,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?f.createElement(va,{location:r.location,revalidation:r.revalidation,component:p,error:u,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:l}):g()},null)}function Ca(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function wa(e){let t=f.useContext(Hi);return nn(t,Ca(e)),t}function Ta(e){let t=f.useContext(Ui);return nn(t,Ca(e)),t}function Ea(e){let t=f.useContext(Zi);return nn(t,Ca(e)),t}function Da(e){let t=Ea(e),n=t.matches[t.matches.length-1];return nn(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Oa(){return Da(`useRouteId`)}function ka(){return Ta(`useNavigation`).navigation}function Aa(){let{matches:e,loaderData:t}=Ta(`useMatches`);return f.useMemo(()=>e.map(e=>Cn(e,t)),[e,t])}function ja(){let e=f.useContext(Qi),t=Ta(`useRouteError`),n=Da(`useRouteError`);return e===void 0?t.errors?.[n]:e}var Ma=0;function Na(e){let{router:t,basename:n}=wa(`useBlocker`),r=Ta(`useBlocker`),[i,a]=f.useState(``),o=f.useCallback(t=>{if(typeof e!=`function`)return!!e;if(n===`/`)return e(t);let{currentLocation:r,nextLocation:i,historyAction:a}=t;return e({currentLocation:{...r,pathname:Bn(r.pathname,n)||r.pathname},nextLocation:{...i,pathname:Bn(i.pathname,n)||i.pathname},historyAction:a})},[n,e]);return f.useEffect(()=>{let e=String(++Ma);return a(e),()=>t.deleteBlocker(e)},[t]),f.useEffect(()=>{i!==``&&t.getBlocker(i,o)},[t,i,o]),i&&r.blockers.has(i)?r.blockers.get(i):wr}function Pa(){let{router:e}=wa(`useNavigate`),t=Da(`useNavigate`),n=f.useRef(!1);return ca(()=>{n.current=!0}),f.useCallback(async(r,i={})=>{rn(n.current,sa),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Fa={};
13function Ia(e,t,n){!t&&!Fa[e]&&(Fa[e]=!0,rn(!1,n))}var La={};function Ra(e,t){!e&&!La[t]&&(La[t]=!0,console.warn(t))}var za=f.useOptimistic,Ba=()=>void 0;function Va(e){return za?za(e):[e,Ba]}function Ha(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&rn(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:f.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&rn(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:f.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&rn(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:f.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var Ua=[`HydrateFallback`,`hydrateFallbackElement`],Wa=class{constructor(){this.status=`pending`,this.promise=new Promise((e,t)=>{this.resolve=t=>{this.status===`pending`&&(this.status=`resolved`,e(t))},this.reject=e=>{this.status===`pending`&&(this.status=`rejected`,t(e))}})}};function Ga({router:e,flushSync:t,onError:n,unstable_useTransitions:r}){r=Gi()||r;let[i,a]=f.useState(e.state),[o,s]=Va(i),[c,l]=f.useState(),[u,d]=f.useState({isTransitioning:!1}),[p,m]=f.useState(),[h,g]=f.useState(),[_,v]=f.useState(),y=f.useRef(new Map),b=f.useCallback((i,{deletedFetchers:o,newErrors:c,flushSync:u,viewTransitionOpts:_})=>{c&&n&&Object.values(c).forEach(e=>n(e,{location:i.location,params:i.matches[0]?.params??{},unstable_pattern:nr(i.matches)})),i.fetchers.forEach((e,t)=>{e.data!==void 0&&y.current.set(t,e.data)}),o.forEach(e=>y.current.delete(e)),Ra(u===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let b=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition==`function`;if(Ra(_==null||b,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!_||!b){t&&u?t(()=>a(i)):r===!1?a(i):f.startTransition(()=>{r===!0&&s(e=>Ka(e,i)),a(i)});return}if(t&&u){t(()=>{h&&(p?.resolve(),h.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:_.currentLocation,nextLocation:_.nextLocation})});let n=e.window.document.startViewTransition(()=>{t(()=>a(i))});n.finished.finally(()=>{t(()=>{m(void 0),g(void 0),l(void 0),d({isTransitioning:!1})})}),t(()=>g(n));return}h?(p?.resolve(),h.skipTransition(),v({state:i,currentLocation:_.currentLocation,nextLocation:_.nextLocation})):(l(i),d({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}))},[e.window,t,h,p,r,s,n]);f.useLayoutEffect(()=>e.subscribe(b),[e,b]),f.useEffect(()=>{u.isTransitioning&&!u.flushSync&&m(new Wa)},[u]),f.useEffect(()=>{if(p&&c&&e.window){let t=c,n=p.promise,i=e.window.document.startViewTransition(async()=>{r===!1?a(t):f.startTransition(()=>{r===!0&&s(e=>Ka(e,t)),a(t)}),await n});i.finished.finally(()=>{m(void 0),g(void 0),l(void 0),d({isTransitioning:!1})}),g(i)}},[c,p,e.window,r,s]),f.useEffect(()=>{p&&c&&o.location.key===c.location.key&&p.resolve()},[p,h,o.location,c]),f.useEffect(()=>{!u.isTransitioning&&_&&(l(_.state),d({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}),v(void 0))},[u.isTransitioning,_]);let x=f.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,n,r)=>e.navigate(t,{state:n,preventScrollReset:r?.preventScrollReset}),replace:(t,n,r)=>e.navigate(t,{replace:!0,state:n,preventScrollReset:r?.preventScrollReset})}),[e]),S=e.basename||`/`,C=f.useMemo(()=>({router:e,navigator:x,static:!1,basename:S,onError:n}),[e,x,S,n]);return f.createElement(f.Fragment,null,f.createElement(Hi.Provider,{value:C},f.createElement(Ui.Provider,{value:o},f.createElement(qi.Provider,{value:y.current},f.createElement(Ki.Provider,{value:u},f.createElement(Za,{basename:S,location:o.location,navigationType:o.historyAction,navigator:x,unstable_useTransitions:r},f.createElement(qa,{routes:e.routes,future:e.future,state:o,isStatic:!1,onError:n})))))),null)}function Ka(e,t){return{...e,navigation:t.navigation.state===`idle`?e.navigation:t.navigation,revalidation:t.revalidation===`idle`?e.revalidation:t.revalidation,actionData:t.navigation.state===`submitting`?e.actionData:t.actionData,fetchers:t.fetchers}}var qa=f.memo(Ja);function Ja({routes:e,future:t,state:n,isStatic:r,onError:i}){return ha(e,void 0,{state:n,isStatic:r,onError:i,future:t})}function Ya({to:e,replace:t,state:n,relative:r}){nn(aa(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i}=f.useContext(Yi);rn(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:a}=f.useContext(Zi),{pathname:o}=oa(),s=la(),c=Yn(e,Jn(a),o,r===`path`),l=JSON.stringify(c);return f.useEffect(()=>{s(JSON.parse(l),{replace:t,state:n,relative:r})},[s,l,r,t,n]),null}function Xa(e){return fa(e.context)}function H(e){nn(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function Za({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,unstable_useTransitions:o}){nn(!aa(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=f.useMemo(()=>({basename:s,navigator:i,static:a,unstable_useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=ln(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:p=null,key:m=`default`,unstable_mask:h}=n,g=f.useMemo(()=>{let e=Bn(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:p,key:m,unstable_mask:h},navigationType:r}},[s,l,u,d,p,m,r,h]);
13return rn(g!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),g==null?null:f.createElement(Yi.Provider,{value:c},f.createElement(Xi.Provider,{children:t,value:g}))}f.Component;function Qa(e,t=[]){let n=[];return f.Children.forEach(e,(e,r)=>{if(!f.isValidElement(e))return;let i=[...t,r];if(e.type===f.Fragment){n.push.apply(n,Qa(e.props.children,i));return}nn(e.type===H,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),nn(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=Qa(e.props.children,i)),n.push(a)}),n}var $a=Qa,eo=`get`,to=`application/x-www-form-urlencoded`;function no(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function ro(e){return no(e)&&e.tagName.toLowerCase()===`button`}function io(e){return no(e)&&e.tagName.toLowerCase()===`form`}function ao(e){return no(e)&&e.tagName.toLowerCase()===`input`}function oo(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function so(e,t){return e.button===0&&(!t||t===`_self`)&&!oo(e)}function co(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function lo(e,t){let n=co(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var uo=null;function fo(){if(uo===null)try{new FormData(document.createElement(`form`),0),uo=!1}catch{uo=!0}return uo}var po=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function mo(e){return e!=null&&!po.has(e)?(rn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${to}"`),null):e}function ho(e,t){let n,r,i,a,o;if(io(e)){let o=e.getAttribute(`action`);r=o?Bn(o,t):null,n=e.getAttribute(`method`)||eo,i=mo(e.getAttribute(`enctype`))||to,a=new FormData(e)}else if(ro(e)||ao(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?Bn(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||eo,i=mo(e.getAttribute(`formenctype`))||mo(o.getAttribute(`enctype`))||to,a=new FormData(o,e),!fo()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(no(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=eo,r=null,i=to,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var go={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},_o=/[&><\u2028\u2029]/g;function vo(e){return e.replace(_o,e=>go[e])}function yo(e,t){if(e===!1||e==null)throw Error(t)}function bo(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&Bn(i.pathname,t)===`/`?i.pathname=`${t.replace(/\/$/,``)}/_root.${r}`:i.pathname=`${i.pathname.replace(/\/$/,``)}.${r}`,i}async function xo(e,t){if(e.id in t)return t[e.id];try{let n=await r(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.
13isSpaMode,window.location.reload(),new Promise(()=>{})}}function So(e){return e!=null&&typeof e.page==`string`}function Co(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function wo(e,t,n){return ko((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await xo(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Co).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function To(e,t,n,r,i,a){let o=(e,t)=>n[t]?e.route.id!==n[t].route.id:!0,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function Eo(e,t,{includeHydrateFallback:n}={}){return Do(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function Do(e){return[...new Set(e)]}function Oo(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function ko(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!So(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Oo(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Ao(){let e=f.useContext(Hi);return yo(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function jo(){let e=f.useContext(Ui);return yo(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Mo=f.createContext(void 0);Mo.displayName=`FrameworkContext`;function No(){let e=f.useContext(Mo);return yo(e,`You must render this element inside a <HydratedRouter> element`),e}function Po(e,t){let n=f.useContext(Mo),[r,i]=f.useState(!1),[a,o]=f.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,p=f.useRef(null);f.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return p.current&&e.observe(p.current),()=>{e.disconnect()}}},[e]),f.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let m=()=>{i(!0)},h=()=>{i(!1),o(!1)};return n?e===`intent`?[a,p,{onFocus:Fo(s,m),onBlur:Fo(c,h),onMouseEnter:Fo(l,m),onMouseLeave:Fo(u,h),onTouchStart:Fo(d,m)}]:[a,p,{}]:[!1,p,{}]}function Fo(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Io({page:e,...t}){let n=Gi(),{router:r}=Ao(),i=f.useMemo(()=>xn(r.routes,e,r.basename),[r.routes,e,r.basename]);return i?n?f.createElement(Ro,{page:e,matches:i,...t}):f.createElement(zo,{page:e,matches:i,...t}):null}function Lo(e){let{manifest:t,routeModules:n}=No(),[r,i]=f.useState([]);return f.useEffect(()=>{let r=!1;return wo(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Ro({page:e,matches:t,...n}){let r=oa(),{future:i}=No(),{basename:a}=Ao(),o=f.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=bo(e,a,i.unstable_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.unstable_trailingSlashAwareDataRequests,e,r,t]);return f.createElement(f.Fragment,null,o.map(e=>f.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function zo({page:e,matches:t,...n}){let r=oa(),{future:i,manifest:a,routeModules:o}=No(),{basename:s}=Ao(),{loaderData:c,matches:l}=jo(),u=f.useMemo(()=>To(e,t,l,a,r,`data`),[e,t,l,a,r]),d=f.useMemo(()=>To(e,t,l,a,r,`assets`),[e,t,l,a,r]),p=f.useMemo(()=>
13{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=bo(e,s,i.unstable_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.unstable_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),m=f.useMemo(()=>Eo(d,a),[d,a]),h=Lo(d);return f.createElement(f.Fragment,null,p.map(e=>f.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),m.map(e=>f.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),h.map(({key:e,link:t})=>f.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Bo(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}f.Component;var Vo=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Vo&&(window.__reactRouterVersion=`7.14.0`)}catch{}function Ho(e,t){return Or({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:tn({window:t?.window}),hydrationData:t?.hydrationData||Uo(),routes:e,mapRouteProperties:Ha,hydrationRouteProperties:Ua,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,unstable_instrumentations:t?.unstable_instrumentations}).initialize()}function Uo(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:Wo(e.errors)}),e}function Wo(e){if(!e)return null;let t=Object.entries(e),n={};for(let[e,r]of t)if(r&&r.__type===`RouteErrorResponse`)n[e]=new er(r.status,r.statusText,r.data,r.internal===!0);else if(r&&r.__type===`Error`){if(r.__subType){let t=window[r.__subType];if(typeof t==`function`)try{let i=new t(r.message);i.stack=``,n[e]=i}catch{}}if(n[e]==null){let t=Error(r.message);t.stack=``,n[e]=t}}else n[e]=r;return n}function Go({basename:e,children:t,history:n,unstable_useTransitions:r}){let[i,a]=f.useState({action:n.action,location:n.location}),o=f.useCallback(e=>{r===!1?a(e):f.startTransition(()=>a(e))},[r]);return f.useLayoutEffect(()=>n.listen(o),[n,o]),f.createElement(Za,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,unstable_useTransitions:r})}Go.displayName=`unstable_HistoryRouter`;var Ko=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,qo=f.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,unstable_mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,unstable_defaultShouldRevalidate:p,...m},h){let{basename:g,navigator:_,unstable_useTransitions:v}=f.useContext(Yi),y=typeof l==`string`&&Ko.test(l),b=ir(l,g);l=b.to;let x=ia(l,{relative:r}),S=oa(),C=null;if(o){let e=Yn(o,[],S.unstable_mask?S.unstable_mask.pathname:`/`,!0);g!==`/`&&(e.pathname=e.pathname===`/`?g:Xn([g,e.pathname])),C=_.createHref(e)}let[w,T,E]=Po(n,m),D=es(l,{replace:a,unstable_mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,unstable_defaultShouldRevalidate:p,unstable_useTransitions:v});function O(t){e&&e(t),t.defaultPrevented||D(t)}let k=!(b.isExternal||i),A=f.createElement(`a`,{...m,...E,href:(k?C:void 0)||b.absoluteURL||x,onClick:k?O:e,ref:Bo(h,T),target:c,"data-discover":!y&&t===`render`?`true`:void 0});return w&&!y?f.createElement(f.Fragment,null,A,f.createElement(Io,{page:x})):A});qo.displayName=`Link`;var Jo=f.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=ma(a,{relative:c.relative}),d=oa(),p=f.useContext(Ui),{navigator:m,basename:h}=f.useContext(Yi),g=p!=null&&ds(u)&&o===!0,_=m.encodeLocation?m.encodeLocation(u).pathname:u.pathname,v=d.pathname,y=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,_=_.toLowerCase()),y&&h&&(y=Bn(y,h)||y);let b=_!==`/`&&_.endsWith(`/`)?_.length-1:_.length,x=v===_||!r&&v.startsWith(_)&&v.charAt(b)===`/`,S=y!=null&&(y===_||!r&&y.startsWith(_)&&y.charAt(_.length)===`/`),C={isActive:x,isPending:S,isTransitioning:g},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,g?`transitioning`:null].filter(
13Boolean).join(` `);let E=typeof i==`function`?i(C):i;return f.createElement(qo,{...c,"aria-current":w,className:T,ref:l,style:E,to:a,viewTransition:o},typeof s==`function`?s(C):s)});Jo.displayName=`NavLink`;var Yo=f.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=eo,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,unstable_defaultShouldRevalidate:p,...m},h)=>{let{unstable_useTransitions:g}=f.useContext(Yi),_=is(),v=as(s,{relative:l}),y=o.toLowerCase()===`get`?`get`:`post`,b=typeof s==`string`&&Ko.test(s);return f.createElement(`form`,{ref:h,method:y,action:v,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,m=()=>_(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,unstable_defaultShouldRevalidate:p});g&&n!==!1?f.startTransition(()=>m()):m()},...m,"data-discover":!b&&e===`render`?`true`:void 0})});Yo.displayName=`Form`;function Xo({getKey:e,storageKey:t,...n}){let r=f.useContext(Mo),{basename:i}=f.useContext(Yi),a=oa(),o=Aa();ls({getKey:e,storageKey:t});let s=f.useMemo(()=>{if(!r||!e)return null;let t=cs(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];
13typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return f.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${vo(JSON.stringify(t||os))}, ${vo(JSON.stringify(s))})`}})}Xo.displayName=`ScrollRestoration`;function Zo(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Qo(e){let t=f.useContext(Hi);return nn(t,Zo(e)),t}function $o(e){let t=f.useContext(Ui);return nn(t,Zo(e)),t}function es(e,{target:t,replace:n,unstable_mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,unstable_defaultShouldRevalidate:c,unstable_useTransitions:l}={}){let u=la(),d=oa(),p=ma(e,{relative:o});return f.useCallback(m=>{if(so(m,t)){m.preventDefault();let t=n===void 0?cn(d)===cn(p):n,h=()=>u(e,{replace:t,unstable_mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,unstable_defaultShouldRevalidate:c});l?f.startTransition(()=>h()):h()}},[d,u,p,n,r,i,t,e,a,o,s,c,l])}function ts(e){rn(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=f.useRef(co(e)),n=f.useRef(!1),r=oa(),i=f.useMemo(()=>lo(r.search,n.current?null:t.current),[r.search]),a=la();return[i,f.useCallback((e,t)=>{let r=co(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var ns=0,rs=()=>`__${String(++ns)}__`;function is(){let{router:e}=Qo(`useSubmit`),{basename:t}=f.useContext(Yi),n=Oa(),r=e.fetch,i=e.navigate;return f.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=ho(e,t);a.navigate===!1?await r(a.fetcherKey||rs(),n,a.action||o,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function as(e,{relative:t}={}){let{basename:n}=f.useContext(Yi),r=f.useContext(Zi);nn(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...ma(e||`.`,{relative:t})},o=oa();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:Xn([n,a.pathname])),cn(a)}var os=`react-router-scroll-positions`,ss={};function cs(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:Bn(e.pathname,n)||e.pathname},t)),i??=e.key,i}function ls({getKey:e,storageKey:t}={}){let{router:n}=Qo(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=$o(`useScrollRestoration`),{basename:a}=f.useContext(Yi),o=oa(),s=Aa(),c=ka();f.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),us(f.useCallback(()=>{if(c.state===`idle`){let t=cs(o,s,a,e);ss[t]=window.scrollY}try{sessionStorage.setItem(t||os,JSON.stringify(ss))}catch(e){rn(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[c.state,e,a,o,s,t])),typeof document<`u`&&(f.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||os);e&&(ss=JSON.parse(e))}catch{}},[t]),f.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(ss,()=>window.scrollY,e?(t,n)=>cs(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),f.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{rn(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function us(e,t){let{capture:n}=t||{};f.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function ds(e,{relative:t}={}){let n=f.useContext(Ki);nn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}
13=Qo(`useViewTransitionState`),i=ma(e,{relative:t});if(!n.isTransitioning)return!1;let a=Bn(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Bn(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Ln(i.pathname,o)!=null||Ln(i.pathname,a)!=null}var fs=t(l(),1);function ps(e){return f.createElement(Ga,{flushSync:fs.flushSync,...e})}var ms=`/dashboard/chat`;function hs(){let e=la(),t=(0,f.useRef)(e);(0,f.useEffect)(()=>{t.current=e}),(0,f.useEffect)(()=>{if(typeof window>`u`||typeof navigator>`u`||!(`serviceWorker`in navigator))return;let e=new Audio(`/bell.mp3`),n=!1,r=()=>{n||(n=!0,e.muted=!0,e.play().then(()=>{e.pause(),e.currentTime=0,e.muted=!1}).catch(()=>{e.muted=!1}),window.removeEventListener(`pointerdown`,r),window.removeEventListener(`keydown`,r))};window.addEventListener(`pointerdown`,r),window.addEventListener(`keydown`,r);let i=n=>{let r=n.data;!r||typeof r!=`object`||(r.type===`NOTIFICATION_RECEIVED`&&r.playSound?e.play().catch(e=>{console.error(`Error playing notification sound:`,e)}):r.type===`NAVIGATE_TO_CHAT`&&r.ROOM_ID&&t.current(`${ms}?roomId=${encodeURIComponent(r.ROOM_ID)}`))};return navigator.serviceWorker.addEventListener(`message`,i),()=>{navigator.serviceWorker.removeEventListener(`message`,i),window.removeEventListener(`pointerdown`,r),window.removeEventListener(`keydown`,r)}},[])}function gs(){return hs(),null}var _s=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),vs=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),ys=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),bs=e=>{let t=ys(e);return t.charAt(0).toUpperCase()+t.slice(1)},xs={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},Ss=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Cs=(0,f.createContext)({}),ws=()=>(0,f.useContext)(Cs),Ts=(0,f.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:p=`currentColor`,className:m=``}=ws()??{},h=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,f.createElement)(`svg`,{ref:c,...xs,width:t??l??xs.width,height:t??l??xs.height,stroke:e??p,strokeWidth:h,className:_s(`lucide`,m,i),...!a&&!Ss(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,f.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),U=(e,t)=>{let n=(0,f.forwardRef)(({className:n,...r},i)=>(0,f.createElement)(Ts,{ref:i,iconNode:t,className:_s(`lucide-${vs(bs(e))}`,`lucide-${e}`,n),...r}));return n.displayName=bs(e),n},Es=U(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),Ds=U(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),Os=U(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),ks=U(`ban`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M4.929 4.929 19.07 19.071`,key:`196cmz`}]]),As=U(`bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),js=U(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),Ms=U(`calendar`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}]]),Ns=U(`camera`,[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]),Ps=U(`chart-no-axes-column`,[[`path`,{d:`M5 21v-6`,key:`1hz6c0`}],[`path`,{d:`M12 21V3`,key:`1lcnhd`}],[`path`,{d:`M19 21V9`,key:`unv183`}
13]]),Fs=U(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Is=U(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Ls=U(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),Rs=U(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),zs=U(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),Bs=U(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),Vs=U(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Hs=U(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Us=U(`clipboard-list`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`M12 11h4`,key:`1jrz19`}],[`path`,{d:`M12 16h4`,key:`n85exb`}],[`path`,{d:`M8 11h.01`,key:`1dfujw`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]),Ws=U(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),Gs=U(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Ks=U(`credit-card`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`5`,rx:`2`,key:`ynyp8z`}],[`line`,{x1:`2`,x2:`22`,y1:`10`,y2:`10`,key:`1b3vmo`}]]),qs=U(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),Js=U(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),Ys=U(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),Xs=U(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Zs=U(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Qs=U(`file-question-mark`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3`,key:`mhlwft`}]]),$s=U(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),ec=U(`grip-vertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]),tc=U(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),nc=U(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),rc=U(`layout-dashboard`,[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]),ic=U(`layout-grid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),ac=U(`link-2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),oc=U(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),sc=U(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),cc=U(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),lc=U(`mail`,[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}
13],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]),uc=U(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),dc=U(`message-circle`,[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]),fc=U(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),pc=U(`messages-square`,[[`path`,{d:`M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z`,key:`1n2ejm`}],[`path`,{d:`M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1`,key:`1qfcsi`}]]),mc=U(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),hc=U(`mouse-pointer-click`,[[`path`,{d:`M14 4.1 12 6`,key:`ita8i4`}],[`path`,{d:`m5.1 8-2.9-.8`,key:`1go3kf`}],[`path`,{d:`m6 12-1.9 2`,key:`mnht97`}],[`path`,{d:`M7.2 2.2 8 5.1`,key:`1cfko1`}],[`path`,{d:`M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z`,key:`s0h3yz`}]]),gc=U(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),_c=U(`pen-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),vc=U(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),yc=U(`percent`,[[`line`,{x1:`19`,x2:`5`,y1:`5`,y2:`19`,key:`1x9vlm`}],[`circle`,{cx:`6.5`,cy:`6.5`,r:`2.5`,key:`4mh3h7`}],[`circle`,{cx:`17.5`,cy:`17.5`,r:`2.5`,key:`1mdrzq`}]]),bc=U(`plug`,[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]),xc=U(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Sc=U(`qr-code`,[[`rect`,{width:`5`,height:`5`,x:`3`,y:`3`,rx:`1`,key:`1tu5fj`}],[`rect`,{width:`5`,height:`5`,x:`16`,y:`3`,rx:`1`,key:`1v8r4q`}],[`rect`,{width:`5`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`1x03jg`}],[`path`,{d:`M21 16h-3a2 2 0 0 0-2 2v3`,key:`177gqh`}],[`path`,{d:`M21 21v.01`,key:`ents32`}],[`path`,{d:`M12 7v3a2 2 0 0 1-2 2H7`,key:`8crl2c`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M12 3h.01`,key:`n36tog`}],[`path`,{d:`M12 16v.01`,key:`133mhm`}],[`path`,{d:`M16 12h1`,key:`1slzba`}],[`path`,{d:`M21 12v.01`,key:`1lwtk9`}],[`path`,{d:`M12 21v-1`,key:`1880an`}]]),Cc=U(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),wc=U(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Tc=U(`smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),Ec=U(`square-check-big`,[[`path`,{d:`M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344`,key:`2acyp4`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),Dc=U(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),Oc=U(`text-align-start`,[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M17 19H3`,key:`z6ezky`}]]),kc=U(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),Ac=U(`trending-up`,[[`path`,{d:`M16 7h6v6`,key:`box55l`}],[`path`,{d:`m22 7-8.5 8.5-5-5L2 17`,key:`1t1m79`}]]),jc=U(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Mc=U(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),Nc=U(`user-check`,[[`path`,{d:`m16 11 2 2 4-4`,key:`9rsbq5`}],[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),Pc=U(`user`,[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]),Fc=U(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),Ic=U(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Lc=U(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]);function Rc(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Rc(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function zc(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Rc(e))&&(r&&(r+=` `),r+=t);return r}var Bc=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Vc=(e,t)=>({classGroupId:e,validator:t}),Hc=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}
vendor: 13,975 bytes, line 13
13),Uc=`-`,Wc=[],Gc=`arbitrary..`,Kc=e=>{let t=Yc(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Jc(e);let n=e.split(Uc);return qc(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Bc(i,t):t:i||Wc}return n[e]||Wc}}},qc=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=qc(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Uc):e.slice(t).join(Uc),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Jc=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Gc+r:void 0})(),Yc=e=>{let{theme:t,classGroups:n}=e;return Xc(n,t)},Xc=(e,t)=>{let n=Hc();for(let r in e){let i=e[r];Zc(i,n,r,t)}return n},Zc=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Qc(i,t,n,r)}},Qc=(e,t,n,r)=>{if(typeof e==`string`){$c(e,t,n);return}if(typeof e==`function`){el(e,t,n,r);return}tl(e,t,n,r)},$c=(e,t,n)=>{let r=e===``?t:nl(t,e);r.classGroupId=n},el=(e,t,n,r)=>{if(rl(e)){Zc(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Vc(n,e))},tl=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Zc(o,nl(t,a),n,r)}},nl=(e,t)=>{let n=e,r=t.split(Uc),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Hc(),n.nextPart.set(t,i)),n=i}return n},rl=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,il=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},al=`!`,ol=`:`,sl=[],cl=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),ll=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===ol){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(al)?(c=s.slice(0,-1),l=!0):s.startsWith(al)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return cl(t,l,c,u)};if(t){let e=t+ol,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):cl(sl,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},ul=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},dl=e=>({cache:il(e.cacheSize),parseClassName:ll(e),sortModifiers:ul(e),...Kc(e)}),fl=/\s+/,pl=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],s=e.trim().split(fl),c=``;for(let e=s.length-1;e>=0;--e){let t=s[e],{isExternal:l,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(t);if(l){c=t+(c.length>0?` `+c:c);continue}let m=!!p,h=r(m?f.substring(0,p):f);if(!h){if(!m){c=t+(c.length>0?` `+c:c);continue}if(h=r(f),!h){c=t+(c.length>0?` `+c:c);continue}m=!1}let g=u.length===0?``:u.length===1?u[0]:a(u).join(`:`),_=d?g+al:g,v=_+h;if(o.indexOf(v)>-1)continue;o.push(v);let y=i(h,m);for(let e=0;e<y.length;++e){let t=y[e];o.push(_+t)}c=t+(c.length>0?` `+c:c)}return c},ml=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=hl(n))&&(i&&(i+=` `),i+=r);return i},hl=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=hl(e[r]))&&(n&&(n+=` `),n+=t);return n},gl=(e,...t)=>{let n,r,i,a,o=o=>(n=dl(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=pl(e,n);return i(e,a),a};return a=o,(...e)=>a(ml(...e))},_l=[],vl=e=>{let t=t=>t[e]||_l;return t.isThemeGetter=!0,t},yl=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,bl=/^\((?:(\w[\w-]*):)?(.+)\)$/i,xl=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Sl=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Cl=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,wl=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Tl=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,El=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Dl=e=>xl.test(e),Ol=e=>!!e&&!Number.isNaN(Number(e)),kl=e=>!!e&&Number.isInteger(Number(e)),Al=e=>e.endsWith(`%`)&&Ol(e.slice(0,-1)),jl=e=>Sl.test(e),Ml=()=>!0,Nl=e=>Cl.test(e)&&!wl.test(e),Pl=()=>!1,Fl=e=>Tl.test(e),Il=e=>El.test(e),Ll=e=>!W(e)&&!G(e),Rl=e=>$l(e,ru,Pl),W=e=>yl.test(e),zl=e=>$l(e,iu,Nl),Bl=e=>$l(e,au,Ol),Vl=e=>$l(e,su,Ml),Hl=e=>$l(e,ou,Pl),Ul=e=>$l(e,tu,Pl),Wl=e=>$l(e,nu,Il),Gl=e=>$l(e,cu,Fl),G=e=>bl.test(e),Kl=e=>eu(e,iu),ql=e=>eu(e,ou),Jl=e=>eu(e,tu),Yl=e=>eu(e,ru),Xl=e=>eu(e,nu),Zl=e=>eu(e,cu,!0),Ql=e=>eu(e,su,!0),$l=(e,t,n)=>{let r=yl.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},eu=(e,t,n=!1)=>{let r=bl.exec(e);return r?r[1]?t(r[1]):n:!1},tu=e=>e===`position`||e===`percentage`,nu=e=>e===`image`||e===`url`,ru=e=>e===`length`||e===`size`||e===`bg-size`,iu=e=>e===`length`,au=e=>e===`number`,ou=e=>e===`family-name`,su=e=>e===`number`||e===`weight`,cu=e=>e===`shadow`,lu=gl(()=>{let e=vl(`color`),t=vl(`font`),n=vl(`text`),r=vl(`font-weight`),i=vl(`tracking`),a=vl(`leading`),o=vl(`breakpoint`),s=vl(`container`),c=vl(`spacing`),l=vl(`radius`),u=vl(`shadow`),d=vl(`inset-shadow`),f=vl(`text-shadow`),p=vl(`drop-shadow`),m=vl(`blur`),h=vl(`perspective`),g=vl(`aspect`),_=vl(`ease`),v=vl(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),G,W],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[G,W,c],T=()=>[Dl,`full`,`auto`,...w()],E=()=>[kl,`none`,`subgrid`,G,W],D=()=>[`auto`,{span:[`full`,kl,G,W]},kl,G,W],O=()=>[kl,`auto`,G,W],k=()=>[`auto`,`min`,`max`,`fr`,G,W],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[Dl,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],ee=()=>[Dl,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],P=()=>[Dl,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],F=()=>[e,G,W],I=()=>[...b(),Jl,Ul,{position:[G,W]}],te=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],L=()=>[`auto`,`cover`,`contain`,Yl,Rl,{size:[G,W]}],ne=()=>[Al,Kl,zl],R=()=>[``,`none`,`full`,l,G,W],z=()=>[``,Ol,Kl,zl],B=()=>[`solid`,`dashed`,`dotted`,`double`],re=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],ie=()=>[Ol,Al,Jl,Ul],ae=()=>[``,`none`,m,G,W],oe=()=>[`none`,Ol,G,W],se=()=>[`none`,Ol,G,W],ce=()=>[Ol,G,W],le=()=>[Dl,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[jl],breakpoint:[jl],color:[Ml],container:[jl],"drop-shadow":[jl],ease:[`in`,`out`,`in-out`],font:[Ll],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[jl],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[jl],shadow:[jl],spacing:[`px`,Ol],text:[jl],"text-shadow":[jl],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Dl,W,G,g]}],container:[`container`],columns:[{columns:[Ol,W,G,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[kl,`auto`,G,W]}],basis:[{basis:[Dl,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[Ol,Dl,`auto`,`initial`,`none`,W]}],grow:[{grow:[``,Ol,G,W]}],shrink:[{shrink:[``,Ol,G,W]}],order:[{order:[kl,`first`,`last`,`none`,G,W]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...ee()]}],"min-inline-size":[{"min-inline":[`auto`,...ee()]}],"max-inline-size":[{"max-inline":[`none`,...ee()]}],"block-size":[{block:[`auto`,...P()]}],"min-block-size":[{"min-block":[`auto`,...P()]}],"max-block-size":[{"max-block":[`none`,...P()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,...N()]}],"font-size":[{text:[`base`,n,Kl,zl]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Ql,Vl]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Al,W]}],"font-family":[{font:[ql,Hl,t]}],"font-features":[{"font-features":[W]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,G,W]}],"line-clamp":[{"line-clamp":[Ol,`none`,G,Bl]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,G,W]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,G,W]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:F()}],"text-color":[{text:F()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...B(),`wavy`]}],"text-decoration-thickness":[{decoration:[Ol,`from-font`,`auto`,G,zl]}],"text-decoration-color":[{decoration:F()}],"underline-offset":[{"underline-offset":[Ol,`auto`,G,W]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,G,W]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,G,W]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:I()}],"bg-repeat":[{bg:te()}],"bg-size":[{bg:L()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},kl,G,W],radial:[``,G,W],conic:[kl,G,W]},Xl,Wl]}],"bg-color":[{bg:F()}],"gradient-from-pos":[{from:ne()}
vendor: 7,791 bytes, line 13
13],"gradient-via-pos":[{via:ne()}],"gradient-to-pos":[{to:ne()}],"gradient-from":[{from:F()}],"gradient-via":[{via:F()}],"gradient-to":[{to:F()}],rounded:[{rounded:R()}],"rounded-s":[{"rounded-s":R()}],"rounded-e":[{"rounded-e":R()}],"rounded-t":[{"rounded-t":R()}],"rounded-r":[{"rounded-r":R()}],"rounded-b":[{"rounded-b":R()}],"rounded-l":[{"rounded-l":R()}],"rounded-ss":[{"rounded-ss":R()}],"rounded-se":[{"rounded-se":R()}],"rounded-ee":[{"rounded-ee":R()}],"rounded-es":[{"rounded-es":R()}],"rounded-tl":[{"rounded-tl":R()}],"rounded-tr":[{"rounded-tr":R()}],"rounded-br":[{"rounded-br":R()}],"rounded-bl":[{"rounded-bl":R()}],"border-w":[{border:z()}],"border-w-x":[{"border-x":z()}],"border-w-y":[{"border-y":z()}],"border-w-s":[{"border-s":z()}],"border-w-e":[{"border-e":z()}],"border-w-bs":[{"border-bs":z()}],"border-w-be":[{"border-be":z()}],"border-w-t":[{"border-t":z()}],"border-w-r":[{"border-r":z()}],"border-w-b":[{"border-b":z()}],"border-w-l":[{"border-l":z()}],"divide-x":[{"divide-x":z()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":z()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...B(),`hidden`,`none`]}],"divide-style":[{divide:[...B(),`hidden`,`none`]}],"border-color":[{border:F()}],"border-color-x":[{"border-x":F()}],"border-color-y":[{"border-y":F()}],"border-color-s":[{"border-s":F()}],"border-color-e":[{"border-e":F()}],"border-color-bs":[{"border-bs":F()}],"border-color-be":[{"border-be":F()}],"border-color-t":[{"border-t":F()}],"border-color-r":[{"border-r":F()}],"border-color-b":[{"border-b":F()}],"border-color-l":[{"border-l":F()}],"divide-color":[{divide:F()}],"outline-style":[{outline:[...B(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[Ol,G,W]}],"outline-w":[{outline:[``,Ol,Kl,zl]}],"outline-color":[{outline:F()}],shadow:[{shadow:[``,`none`,u,Zl,Gl]}],"shadow-color":[{shadow:F()}],"inset-shadow":[{"inset-shadow":[`none`,d,Zl,Gl]}],"inset-shadow-color":[{"inset-shadow":F()}],"ring-w":[{ring:z()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:F()}],"ring-offset-w":[{"ring-offset":[Ol,zl]}],"ring-offset-color":[{"ring-offset":F()}],"inset-ring-w":[{"inset-ring":z()}],"inset-ring-color":[{"inset-ring":F()}],"text-shadow":[{"text-shadow":[`none`,f,Zl,Gl]}],"text-shadow-color":[{"text-shadow":F()}],opacity:[{opacity:[Ol,G,W]}],"mix-blend":[{"mix-blend":[...re(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":re()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[Ol]}],"mask-image-linear-from-pos":[{"mask-linear-from":ie()}],"mask-image-linear-to-pos":[{"mask-linear-to":ie()}],"mask-image-linear-from-color":[{"mask-linear-from":F()}],"mask-image-linear-to-color":[{"mask-linear-to":F()}],"mask-image-t-from-pos":[{"mask-t-from":ie()}],"mask-image-t-to-pos":[{"mask-t-to":ie()}],"mask-image-t-from-color":[{"mask-t-from":F()}],"mask-image-t-to-color":[{"mask-t-to":F()}],"mask-image-r-from-pos":[{"mask-r-from":ie()}],"mask-image-r-to-pos":[{"mask-r-to":ie()}],"mask-image-r-from-color":[{"mask-r-from":F()}],"mask-image-r-to-color":[{"mask-r-to":F()}],"mask-image-b-from-pos":[{"mask-b-from":ie()}],"mask-image-b-to-pos":[{"mask-b-to":ie()}],"mask-image-b-from-color":[{"mask-b-from":F()}],"mask-image-b-to-color":[{"mask-b-to":F()}],"mask-image-l-from-pos":[{"mask-l-from":ie()}],"mask-image-l-to-pos":[{"mask-l-to":ie()}],"mask-image-l-from-color":[{"mask-l-from":F()}],"mask-image-l-to-color":[{"mask-l-to":F()}],"mask-image-x-from-pos":[{"mask-x-from":ie()}],"mask-image-x-to-pos":[{"mask-x-to":ie()}],"mask-image-x-from-color":[{"mask-x-from":F()}],"mask-image-x-to-color":[{"mask-x-to":F()}],"mask-image-y-from-pos":[{"mask-y-from":ie()}],"mask-image-y-to-pos":[{"mask-y-to":ie()}],"mask-image-y-from-color":[{"mask-y-from":F()}],"mask-image-y-to-color":[{"mask-y-to":F()}],"mask-image-radial":[{"mask-radial":[G,W]}],"mask-image-radial-from-pos":[{"mask-radial-from":ie()}],"mask-image-radial-to-pos":[{"mask-radial-to":ie()}],"mask-image-radial-from-color":[{"mask-radial-from":F()}],"mask-image-radial-to-color":[{"mask-radial-to":F()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[Ol]}],"mask-image-conic-from-pos":[{"mask-conic-from":ie()}],"mask-image-conic-to-pos":[{"mask-conic-to":ie()}],"mask-image-conic-from-color":[{"mask-conic-from":F()}],"mask-image-conic-to-color":[{"mask-conic-to":F()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:I()}],"mask-repeat":[{mask:te()}],"mask-size":[{mask:L()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,G,W]}],filter:[{filter:[``,`none`,G,W]}],blur:[{blur:ae()}],brightness:[{brightness:[Ol,G,W]}],contrast:[{contrast:[Ol,G,W]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Zl,Gl]}],"drop-shadow-color":[{"drop-shadow":F()}],grayscale:[{grayscale:[``,Ol,G,W]}],"hue-rotate":[{"hue-rotate":[Ol,G,W]}],invert:[{invert:[``,Ol,G,W]}],saturate:[{saturate:[Ol,G,W]}],sepia:[{sepia:[``,Ol,G,W]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,G,W]}],"backdrop-blur":[{"backdrop-blur":ae()}],"backdrop-brightness":[{"backdrop-brightness":[Ol,G,W]}],"backdrop-contrast":[{"backdrop-contrast":[Ol,G,W]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,Ol,G,W]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ol,G,W]}],"backdrop-invert":[{"backdrop-invert":[``,Ol,G,W]}],"backdrop-opacity":[{"backdrop-opacity":[Ol,G,W]}],"backdrop-saturate":[{"backdrop-saturate":[Ol,G,W]}],"backdrop-sepia":[{"backdrop-sepia":[``,Ol,G,W]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,G,W]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[Ol,`initial`,G,W]}],ease:[{ease:[`linear`,`initial`,_,G,W]}],delay:[{delay:[Ol,G,W]}],animate:[{animate:[`none`,v,G,W]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,G,W]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:oe()}],"rotate-x":[{"rotate-x":oe()}],"rotate-y":[{"rotate-y":oe()}],"rotate-z":[{"rotate-z":oe()}],scale:[{scale:se()}],"scale-x":[{"scale-x":se()}],"scale-y":[{"scale-y":se()}],"scale-z":[{"scale-z":se()}],"scale-3d":[`scale-3d`],skew:[{skew:ce()}],"skew-x":[{"skew-x":ce()}],"skew-y":[{"skew-y":ce()}],transform:[{transform:[G,W,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:le()}],"translate-x":[{"translate-x":le()}],"translate-y":[{"translate-y":le()}],"translate-z":[{"translate-z":le()}],"translate-none":[`translate-none`],accent:[{accent:F()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:F()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom
13-in`,`zoom-out`,G,W]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}
13],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,G,W]}],fill:[{fill:[`none`,...F()]}],"stroke-w":[{stroke:[Ol,Kl,zl,Bl]}],stroke:[{stroke:[`none`,...F()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function K(...e){return lu(zc(e))}async function uu(e){if(typeof navigator.clipboard?.writeText==`function`){await navigator.clipboard.writeText(e);return}let t=document.activeElement instanceof HTMLElement?document.activeElement:null,n=document.createElement(`textarea`);n.value=e,n.setAttribute(`readonly`,``),n.style.position=`fixed`,n.style.left=`-9999px`,n.style.opacity=`0`,n.style.pointerEvents=`none`,document.body.appendChild(n),n.focus(),n.select();try{if(!document.execCommand(`copy`))throw Error(`Copy command was rejected`)}finally{n.remove(),t?.focus()}}function du(e){return e.toLocaleString(`zh-TW`)}function fu(e){let t=Math.max(0,Math.floor(e)),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60,a=e=>String(e).padStart(2,`0`);return`${a(n)}:${a(r)}:${a(i)}`}function pu(e){return e?e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(2)} MB`:``}function mu(){let e=globalThis.crypto;if(typeof e?.randomUUID==`function`)return e.randomUUID();if(typeof e?.getRandomValues!=`function`)throw Error(`Secure random number generation is unavailable`);let t=e.getRandomValues(new Uint8Array(16));t[6]=t[6]&15|64,t[8]=t[8]&63|128;let n=Array.from(t,e=>e.toString(16).padStart(2,`0`)).join(``);return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}function hu(e){return e===`var(--brand)`?`var(--brand-tint)`:`${e}18`}var gu=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({}
13,t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},_u=(e=>e?gu(e):gu),vu=e=>e;function yu(e,t=vu){let n=f.useSyncExternalStore(e.subscribe,f.useCallback(()=>t(e.getState()),[e,t]),f.useCallback(()=>t(e.getInitialState()),[e,t]));return f.useDebugValue(n),n}var bu=e=>{let t=_u(e),n=e=>yu(t,e);return Object.assign(n,t),n},xu=(e=>e?bu(e):bu),Su=typeof window<`u`&&window.__ENV__?window.__ENV__:{},Cu={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1},wu={VITE_PINCHAT_API_BASE:Su.VITE_PINCHAT_API_BASE??Cu.VITE_PINCHAT_API_BASE??``,VITE_CHAT_API_BASE:Su.VITE_CHAT_API_BASE??Cu.VITE_CHAT_API_BASE??``,VITE_IMKIT_BUNDLE_URL:Su.VITE_IMKIT_BUNDLE_URL??Cu.VITE_IMKIT_BUNDLE_URL??``,VITE_PINCHAT_AI_ENABLED:Su.VITE_PINCHAT_AI_ENABLED??Cu.VITE_PINCHAT_AI_ENABLED??`false`,VITE_WIDGET_BASE:(Su.VITE_WIDGET_BASE||Cu.VITE_WIDGET_BASE||`https://pinchat.app`).replace(/\/+$/,``),VITE_TAPPAY_APP_ID:Su.VITE_TAPPAY_APP_ID??Cu.VITE_TAPPAY_APP_ID??`12005`,VITE_TAPPAY_APP_KEY:Su.VITE_TAPPAY_APP_KEY??Cu.VITE_TAPPAY_APP_KEY??``,VITE_TAPPAY_ENV:Su.VITE_TAPPAY_ENV??Cu.VITE_TAPPAY_ENV??`sandbox`,VITE_FIREBASE_ENV:Su.VITE_FIREBASE_ENV??Cu.VITE_FIREBASE_ENV??`dev`};function Tu(e){return`${(wu.VITE_PINCHAT_API_BASE||`https://api.pinchat.me`).replace(/\/+$/,``)}${e.startsWith(`/`)?e:`/${e}`}`}function Eu(){return(Jt.language||`zh-TW`).toLowerCase()}var Du=class extends Error{status;code;payload;constructor(e,t,n,r=null){super(n),this.name=`ApiError`,this.status=e,this.code=t,this.payload=r}},Ou=`token`,ku=`refresh_token`,Au=`token_end_at`,ju=`imkit-token`,Mu=`imkit-client-key`,Nu=`Basic cGluY2hhdC11c2VyOnNlY3JldA==`,Pu=`pinchat_isSubAccount`,Fu=`pinchat:auth-cleared`,Iu=null;async function Lu(){let e=localStorage.getItem(ku);if(!e)return!1;try{let t=`${wu.VITE_PINCHAT_API_BASE}/api/${Eu()}/auth/refreshToken`,n=await fetch(t,{method:`POST`,headers:{"Content-Type":`application/json`,Authorization:Nu},body:JSON.stringify({refresh_token:e})});if(!n.ok)return!1;let r=(await n.json())?.data?.data;return!r?.access_token||!r.refresh_token?!1:(localStorage.setItem(Ou,r.access_token),localStorage.setItem(ku,r.refresh_token),r.end_at!=null&&localStorage.setItem(Au,String(r.end_at)),!0)}catch(e){return console.warn(`[auth] token refresh failed`,e),!1}}function Ru(){localStorage.removeItem(Ou),localStorage.removeItem(ku),localStorage.removeItem(Au),localStorage.removeItem(ju),localStorage.removeItem(Mu),typeof window<`u`&&window.dispatchEvent(new Event(Fu))}async function zu(e,t,n,r){if(!t.startsWith(`/`))throw Error(`api: path must start with '/', got: ${t}`);let i=`${wu.VITE_PINCHAT_API_BASE}/api/${Eu()}${t}`,a={},o;if(n.formData?o=n.formData:n.body!==void 0&&(a[`Content-Type`]=`application/json`,o=JSON.stringify(n.body)),!n.skipAuth){let e=localStorage.getItem(Ou);e&&(a.Authorization=`Bearer ${e}`)}n.headers&&Object.assign(a,n.headers);let s=await fetch(i,{method:e,headers:a,body:o,signal:n.signal});if((s.status===401||s.status===403)&&!n.skipAuth&&!r){if(Iu||=Lu().then(e=>(e||Ru(),e)).finally(()=>{Iu=null}),await Iu)return zu(e,t,n,!0);throw new Du(s.status,void 0,`Unauthorized`)}let c=null,l=await s.text();if(l)try{c=JSON.parse(l)}catch{c=l}if(!s.ok){let e=c,t=typeof e?.message==`string`?e.message:``,n=/^Request failed/i.test(t);throw new Du(s.status,e?.errorCode,n?``:t,c)}let u=c;return u&&typeof u==`object`&&`data`in u?u.data:c}var q={get:(e,t={})=>zu(`GET`,e,t,!1),post:(e,t,n={})=>zu(`POST`,e,{...n,body:t},!1),put:(e,t,n={})=>zu(`PUT`,e,{...n,body:t},!1),patch:(e,t,n={})=>zu(`PATCH`,e,{...n,body:t},!1),delete:(e,t,n={})=>zu(`DELETE`,e,t===void 0?n:{...n,body:t},!1),upload:(e,t,n={})=>zu(`POST`,e,{...n,formData:t},!1)};function Bu(e,t,n={}){let r=n.enabled??!0,[i,a]=(0,f.useState)({data:void 0,loading:!1,error:void 0}),o=(0,f.useRef)(e);o.current=e;let s=(0,f.useRef)(0),c=(0,f.useRef)(!0),l=(0,f.useRef)(null),u=(0,f.useCallback)(async()=>{l.current?.abort();let e=new AbortController;l.current=e;let t=++s.current;a(e=>({...e,loading:!0,error:void 0}));try{let n=await o.current(e.signal);if(!c.current||t!==s.current)return;a({data:n,loading:!1,error:void 0})}catch(n){if(e.signal.aborted||!c.current||t!==s.current)return;a(e=>({...e,loading:!1,error:n}))}},[]);(0,f.useEffect)(()=>(c.current=!0,r?u():a({data:void 0,loading:!1,error:void 0}),()=>{c.current=!1,l.current?.abort()}),[...t,r]);let d=i.loading||r&&i.data===void 0&&i.error===void 0;return{...i,loading:d,refetch:u}}function J(e){let[t,n]=(0,f.useState)({data:void 0,loading:!1,error:void 0}),r=(0,f.useRef)(e);r.current=e;let i=(0,f.useRef)(!0);(0,f.useEffect)(()=>(i.current=!0,()=>{i.current=!1}),[]);let a=(0,f.useCallback)(async e=>{n(e=>({...e,loading:!0,error:void 0}));try{let t=await r.current(e);return i.current&&n({data:t,loading:!1,error:void 0}),t}catch(e){throw i.current&&n(t=>({...t,loading:!1,error:e})),e}},[]),o=(0,f.useCallback)(()=>{n({data:void 0,loading:!1,error:void 0})},[]);return{...t,mutate:a,reset:o}}function Vu(){return J(async e=>{let t=await q.post(`/auth/login`,e,{skipAuth:!0,headers:{Authorization:Nu}}),n=t?.access_token?t:t?.data;if(!n?.access_token||!n?.refresh_token)throw Error(`Login response missing tokens`);return n})}function Hu(e){return Bu((0,f.useCallback)(async e=>{let t=await q.get(`/auth/setting`,{signal:e});return t?.data&&typeof t.data==`object`?t.data:t},[]),[],{enabled:e})}async function Uu(){let e=await q.get(`/auth/setting`);return e?.data&&typeof e.data==`object`?e.data:e}function Wu(){return J(e=>q.post(`/auth/setting`,e))}function Gu(){return J(e=>q.put(`/auth/updatePassword`,e))}function Ku(){return J(e=>q.put(`/user/notify`,e))}function qu(){return J(()=>q.delete(`/user`))}function Ju(){return J(async e=>{let t=await q.post(`/auth/register`,e,{skipAuth:!0,headers:{Authorization:Nu}}),n=t?.access_token?t:t?.data;if(!n?.access_token||!n?.refresh_token)throw Error(`Register response missing tokens`);return n})}function Yu(){return J(()=>q.post(`/auth/resend/verify_email`))}function Xu(){return J(e=>q.put(`/auth/forgetPassword`,e,{skipAuth:!0}))}function Zu(){return J(async e=>{let t=await q.post(`/auth/verify_email`,e,{skipAuth:!0}),n=t?.access_token?t:t?.data;if(!n?.access_token||!n?.refresh_token)throw Error(`Verify email response missing tokens`);return n})}async function Qu(){let e=await Uu(),t=(e.plan_uid??``).toLowerCase()===`free`,n=(e.trial_status??-1)===0,r=!e.appsumo_invoice_item_uuid;if(!t||!n||!r)return;let i=new Date,a=new Date(i.getTime()+10080*60*1e3);await Promise.all([q.post(`/user/trial`),q.put(`/user/trial/option`,{show_trial_at:i.toUTCString(),show_end_survey_at:a.toUTCString()})])}function $u(){return J(e=>q.put(`/auth/resetPassword`,e,{skipAuth:!0}))}function ed(){return J(async e=>{let t=await q.post(`/auth/phone/login`,e,{skipAuth:!0,headers:{Authorization:Nu}}),n=t?.access_token?t:t?.data;if(!n?.access_token||!n?.refresh_token)throw Error(`Phone login response missing tokens`);return n})}function td(){return J(async e=>{let t=await q.post(`/auth/facebook`,e,{skipAuth:!0,headers:{Authorization:Nu}}),n=t?.access_token?t:t?.data;if(!n?.access_token||!n?.refresh_token)throw Error(`Facebook OAuth response missing tokens`);return n})}
13function nd(){return J(async e=>{let t=await q.post(`/auth/google`,e,{skipAuth:!0,headers:{Authorization:Nu}}),n=t?.access_token?t:t?.data;if(!n?.access_token||!n?.refresh_token)throw Error(`Google OAuth response missing tokens`);return n})}function rd(){return J(async e=>{let t=await q.post(`/auth/apple`,e,{skipAuth:!0,headers:{Authorization:Nu}}),n=t?.access_token?t:t?.data;if(!n?.access_token||!n?.refresh_token)throw Error(`Apple OAuth response missing tokens`);return n})}function id(){return J(async e=>{let t=await q.post(`/auth/verify_phone`,{token:e},{skipAuth:!0,headers:{Authorization:`Bearer ${e}`}}),n=t?.access_token??t?.data?.access_token;if(!n)throw Error(`verify_phone response missing access_token`);return{access_token:n}})}function ad(){return J(async e=>{let{resetToken:t,...n}=e;return q.put(`/user/setPassword`,n,{skipAuth:!0,headers:{Authorization:`Bearer ${t}`}})})}function od(){return J(async e=>{let t=await q.post(`/chat/sub/login`,e,{skipAuth:!0,headers:{Authorization:Nu}}),n=t.access_token?t:t.data?.access_token?t.data:t.data?.access?.access_token?t.data.access:t.access?.access_token?t.access:void 0;if(!n?.access_token)throw Error(`Sub-account login response missing tokens`);return{token_type:`Bearer`,expires_in:0,access_token:n.access_token,refresh_token:n.refresh_token??``,end_at:n.end_at??0}})}function sd(e){localStorage.setItem(Ou,e.access_token),localStorage.setItem(ku,e.refresh_token),e.end_at!=null&&localStorage.setItem(Au,String(e.end_at))}function cd(){localStorage.removeItem(Ou),localStorage.removeItem(ku),localStorage.removeItem(Au),localStorage.removeItem(ju),localStorage.removeItem(Mu),localStorage.removeItem(`email_verified`),typeof window<`u`&&window.dispatchEvent(new Event(Fu))}function ld(){return!!localStorage.getItem(Ou)}function ud(e){return Bu((0,f.useCallback)(async t=>(await q.get(`/user/login?page=0&pageSize=${e}`,{signal:t})).data??[],[e]),[e])}function dd(e={}){let{page:t=1,pageSize:n,sort:r=`createdAt`,order:i=`desc`,keyword:a}=e,o=a?.trim()||``,s=r===`unread`?`badge`:r;return Bu((0,f.useCallback)(async e=>{let r=new URLSearchParams({sort:s,order:i,page:String(t)});n&&r.set(`pageSize`,String(n)),o&&r.set(`keyword`,o);let a=await q.get(`/chat/enterpoints/list?${r.toString()}`,{signal:e});return{data:a?.data??[],counts:a?.counts??0,totalBadge:a?.totalBadge}},[t,n,s,i,o]),[t,n,s,i,o])}function fd(e){return e?.bot?.type===`ai`?e.bot:void 0}function pd(e){return Bu((0,f.useCallback)(async t=>{if(!e)throw Error(`useEnterpointConfig: token is required`);let n=(await q.get(`/chat/enterpoints/configs/${encodeURIComponent(e)}`,{signal:t}))?.data??[],r=n.find(e=>e?.bot?.type===`ai`)??n.find(e=>e?.bot!=null)??n[0];if(!r)throw Error(`Enterpoint config not found`);return r},[e]),[e],{enabled:!!e})}function md(){return J(e=>q.post(`/dashboard/enterpoint`,{is_valid:!0,...e}))}function hd(){return J(async e=>{let t=await q.post(`/dashboard/enterpoint`,{id:``,is_valid:!0,...e});return t?.data&&typeof t.data==`object`?t.data:t})}function gd(){return J(e=>q.post(`/dashboard/enterpoint/copy`,e))}function _d(){return J(e=>q.post(`/dashboard/enterpoint`,{id:e.id,token:e.token,is_valid:!1}))}function vd(){return J(e=>q.post(`/dashboard/enterpoint/check-domain-cname`,{domain:e}))}function yd(){return J(e=>q.get(`/enterpoint/check_enterpoint_token/${encodeURIComponent(e)}`))}function bd(e){return J(t=>q.post(`/enterpoint/${encodeURIComponent(e)}/custom_domain/setup`,t))}function xd(e){return J(()=>q.post(`/enterpoint/${encodeURIComponent(e)}/custom_domain/remove`))}function Sd(e,t){return t?`https://${t}`:typeof window>`u`?`https://pinchat.app/${e}`:`${window.location.protocol}//${window.location.host}/${e}`}function Cd(e){return{id:String(e.id),token:e.token,name:e.name,url:Sd(e.token,e.custom_domain),type:e.type,title:e.title??void 0,unreadCount:e.badge??0,createdAt:e.createdAt,avatar:e.imageUrl??void 0}}function wd(e){return{id:String(e.id),token:e.token,name:e.name,url:Sd(e.token,e.custom_domain),type:e.type,title:e.title??void 0,unreadCount:0,createdAt:e.createdAt,avatar:e.avatar??void 0}}var Td={image:`/dashboard/enterpoint/image`,logo:`/dashboard/enterpoint/logo`,widget_logo:`/dashboard/enterpoint/widget/logo`};function Ed(e){return J(async t=>{let n=new FormData;n.append(`file`,t);let r=await q.upload(Td[e],n);if(!r?.data?.url)throw Error(`Upload response missing url`);return r.data})}function Dd({token:e,keyword:t}){return Bu((0,f.useCallback)(async n=>{if(!e)throw Error(`useCustomers: token is required`);let r=new URLSearchParams;t&&r.set(`keyword`,t);let i=r.toString(),a=await q.get(`/chat/enterpoints/customer/${encodeURIComponent(e)}${i?`?${i}`:``}`,{signal:n});return Array.isArray(a?.data)?a.data:[]},[e,t]),[e,t],{enabled:!!e})}function Od(e){return J(async()=>
13{if(!e)throw Error(`useExportCustomersCsv: token is required`);let t=await q.get(`/chat/enterpoints/customer/export/${encodeURIComponent(e)}`);if(!t?.data?.url)throw Error(`Export response missing url`);return t.data.url})}function kd(e){return J(async t=>{if(!e)throw Error(`useExportCustomersEmail: token is required`);await q.get(`/chat/enterpoints/customer/export/email/${encodeURIComponent(t)}/${encodeURIComponent(e)}`)})}function Ad(){return J(e=>q.post(`/customer/info`,e))}function jd(e){return Bu((0,f.useCallback)(async t=>{if(!e)throw Error(`useCustomerType: token is required`);return q.get(`/customer/type?token=${encodeURIComponent(e)}`,{signal:t})},[e]),[e],{enabled:!!e})}function Md(){return J(e=>q.post(`/customer/type`,e))}function Nd(e){return Bu((0,f.useCallback)(async t=>{if(!e)throw Error(`useEnterpointSubAccounts: token is required`);return await q.get(`/enterpoint/${encodeURIComponent(e)}/subAccounts`,{signal:t})??{shareAvatars:!1,list:[]}},[e]),[e],{enabled:!!e})}function Pd(e){return J(async t=>{if(!e)throw Error(`useSaveEnterpointSubAccounts: token is required`);return q.put(`/enterpoint/${encodeURIComponent(e)}/subAccounts/rules`,t)})}function Fd(e){let{startDate:t,endDate:n,token:r}=e;return Bu((0,f.useCallback)(async e=>{let i=new URLSearchParams({startDate:t,endDate:n});r&&i.set(`token`,r);let a=await q.get(`/dashboard/rangeReport?${i.toString()}`,{signal:e});return a?.data&&typeof a.data==`object`?a.data:a},[t,n,r]),[t,n,r],{enabled:!!t&&!!n})}function Id(e){return e?e.reduce((e,t)=>e+Number(t.count??0),0):0}function Ld(e){return Bu((0,f.useCallback)(async t=>{let n=e?`/dashboard/userType?token=${encodeURIComponent(e)}`:`/dashboard/userType`,r=await q.get(n,{signal:t});return r?.data&&typeof r.data==`object`?r.data:r},[e]),[e])}function Rd(e,t,n){return Bu((0,f.useCallback)(async r=>{let i=new URLSearchParams({startDate:t,endDate:n}),a=await q.get(`/dashboard/qrCode/landing/${e}?${i.toString()}`,{signal:r});return a?.data&&typeof a.data==`object`?a.data:a},[e,t,n]),[e,t,n],{enabled:!!e&&!!t&&!!n})}function zd(e,t){return Bu((0,f.useCallback)(async n=>{let r=new URLSearchParams({token:e,survey_id:String(t)}),i=await q.get(`/survey/result?${r.toString()}`,{signal:n});return i?.data&&typeof i.data==`object`?i.data:i},[e,t]),[e,t],{enabled:!!e&&t!=null})}function Bd(e){return Bu((0,f.useCallback)(async t=>{let n=[`starter3_month`,`light3_month`,`standard4_month`],r=new URLSearchParams({currency:e});return n.forEach(e=>r.append(`uids`,e)),(await q.get(`/plans?${r.toString()}`,{signal:t}))?.data??[]},[e]),[e])}function Vd(){return J(async e=>{let t=await Promise.all(e.map(e=>q.post(`/polar/payment`,{uid:e}))),n={};return e.forEach((e,r)=>{n[e]=t[r]?.url??``}),n})}function Hd(){return Bu((0,f.useCallback)(async e=>{let t=await q.get(`/payment`,{signal:e});return Array.isArray(t?.data)?t.data:t},[]),[])}function Ud(){return Bu((0,f.useCallback)(async e=>{let t=await q.get(`/payment/status`,{signal:e});return t?.data&&typeof t.data==`object`?t.data:t},[]),[])}function Wd(){return J(async({code:e,currency:t})=>{let n=await q.get(`/coupon/checkAvailable/${encodeURIComponent(e)}?currency=${encodeURIComponent(t)}`),r=n;return r?.data&&typeof r.data==`object`?r.data:n})}function Gd(){return J(e=>q.post(`/coupon/directlyRedeem/${encodeURIComponent(e)}`,{}))}function Kd(){return J(e=>q.post(`/payment`,e))}function qd(){return J(e=>q.post(`/payment/pinchat/linepay`,e))}function Jd(){return J(e=>{let t=`/polar/subscription/cancel`;return e===1?t=`/payment/tappay/subscription/cancel`:e===0&&(t=`/payment/linepay/subscription/cancel`),q.post(t,{})})}function Yd(e=0,t=100){return Bu((0,f.useCallback)(async n=>{let r=await q.get(`/user/subAccount?page=${e}&pageSize=${t}`,{signal:n});return{data:r?.data??[],count:r?.count??0,page:r?.page??e,pageSize:r?.pageSize??t}},[e,t]),[e,t])}function Xd(){return J(e=>q.post(`/user/subAccount`,e))}function Zd(){return J(e=>q.put(`/user/subAccount/${e.id}`,e.payload))}function Qd(){return J(e=>q.delete(`/user/subAccount/${e}`))}function $d(){return J(e=>q.put(`/user/subAccount/${e.id}/rule`,e.payload))}function ef(e){return Bu((0,f.useCallback)(async t=>{if(!e)throw Error(`useSurveys: token is required`);return(await q.get(`/survey?token=${encodeURIComponent(e)}`,{signal:t}))?.data??[]},[e]),[e],{enabled:!!e})}function tf(){return J(async e=>{let t=await q.post(`/survey`,e);if(!t?.data?.id)throw Error(`Save survey response missing id`);return t.data.id})}function nf(){return J(e=>q.delete(`/survey`,e))}function rf(){return J(e=>q.post(`/survey/copy`,e))}function af(){return J(e=>q.post(`/survey/release`,e))}function of(){return J(async e=>(await q.post(`/survey/flow`,e))?.data?.id??e.id??0)}function sf(){return J(e=>q.delete(`/survey/flow`,e))}function cf(e){if(Array.isArray(e))return e;let t=e;return t&&Array.isArray(t.data)?t.data:t&&Array.isArray(t.providers)?t.providers:[]}function lf(){return Bu((0,f.useCallback)(async e=>cf(await q.get(`/user/model-providers/supported-models`,{signal:e})),[]),[])}function uf(){return Bu((0,f.useCallback)(async e=>cf(await q.get(`/user/model-providers`,{signal:e})),[]),[])}function df(){return J(e=>q.post(`/user/model-providers`,e))}function ff(){return J(e=>q.delete(`/user/model-providers/${encodeURIComponent(e)}`))}var pf=`/ai-bot`,mf=`https://pinchat-prod.s3.ap-northeast-1.amazonaws.com/user/e2669806e2830fc502f8835f2e6e4abe.png`,hf={keyword:``,notify_keyword:[],notify_type:`all`,type:`ai`};function gf(){return J(e=>q.post(`/bot`,{...hf,avatar:mf,is_open:!1,...e}))}function _f(){return J(e=>q.post(`/bot`,{...hf,byok_openai_enabled:!1,...e}))}function vf(e){return Bu((0,f.useCallback)(async t=>{if(!e)throw Error(`useAiBot: botId is required`);return q.get(`${pf}/${encodeURIComponent(e)}`,{signal:t})},[e]),[e],{enabled:!!e})}function yf(e){return J(async t=>{if(!e)throw Error(`useSaveAiBot: botId is required`);return q.patch(`${pf}/${encodeURIComponent(e)}`,t)})}function bf(e){return J(async()=>
13{if(!e)throw Error(`useDeleteAiBot: botId is required`);return q.delete(`/bot/${encodeURIComponent(e)}`)})}function xf(e){return Bu((0,f.useCallback)(async t=>{if(!e)throw Error(`useAiBotConfig: botId is required`);return q.get(`${pf}/${encodeURIComponent(e)}/config`,{signal:t})},[e]),[e],{enabled:!!e})}function Sf(e){return J(async t=>{if(!e)throw Error(`useSaveAiBotConfig: botId is required`);return q.put(`${pf}/${encodeURIComponent(e)}/config`,t)})}var Cf=100;async function wf(e,t){let n=`${pf}/${encodeURIComponent(e)}/datasources`,r=await q.get(`${n}?skip=0&limit=${Cf}`,{signal:t}),i=r?.data??[],a=r?.total??i.length;for(let e=i.length;e<a;e+=Cf){let r=(await q.get(`${n}?skip=${e}&limit=${Cf}`,{signal:t}))?.data??[];if(r.length===0)break;i.push(...r)}return i}function Tf(e){return Bu((0,f.useCallback)(async t=>{if(!e)throw Error(`useDatasources: botId is required`);return wf(e,t)},[e]),[e],{enabled:!!e})}function Ef(e){return J(t=>{if(!e)throw Error(`useCreateWebDatasource: botId is required`);return q.post(`${pf}/${encodeURIComponent(e)}/datasources/web`,t)})}function Df(e){return J(t=>{if(!e)throw Error(`useUpdateWebDatasource: botId is required`);return q.patch(`${pf}/${encodeURIComponent(e)}/datasources/${encodeURIComponent(t.datasourceId)}/web`,{target_urls:t.target_urls})})}function Of(e){return J(t=>{if(!e)throw Error(`useUploadFileDatasource: botId is required`);let n=new FormData;return n.append(`file`,t),n.append(`name`,t.name),q.upload(`${pf}/${encodeURIComponent(e)}/datasources/files`,n)})}function kf(e){return J(t=>{if(!e)throw Error(`useCreateManualQaDatasource: botId is required`);return q.post(`${pf}/${encodeURIComponent(e)}/datasources/manual-qa`,t)})}function Af(e){return J(t=>{if(!e)throw Error(`useUpdateManualQaDatasource: botId is required`);return q.patch(`${pf}/${encodeURIComponent(e)}/datasources/${encodeURIComponent(t.datasourceId)}/manual-qa`,{qa_pairs:t.qa_pairs})})}function jf(e){return J(t=>{if(!e)throw Error(`useDeleteDatasource: botId is required`);return q.delete(`${pf}/${encodeURIComponent(e)}/datasources/${encodeURIComponent(t)}`)})}async function Mf(e,t){let n=(await q.get(`${pf}/${encodeURIComponent(e)}/datasources/${encodeURIComponent(t)}/download?expires_in=3600&inline=false`))?.download_url;if(!n)throw Error(`Download URL not found`);return n}function Nf(e){return J(t=>{if(!e)throw Error(`useBuildIngestion: botId is required`);return q.post(`${pf}/${encodeURIComponent(e)}/ingestions`,t??{})})}function Pf(e){return Bu((0,f.useCallback)(async t=>{if(!e)return null;try{return await q.get(`${pf}/${encodeURIComponent(e)}/ingestions/status`,{signal:t})}catch{return null}},[e]),[e],{enabled:!!e})}function Ff(e,t,n,r,i,a){let o=new AbortController,s=localStorage.getItem(Ou),c=new URLSearchParams;t&&c.set(`task_id`,t);let l=`${wu.VITE_PINCHAT_API_BASE}/api/${Eu()}${pf}/${encodeURIComponent(e)}/ingestions/stream${c.toString()?`?${c.toString()}`:``}`;return(async()=>{try{let e=await fetch(l,{method:`GET`,headers:{Accept:`text/event-stream`,...s?{Authorization:`Bearer ${s}`}:{}},signal:o.signal});if(!e.ok||!e.body)throw Error(`SSE open failed: ${e.status}`);let t=e.body.getReader(),r=new TextDecoder,c=``;for(;;){let{value:e,done:i}=await t.read();if(i)break;c+=r.decode(e,{stream:!0});let o;for(;(o=c.indexOf(` 14 15`))>=0;){let e=c.slice(0,o);c=c.slice(o+2);let t=e.split(` 16`),r=t.find(e=>e.startsWith(`event:`))?.slice(6).trim(),i=t.filter(e=>e.startsWith(`data:`)).map(e=>e.slice(5).replace(/^ /,``));if(i.length===0){e.trim()&&a?.();continue}if(r!==`timeout`)try{n(JSON.parse(i.join(` 17`)))}catch{}}}i?.()}catch(e){if(e.name===`AbortError`)return;r?.(e)}})().catch(e=>{console.error(`[sse] ingestion stream callback threw`,e)}),()=>o.abort()}function If(e,t,n,r,i){let a=new AbortController,o=localStorage.getItem(Ou),s=new URLSearchParams({source_url:t});o&&s.set(`access_token`,o);let c=`${wu.VITE_PINCHAT_API_BASE}/api/${Eu()}${pf}/${encodeURIComponent(e)}/datasources/preview-urls/stream?${s.toString()}`;return(async()=>{try{let e=await fetch(c,{method:`GET`,headers:{Accept:`text/event-stream`},signal:a.signal});if(!e.ok||!e.body)throw Error(`Preview URLs SSE open failed: ${e.status}`);let t=e.body.getReader(),o=new TextDecoder,s=``;for(;;){let{value:e,done:i}=await t.read();if(i)break;s+=o.decode(e,{stream:!0});let a;for(;(a=s.indexOf(` 18 19`))>=0;){let e=s.slice(0,a);s=s.slice(a+2);let t=e.split(` 20`).filter(e=>e.startsWith(`data:`)).map(e=>e.slice(5).replace(/^ /,``));if(t.length!==0)try{let e=JSON.parse(t.join(` 21`));if(e.type===`error`){r?.(Error(e.message||`Crawl failed`));return}n(e.urls_found??[],e.progress??0)}catch{}}}i?.()}catch(e){if(e.name===`AbortError`)return;r?.(e)}})().catch(e=>{console.error(`[sse] preview-urls stream callback threw`,e)}),()=>a.abort()}function Lf(e){if(!e)return null;let t=e.subAccount?.name||e.display_name||e.name||e.email||``,n=e.subAccount?e.subAccount.avatar:e.avatar;return{id:e.id==null?``:String(e.id),name:t,email:e.email??``,avatar:n??void 0,plan:e.plan_uid??``}}function Rf(e){if(typeof window>`u`)return;let t=e?.chatToken;typeof t==`string`&&t.length>0&&localStorage.setItem(ju,t);let n=e?.clientKey;typeof n==`string`&&n.length>0?localStorage.setItem(Mu,n):localStorage.removeItem(Mu)}var zf=xu()(e=>({user:null,userSetting:null,setUser:t=>{Rf(t),typeof window<`u`&&(t?.subAccount?localStorage.setItem(Pu,`1`):localStorage.removeItem(Pu)),e({user:Lf(t),userSetting:t})},logout:()=>{cd(),typeof window<`u`&&localStorage.removeItem(Pu),e({user:null,userSetting:null})}}));typeof window<`u`&&window.addEventListener(Fu,()=>{zf.setState({user:null,userSetting:null})});var Bf=()=>void 0,Vf=function(e){let t=[],n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=i&63|128):(i&64512)==55296&&r+1<e.length&&(e.charCodeAt(r+1)&64512)==56320?(i=65536+((i&1023)<<10)+(e.charCodeAt(++r)&1023),t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=i&63|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=i&63|128)}return t},Hf=function(e){let t=[],n=0,r=0;for(;n<e.length;){let i=e[n++];if(i<128)t[r++]=String.fromCharCode(i);else if(i>191&&i<224){let a=e[n++];t[r++]=String.fromCharCode((i&31)<<6|a&63)}else if(i>239&&i<365){let a=e[n++],o=e[n++],s=e[n++],c=((i&7)<<18|(a&63)<<12|(o&63)<<6|s&63)-65536;t[r++]=String.fromCharCode(55296+(c>>10)),t[r++]=String.fromCharCode(56320+(c&1023))}else{let a=e[n++],o=e[n++];t[r++]=String.fromCharCode((i&15)<<12|(a&63)<<6|o&63)}}return t.join(``)},Uf={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789`,get ENCODED_VALS(){return this.ENCODED_VALS_BASE+`+/=`},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+`-_.`},HAS_NATIVE_SUPPORT:typeof atob==`function`,encodeByteArray(e,t){if(!Array.isArray(e))throw Error(`encodeByteArray takes an array as a parameter`);this.init_();let n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let t=0;t<e.length;t+=3){let i=e[t],a=t+1<e.length,o=a?e[t+1]:0,s=t+2<e.length,c=s?e[t+2]:0,l=i>>2,u=(i&3)<<4|o>>4,d=(o&15)<<2|c>>6,f=c&63;s||(f=64,a||(d=64)),r.push(n[l],n[u],n[d],n[f])}return r.join(``)},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(Vf(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):Hf(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();let n=t?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let t=0;t<e.length;){let i=n[e.charAt(t++)],a=t<e.length?n[e.charAt(t)]:0;++t;let o=t<e.length?n[e.charAt(t)]:64;++t;let s=t<e.length?n[e.charAt(t)]:64;if(++t,i==null||a==null||o==null||s==null)throw new Wf;let c=i<<2|a>>4;if(r.push(c),o!==64){let e=a<<4&240|o>>2;if(r.push(e),s!==64){let e=o<<6&192|s;
21r.push(e)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}},Wf=class extends Error{constructor(){super(...arguments),this.name=`DecodeBase64StringError`}},Gf=function(e){let t=Vf(e);return Uf.encodeByteArray(t,!0)},Kf=function(e){return Gf(e).replace(/\./g,``)},qf=function(e){try{return Uf.decodeString(e,!0)}catch(e){console.error(`base64Decode failed: `,e)}return null};function Jf(){if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(typeof global<`u`)return global;throw Error(`Unable to locate global object.`)}var Yf=()=>Jf().__FIREBASE_DEFAULTS__,Xf=()=>{if(typeof process>`u`)return;let e={}.__FIREBASE_DEFAULTS__;if(e)return JSON.parse(e)},Zf=()=>{if(typeof document>`u`)return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}let t=e&&qf(e[1]);return t&&JSON.parse(t)},Qf=()=>{try{return Bf()||Yf()||Xf()||Zf()}catch(e){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`);return}},$f=e=>Qf()?.emulatorHosts?.[e],ep=()=>Qf()?.config,tp=e=>Qf()?.[`_${e}`],np=class{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(e){return(t,n)=>{t?this.reject(t):this.resolve(n),typeof e==`function`&&(this.promise.catch(()=>{}),e.length===1?e(t):e(t,n))}}};function rp(e){try{return(e.startsWith(`http://`)||e.startsWith(`https://`)?new URL(e).hostname:e).endsWith(`.cloudworkstations.dev`)}catch{return!1}}async function ip(e){return(await fetch(e,{credentials:`include`})).ok}var ap={};function op(){let e={prod:[],emulator:[]};for(let t of Object.keys(ap))ap[t]?e.emulator.push(t):e.prod.push(t);return e}function sp(e){let t=document.getElementById(e),n=!1;return t||(t=document.createElement(`div`),t.setAttribute(`id`,e),n=!0),{created:n,element:t}}var cp=!1;function lp(e,t){if(typeof window>`u`||typeof document>`u`||!rp(window.location.host)||ap[e]===t||ap[e]||cp)return;ap[e]=t;function n(e){return`__firebase__banner__${e}`}let r=`__firebase__banner`,i=op().prod.length>0;function a(){let e=document.getElementById(r);e&&e.remove()}function o(e){e.style.display=`flex`,e.style.background=`#7faaf0`,e.style.position=`fixed`,e.style.bottom=`5px`,e.style.left=`5px`,e.style.padding=`.5em`,e.style.borderRadius=`5px`,e.style.alignItems=`center`}function s(e,t){e.setAttribute(`width`,`24`),e.setAttribute(`id`,t),e.setAttribute(`height`,`24`),e.setAttribute(`viewBox`,`0 0 24 24`),e.setAttribute(`fill`,`none`),e.style.marginLeft=`-6px`}function c(){let e=document.createElement(`span`);return e.style.cursor=`pointer`,e.style.marginLeft=`16px`,e.style.fontSize=`24px`,e.innerHTML=` ×`,e.onclick=()=>{cp=!0,a()},e}function l(e,t){e.setAttribute(`id`,t),e.innerText=`Learn more`,e.href=`https://firebase.google.com/docs/studio/preview-apps#preview-backend`,e.setAttribute(`target`,`__blank`),e.style.paddingLeft=`5px`,e.style.textDecoration=`underline`}function u(){let e=sp(r),t=n(`text`),a=document.getElementById(t)||document.createElement(`span`),u=n(`learnmore`),d=document.getElementById(u)||document.createElement(`a`),f=n(`preprendIcon`),p=document.getElementById(f)||document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);if(e.created){let t=e.element;o(t),l(d,u);let n=c();s(p,f),t.append(p,a,d,n),document.body.appendChild(t)}i?(a.innerText=`Preview backend disconnected.`,p.innerHTML=`<g clip-path="url(#clip0_6013_33858)"> 22<path d="M4.8 17.6L12 5.6L19.2 17.6H4.8ZM6.91667 16.4H17.0833L12 7.93333L6.91667 16.4ZM12 15.6C12.1667 15.6 12.3056 15.5444 12.4167 15.4333C12.5389 15.3111 12.6 15.1667 12.6 15C12.6 14.8333 12.5389 14.6944 12.4167 14.5833C12.3056 14.4611 12.1667 14.4 12 14.4C11.8333 14.4 11.6889 14.4611 11.5667 14.5833C11.4556 14.6944 11.4 14.8333 11.4 15C11.4 15.1667 11.4556 15.3111 11.5667 15.4333C11.6889 15.5444 11.8333 15.6 12 15.6ZM11.4 13.6H12.6V10.4H11.4V13.6Z" fill="#212121"/> 23</g> 24<defs> 25<clipPath id="clip0_6013_33858"> 26<rect width="24" height="24" fill="white"/> 27</clipPath> 28</defs>`):(p.innerHTML=`<g clip-path="url(#clip0_6083_34804)"> 29<path d="M11.4 15.2H12.6V11.2H11.4V15.2ZM12 10C12.1667 10 12.3056 9.94444
2912.4167 9.83333C12.5389 9.71111 12.6 9.56667 12.6 9.4C12.6 9.23333 12.5389 9.09444 12.4167 8.98333C12.3056 8.86111 12.1667 8.8 12 8.8C11.8333 8.8 11.6889 8.86111 11.5667 8.98333C11.4556 9.09444 11.4 9.23333 11.4 9.4C11.4 9.56667 11.4556 9.71111 11.5667 9.83333C11.6889 9.94444 11.8333 10 12 10ZM12 18.4C11.1222 18.4 10.2944 18.2333 9.51667 17.9C8.73889 17.5667 8.05556 17.1111 7.46667 16.5333C6.88889 15.9444 6.43333 15.2611 6.1 14.4833C5.76667 13.7056 5.6 12.8778 5.6 12C5.6 11.1111 5.76667 10.2833 6.1 9.51667C6.43333 8.73889 6.88889 8.06111 7.46667 7.48333C8.05556 6.89444 8.73889 6.43333 9.51667 6.1C10.2944 5.76667 11.1222 5.6 12 5.6C12.8889 5.6 13.7167 5.76667 14.4833 6.1C15.2611 6.43333 15.9389 6.89444 16.5167 7.48333C17.1056 8.06111 17.5667 8.73889 17.9 9.51667C18.2333 10.2833 18.4 11.1111 18.4 12C18.4 12.8778 18.2333 13.7056 17.9 14.4833C17.5667 15.2611 17.1056 15.9444 16.5167 16.5333C15.9389 17.1111 15.2611 17.5667 14.4833 17.9C13.7167 18.2333 12.8889 18.4 12 18.4ZM12 17.2C13.4444 17.2 14.6722 16.6944 15.6833 15.6833C16.6944 14.6722 17.2 13.4444 17.2 12C17.2 10.5556 16.6944 9.32778 15.6833 8.31667C14.6722 7.30555 13.4444 6.8 12 6.8C10.5556 6.8 9.32778 7.30555 8.31667 8.31667C7.30556 9.32778 6.8 10.5556 6.8 12C6.8 13.4444 7.30556 14.6722 8.31667 15.6833C9.32778 16.6944 10.5556 17.2 12 17.2Z" fill="#212121"/> 30</g> 31<defs> 32<clipPath id="clip0_6083_34804"> 33<rect width="24" height="24" fill="white"/> 34</clipPath> 35</defs>`,a.innerText=`Preview backend running in this workspace.`),a.setAttribute(`id`,t)}document.readyState===`loading`?window.addEventListener(`DOMContentLoaded`,u):u()}function up(){return typeof navigator<`u`&&typeof navigator.userAgent==`string`?navigator.userAgent:``}function dp(){return typeof window<`u`&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(up())}function fp(){return typeof navigator<`u`&&navigator.userAgent===`Cloudflare-Workers`}function pp(){let e=typeof chrome==`object`?chrome.runtime:typeof browser==`object`?browser.runtime:void 0;return typeof e==`object`&&e.id!==void 0}function mp(){return typeof navigator==`object`&&navigator.product===`ReactNative`}function hp(){let e=up();return e.indexOf(`MSIE `)>=0||e.indexOf(`Trident/`)>=0}function gp(){try{return typeof indexedDB==`object`}catch{return!1}}function _p(){return new Promise((e,t)=>{try{let n=!0,r=`validate-browser-context-for-indexeddb-analytics-module`,i=self.indexedDB.open(r);i.onsuccess=()=>{i.result.close(),n||self.indexedDB.deleteDatabase(r),e(!0)},i.onupgradeneeded=()=>{n=!1},i.onerror=()=>{t(i.error?.message||``)}}catch(e){t(e)}})}function vp(){return!(typeof navigator>`u`||!navigator.cookieEnabled)}var yp=`FirebaseError`,bp=class e extends Error{constructor(t,n,r){super(n),this.code=t,this.customData=r,this.name=yp,Object.setPrototypeOf(this,e.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,xp.prototype.create)}},xp=class{constructor(e,t,n){this.service=e,this.serviceName=t,this.errors=n}create(e,...t){let n=t[0]||{},r=`${this.service}/${e}`,i=this.errors[e],a=i?Sp(i,n):`Error`;return new bp(r,`${this.serviceName}: ${a} (${r}).`,n)}};function Sp(e,t){return e.replace(Cp,(e,n)=>{let r=t[n];return r==null?`<${n}?>`:String(r)})}var Cp=/\{\$([^}]+)}/g;function wp(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function Tp(e,t){if(e===t)return!0;let n=Object.keys(e),r=Object.keys(t);for(let i of n){if(!r.includes(i))return!1;let n=e[i],a=t[i];if(Ep(n)&&Ep(a)){if(!Tp(n,a))return!1}else if(n!==a)return!1}for(let e of r)if(!n.includes(e))return!1;return!0}function Ep(e){return typeof e==`object`&&!!e}function Dp(e){let t=[];for(let[n,r]of Object.entries(e))Array.isArray(r)?r.forEach(e=>{t.push(encodeURIComponent(n)+`=`+encodeURIComponent(e))}):t.push(encodeURIComponent(n)+`=`+encodeURIComponent(r));return t.length?`&`+t.join(`&`):``}function Op(e){let t={};return e.replace(/^\?/,``).split(`&`).forEach(e=>{if(e){let[n,r]=e.split(`=`);t[decodeURIComponent(n)]=decodeURIComponent(r)}}),t}function kp(e){let t=e.indexOf(`?`);if(!t)return``;let n=e.indexOf(`#`,t);return e.substring(t,n>0?n:void 0)}function Ap(e,t){let n=new jp(e,t);return n.subscribe.bind(n)}var jp=class{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Prom
35ise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(()=>{e(this)}).catch(e=>{this.error(e)})}next(e){this.forEachObserver(t=>{t.next(e)})}error(e){this.forEachObserver(t=>{t.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,t,n){let r;if(e===void 0&&t===void 0&&n===void 0)throw Error(`Missing Observer.`);r=Mp(e,[`next`,`error`,`complete`])?e:{next:e,error:t,complete:n},r.next===void 0&&(r.next=Np),r.error===void 0&&(r.error=Np),r.complete===void 0&&(r.complete=Np);let i=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?r.error(this.finalError):r.complete()}catch{}}),this.observers.push(r),i}unsubscribeOne(e){this.observers===void 0||this.observers[e]===void 0||(delete this.observers[e],--this.observerCount,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t<this.observers.length;t++)this.sendOne(t,e)}sendOne(e,t){this.task.then(()=>{if(this.observers!==void 0&&this.observers[e]!==void 0)try{t(this.observers[e])}catch(e){typeof console<`u`&&console.error&&console.error(e)}})}close(e){this.finalized||(this.finalized=!0,e!==void 0&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}};function Mp(e,t){if(typeof e!=`object`||!e)return!1;for(let n of t)if(n in e&&typeof e[n]==`function`)return!0;return!1}function Np(){}var Pp=1e3,Fp=2,Ip=14400*1e3,Lp=.5;function Rp(e,t=Pp,n=Fp){let r=t*n**+e,i=Math.round(Lp*r*(Math.random()-.5)*2);return Math.min(Ip,r+i)}function zp(e){return e&&e._delegate?e._delegate:e}var Bp=class{constructor(e,t,n){this.name=e,this.instanceFactory=t,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode=`LAZY`,this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}},Vp=`[DEFAULT]`,Hp=class{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){let t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){let e=new np;if(this.instancesDeferred.set(t,e),this.isInitialized(t)||this.shouldAutoInitialize())try{let n=this.getOrInitializeService({instanceIdentifier:t});n&&e.resolve(n)}catch{}}return this.instancesDeferred.get(t).promise}getImmediate(e){let t=this.normalizeInstanceIdentifier(e?.identifier),n=e?.optional??!1;if(this.isInitialized(t)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:t})}catch(e){if(n)return null;throw e}else if(n)return null;else throw Error(`Service ${this.name} is not available`)}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,this.shouldAutoInitialize()){if(Wp(e))try{this.getOrInitializeService({instanceIdentifier:Vp})}catch{}for(let[e,t]of this.instancesDeferred.entries()){let n=this.normalizeInstanceIdentifier(e);try{let e=this.getOrInitializeService({instanceIdentifier:n});t.resolve(e)}catch{}}}}clearInstance(e=Vp){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){let e=Array.from(this.instances.values());await Promise.all([...e.filter(e=>`INTERNAL`in e).map(e=>e.INTERNAL.delete()),...e.filter(e=>`_delete`in e).map(e=>e._delete())])}isComponentSet(){return this.component!=null}isInitialized(e=Vp){return this.instances.has(e)}getOptions(e=Vp){return this.instancesOptions.get(e)||{}}initialize(e={}){let{options:t={}}=e,n=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(n))throw Error(`${this.name}(${n}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);let r=this.getOrInitializeService({instanceIdentifier:n,options:t});for(let[e,t]of this.instancesDeferred.entries())n===this.normalizeInstanceIdentifier(e)&&t.resolve(r);return r}onInit(e,t){let n=this.normalizeInstanceIdentifier(t),r=this.onInitCallbacks.get(n)??new Set;r.add(e),this.onInitCallbacks.set(n,r);let i=this.instances.get(n);return i&&e(i,n),()=>{r.delete(e)}}invokeOnInitCallbacks(e,t){let n=this.onInitCallbacks.get(t);if(n)for(let r of n)try{r(e,t)}catch{}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let n=this.instances.get(e);if(!n&&this.component&&(n=this.component.instanceFactory(this.container,{instanceIdentifier:Up(e),options:t}),this.instances.set(e,n),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(n,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,n)}catch{}return n||null}normalizeInstanceIdentifier(e=Vp){return this.component?this.component.multipleInstances?e:Vp:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!==`EXPLICIT`}};function Up(e){return e===Vp?void 0:e}function Wp(e){return e.instantiationMode===`EAGER`}var Gp=class{constructor(e){this.name=e,this.providers=new Map}addComponent(e){let t=this.getProvider(e.name);if(t.isComponentSet())throw Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);let t=new Hp(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}},Kp=[],qp;(function(e){e[e.DEBUG=0]=`DEBUG`,e[e.VERBOSE=1]=`VERBOSE`,e[e.INFO=2]=`INFO`,e[e.WARN=3]=`WARN`,e[e.ERROR=4]=`ERROR`,e[e.SILENT=5]=`SILENT`})(qp||={});var Jp={debug:qp.DEBUG,verbose:qp.VERBOSE,info:qp.INFO,warn:qp.WARN,error:qp.ERROR,silent:qp.SILENT},Yp=qp.INFO,Xp={[qp.DEBUG]:`log`,[qp.VERBOSE]:`log`,[qp.INFO]:`info`,[qp.WARN]:`warn`,[qp.ERROR]:`error`},Zp=(e,t,...n)=>{if(t<e.logLevel)return;let r=new Date().toISOString(),i=Xp[t];
vendor: 4,142 bytes, line 35
35if(i)console[i](`[${r}] ${e.name}:`,...n);else throw Error(`Attempted to log a message with an invalid logType (value: ${t})`)},Qp=class{constructor(e){this.name=e,this._logLevel=Yp,this._logHandler=Zp,this._userLogHandler=null,Kp.push(this)}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in qp))throw TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel=typeof e==`string`?Jp[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if(typeof e!=`function`)throw TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,qp.DEBUG,...e),this._logHandler(this,qp.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,qp.VERBOSE,...e),this._logHandler(this,qp.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,qp.INFO,...e),this._logHandler(this,qp.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,qp.WARN,...e),this._logHandler(this,qp.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,qp.ERROR,...e),this._logHandler(this,qp.ERROR,...e)}},$p=(e,t)=>t.some(t=>e instanceof t),em,tm;function nm(){return em||=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]}function rm(){return tm||=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey]}var im=new WeakMap,am=new WeakMap,om=new WeakMap,sm=new WeakMap,cm=new WeakMap;function eee(e){let t=new Promise((t,n)=>{let r=()=>{e.removeEventListener(`success`,i),e.removeEventListener(`error`,a)},i=()=>{t(pm(e.result)),r()},a=()=>{n(e.error),r()};e.addEventListener(`success`,i),e.addEventListener(`error`,a)});return t.then(t=>{t instanceof IDBCursor&&im.set(t,e)}).catch(()=>{}),cm.set(t,e),t}function tee(e){if(am.has(e))return;let t=new Promise((t,n)=>{let r=()=>{e.removeEventListener(`complete`,i),e.removeEventListener(`error`,a),e.removeEventListener(`abort`,a)},i=()=>{t(),r()},a=()=>{n(e.error||new DOMException(`AbortError`,`AbortError`)),r()};e.addEventListener(`complete`,i),e.addEventListener(`error`,a),e.addEventListener(`abort`,a)});am.set(e,t)}var lm={get(e,t,n){if(e instanceof IDBTransaction){if(t===`done`)return am.get(e);if(t===`objectStoreNames`)return e.objectStoreNames||om.get(e);if(t===`store`)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return pm(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&(t===`done`||t===`store`)?!0:t in e}};function um(e){lm=e(lm)}function dm(e){return e===IDBDatabase.prototype.transaction&&!(`objectStoreNames`in IDBTransaction.prototype)?function(t,...n){let r=e.call(mm(this),t,...n);return om.set(r,t.sort?t.sort():[t]),pm(r)}:rm().includes(e)?function(...t){return e.apply(mm(this),t),pm(im.get(this))}:function(...t){return pm(e.apply(mm(this),t))}}function fm(e){return typeof e==`function`?dm(e):(e instanceof IDBTransaction&&tee(e),$p(e,nm())?new Proxy(e,lm):e)}function pm(e){if(e instanceof IDBRequest)return eee(e);if(sm.has(e))return sm.get(e);let t=fm(e);return t!==e&&(sm.set(e,t),cm.set(t,e)),t}var mm=e=>cm.get(e);function hm(e,t,{blocked:n,upgrade:r,blocking:i,terminated:a}={}){let o=indexedDB.open(e,t),s=pm(o);return r&&o.addEventListener(`upgradeneeded`,e=>{r(pm(o.result),e.oldVersion,e.newVersion,pm(o.transaction),e)}),n&&o.addEventListener(`blocked`,e=>n(e.oldVersion,e.newVersion,e)),s.then(e=>{a&&e.addEventListener(`close`,()=>a()),i&&e.addEventListener(`versionchange`,e=>i(e.oldVersion,e.newVersion,e))}).catch(()=>{}),s}var gm=[`get`,`getKey`,`getAll`,`getAllKeys`,`count`],_m=[`put`,`add`,`delete`,`clear`],vm=new Map;function ym(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t==`string`))return;if(vm.get(t))return vm.get(t);let n=t.replace(/FromIndex$/,``),r=t!==n,i=_m.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(i||gm.includes(n)))return;let a=async function(e,...t){let a=this.transaction(e,i?`readwrite`:`readonly`),o=a.store;
35return r&&(o=o.index(t.shift())),(await Promise.all([o[n](...t),i&&a.done]))[0]};return vm.set(t,a),a}um(e=>({...e,get:(t,n,r)=>ym(t,n)||e.get(t,n,r),has:(t,n)=>!!ym(t,n)||e.has(t,n)}));var bm=class{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(e=>{if(xm(e)){let t=e.getImmediate();return`${t.library}/${t.version}`}else return null}).filter(e=>e).join(` `)}};function xm(e){return e.getComponent()?.type===`VERSION`}var Sm=`@firebase/app`,Cm=`0.13.2`,wm=new Qp(`@firebase/app`),Tm=`@firebase/app-compat`,Em=`@firebase/analytics-compat`,Dm=`@firebase/analytics`,Om=`@firebase/app-check-compat`,km=`@firebase/app-check`,Am=`@firebase/auth`,jm=`@firebase/auth-compat`,Mm=`@firebase/database`,Nm=`@firebase/data-connect`,Pm=`@firebase/database-compat`,Fm=`@firebase/functions`,Im=`@firebase/functions-compat`,Lm=`@firebase/installations`,Rm=`@firebase/installations-compat`,zm=`@firebase/messaging`,Bm=`@firebase/messaging-compat`,Vm=`@firebase/performance`,Hm=`@firebase/performance-compat`,Um=`@firebase/remote-config`,Wm=`@firebase/remote-config-compat`,Gm=`@firebase/storage`,Km=`@firebase/storage-compat`,qm=`@firebase/firestore`,Jm=`@firebase/ai`,Ym=`@firebase/firestore-compat`,Xm=`firebase`,Zm=`11.10.0`,Qm=`[DEFAULT]`,$m={[Sm]:`fire-core`,[Tm]:`fire-core-compat`,[Dm]:`fire-analytics`,[Em]:`fire-analytics-compat`,[km]:`fire-app-check`,[Om]:`fire-app-check-compat`,[Am]:`fire-auth`,[jm]:`fire-auth-compat`,[Mm]:`fire-rtdb`,[Nm]:`fire-data-connect`,[Pm]:`fire-rtdb-compat`,[Fm]:`fire-fn`,[Im]:`fire-fn-compat`,[Lm]:`fire-iid`,[Rm]:`fire-iid-compat`,[zm]:`fire-fcm`,[Bm]:`fire-fcm-compat`,[Vm]:`fire-perf`,[Hm]:`fire-perf-compat`,[Um]:`fire-rc`,[Wm]:`fire-rc-compat`,[Gm]:`fire-gcs`,[Km]:`fire-gcs-compat`,[qm]:`fire-fst`,[Ym]:`fire-fst-compat`,[Jm]:`fire-vertex`,"fire-js":`fire-js`,[Xm]:`fire-js-all`},eh=new Map,nee=new Map,th=new Map;function nh(e,t){try{e.container.addComponent(t)}catch(n){wm.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,n)}}function rh(e){let t=e.name;if(th.has(t))return wm.debug(`There were multiple attempts to register component ${t}.`),!1;th.set(t,e);for(let t of eh.values())nh(t,e);for(let t of nee.values())nh(t,e);return!0}function ih(e,t){let n=e.container.getProvider(`heartbeat`).getImmediate({optional:!0});return n&&n.triggerHeartbeat(),e.container.getProvider(t)}function ah(e){return e==null?!1:e.settings!==void 0}var oh=new xp(`app`,`Firebase`,{"no-app":`No Firebase App '{$appName}' has been created - call initializeApp() first`,"bad-app-name":`Illegal App name: '{$appName}'`,"duplicate-app":`Firebase App named '{$appName}' already exists with different options or config`,"app-deleted":`Firebase App named '{$appName}' already deleted`,"server-app-deleted":`Firebase Server App has been deleted`,"no-options":`Need to provide options, when not being deployed to hosting via source.`,"invalid-app-argument":`firebase.{$appName}() takes either no argument or a Firebase App instance.`,"invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":`Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.`,"idb-get":`Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.`,"idb-set":`Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.`,"idb-delete":`Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.`,"finalization-registry-not-supported":`FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.`,"invalid-server-app-environment":`FirebaseServerApp is not for use in browser environments.`}),sh=class{constructor(e,t,n){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=n,this.container.addComponent(new Bp(`app`,()=>this,`PUBLIC`))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw oh.create(`app-deleted`,{appName:this._name})}},ch=Zm;function lh(e,t={}){let n=e;typeof t!=`object`&&(t={name:t});let r=Object.assign({name:Qm,automaticDataCollectionEnabled:!0},t),i=r.name;if(typeof i!=`string`||!i)throw oh.create(`bad-app-name`,{appName:String(i)});if(n||=ep(),!n)throw oh.create(`no-options`);let a=eh.get(i);if(a){if(Tp(n,a.options)&&Tp(r,a.config))return a;throw oh.create(`duplicate-app`,{appName:i})}let o=new Gp(i);for(let e of th.values())o.addComponent(e);let s=new sh(n,r,o);return eh.set(i,s),s}function uh(e=Qm){let t=eh.get(e);if(!t&&e===`[DEFAULT]`&&ep())return lh();if(!t)throw oh.create(`no-app`,{appName:e});return t}function dh(e,t,n){let r=$m[e]??e;n&&(r+=`-${n}`);let i=r.match(/\s|\//),a=t.match(/\s|\//);if(i||a){let e=[`Unable to register library "${r}" with version "${t}":`];i&&e.push(`library name "${r}" contains illegal characters (whitespace or "/")`),i&&a&&e.push(`and`),a&&e.push(`version name "${t}" contains illegal characters (whitespace or "/")`),wm.warn(e.join(` `));return}rh(new Bp(`${r}-version`,()=>({library:r,version:t}),`VERSION`))}var fh=`firebase-heartbeat-database`,ph=1,mh=`firebase-heartbeat-store`,hh=null;function gh(){return hh||=hm(fh,ph,{upgrade:(e,t)=>{switch(t){case 0:try{e.createObjectStore(mh)}catch(e){console.warn(e)}}}}).catch(e=>{throw oh.create(`idb-open`,{originalErrorMessage:e.message})}),hh}async function _h(e){try{let t=(await gh()).transaction(mh),n=await t.objectStore(mh).get(yh(e));return await t.done,n}catch(e){if(e instanceof bp)wm.warn(e.message);else{let t=oh.create(`idb-get`,{originalErrorMessage:e?.message});wm.warn(t.message)}}}async function vh(e,t){try{let n=(await gh()).transaction(mh,`readwrite`);await n.objectStore(mh).put(t,yh(e)),await n.done}catch(e){if(e instanceof bp)wm.warn(e.message);else{let t=oh.create(`idb-set`,{originalErrorMessage:e?.message});wm.warn(t.message)}}}function yh(e){return`${e.name}!${e.options.appId}`}var bh=1024,xh=30,Sh=class{constructor(e){this.container=e,this._heartbeatsCache=null,this._storage=new Th(this.container.getProvider(`app`).getImmediate()),this._heartbeatsCachePromise=this._storage.read().then(e=>(this._heartbeatsCache=e,e))}async triggerHeartbeat(){try{let e=this.container.getProvider(`platform-logger`).getImmediate().getPlatformInfoString(),t=Ch();if(this._heartbeatsCache?.heartbeats==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,this._heartbeatsCache?.heartbeats==null)||this._heartbeatsCache.lastSentHeartbeatDate===t||this._heartbeatsCache.heartbeats.some(e=>e.date===t))return;if(this._heartbeatsCache.heartbeats.push({date:t,agent:e}),this._heartbeatsCache.heartbeats.length>xh){let e=Dh(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(e,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(e){wm.warn(e)}}async getHeartbeatsHeader(){try{if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,this._heartbeatsCache?.heartbeats==null||this._heartbeatsCache.heartbeats.length===0)return``;let e=Ch(),{heartbeatsToSend:t,unsentEntries:n}=wh(this._heartbeatsCache.heartbeats),r=Kf(JSON.stringify({version:2,heartbeats:t}));return this._heartbeatsCache.lastSentHeartbeatDate=e,n.length>0?(this._heartbeatsCache.heartbeats=n,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),r}catch(e){return wm.warn(e),``}}};function Ch(){return new Date().toISOString().substring(0,10)}function wh(e,t=bh){let n=[],r=e.slice();for(let i of e){let e=n.find(e=>e.agent===i.agent);if(!e){if(n.push({agent:i.agent,dates:[i.date]}),Eh(n)>t){n.pop();break}}else if(e.dates.push(i.date),Eh(n)>t){e.dates.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}var Th=class{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return gp()?_p().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){let e=await _h(this.app);return e?.heartbeats?e:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(e){if(await this._canUseIndexedDBPromise){let t=await this.read();return vh(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??t.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){if(await this._canUseIndexedDBPromise){let t=await this.read();return vh(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??t.lastSentHeartbeatDate,heartbeats:[...t.heartbeats,...e.heartbeats]})}else return}};function Eh(e){return Kf(JSON.stringify({version:2,heartbeats:e})).length}function Dh(e){if(e.length===0)return-1;let t=0,n=e[0].date;for(let r=1;r<e.length;r++)e[r].date<n&&(n=e[r].date,t=r);return t}function Oh(e){rh(new Bp(`platform-logger`,e=>new bm(e),`PRIVATE`)),rh(new Bp(`heartbeat`,e=>new Sh(e),`PRIVATE`)),dh(Sm,Cm,e),dh(Sm,Cm,`esm2017`),dh(`fire-js`,``)}Oh(``);var kh=`@firebase/installations`,Ah=`0.6.18`,jh=1e4,Mh=`w:${Ah}`,Nh=`FIS_v2`,Ph=`https://firebaseinstallations.googleapis.com/v1`,Fh=3600*1e3,Ih=new xp(`installations`,`Installations`,{"missing-app-config-values":`Missing App configuration value: "{$valueName}"`,"not-registered":`Firebase Installation is not registered.`,"installation-not-found":`Firebase Installation not found.`,"request-failed":`{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"`,"app-offline":`Could not process request. Application offline.`,"delete-pending-registration":`Can't delete installation while there is a pending registration request.`});function Lh(e){return e instanceof bp&&e.code.includes(`request-failed`)}function Rh({projectId:e}){return`${Ph}/projects/${e}/installations`}
35function zh(e){return{token:e.token,requestStatus:2,expiresIn:Wh(e.expiresIn),creationTime:Date.now()}}async function Bh(e,t){let n=(await t.json()).error;return Ih.create(`request-failed`,{requestName:e,serverCode:n.code,serverMessage:n.message,serverStatus:n.status})}function Vh({apiKey:e}){return new Headers({"Content-Type":`application/json`,Accept:`application/json`,"x-goog-api-key":e})}function Hh(e,{refreshToken:t}){let n=Vh(e);return n.append(`Authorization`,Gh(t)),n}async function Uh(e){let t=await e();return t.status>=500&&t.status<600?e():t}function Wh(e){return Number(e.replace(`s`,`000`))}function Gh(e){return`${Nh} ${e}`}async function Kh({appConfig:e,heartbeatServiceProvider:t},{fid:n}){let r=Rh(e),i=Vh(e),a=t.getImmediate({optional:!0});if(a){let e=await a.getHeartbeatsHeader();e&&i.append(`x-firebase-client`,e)}let o={fid:n,authVersion:Nh,appId:e.appId,sdkVersion:Mh},s={method:`POST`,headers:i,body:JSON.stringify(o)},c=await Uh(()=>fetch(r,s));if(c.ok){let e=await c.json();return{fid:e.fid||n,registrationStatus:2,refreshToken:e.refreshToken,authToken:zh(e.authToken)}}else throw await Bh(`Create Installation`,c)}function qh(e){return new Promise(t=>{setTimeout(t,e)})}function Jh(e){return btoa(String.fromCharCode(...e)).replace(/\+/g,`-`).replace(/\//g,`_`)}var Yh=/^[cdef][\w-]{21}$/,Xh=``;function Zh(){try{let e=new Uint8Array(17);(self.crypto||self.msCrypto).getRandomValues(e),e[0]=112+e[0]%16;let t=Qh(e);return Yh.test(t)?t:Xh}catch{return Xh}}function Qh(e){return Jh(e).substr(0,22)}function $h(e){return`${e.appName}!${e.appId}`}var eg=new Map;function tg(e,t){let n=$h(e);ng(n,t),rg(n,t)}function ng(e,t){let n=eg.get(e);if(n)for(let e of n)e(t)}function rg(e,t){let n=ag();n&&n.postMessage({key:e,fid:t}),og()}var ig=null;function ag(){return!ig&&`BroadcastChannel`in self&&(ig=new BroadcastChannel(`[Firebase] FID Change`),ig.onmessage=e=>{ng(e.data.key,e.data.fid)}),ig}function og(){eg.size===0&&ig&&(ig.close(),ig=null)}var sg=`firebase-installations-database`,cg=1,lg=`firebase-installations-store`,ug=null;function dg(){return ug||=hm(sg,cg,{upgrade:(e,t)=>{switch(t){case 0:e.createObjectStore(lg)}}}),ug}async function fg(e,t){let n=$h(e),r=(await dg()).transaction(lg,`readwrite`),i=r.objectStore(lg),a=await i.get(n);return await i.put(t,n),await r.done,(!a||a.fid!==t.fid)&&tg(e,t.fid),t}async function pg(e){let t=$h(e),n=(await dg()).transaction(lg,`readwrite`);await n.objectStore(lg).delete(t),await n.done}async function mg(e,t){let n=$h(e),r=(await dg()).transaction(lg,`readwrite`),i=r.objectStore(lg),a=await i.get(n),o=t(a);return o===void 0?await i.delete(n):await i.put(o,n),await r.done,o&&(!a||a.fid!==o.fid)&&tg(e,o.fid),o}async function hg(e){let t,n=await mg(e.appConfig,n=>{let r=_g(e,gg(n));return t=r.registrationPromise,r.installationEntry});return n.fid===Xh?{installationEntry:await t}:{installationEntry:n,registrationPromise:t}}function gg(e){return xg(e||{fid:Zh(),registrationStatus:0})}function _g(e,t){if(t.registrationStatus===0){if(!navigator.onLine)return{installationEntry:t,registrationPromise:Promise.reject(Ih.create(`app-offline`))};let n={fid:t.fid,registrationStatus:1,registrationTime:Date.now()};return{installationEntry:n,registrationPromise:vg(e,n)}}else if(t.registrationStatus===1)return{installationEntry:t,registrationPromise:yg(e)};else return{installationEntry:t}}async function vg(e,t){try{let n=await Kh(e,t);return fg(e.appConfig,n)}catch(n){throw Lh(n)&&n.customData.serverCode===409?await pg(e.appConfig):await fg(e.appConfig,{fid:t.fid,registrationStatus:0}),n}}async function yg(e){let t=await bg(e.appConfig);for(;t.registrationStatus===1;)await qh(100),t=await bg(e.appConfig);if(t.registrationStatus===0){let{installationEntry:t,registrationPromise:n}=await hg(e);return n||t}return t}function bg(e){return mg(e,e=>{if(!e)throw Ih.create(`installation-not-found`);return xg(e)})}function xg(e){return Sg(e)?{fid:e.fid,registrationStatus:0}:e}function Sg(e){return e.registrationStatus===1&&e.registrationTime+jh<Date.now()}async function Cg({appConfig:e,heartbeatServiceProvider:t},n){let r=wg(e,n),i=Hh(e,n),a=t.getImmediate({optional:!0});if(a){let e=await a.getHeartbeatsHeader();e&&i.append(`x-firebase-client`,e)}let o={installation:{sdkVersion:Mh,appId:e.appId}},s={method:`POST`,headers:i,body:JSON.stringify(o)},c=await Uh(()=>fetch(r,s));if(c.ok)return zh(await c.json());throw await Bh(`Generate Auth Token`,c)}function wg(e,{fid:t}){return`${Rh(e)}/${t}/authTokens:generate`}async function Tg(e,t=!1){let n,r=await mg(e.appConfig,r=>{if(!kg(r))throw Ih.create(`not-registered`);let i=r.authToken;if(!t&&Ag(i))return r;if(i.requestStatus===1)return n=Eg(e,t),r;{if(!navigator.onLine)throw Ih.create(`app-offline`);let t=Mg(r);return n=Og(e,t),t}});return n?await n:r.authToken}async function Eg(e,t){let n=await Dg(e.appConfig);for(;n.authToken.requestStatus===1;)await qh(100),n=await Dg(e.appConfig);let r=n.authToken;return r.requestStatus===0?Tg(e,t):r}function Dg(e){return mg(e,e=>
35{if(!kg(e))throw Ih.create(`not-registered`);let t=e.authToken;return Ng(t)?Object.assign(Object.assign({},e),{authToken:{requestStatus:0}}):e})}async function Og(e,t){try{let n=await Cg(e,t),r=Object.assign(Object.assign({},t),{authToken:n});return await fg(e.appConfig,r),n}catch(n){if(Lh(n)&&(n.customData.serverCode===401||n.customData.serverCode===404))await pg(e.appConfig);else{let n=Object.assign(Object.assign({},t),{authToken:{requestStatus:0}});await fg(e.appConfig,n)}throw n}}function kg(e){return e!==void 0&&e.registrationStatus===2}function Ag(e){return e.requestStatus===2&&!jg(e)}function jg(e){let t=Date.now();return t<e.creationTime||e.creationTime+e.expiresIn<t+Fh}function Mg(e){let t={requestStatus:1,requestTime:Date.now()};return Object.assign(Object.assign({},e),{authToken:t})}function Ng(e){return e.requestStatus===1&&e.requestTime+jh<Date.now()}async function Pg(e){let t=e,{installationEntry:n,registrationPromise:r}=await hg(t);return r?r.catch(console.error):Tg(t).catch(console.error),n.fid}async function Fg(e,t=!1){let n=e;return await Ig(n),(await Tg(n,t)).token}async function Ig(e){let{registrationPromise:t}=await hg(e);t&&await t}function Lg(e){if(!e||!e.options)throw Rg(`App Configuration`);if(!e.name)throw Rg(`App Name`);for(let t of[`projectId`,`apiKey`,`appId`])if(!e.options[t])throw Rg(t);return{appName:e.name,projectId:e.options.projectId,apiKey:e.options.apiKey,appId:e.options.appId}}function Rg(e){return Ih.create(`missing-app-config-values`,{valueName:e})}var zg=`installations`,ree=`installations-internal`,iee=e=>{let t=e.getProvider(`app`).getImmediate();return{app:t,appConfig:Lg(t),heartbeatServiceProvider:ih(t,`heartbeat`),_delete:()=>Promise.resolve()}},aee=e=>{let t=ih(e.getProvider(`app`).getImmediate(),zg).getImmediate();return{getId:()=>Pg(t),getToken:e=>Fg(t,e)}};function oee(){rh(new Bp(zg,iee,`PUBLIC`)),rh(new Bp(ree,aee,`PRIVATE`))}oee(),dh(kh,Ah),dh(kh,Ah,`esm2017`);var Bg=`analytics`,see=`firebase_id`,cee=`origin`,Vg=60*1e3,Hg=`https://firebase.googleapis.com/v1alpha/projects/-/apps/{app-id}/webConfig`,Ug=`https://www.googletagmanager.com/gtag/js`,Wg=new Qp(`@firebase/analytics`),Gg=new xp(`analytics`,`Analytics`,{"already-exists":`A Firebase Analytics instance with the appId {$id} already exists. Only one Firebase Analytics instance can be created for each appId.`,"already-initialized":`initializeAnalytics() cannot be called again with different options than those it was initially called with. It can be called again with the same options to return the existing instance, or getAnalytics() can be used to get a reference to the already-initialized instance.`,"already-initialized-settings":`Firebase Analytics has already been initialized.settings() must be called before initializing any Analytics instanceor it will have no effect.`,"interop-component-reg-failed":`Firebase Analytics Interop Component failed to instantiate: {$reason}`,"invalid-analytics-context":`Firebase Analytics is not supported in this environment. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments. Details: {$errorInfo}`,"indexeddb-unavailable":`IndexedDB unavailable or restricted in this environment. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments. Details: {$errorInfo}`,"fetch-throttle":`The config fetch request timed out while in an exponential backoff state. Unix timestamp in milliseconds when fetch request throttling ends: {$throttleEndTimeMillis}.`,"config-fetch-failed":`Dynamic config fetch failed: [{$httpStatus}] {$responseMessage}`,"no-api-key":`The "apiKey" field is empty in the local Firebase config. Firebase Analytics requires this field tocontain a valid API key.`,"no-app-id":`The "appId" field is empty in the local Firebase config. Firebase Analytics requires this field tocontain a valid app ID.`,"no-client-id":`The "client_id" field is empty.`,"invalid-gtag-resource":`Trusted Types detected an invalid gtag resource: {$gtagURL}.`});function Kg(e){if(!e.startsWith(Ug)){let t=Gg.create(`invalid-gtag-resource`,{gtagURL:e});return Wg.warn(t.message),``}return e}function qg(e){return Promise.all(e.map(e=>e.catch(e=>e)))}function Jg(e,t){let n;return window.trustedTypes&&(n=window.trustedTypes.createPolicy(e,t)),n}function Yg(e,t){let n=Jg(`firebase-js-sdk-policy`,{createScriptURL:Kg}),r=document.createElement(`script`),i=`${Ug}?l=${e}
35&id=${t}`;r.src=n?n?.createScriptURL(i):i,r.async=!0,document.head.appendChild(r)}function Xg(e){let t=[];return Array.isArray(window[e])?t=window[e]:window[e]=t,t}async function Zg(e,t,n,r,i,a){let o=r[i];try{if(o)await t[o];else{let e=(await qg(n)).find(e=>e.measurementId===i);e&&await t[e.appId]}}catch(e){Wg.error(e)}e(`config`,i,a)}async function Qg(e,t,n,r,i){try{let a=[];if(i&&i.send_to){let e=i.send_to;Array.isArray(e)||(e=[e]);let r=await qg(n);for(let n of e){let e=r.find(e=>e.measurementId===n),i=e&&t[e.appId];if(i)a.push(i);else{a=[];break}}}a.length===0&&(a=Object.values(t)),await Promise.all(a),e(`event`,r,i||{})}catch(e){Wg.error(e)}}function $g(e,t,n,r){async function i(i,...a){try{if(i===`event`){let[r,i]=a;await Qg(e,t,n,r,i)}else if(i===`config`){let[i,o]=a;await Zg(e,t,n,r,i,o)}else if(i===`consent`){let[t,n]=a;e(`consent`,t,n)}else if(i===`get`){let[t,n,r]=a;e(`get`,t,n,r)}else if(i===`set`){let[t]=a;e(`set`,t)}else e(i,...a)}catch(e){Wg.error(e)}}return i}function e_(e,t,n,r,i){let a=function(...e){window[r].push(arguments)};return window[i]&&typeof window[i]==`function`&&(a=window[i]),window[i]=$g(a,e,t,n),{gtagCore:a,wrappedGtag:window[i]}}function t_(e){let t=window.document.getElementsByTagName(`script`);for(let n of Object.values(t))if(n.src&&n.src.includes(Ug)&&n.src.includes(e))return n;return null}var n_=30,r_=1e3,i_=new class{constructor(e={},t=r_){this.throttleMetadata=e,this.intervalMillis=t}getThrottleMetadata(e){return this.throttleMetadata[e]}setThrottleMetadata(e,t){this.throttleMetadata[e]=t}deleteThrottleMetadata(e){delete this.throttleMetadata[e]}};function a_(e){return new Headers({Accept:`application/json`,"x-goog-api-key":e})}async function o_(e){let{appId:t,apiKey:n}=e,r={method:`GET`,headers:a_(n)},i=Hg.replace(`{app-id}`,t),a=await fetch(i,r);if(a.status!==200&&a.status!==304){let e=``;try{let t=await a.json();t.error?.message&&(e=t.error.message)}catch{}throw Gg.create(`config-fetch-failed`,{httpStatus:a.status,responseMessage:e})}return a.json()}async function s_(e,t=i_,n){let{appId:r,apiKey:i,measurementId:a}=e.options;if(!r)throw Gg.create(`no-app-id`);if(!i){if(a)return{measurementId:a,appId:r};throw Gg.create(`no-api-key`)}let o=t.getThrottleMetadata(r)||{backoffCount:0,throttleEndTimeMillis:Date.now()},s=new d_;return setTimeout(async()=>{s.abort()},n===void 0?Vg:n),c_({appId:r,apiKey:i,measurementId:a},o,s,t)}
35async function c_(e,{throttleEndTimeMillis:t,backoffCount:n},r,i=i_){let{appId:a,measurementId:o}=e;try{await l_(r,t)}catch(e){if(o)return Wg.warn(`Timed out fetching this Firebase app's measurement ID from the server. Falling back to the measurement ID ${o} provided in the "measurementId" field in the local Firebase config. [${e?.message}]`),{appId:a,measurementId:o};throw e}try{let t=await o_(e);return i.deleteThrottleMetadata(a),t}catch(t){let s=t;if(!u_(s)){if(i.deleteThrottleMetadata(a),o)return Wg.warn(`Failed to fetch this Firebase app's measurement ID from the server. Falling back to the measurement ID ${o} provided in the "measurementId" field in the local Firebase config. [${s?.message}]`),{appId:a,measurementId:o};throw t}let c=Number(s?.customData?.httpStatus)===503?Rp(n,i.intervalMillis,n_):Rp(n,i.intervalMillis),l={throttleEndTimeMillis:Date.now()+c,backoffCount:n+1};return i.setThrottleMetadata(a,l),Wg.debug(`Calling attemptFetch again in ${c} millis`),c_(e,l,r,i)}}function l_(e,t){return new Promise((n,r)=>{let i=Math.max(t-Date.now(),0),a=setTimeout(n,i);e.addEventListener(()=>{clearTimeout(a),r(Gg.create(`fetch-throttle`,{throttleEndTimeMillis:t}))})})}function u_(e){if(!(e instanceof bp)||!e.customData)return!1;let t=Number(e.customData.httpStatus);return t===429||t===500||t===503||t===504}var d_=class{constructor(){this.listeners=[]}addEventListener(e){this.listeners.push(e)}abort(){this.listeners.forEach(e=>e())}},f_;async function p_(e,t,n,r,i){if(i&&i.global){e(`event`,n,r);return}else{let i=await t;e(`event`,n,Object.assign(Object.assign({},r),{send_to:i}))}}var m_;function h_(e){m_=e}function g_(e){f_=e}async function __(){if(gp())try{await _p()}catch(e){return Wg.warn(Gg.create(`indexeddb-unavailable`,{errorInfo:e?.toString()}).message),!1}else return Wg.warn(Gg.create(`indexeddb-unavailable`,{errorInfo:`IndexedDB is not available in this environment.`}).message),!1;return!0}async function v_(e,t,n,r,i,a,o){let s=s_(e);s.then(t=>{n[t.measurementId]=t.appId,e.options.measurementId&&t.measurementId!==e.options.measurementId&&Wg.warn(`The measurement ID in the local Firebase config (${e.options.measurementId}) does not match the measurement ID fetched from the server (${t.measurementId}). To ensure analytics events are always sent to the correct Analytics property, update the measurement ID field in the local config or remove it from the local config.`)}).catch(e=>Wg.error(e)),t.push(s);let c=__().then(e=>{if(e)return r.getId()}),[l,u]=await Promise.all([s,c]);t_(a)||Yg(a,l.measurementId),m_&&(i(`consent`,`default`,m_),h_(void 0)),i(`js`,new Date);let d=o?.config??{};return d[cee]=`firebase`,d.update=!0,u!=null&&(d[see]=u),i(`config`,l.measurementId,d),f_&&(i(`set`,f_),g_(void 0)),l.measurementId}var y_=class{constructor(e){this.app=e}_delete(){return delete b_[this.app.options.appId],Promise.resolve()}},b_={},x_=[],S_={},C_=`dataLayer`,w_=`gtag`,T_,E_,D_=!1;function O_(){let e=[];
35if(pp()&&e.push(`This is a browser extension environment.`),vp()||e.push(`Cookies are not available.`),e.length>0){let t=e.map((e,t)=>`(${t+1}) ${e}`).join(` `),n=Gg.create(`invalid-analytics-context`,{errorInfo:t});Wg.warn(n.message)}}function k_(e,t,n){O_();let r=e.options.appId;if(!r)throw Gg.create(`no-app-id`);if(!e.options.apiKey)if(e.options.measurementId)Wg.warn(`The "apiKey" field is empty in the local Firebase config. This is needed to fetch the latest measurement ID for this Firebase app. Falling back to the measurement ID ${e.options.measurementId} provided in the "measurementId" field in the local Firebase config.`);else throw Gg.create(`no-api-key`);if(b_[r]!=null)throw Gg.create(`already-exists`,{id:r});if(!D_){Xg(C_);let{wrappedGtag:e,gtagCore:t}=e_(b_,x_,S_,C_,w_);E_=e,T_=t,D_=!0}return b_[r]=v_(e,x_,S_,t,T_,C_,n),new y_(e)}function A_(e=uh()){e=zp(e);let t=ih(e,Bg);return t.isInitialized()?t.getImmediate():j_(e)}function j_(e,t={}){let n=ih(e,Bg);if(n.isInitialized()){let e=n.getImmediate();if(Tp(t,n.getOptions()))return e;throw Gg.create(`already-initialized`)}return n.initialize({options:t})}function M_(e,t,n,r){e=zp(e),p_(E_,b_[e.app.options.appId],t,n,r).catch(e=>Wg.error(e))}var N_=`@firebase/analytics`,P_=`0.10.17`;function F_(){rh(new Bp(Bg,(e,{options:t})=>k_(e.getProvider(`app`).getImmediate(),e.getProvider(`installations-internal`).getImmediate(),t),`PUBLIC`)),rh(new Bp(`analytics-internal`,e,`PRIVATE`)),dh(N_,P_),dh(N_,P_,`esm2017`);function e(e){try{let t=e.getProvider(Bg).getImmediate();return{logEvent:(e,n,r)=>M_(t,e,n,r)}}catch(e){throw Gg.create(`interop-component-reg-failed`,{reason:e})}}}F_(),dh(`firebase`,`11.10.0`,`app`);function I_(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function L_(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}var R_=L_,z_=new xp(`auth`,`Firebase`,L_()),B_=new Qp(`@firebase/auth`);function V_(e,...t){B_.logLevel<=qp.WARN&&B_.warn(`Auth (${ch}): ${e}`,...t)}function H_(e,...t){B_.logLevel<=qp.ERROR&&B_.error(`Auth (${ch}): ${e}`,...t)}function U_(e,...t){throw J_(e,...t)}function W_(e,...t){return J_(e,...t)}function G_(e,t,n){return new xp(`auth`,`Firebase`,Object.assign(Object.assign({},R_()),{[t]:n})).create(t,{appName:e.name})}function K_(e){return G_(e,`operation-not-supported-in-this-environment`,`Operations that alter the current user are not supported in conjunction with FirebaseServerApp`)}function q_(e,t,n){let r=n;if(!(t instanceof r))throw r.name!==t.constructor.name&&U_(e,`argument-error`),G_(e,`argument-error`,`Type of ${t.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function J_(e,...t){if(typeof e!=`string`){let n=t[0],r=[...t.slice(1)];return r[0]&&(r[0].appName=e.name),e._errorFactory.create(n,...r)}return z_.create(e,...t)}function Y(e,t,...n){if(!e)throw J_(t,...n)}function Y_(e){let t=`INTERNAL ASSERTION FAILED: `+e;throw H_(t),Error(t)}function X_(e,t){e||Y_(t)}function Z_(){return typeof self<`u`&&self.location?.href||``}function Q_(){return $_()===`http:`||$_()===`https:`}function $_(){return typeof self<`u`&&self.location?.protocol||null}function ev(){return typeof navigator<`u`&&navigator&&`onLine`in navigator&&typeof navigator.onLine==`boolean`&&(Q_()||pp()||`connection`in navigator)?navigator.onLine:!0}function tv(){if(typeof navigator>`u`)return null;let e=navigator;return e.languages&&e.languages[0]||e.language||null}var nv=class{constructor(e,t){this.shortDelay=e,this.longDelay=t,X_(t>e,`Short delay should be less than long delay!`),this.isMobile=dp()||mp()}get(){return ev()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}};function rv(e,t){X_(e.emulator,`Emulator should always be set here`);let{url:n}=e.emulator;return t?`${n}${t.startsWith(`/`)?t.slice(1):t}`:n}var iv=class{static initialize(e,t,n){this.fetchImpl=e,t&&(this.headersImpl=t),n&&(this.responseImpl=n)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self<`u`&&`fetch`in self)return self.fetch;if(typeof globalThis<`u`&&globalThis.fetch)return globalThis.fetch;if(typeof fetch<`u`)return fetch;Y_(`Could not find fetch implementation, make sure you call FetchProvi
35der.initialize() with an appropriate polyfill`)}static headers(){if(this.headersImpl)return this.headersImpl;if(typeof self<`u`&&`Headers`in self)return self.Headers;if(typeof globalThis<`u`&&globalThis.Headers)return globalThis.Headers;if(typeof Headers<`u`)return Headers;Y_(`Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill`)}static response(){if(this.responseImpl)return this.responseImpl;if(typeof self<`u`&&`Response`in self)return self.Response;if(typeof globalThis<`u`&&globalThis.Response)return globalThis.Response;if(typeof Response<`u`)return Response;Y_(`Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill`)}},av={CREDENTIAL_MISMATCH:`custom-token-mismatch`,MISSING_CUSTOM_TOKEN:`internal-error`,INVALID_IDENTIFIER:`invalid-email`,MISSING_CONTINUE_URI:`internal-error`,INVALID_PASSWORD:`wrong-password`,MISSING_PASSWORD:`missing-password`,INVALID_LOGIN_CREDENTIALS:`invalid-credential`,EMAIL_EXISTS:`email-already-in-use`,PASSWORD_LOGIN_DISABLED:`operation-not-allowed`,INVALID_IDP_RESPONSE:`invalid-credential`,INVALID_PENDING_TOKEN:`invalid-credential`,FEDERATED_USER_ID_ALREADY_LINKED:`credential-already-in-use`,MISSING_REQ_TYPE:`internal-error`,EMAIL_NOT_FOUND:`user-not-found`,RESET_PASSWORD_EXCEED_LIMIT:`too-many-requests`,EXPIRED_OOB_CODE:`expired-action-code`,INVALID_OOB_CODE:`invalid-action-code`,MISSING_OOB_CODE:`internal-error`,CREDENTIAL_TOO_OLD_LOGIN_AGAIN:`requires-recent-login`,INVALID_ID_TOKEN:`invalid-user-token`,TOKEN_EXPIRED:`user-token-expired`,USER_NOT_FOUND:`user-token-expired`,TOO_MANY_ATTEMPTS_TRY_LATER:`too-many-requests`,PASSWORD_DOES_NOT_MEET_REQUIREMENTS:`password-does-not-meet-requirements`,INVALID_CODE:`invalid-verification-code`,INVALID_SESSION_INFO:`invalid-verification-id`,INVALID_TEMPORARY_PROOF:`invalid-credential`,MISSING_SESSION_INFO:`missing-verification-id`,SESSION_EXPIRED:`code-expired`,MISSING_ANDROID_PACKAGE_NAME:`missing-android-pkg-name`,UNAUTHORIZED_DOMAIN:`unauthorized-continue-uri`,INVALID_OAUTH_CLIENT_ID:`invalid-oauth-client-id`,ADMIN_ONLY_OPERATION:`admin-restricted-operation`,INVALID_MFA_PENDING_CREDENTIAL:`invalid-multi-factor-session`,MFA_ENROLLMENT_NOT_FOUND:`multi-factor-info-not-found`,MISSING_MFA_ENROLLMENT_ID:`missing-multi-factor-info`,MISSING_MFA_PENDING_CREDENTIAL:`missing-multi-factor-session`,SECOND_FACTOR_EXISTS:`second-factor-already-in-use`,SECOND_FACTOR_LIMIT_EXCEEDED:`maximum-second-factor-count-exceeded`,BLOCKING_FUNCTION_ERROR_RESPONSE:`internal-error`,RECAPTCHA_NOT_ENABLED:`recaptcha-not-enabled`,MISSING_RECAPTCHA_TOKEN:`missing-recaptcha-token`,INVALID_RECAPTCHA_TOKEN:`invalid-recaptcha-token`,INVALID_RECAPTCHA_ACTION:`invalid-recaptcha-action`,MISSING_CLIENT_TYPE:`missing-client-type`,MISSING_RECAPTCHA_VERSION:`missing-recaptcha-version`,INVALID_RECAPTCHA_VERSION:`invali
35d-recaptcha-version`,INVALID_REQ_TYPE:`invalid-req-type`},ov=[`/v1/accounts:signInWithCustomToken`,`/v1/accounts:signInWithEmailLink`,`/v1/accounts:signInWithIdp`,`/v1/accounts:signInWithPassword`,`/v1/accounts:signInWithPhoneNumber`,`/v1/token`],sv=new nv(3e4,6e4);function cv(e,t){return e.tenantId&&!t.tenantId?Object.assign(Object.assign({},t),{tenantId:e.tenantId}):t}async function lv(e,t,n,r,i={}){return uv(e,i,async()=>{let i={},a={};r&&(t===`GET`?a=r:i={body:JSON.stringify(r)});let o=Dp(Object.assign({key:e.config.apiKey},a)).slice(1),s=await e._getAdditionalHeaders();s[`Content-Type`]=`application/json`,e.languageCode&&(s[`X-Firebase-Locale`]=e.languageCode);let c=Object.assign({method:t,headers:s},i);return fp()||(c.referrerPolicy=`no-referrer`),e.emulatorConfig&&rp(e.emulatorConfig.host)&&(c.credentials=`include`),iv.fetch()(await fv(e,e.config.apiHost,n,o),c)})}async function uv(e,t,n){e._canInitEmulator=!1;let r=Object.assign(Object.assign({},av),t);try{let t=new mv(e),i=await Promise.race([n(),t.promise]);t.clearNetworkTimeout();let a=await i.json();if(`needConfirmation`in a)throw hv(e,`account-exists-with-different-credential`,a);if(i.ok&&!(`errorMessage`in a))return a;{let[t,n]=(i.ok?a.errorMessage:a.error.message).split(` : `);if(t===`FEDERATED_USER_ID_ALREADY_LINKED`)throw hv(e,`credential-already-in-use`,a);if(t===`EMAIL_EXISTS`)throw hv(e,`email-already-in-use`,a);if(t===`USER_DISABLED`)throw hv(e,`user-disabled`,a);let o=r[t]||t.toLowerCase().replace(/[_\s]+/g,`-`);if(n)throw G_(e,o,n);U_(e,o)}}catch(t){if(t instanceof bp)throw t;U_(e,`network-request-failed`,{message:String(t)})}}async function dv(e,t,n,r,i={}){let a=await lv(e,t,n,r,i);return`mfaPendingCredential`in a&&U_(e,`multi-factor-auth-required`,{_serverResponse:a}),a}async function fv(e,t,n,r){let i=`${t}${n}?${r}`,a=e,o=a.config.emulator?rv(e.config,i):`${e.config.apiScheme}://${i}`;return ov.includes(n)&&(await a._persistenceManagerAvailable,a._getPersistenceType()===`COOKIE`)?a._getPersistence()._getFinalTarget(o).toString():o}function pv(e){switch(e){case`ENFORCE`:return`ENFORCE`;case`AUDIT`:return`AUDIT`;case`OFF`:return`OFF`;default:return`ENFORCEMENT_STATE_UNSPECIFIED`}}var mv=class{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((e,t)=>{this.timer=setTimeout(()=>t(W_(this.auth,`network-request-failed`)),sv.get())})}};function hv(e,t,n){let r={appName:e.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);let i=W_(e,t,r);return i.customData._tokenResponse=n,i}function gv(e){return e!==void 0&&e.getResponse!==void 0}function _v(e){return e!==void 0&&e.enterprise!==void 0}var vv=class{constructor(e){if(this.siteKey=``,this.recaptchaEnforcementState=[],e.recaptchaKey===void 0)throw Error(`recaptchaKey undefined`);this.siteKey=e.recaptchaKey.split(`/`)[3],this.recaptchaEnforcementState=e.recaptchaEnforcementState}getProviderEnforcementState(e){if(!this.recaptchaEnforcementState||this.recaptchaEnforcementState.length===0)return null;for(let t of this.recaptchaEnforcementState)if(t.provider&&t.provider===e)return pv(t.enforcementState);return null}isProviderEnabled(e){return this.getProviderEnforcementState(e)===`ENFORCE`||this.getProviderEnforcementState(e)===`AUDIT`}isAnyProviderEnabled(){return this.isProviderEnabled(`EMAIL_PASSWORD_PROVIDER`)||this.isProviderEnabled(`PHONE_PROVIDER`)}};async function yv(e){return(await lv(e,`GET`,`/v1/recaptchaParams`)).recaptchaSiteKey||``}async function bv(e,t){return lv(e,`GET`,`/v2/recaptchaConfig`,cv(e,t))}async function xv(e,t){return lv(e,`POST`,`/v1/accounts:delete`,t)}async function Sv(e,t){return lv(e,`POST`,`/v1/accounts:lookup`,t)}function Cv(e){if(e)try{let t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch{}}async function wv(e,t=!1){let n=zp(e),r=await n.getIdToken(t),i=Ev(r);Y(i&&i.exp&&i.auth_time&&i.iat,n.auth,`internal-error`);let a=typeof i.firebase==`object`?i.firebase:void 0,o=a?.sign_in_provider;return{claims:i,token:r,authTime:Cv(Tv(i.auth_time)),issuedAtTime:Cv(Tv(i.iat)),expirationTime:Cv(Tv(i.exp)),signInProvider:o||null,signInSecondFactor:a?.sign_in_second_factor||null}}function Tv(e){return Number(e)*1e3}function Ev(e){let[t,n,r]=e.split(`.`);if(t===void 0||n===void 0||r===void 0)return H_(`JWT malformed, contained fewer than 3 sections`),null;try{let e=qf(n);return e?JSON.parse(e):(H_(`Failed to decode base64 JWT payload`),null)}catch(e){return H_(`Caught error parsing JWT payload as JSON`,e?.toString()),null}}function Dv(e){let t=Ev(e);return Y(t,`internal-error`),Y(t.exp!==void 0,`internal-error`),Y(t.iat!==void 0,`internal-error`),Number(t.exp)-Number(t.iat)}async function Ov(e,t,n=!1){if(n)return t;try{return await t}catch(t){throw t instanceof bp&&kv(t)&&e.auth.currentUser===e&&await e.auth.signOut(),t}}function kv({code:e}){return e===`auth/user-disabled`||e===`auth/user-token-expired`}var Av=class{constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,this.timerId!==null&&clearTimeout(this.timerId))}getInterval(e){if(e){let e=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),e}else{this.errorBackoff=3e4;let e=(this.user.stsTokenManager.expirationTime??0)-Date.now()-3e5;return Math.max(0,e)}}schedule(e=!1){if(!this.isRunning)return;let t=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},t)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){e?.code===`auth/network-request-failed`&&this.schedule(!0);return}this.schedule()}},jv=class{constructor(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}_initializeTime(){this.lastSignInTime=Cv(this.lastLoginAt),this.creationTime=Cv(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}};async function Mv(e){let t=e.auth,n=await Ov(e,Sv(t,{idToken:await e.getIdToken()}));Y(n?.users.length,t,`internal-error`);let r=n.users[0];e._notifyReloadListener(r);let i=r.providerUserInfo?.length?Fv(r.providerUserInfo):[],a=Pv(e.providerData,i),o=e.isAnonymous,s=!(e.email&&r.passwordHash)&&!a?.length,c=o?s:!1,l={uid:r.localId,displayName:r.displayName||null,photoURL:r.photoUrl||null,email:r.email||null,emailVerified:r.emailVerified||!1,phoneNumber:r.phoneNumber||null,tenantId:r.tenantId||null,providerData:a,metadata:new jv(r.createdAt,r.lastLoginAt),isAnonymous:c};Object.assign(e,l)}async function Nv(e){let t=zp(e);await Mv(t),await t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)}function Pv(e,t){return[...e.filter(e=>!t.some(t=>t.providerId===e.providerId)),...t]}function Fv(e){return e.map(e=>{var{providerId:t}=e,n=I_(e,[`providerId`]);return{providerId:t,uid:n.rawId||``,displayName:n.displayName||null,email:n.email||null,phoneNumber:n.phoneNumber||null,photoURL:n.photoUrl||null}})}async function Iv(e,t){let n=await uv(e,{},async()=>{let n=Dp({grant_type:`refresh_token`,refresh_token:t}).slice(1),{tokenApiHost:r,apiKey:i}=e.config,a=await fv(e,r,`/v1/token`,`key=${i}`),o=await e._getAdditionalHeaders();o[`Content-Type`]=`application/x-www-form-urlencoded`;let s={method:`POST`,headers:o,body:n};return e.emulatorConfig&&rp(e.emulatorConfig.host)&&(s.credentials=`include`),iv.fetch()(a,s)});return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}async function Lv(e,t){return lv(e,`POST`,`/v2/accounts:revokeToken`,cv(e,t))}var Rv=class e{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){Y(e.idToken,`internal-error`),Y(e.idToken!==void 0,`internal-error`),Y(e.refreshToken!==void 0,`internal-error`);
35let t=`expiresIn`in e&&e.expiresIn!==void 0?Number(e.expiresIn):Dv(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}updateFromIdToken(e){Y(e.length!==0,`internal-error`);let t=Dv(e);this.updateTokensAndExpiration(e,null,t)}async getToken(e,t=!1){return!t&&this.accessToken&&!this.isExpired?this.accessToken:(Y(this.refreshToken,e,`user-token-expired`),this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null)}clearRefreshToken(){this.refreshToken=null}async refresh(e,t){let{accessToken:n,refreshToken:r,expiresIn:i}=await Iv(e,t);this.updateTokensAndExpiration(n,r,Number(i))}updateTokensAndExpiration(e,t,n){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+n*1e3}static fromJSON(t,n){let{refreshToken:r,accessToken:i,expirationTime:a}=n,o=new e;return r&&(Y(typeof r==`string`,`internal-error`,{appName:t}),o.refreshToken=r),i&&(Y(typeof i==`string`,`internal-error`,{appName:t}),o.accessToken=i),a&&(Y(typeof a==`number`,`internal-error`,{appName:t}),o.expirationTime=a),o}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new e,this.toJSON())}_performRefresh(){return Y_(`not implemented`)}};function zv(e,t){Y(typeof e==`string`||e===void 0,`internal-error`,{appName:t})}var Bv=class e{constructor(e){var{uid:t,auth:n,stsTokenManager:r}=e,i=I_(e,[`uid`,`auth`,`stsTokenManager`]);this.providerId=`firebase`,this.proactiveRefresh=new Av(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=n,this.stsTokenManager=r,this.accessToken=r.accessToken,this.displayName=i.displayName||null,this.email=i.email||null,this.emailVerified=i.emailVerified||!1,this.phoneNumber=i.phoneNumber||null,this.photoURL=i.photoURL||null,this.isAnonymous=i.isAnonymous||!1,this.tenantId=i.tenantId||null,this.providerData=i.providerData?[...i.providerData]:[],this.metadata=new jv(i.createdAt||void 0,i.lastLoginAt||void 0)}async getIdToken(e){let t=await Ov(this,this.stsTokenManager.getToken(this.auth,e));return Y(t,this.auth,`internal-error`),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return wv(this,e)}reload(){return Nv(this)}_assign(e){this!==e&&(Y(this.uid===e.uid,this.auth,`internal-error`),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(e=>Object.assign({},e)),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(t){let n=new e(Object.assign(Object.assign({},this),{auth:t,stsTokenManager:this.stsTokenManager._clone()}));return n.metadata._copy(this.metadata),n}_onReload(e){Y(!this.reloadListener,this.auth,`internal-error`),this.reloadListener=e,this.reloadUserInfo&&=(this._notifyReloadListener(this.reloadUserInfo),null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,t=!1){let n=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),n=!0),t&&await Mv(this),await this.auth._persistUserIfCurrent(this),n&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(ah(this.auth.app))return Promise.reject(K_(this.auth));let e=await this.getIdToken();return await Ov(this,xv(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return Object.assign(Object.assign({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>Object.assign({},e)),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{apiKey:this.auth.config.apiKey,appName:this.auth.name})}get refreshToken(){return this.stsTokenManager.refreshToken||``}static _fromJSON(t,n){let r=n.displayName??void 0,i=n.email??void 0,a=n.phoneNumber??void 0,o=n.photoURL??void 0,s=n.tenantId??void 0,c=n._redirectEventId??void 0,l=n.createdAt??void 0,u=n.lastLoginAt??void 0,{uid:d,emailVerified:f,isAnonymous:p,providerData:m,stsTokenManager:h}=n;Y(d&&h,t,`internal-error`);let g=Rv.fromJSON(this.name,h);Y(typeof d==`string`,t,`internal-error`),zv(r,t.name),zv(i,t.name),Y(typeof f==`boolean`,t,`internal-error`),Y(typeof p==`boolean`,t,`internal-error`),zv(a,t.name),zv(o,t.name),zv(s,t.name),zv(c,t.n
35ame),zv(l,t.name),zv(u,t.name);let _=new e({uid:d,auth:t,email:i,emailVerified:f,displayName:r,isAnonymous:p,photoURL:o,phoneNumber:a,tenantId:s,stsTokenManager:g,createdAt:l,lastLoginAt:u});return m&&Array.isArray(m)&&(_.providerData=m.map(e=>Object.assign({},e))),c&&(_._redirectEventId=c),_}static async _fromIdTokenResponse(t,n,r=!1){let i=new Rv;i.updateFromServerResponse(n);let a=new e({uid:n.localId,auth:t,stsTokenManager:i,isAnonymous:r});return await Mv(a),a}static async _fromGetAccountInfoResponse(t,n,r){let i=n.users[0];Y(i.localId!==void 0,`internal-error`);let a=i.providerUserInfo===void 0?[]:Fv(i.providerUserInfo),o=!(i.email&&i.passwordHash)&&!a?.length,s=new Rv;s.updateFromIdToken(r);let c=new e({uid:i.localId,auth:t,stsTokenManager:s,isAnonymous:o}),l={uid:i.localId,displayName:i.displayName||null,photoURL:i.photoUrl||null,email:i.email||null,emailVerified:i.emailVerified||!1,phoneNumber:i.phoneNumber||null,tenantId:i.tenantId||null,providerData:a,metadata:new jv(i.createdAt,i.lastLoginAt),isAnonymous:!(i.email&&i.passwordHash)&&!a?.length};return Object.assign(c,l),c}},Vv=new Map;function Hv(e){X_(e instanceof Function,`Expected a class definition`);let t=Vv.get(e);return t?(X_(t instanceof e,`Instance stored in cache mismatched with class`),t):(t=new e,Vv.set(e,t),t)}var Uv=class{constructor(){this.type=`NONE`,this.storage={}}async _isAvailable(){return!0}async _set(e,t){this.storage[e]=t}async _get(e){let t=this.storage[e];return t===void 0?null:t}async _remove(e){delete this.storage[e]}_addListener(e,t){}_removeListener(e,t){}};Uv.type=`NONE`;var Wv=Uv;function Gv(e,t,n){return`firebase:${e}:${t}:${n}`}var Kv=class e{constructor(e,t,n){this.persistence=e,this.auth=t,this.userKey=n;let{config:r,name:i}=this.auth;this.fullUserKey=Gv(this.userKey,r.apiKey,i),this.fullPersistenceKey=Gv(`persistence`,r.apiKey,i),this.boundEventHandler=t._onStorageEvent.bind(t),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){let e=await this.persistence._get(this.fullUserKey);if(!e)return null;if(typeof e==`string`){let t=await Sv(this.auth,{idToken:e}).catch(()=>void 0);return t?Bv._fromGetAccountInfoResponse(this.auth,t,e):null}return Bv._fromJSON(this.auth,e)}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;let t=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=e,t)return this.setCurrentUser(t)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(t,n,r=`authUser`){if(!n.length)return new e(Hv(Wv),t,r);let i=(await Promise.all(n.map(async e=>{if(await e._isAvailable())return e}))).filter(e=>e),a=i[0]||Hv(Wv),o=Gv(r,t.config.apiKey,t.name),s=null;for(let e of n)try{let n=await e._get(o);if(n){let r;if(typeof n==`string`){let e=await Sv(t,{idToken:n}).catch(()=>void 0);if(!e)break;r=await Bv._fromGetAccountInfoResponse(t,e,n)}else r=Bv._fromJSON(t,n);e!==a&&(s=r),a=e;break}}catch{}let c=i.filter(e=>e._shouldAllowMigration);return!a._shouldAllowMigration||!c.length?new e(a,t,r):(a=c[0],s&&await a._set(o,s.toJSON()),await Promise.all(n.map(async e=>{if(e!==a)try{await e._remove(o)}catch{}})),new e(a,t,r))}};function qv(e){let t=e.toLowerCase();if(t.includes(`opera/`)||t.includes(`opr/`)||t.includes(`opios/`))return`Opera`;if(Zv(t))return`IEMobile`;if(t.includes(`msie`)||t.includes(`trident/`))return`IE`;if(t.includes(`edge/`))return`Edge`;if(Jv(t))return`Firefox`;if(t.includes(`silk/`))return`Silk`;if($v(t))return`Blackberry`;if(ey(t))return`Webos`;if(Yv(t))return`Safari`;if((t.includes(`chrome/`)||Xv(t))&&!t.includes(`edge/`))return`Chrome`;if(Qv(t))return`Android`;{let t=e.match(/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/);if(t?.length===2)return t[1]}return`Other`}function Jv(e=up()){return/firefox\//i.test(e)}function Yv(e=up()){let t=e.toLowerCase();return t.includes(`safari/`)&&!t.includes(`chrome/`)&&!t.includes(`crios/`)&&!t.includes(`android`)}function Xv(e=up()){return/crios\//i.test(e)}function Zv(e=up()){return/iemobile/i.test(e)}function Qv(e=up()){return/android/i.test(e)}function $v(e=up()){return/blackberry/i.test(e)}function ey(e=up()){return/webos/i.test(e)}function ty(e=up()){return/iphone|ipad|ipod/i.test(e)||/macintosh/i.test(e)&&/mobile/i.test(e)}function ny(e=up()){return ty(e)&&!!window.navigator?.standalone}function ry(){return hp()&&document.documentMode===10}function iy(e=up()){return ty(e)||Qv(e)||ey(e)||$v(e)||/windows phone/i.test(e)||Zv(e)}function ay(e,t=[]){let n;switch(e){case`Browser`:n=qv(up());break;case`Worker`:n=`${qv(up())}-${e}`;break;default:n=e}let r=t.length?t.join(`,`):`FirebaseCore-web`;return`${n}/JsCore/${ch}/${r}`}var oy=class{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,t){let n=t=>new Promise((n,r)=>{try{n(e(t))}catch(e){r(e)}});n.onAbort=t,this.queue.push(n);let r=this.queue.length-1;return()=>{this.queue[r]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;let t=[];try{for(let n of this.queue)await n(e),n.onAbort&&t.push(n.onAbort)}catch(e){t.reverse();for(let e of t)try{e()}catch{}throw this.auth._errorFactory.create(`login-blocked`,{originalMessage:e?.message})}}};async function sy(e,t={}){return lv(e,`GET`,`/v2/passwordPolicy`,cv(e,t))}var cy=6,ly=class{constructor(e){let t=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=t.minPasswordLength??cy,t.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=t.maxPasswordLength),t.containsLowercaseCharacter!==void 0&&(this.customStrengthOptions.containsLowercaseLetter=t.containsLowercaseCharacter),t.containsUppercaseCharacter!==void 0&&(this.customStrengthOptions.containsUppercaseLetter=t.containsUppercaseCharacter),t.containsNumericCharacter!==void 0&&(this.customStrengthOptions.containsNumericCharacter=t.containsNumericCharacter),t.containsNonAlphanumericCharacter!==void 0&&(this.customStrengthOptions.containsNonAlphanumericCharacter=t.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,this.enforcementState===`ENFORCEMENT_STATE_UNSPECIFIED`&&(this.enforcementState=`OFF`),this.allowedNonAlphanumericCharacters=e.allowedNonAlphanumericCharacters?.join(``)??``,this.forceUpgradeOnSignin=e.forceUpgradeOnSignin??!1,this.schemaVersion=e.schemaVersion}validatePassword(e){let t={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,t),this.validatePasswordCharacterOptions(e,t),t.isValid&&=t.meetsMinPasswordLength??!0,t.isValid&&=t.meetsMaxPasswordLength??!0,t.isValid&&=t.containsLowercaseLetter??!0,t.isValid&&=t.containsUppercaseLetter??!0,t.isValid&&=t.containsNumericCharacter??!0,t.isValid&&=t.containsNonAlphanumericCharacter??!0,t}validatePasswordLengthOptions(e,t){let n=this.customStrengthOptions.minPasswordLength,r=this.customStrengthOptions.maxPasswordLength;n&&(t.meetsMinPasswordLength=e.length>=n),r&&(t.meetsMaxPasswordLength=e.length<=r)}validatePasswordCharacterOptions(e,t){this.updatePasswordCharacterOptionsStatuses(t,!1,!1,!1,!1);let n;for(let r=0;r<e.length;r++)n=e.charAt(r),this.updatePasswordCharacterOptionsStatuses(t,n>=`a`&&n<=`z`,n>=`A`&&n<=`Z`,n>=`0`&&n<=`9`,this.allowedNonAlphanumericCharacters.includes(n))}updatePasswordCharacterOptionsStatuses(e,t,n,r,i){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||=t),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||=n),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||=r),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||=i)}},uy=class{constructor(e,t,n,r){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=n,this.config=r,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new fy(this),this.idTokenSubscription=new fy(this),this.beforeStateQueue=new oy(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=z_,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this._resolvePersistenceManagerAvailable=void 0,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=r.sdkClientVersion,this._persistenceManagerAvailable=new Promise(e=>this._resolvePersistenceManagerAvailable=e)}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=Hv(t)),this._initializationPromise=this.queue(async()=>{var n;if(!this._deleted&&(this.persistenceManager=await Kv.create(this,e),(n=this._resolvePersistenceManagerAvailable)==null||n.call(this),!this._deleted)){if
35(this._popupRedirectResolver?._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(t),this.lastNotifiedUid=this.currentUser?.uid||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;let e=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!e)){if(this.currentUser&&e&&this.currentUser.uid===e.uid){this._currentUser._assign(e),await this.currentUser.getIdToken();return}await this._updateCurrentUser(e,!0)}}async initializeCurrentUserFromIdToken(e){try{let t=await Sv(this,{idToken:e}),n=await Bv._fromGetAccountInfoResponse(this,t,e);await this.directlySetCurrentUser(n)}catch(e){console.warn(`FirebaseServerApp could not login user with provided authIdToken: `,e),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){if(ah(this.app)){let e=this.app.settings.authIdToken;return e?new Promise(t=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(e).then(t,t))}):this.directlySetCurrentUser(null)}let t=await this.assertedPersistence.getCurrentUser(),n=t,r=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();let t=this.redirectUser?._redirectEventId,i=n?._redirectEventId,a=await this.tryRedirectSignIn(e);(!t||t===i)&&a?.user&&(n=a.user,r=!0)}if(!n)return this.directlySetCurrentUser(null);if(!n._redirectEventId){if(r)try{await this.beforeStateQueue.runMiddleware(n)}catch(e){n=t,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(e))}return n?this.reloadAndSetCurrentUserOrClear(n):this.directlySetCurrentUser(null)}return Y(this._popupRedirectResolver,this,`argument-error`),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===n._redirectEventId?this.directlySetCurrentUser(n):this.reloadAndSetCurrentUserOrClear(n)}async tryRedirectSignIn(e){let t=null;try{t=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch{await this._setRedirectUser(null)}return t}async reloadAndSetCurrentUserOrClear(e){try{await Mv(e)}catch(e){if(e?.code!==`auth/network-request-failed`)return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=tv()}async _delete(){this._deleted=!0}async updateCurrentUser(e){if(ah(this.app))return Promise.reject(K_(this));let t=e?zp(e):null;return t&&Y(t.auth.config.apiKey===this.config.apiKey,this,`invalid-user-token`),this._updateCurrentUser(t&&t._clone(this))}async _updateCurrentUser(e,t=!1){if(!this._deleted)return e&&Y(this.tenantId===e.tenantId,this,`tenant-id-mismatch`),t||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return ah(this.app)?Promise.reject(K_(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return ah(this.app)?Promise.reject(K_(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(Hv(e))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();let t=this._getPasswordPolicyInternal();return t.schemaVersion===this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?t.validatePassword(e):Promise.reject(this._errorFactory.create(`unsupported-password-policy-schema-version`,{}))}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){let e=new ly(await sy(this));this.tenantId===null?this._projectPasswordPolicy=e:this._tenantPasswordPolicies[this.tenantId]=e}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(e){this._errorFactory=new xp(`auth`,`Firebase`,e())}onAuthStateChanged(e,t,n){return this.registerStateListener(this.authStateSubscription,e,t,n)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,n){return this.registerStateListener(this.idTokenSubscription,e,t,n)}authStateReady(){return new Promise((e,t)=>
35{if(this.currentUser)e();else{let n=this.onAuthStateChanged(()=>{n(),e()},t)}})}async revokeAccessToken(e){if(this.currentUser){let t={providerId:`apple.com`,tokenType:`ACCESS_TOKEN`,token:e,idToken:await this.currentUser.getIdToken()};this.tenantId!=null&&(t.tenantId=this.tenantId),await Lv(this,t)}}toJSON(){return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:this._currentUser?.toJSON()}}async _setRedirectUser(e,t){let n=await this.getOrInitRedirectPersistenceManager(t);return e===null?n.removeCurrentUser():n.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){let t=e&&Hv(e)||this._popupRedirectResolver;Y(t,this,`argument-error`),this.redirectPersistenceManager=await Kv.create(this,[Hv(t._redirectPersistence)],`redirectUser`),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){return this._isInitialized&&await this.queue(async()=>{}),this._currentUser?._redirectEventId===e?this._currentUser:this.redirectUser?._redirectEventId===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(e))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);let e=this.currentUser?.uid??null;this.lastNotifiedUid!==e&&(this.lastNotifiedUid=e,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,n,r){if(this._deleted)return()=>{};let i=typeof t==`function`?t:t.next.bind(t),a=!1,o=this._isInitialized?Promise.resolve():this._initializationPromise;if(Y(o,this,`internal-error`),o.then(()=>{a||i(this.currentUser)}),typeof t==`function`){let i=e.addObserver(t,n,r);return()=>{a=!0,i()}}else{let n=e.addObserver(t);return()=>{a=!0,n()}}}async directlySetCurrentUser(e){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?await this.assertedPersistence.setCurrentUser(e):await this.assertedPersistence.removeCurrentUser()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return Y(this.persistenceManager,this,`internal-error`),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=ay(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){let e={"X-Client-Version":this.clientVersion};this.app.options.appId&&(e[`X-Firebase-gmpid`]=this.app.options.appId);let t=await this.heartbeatServiceProvider.getImmediate({optional:!0})?.getHeartbeatsHeader();t&&(e[`X-Firebase-Client`]=t);let n=await this._getAppCheckToken();return n&&(e[`X-Firebase-AppCheck`]=n),e}async _getAppCheckToken(){if(ah(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;let e=await this.appCheckServiceProvider.getImmediate({optional:!0})?.getToken();return e?.error&&V_(`Error while retrieving App Check token: ${e.error}`),e?.token}};function dy(e){return zp(e)}var fy=class{constructor(e){this.auth=e,this.observer=null,this.addObserver=Ap(e=>this.observer=e)}get next(){return Y(this.observer,this.auth,`internal-error`),this.observer.next.bind(this.observer)}},py={async loadJS(){throw Error(`Unable to load external scripts`)},recaptchaV2Script:``,recaptchaEnterpriseScript:``,gapiScript:``};function my(e){py=e}function hy(e){return py.loadJS(e)}function gy(){return py.recaptchaV2Script}function _y(){return py.recaptchaEnterpriseScript}function vy(){return py.gapiScript}function yy(e){return`__${e}${Math.floor(Math.random()*1e6)}`}var by=500,xy=6e4,Sy=0xe8d4a51000,Cy=class{constructor(e){this.auth=e,this.counter=Sy,this._widgets=new Map}render(e,t){let n=this.counter;return this._widgets.set(n,new Ey(e,this.auth.name,t||{})),this.counter++,n}reset(e){var t;let n=e||Sy;(t=this._widgets.get(n))==null||t.delete(),this._widgets.delete(n)}getResponse(e){let t=e||Sy;return this._widgets.get(t)?.getResponse()||``}async execute(e){var t;let n=e||Sy;return(t=this._widgets.get(n))==null||t.execute(),``}},wy=class{constructor(){this.enterprise=new Ty}ready(e){e()}execute(e,t){return Promise.resolve(`token`)}render(e,t){return``}},Ty=class{ready(e){e()}execute(e,t){return Promise.resolve(`token`)}render(e,t){return``}},Ey=class{constructor(e,t,n){this.params=n,this.timerId=null,this.deleted=!1,this.responseToken=null,this.clickHandler=()=>{this.execute()};let r=typeof e==`string`?document.getElementById(e):e;Y(r,`argument-error`,{appName:t}),this.container=r,this.isVisible=this.params.size!==`invisible`,this.isVisible?this.execute():this.container.addEventListener(`click`,this.clickHandler)}getResponse(){return this.checkIfDeleted(),this.responseToken}delete(){this.checkIfDeleted(),this.deleted=!0,this.timerId&&=(clearTimeout(this.timerId),null),this.container.removeEventListener(`click`,this.clickHandler)}execute(){this.checkIfDeleted(),!this.timerId&&(this.timerId=window.setTimeout(()=>{this.responseToken=Dy(50);let{callback:e,"expired-callback":t}=this.params;if(e)try{e(this.responseToken)}catch{}this.timerId=window.setTimeout(()=>{if(this.timerId=null,this.responseToken=null,t)try{t()}catch{}this.isVisible&&this.execute()},xy)},by))}checkIfDeleted(){if(this.deleted)throw Error(`reCAPTCHA mock was already deleted!`)}};function Dy(e){let t=[];for(let n=0;n<e;n++)t.push(`1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`.charAt(Math.floor(Math.random()*62)));return t.join(``)}var Oy=`recaptcha-enterprise`,ky=`NO_RECAPTCHA`,Ay=class{constructor(e){this.type=Oy,this.auth=dy(e)}async verify(e=`verify`,t=!1){async function n(e){if(!t){if(e.tenantId==null&&e._agentRecaptchaConfig!=null)return e._agentRecaptchaConfig.siteKey;if(e.tenantId!=null&&e._tenantRecaptchaConfigs[e.tenantId]!==void 0)return e._tenantRecaptchaConfigs[e.tenantId].siteKey}return new Promise(async(t,n)=>{bv(e,{clientType:`CLIENT_TYPE_WEB`,version:`RECAPTCHA_ENTERPRISE`}).then(r=>{if(r.recaptchaKey===void 0)n(Error(`recaptcha Enterprise site key undefined`));else{let n=new vv(r);return e.tenantId==null?e._agentRecaptchaConfig=n:e._tenantRecaptchaConfigs[e.tenantId]=n,t(n.siteKey)}}).catch(e=>{n(e)})})}function r(t,n,r){let i=window.grecaptcha;_v(i)?i.enterprise.ready(()=>{i.enterprise.execute(t,{action:e}).then(e=>{n(e)}).catch(()=>{n(ky)})}):r(Error(`No reCAPTCHA enterprise script loaded.`))}return this.auth.settings.appVerificationDisabledForTesting?new wy().execute(`siteKey`,{action:`verify`}):new Promise((e,i)=>{n(this.auth).then(n=>{if(!t&&_v(window.grecaptcha))r(n,e,i);else{if(typeof window>`u`){i(Error(`RecaptchaVerifier is only supported in browser`));return}let t=_y();t.length!==0&&(t+=n),hy(t).then(()=>{r(n,e,i)}).catch(e=>{i(e)})}}).catch(e=>{i(e)})})}};async function jy(e,t,n,r=!1,i=!1){let a=new Ay(e),o;if(i)o=ky;else try{o=await a.verify(n)}
35catch{o=await a.verify(n,!0)}let s=Object.assign({},t);if(n===`mfaSmsEnrollment`||n===`mfaSmsSignIn`){if(`phoneEnrollmentInfo`in s){let e=s.phoneEnrollmentInfo.phoneNumber,t=s.phoneEnrollmentInfo.recaptchaToken;Object.assign(s,{phoneEnrollmentInfo:{phoneNumber:e,recaptchaToken:t,captchaResponse:o,clientType:`CLIENT_TYPE_WEB`,recaptchaVersion:`RECAPTCHA_ENTERPRISE`}})}else if(`phoneSignInInfo`in s){let e=s.phoneSignInInfo.recaptchaToken;Object.assign(s,{phoneSignInInfo:{recaptchaToken:e,captchaResponse:o,clientType:`CLIENT_TYPE_WEB`,recaptchaVersion:`RECAPTCHA_ENTERPRISE`}})}return s}return r?Object.assign(s,{captchaResp:o}):Object.assign(s,{captchaResponse:o}),Object.assign(s,{clientType:`CLIENT_TYPE_WEB`}),Object.assign(s,{recaptchaVersion:`RECAPTCHA_ENTERPRISE`}),s}async function My(e,t,n,r,i){return i===`EMAIL_PASSWORD_PROVIDER`?e._getRecaptchaConfig()?.isProviderEnabled(`EMAIL_PASSWORD_PROVIDER`)?r(e,await jy(e,t,n,n===`getOobCode`)):r(e,t).catch(async i=>i.code===`auth/missing-recaptcha-token`?(console.log(`${n} is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow.`),r(e,await jy(e,t,n,n===`getOobCode`))):Promise.reject(i)):i===`PHONE_PROVIDER`?e._getRecaptchaConfig()?.isProviderEnabled(`PHONE_PROVIDER`)?r(e,await jy(e,t,n)).catch(async i=>e._getRecaptchaConfig()?.getProviderEnforcementState(`PHONE_PROVIDER`)===`AUDIT`&&(i.code===`auth/missing-recaptcha-token`||i.code===`auth/invalid-app-credential`)?(console.log(`Failed to verify with reCAPTCHA Enterprise. Automatically triggering the reCAPTCHA v2 flow to complete the ${n} flow.`),r(e,await jy(e,t,n,!1,!0))):Promise.reject(i)):r(e,await jy(e,t,n,!1,!0)):Promise.reject(i+` provider is not supported.`)}async function Ny(e){let t=dy(e),n=new vv(await bv(t,{clientType:`CLIENT_TYPE_WEB`,version:`RECAPTCHA_ENTERPRISE`}));t.tenantId==null?t._agentRecaptchaConfig=n:t._tenantRecaptchaConfigs[t.tenantId]=n,n.isAnyProviderEnabled()&&new Ay(t).verify()}function Py(e,t){let n=ih(e,`auth`);if(n.isInitialized()){let e=n.getImmediate();if(Tp(n.getOptions(),t??{}))return e;U_(e,`already-initialized`)}return n.initialize({options:t})}function Fy(e,t){let n=t?.persistence||[],r=(Array.isArray(n)?n:[n]).map(Hv);t?.errorMap&&e._updateErrorMap(t.errorMap),e._initializeWithPersistence(r,t?.popupRedirectResolver)}function Iy(e,t,n){let r=dy(e);Y(/^https?:\/\//.test(t),r,`invalid-emulator-scheme`);let i=!!n?.disableWarnings,a=Ly(t),{host:o,port:s}=Ry(t),c=s===null?``:`:${s}`,l={url:`${a}//${o}${c}/`},u=Object.freeze({host:o,port:s,protocol:a.replace(`:`,``),options:Object.freeze({disableWarnings:i})});if(!r._canInitEmulator){Y(r.config.emulator&&r.emulatorConfig,r,`emulator-config-failed`),Y(Tp(l,r.config.emulator)&&Tp(u,r.emulatorConfig),r,`emulator-config-failed`);return}r.config.emulator=l,r.emulatorConfig=u,r.settings.appVerificationDisabledForTesting=!0,rp(o)?(ip(`${a}//${o}${c}`),lp(`Auth`,!0)):i||lee()}function Ly(e){let t=e.indexOf(`:`);return t<0?``:e.substr(0,t+1)}function Ry(e){let t=Ly(e),n=/(\/\/)?([^?#/]+)/.exec(e.substr(t.length));if(!n)return{host:``,port:null};let r=n[2].split(`@`).pop()||``,i=/^(\[[^\]]+\])(:|$)/.exec(r);if(i){let e=i[1];return{host:e,port:zy(r.substr(e.length+1))}}else{let[e,t]=r.split(`:`);return{host:e,port:zy(t)}}}function zy(e){if(!e)return null;let t=Number(e);return isNaN(t)?null:t}function lee(){function e(){let e=document.createElement(`p`),t=e.style;e.innerText=`Running in emulator mode. Do not use with production credentials.`,t.position=`fixed`,t.width=`100%`,t.backgroundColor=`#ffffff`,t.border=`.1em solid #000000`,t.color=`#b50000`,t.bottom=`0px`,t.left=`0px`,t.margin=`0px`,t.zIndex=`10000`,t.textAlign=`center`,e.classList.add(`firebase-emulator-warning`),document.body.appendChild(e)}typeof console<`u`&&typeof console.info==`function`&&console.info(`WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials.`),typeof window<`u`&&typeof document<`u`&&(document.readyState===`loading`?window.addEventListener(`DOMContentLoaded`,e):e())}var By=class{constructor(e,t){this.providerId=e,this.signInMethod=t}toJSON(){return Y_(`not implemented`)}_getIdTokenResponse(e){return Y_(`not implemented`)}_linkToIdToken(e,t){return Y_(`not implemented`)}_getReauthenticationResolver(e){return Y_(`not implemented`)}};async function uee(e,t){return lv(e,`POST`,`/v1/accounts:signUp`,t)}async function dee(e,t){return dv(e,`POST`,`/v1/accounts:signInWithPassword`,cv(e,t))}async function fee(e,t){return dv(e,`POST`,`/v1/accounts:signInWithEmailLink`,cv(e,t))}async function pee(e,t){return dv(e,`POST`,`/v1/accounts:signInWithEmailLink`,cv(e,t))}var Vy=class e extends By{constructor(e,t,n,r=null){super(`password`,n),this._email=e,this._password=t,this._tenantId=r}static _fromEmailAndPassword(t,n){return new e(t,n,`password`)}static _fromEmailAndCode(t,n,r=null){return new e(t,n,`emailLink`,r)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){let t=typeof e==`string`?JSON.parse(e):e;if(t?.email&&t?.password){if(t.signInMethod===`password`)return this._fromEmailAndPassword(t.email,t.password);if(t.signInMethod===`emailLink`)return this._fromEmailAndCode(t.email,t.password,t.tenantId)}return null}async _getIdTokenResponse(e){switch(this.signInMethod){case`password`:return My(e,{returnSecureToken:!0,email:this._email,password:this._password,clientType:`CLIENT_TYPE_WEB`},`signInWithPassword`,dee,`EMAIL_PASSWORD_PROVIDER`);case`emailLink`:return fee(e,{email:this._email,oobCode:this._password});default:U_(e,`internal-error`)}}async _linkToIdToken(e,t){switch(this.signInMethod){case`password`:return My(e,{idToken:t,returnSecureToken:!0,email:this._email,password:this._password,clientType:`CLIENT_TYPE_WEB`},`signUpPassword`,uee,`EMAIL_PASSWORD_PROVIDER`);case`emailLink`:return pee(e,{idToken:t,email:this._email,oobCode:this._password});default:U_(e,`internal-error`)}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}};async function Hy(e,t){return dv(e,`POST`,`/v1/accounts:signInWithIdp`,cv(e,t))}var mee=`http://localhost`,Uy=class e extends By{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(t){let n=new e(t.providerId,t.signInMethod);return t.idToken||t.accessToken?(t.idToken&&(n.idToken=t.idToken),t.accessToken&&(n.accessToken=t.accessToken),t.nonce&&!t.pen
35dingToken&&(n.nonce=t.nonce),t.pendingToken&&(n.pendingToken=t.pendingToken)):t.oauthToken&&t.oauthTokenSecret?(n.accessToken=t.oauthToken,n.secret=t.oauthTokenSecret):U_(`argument-error`),n}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(t){let n=typeof t==`string`?JSON.parse(t):t,{providerId:r,signInMethod:i}=n,a=I_(n,[`providerId`,`signInMethod`]);if(!r||!i)return null;let o=new e(r,i);return o.idToken=a.idToken||void 0,o.accessToken=a.accessToken||void 0,o.secret=a.secret,o.nonce=a.nonce,o.pendingToken=a.pendingToken||null,o}_getIdTokenResponse(e){return Hy(e,this.buildRequest())}_linkToIdToken(e,t){let n=this.buildRequest();return n.idToken=t,Hy(e,n)}_getReauthenticationResolver(e){let t=this.buildRequest();return t.autoCreate=!1,Hy(e,t)}buildRequest(){let e={requestUri:mee,returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{let t={};this.idToken&&(t.id_token=this.idToken),this.accessToken&&(t.access_token=this.accessToken),this.secret&&(t.oauth_token_secret=this.secret),t.providerId=this.providerId,this.nonce&&!this.pendingToken&&(t.nonce=this.nonce),e.postBody=Dp(t)}return e}};async function Wy(e,t){return lv(e,`POST`,`/v1/accounts:sendVerificationCode`,cv(e,t))}async function hee(e,t){return dv(e,`POST`,`/v1/accounts:signInWithPhoneNumber`,cv(e,t))}async function gee(e,t){let n=await dv(e,`POST`,`/v1/accounts:signInWithPhoneNumber`,cv(e,t));if(n.temporaryProof)throw hv(e,`account-exists-with-different-credential`,n);return n}var _ee={USER_NOT_FOUND:`user-not-found`};async function vee(e,t){return dv(e,`POST`,`/v1/accounts:signInWithPhoneNumber`,cv(e,Object.assign(Object.assign({},t),{operation:`REAUTH`})),_ee)}var Gy=class e extends By{constructor(e){super(`phone`,`phone`),this.params=e}static _fromVerification(t,n){return new e({verificationId:t,verificationCode:n})}static _fromTokenResponse(t,n){return new e({phoneNumber:t,temporaryProof:n})}_getIdTokenResponse(e){return hee(e,this._makeVerificationRequest())}_linkToIdToken(e,t){return gee(e,Object.assign({idToken:t},this._makeVerificationRequest()))}_getReauthenticationResolver(e){return vee(e,this._makeVerificationRequest())}_makeVerificationRequest(){let{temporaryProof:e,phoneNumber:t,verificationId:n,verificationCode:r}=this.params;return e&&t?{temporaryProof:e,phoneNumber:t}:{sessionInfo:n,code:r}}toJSON(){let e={providerId:this.providerId};return this.params.phoneNumber&&(e.phoneNumber=this.params.phoneNumber),this.params.temporaryProof&&(e.temporaryProof=this.params.temporaryProof),this.params.verificationCode&&(e.verificationCode=this.params.verificationCode),this.params.verificationId&&(e.verificationId=this.params.verificationId),e}static fromJSON(t){typeof t==`string`&&(t=JSON.parse(t));let{verificationId:n,verificationCode:r,phoneNumber:i,temporaryProof:a}=t;return!r&&!n&&!i&&!a?null:new e({verificationId:n,verificationCode:r,phoneNumber:i,temporaryProof:a})}};function yee(e){switch(e){case`recoverEmail`:return`RECOVER_EMAIL`;case`resetPassword`:return`PASSWORD_RESET`;case`signIn`:return`EMAIL_SIGNIN`;case`verifyEmail`:return`VERIFY_EMAIL`;case`verifyAndChangeEmail`:return`VERIFY_AND_CHANGE_EMAIL`;case`revertSecondFactorAddition`:return`REVERT_SECOND_FACTOR_ADDITION`;default:return null}}function bee(e){let t=Op(kp(e)).link,n=t?Op(kp(t)).deep_link_id:null,r=Op(kp(e)).deep_link_id;return(r?Op(kp(r)).link:null)||r||n||t||e}var xee=class e{constructor(e){let t=Op(kp(e)),n=t.apiKey??null,r=t.oobCode??null,i=yee(t.mode??null);Y(n&&r&&i,`argument-error`),this.apiKey=n,this.operation=i,this.code=r,this.continueUrl=t.continueUrl??null,this.languageCode=t.lang??null,this.tenantId=t.tenantId??null}static parseLink(t){let n=bee(t);try{return new e(n)}catch{return null}}},Ky=class e{constructor(){this.providerId=e.PROVIDER_ID}static credential(e,t){return Vy._fromEmailAndPassword(e,t)}static credentialWithLink(e,t){let n=xee.parseLink(t);return Y(n,`argument-error`),Vy._fromEmailAndCode(e,n.code,n.tenantId)}};Ky.PROVIDER_ID=`password`,Ky.EMAIL_PASSWORD_SIGN_IN_METHOD=`password`,Ky.EMAIL_LINK_SIGN_IN_METHOD=`emailLink`;var qy=class{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}},Jy=class extends qy{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}},Yy=class e extends Jy{static credentialFromJSON(e){let t=typeof e==`string`?JSON.parse(e):e;
35return Y(`providerId`in t&&`signInMethod`in t,`argument-error`),Uy._fromParams(t)}credential(e){return this._credential(Object.assign(Object.assign({},e),{nonce:e.rawNonce}))}_credential(e){return Y(e.idToken||e.accessToken,`argument-error`),Uy._fromParams(Object.assign(Object.assign({},e),{providerId:this.providerId,signInMethod:this.providerId}))}static credentialFromResult(t){return e.oauthCredentialFromTaggedObject(t)}static credentialFromError(t){return e.oauthCredentialFromTaggedObject(t.customData||{})}static oauthCredentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;let{oauthIdToken:n,oauthAccessToken:r,oauthTokenSecret:i,pendingToken:a,nonce:o,providerId:s}=t;if(!r&&!i&&!n&&!a||!s)return null;try{return new e(s)._credential({idToken:n,accessToken:r,nonce:o,pendingToken:a})}catch{return null}}},Xy=class e extends Jy{constructor(){super(`facebook.com`)}static credential(t){return Uy._fromParams({providerId:e.PROVIDER_ID,signInMethod:e.FACEBOOK_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return e.credentialFromTaggedObject(t)}static credentialFromError(t){return e.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!(`oauthAccessToken`in t)||!t.oauthAccessToken)return null;try{return e.credential(t.oauthAccessToken)}catch{return null}}};Xy.FACEBOOK_SIGN_IN_METHOD=`facebook.com`,Xy.PROVIDER_ID=`facebook.com`;var Zy=class e extends Jy{constructor(){super(`google.com`),this.addScope(`profile`)}static credential(t,n){return Uy._fromParams({providerId:e.PROVIDER_ID,signInMethod:e.GOOGLE_SIGN_IN_METHOD,idToken:t,accessToken:n})}static credentialFromResult(t){return e.credentialFromTaggedObject(t)}static credentialFromError(t){return e.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;let{oauthIdToken:n,oauthAccessToken:r}=t;if(!n&&!r)return null;try{return e.credential(n,r)}catch{return null}}};Zy.GOOGLE_SIGN_IN_METHOD=`google.com`,Zy.PROVIDER_ID=`google.com`;var Qy=class e extends Jy{constructor(){super(`github.com`)}static credential(t){return Uy._fromParams({providerId:e.PROVIDER_ID,signInMethod:e.GITHUB_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return e.credentialFromTaggedObject(t)}static credentialFromError(t){return e.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!(`oauthAccessToken`in t)||!t.oauthAccessToken)return null;try{return e.credential(t.oauthAccessToken)}catch{return null}}};Qy.GITHUB_SIGN_IN_METHOD=`github.com`,Qy.PROVIDER_ID=`github.com`;var $y=class e extends Jy{constructor(){super(`twitter.com`)}static credential(t,n){return Uy._fromParams({providerId:e.PROVIDER_ID,signInMethod:e.TWITTER_SIGN_IN_METHOD,oauthToken:t,oauthTokenSecret:n})}static credentialFromResult(t){return e.credentialFromTaggedObject(t)}static credentialFromError(t){return e.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;let{oauthAccessToken:n,oauthTokenSecret:r}=t;if(!n||!r)return null;try{return e.credential(n,r)}catch{return null}}};$y.TWITTER_SIGN_IN_METHOD=`twitter.com`,$y.PROVIDER_ID=`twitter.com`;var eb=class e{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(t,n,r,i=!1){return new e({user:await Bv._fromIdTokenResponse(t,r,i),providerId:tb(r),_tokenResponse:r,operationType:n})}static async _forOperation(t,n,r){return await t._updateTokensIfNecessary(r,!0),new e({user:t,providerId:tb(r),_tokenResponse:r,operationType:n})}};function tb(e){return e.providerId?e.providerId:`phoneNumber`in e?`phone`:null}var nb=class e extends bp{constructor(t,n,r,i){super(n.code,n.message),this.operationType=r,this.user=i,Object.setPrototypeOf(this,e.prototype),this.customData={appName:t.name,tenantId:t.tenantId??void 0,_serverResponse:n.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(t,n,r,i){return new e(t,n,r,i)}};function rb(e,t,n,r){return(t===`reauthenticate`?n._getReauthenticationResolver(e):n._getIdTokenResponse(e)).catch(n=>{throw n.code===`auth/multi-factor-auth-required`?nb._fromErrorAndOperation(e,n,t,r):n})}async function ib(e,t,n=!1){let r=await Ov(e,t._linkToIdToken(e.auth,await e.getIdToken()),n);return eb._forOperation(e,`link`,r)}async function ab(e,t,n=!1){let{auth:r}=e;if(ah(r.app))return Promise.reject(K_(r));let i=`reauthenticate`;
35try{let a=await Ov(e,rb(r,i,t,e),n);Y(a.idToken,r,`internal-error`);let o=Ev(a.idToken);Y(o,r,`internal-error`);let{sub:s}=o;return Y(e.uid===s,r,`user-mismatch`),eb._forOperation(e,i,a)}catch(e){throw e?.code===`auth/user-not-found`&&U_(r,`user-mismatch`),e}}async function ob(e,t,n=!1){if(ah(e.app))return Promise.reject(K_(e));let r=`signIn`,i=await rb(e,r,t),a=await eb._fromIdTokenResponse(e,r,i);return n||await e._updateCurrentUser(a.user),a}async function sb(e,t){return ob(dy(e),t)}function cb(e){return Ny(e)}function lb(e,t,n,r){return zp(e).onIdTokenChanged(t,n,r)}function ub(e,t,n){return zp(e).beforeAuthStateChanged(t,n)}function db(e,t){return lv(e,`POST`,`/v2/accounts/mfaEnrollment:start`,cv(e,t))}function fb(e,t){return lv(e,`POST`,`/v2/accounts/mfaEnrollment:finalize`,cv(e,t))}function pb(e,t){return lv(e,`POST`,`/v2/accounts/mfaEnrollment:start`,cv(e,t))}function mb(e,t){return lv(e,`POST`,`/v2/accounts/mfaEnrollment:finalize`,cv(e,t))}var hb=`__sak`,gb=class{constructor(e,t){this.storageRetriever=e,this.type=t}_isAvailable(){try{return this.storage?(this.storage.setItem(hb,`1`),this.storage.removeItem(hb),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(e,t){return this.storage.setItem(e,JSON.stringify(t)),Promise.resolve()}_get(e){let t=this.storage.getItem(e);return Promise.resolve(t?JSON.parse(t):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}},_b=1e3,vb=10,yb=class extends gb{constructor(){super(()=>window.localStorage,`LOCAL`),this.boundEventHandler=(e,t)=>this.onStorageEvent(e,t),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=iy(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(let t of Object.keys(this.listeners)){let n=this.storage.getItem(t),r=this.localCache[t];n!==r&&e(t,r,n)}}onStorageEvent(e,t=!1){if(!e.key){this.forAllChangedKeys((e,t,n)=>{this.notifyListeners(e,n)});return}let n=e.key;t?this.detachListener():this.stopPolling();let r=()=>{let e=this.storage.getItem(n);!t&&this.localCache[n]===e||this.notifyListeners(n,e)},i=this.storage.getItem(n);ry()&&i!==e.newValue&&e.newValue!==e.oldValue?setTimeout(r,vb):r()}notifyListeners(e,t){this.localCache[e]=t;let n=this.listeners[e];if(n)for(let e of Array.from(n))e(t&&JSON.parse(t))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,t,n)=>{this.onStorageEvent(new StorageEvent(`storage`,{key:e,oldValue:t,newValue:n}),!0)})},_b)}stopPolling(){this.pollTimer&&=(clearInterval(this.pollTimer),null)}attachListener(){window.addEventListener(`storage`,this.boundEventHandler)}detachListener(){window.removeEventListener(`storage`,this.boundEventHandler)}_addListener(e,t){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),this.listeners[e].size===0&&delete this.listeners[e]),Ob
35ject.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(e,t){await super._set(e,t),this.localCache[e]=JSON.stringify(t)}async _get(e){let t=await super._get(e);return this.localCache[e]=JSON.stringify(t),t}async _remove(e){await super._remove(e),delete this.localCache[e]}};yb.type=`LOCAL`;var bb=yb,xb=1e3;function Sb(e){let t=e.replace(/[\\^$.*+?()[\]{}|]/g,`\\$&`),n=RegExp(`${t}=([^;]+)`);return document.cookie.match(n)?.[1]??null}function Cb(e){return`${window.location.protocol===`http:`?`__dev_`:`__HOST-`}FIREBASE_${e.split(`:`)[3]}`}var wb=class{constructor(){this.type=`COOKIE`,this.listenerUnsubscribes=new Map}_getFinalTarget(e){let t=new URL(`${window.location.origin}/__cookies__`);return t.searchParams.set(`finalTarget`,e),t}async _isAvailable(){return typeof isSecureContext==`boolean`&&!isSecureContext||typeof navigator>`u`||typeof document>`u`?!1:navigator.cookieEnabled??!0}async _set(e,t){}async _get(e){if(!this._isAvailable())return null;let t=Cb(e);return window.cookieStore?(await window.cookieStore.get(t))?.value:Sb(t)}async _remove(e){if(!this._isAvailable()||!await this._get(e))return;let t=Cb(e);document.cookie=`${t}=;Max-Age=34560000;Partitioned;Secure;SameSite=Strict;Path=/;Priority=High`,await fetch(`/__cookies__`,{method:`DELETE`}).catch(()=>void 0)}_addListener(e,t){if(!this._isAvailable())return;let n=Cb(e);if(window.cookieStore){let e=(e=>{let r=e.changed.find(e=>e.name===n);r&&t(r.value),e.deleted.find(e=>e.name===n)&&t(null)});return this.listenerUnsubscribes.set(t,()=>window.cookieStore.removeEventListener(`change`,e)),window.cookieStore.addEventListener(`change`,e)}let r=Sb(n),i=setInterval(()=>{let e=Sb(n);e!==r&&(t(e),r=e)},xb);this.listenerUnsubscribes.set(t,()=>clearInterval(i))}_removeListener(e,t){let n=this.listenerUnsubscribes.get(t);n&&(n(),this.listenerUnsubscribes.delete(t))}};wb.type=`COOKIE`;var Tb=class extends gb{constructor(){super(()=>window.sessionStorage,`SESSION`)}_addListener(e,t){}_removeListener(e,t){}};Tb.type=`SESSION`;var Eb=Tb;function Db(e){return Promise.all(e.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(e){return{fulfilled:!1,reason:e}}}))}var Ob=class e{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(t){let n=this.receivers.find(e=>e.isListeningto(t));if(n)return n;let r=new e(t);return this.receivers.push(r),r}isListeningto(e){return this.eventTarget===e}async handleEvent(e){let t=e,{eventId:n,eventType:r,data:i}=t.data,a=this.handlersMap[r];if(!a?.size)return;t.ports[0].postMessage({status:`ack`,eventId:n,eventType:r});let o=await Db(Array.from(a).map(async e=>e(t.origin,i)));t.ports[0].postMessage({status:`done`,eventId:n,eventType:r,response:o})}_subscribe(e,t){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener(`message`,this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(t)}_unsubscribe(e,t){this.handlersMap[e]&&t&&this.handlersMap[e].delete(t),(!t||this.handlersMap[e].size===0)&&delete this.handlersMap[e],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener(`message`,this.boundEventHandler)}};Ob.receivers=[];function kb(e=``,t=10){let n=``;for(let e=0;e<t;e++)n+=Math.floor(Math.random()*10);return e+n}var Ab=class{constructor(e){this.target=e,this.handlers=new Set}removeMessageHandler(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener(`message`,e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}async _send(e,t,n=50){let r=typeof MessageChannel<`u`?new MessageChannel:null;if(!r)throw Error(`connection_unavailable`);let i,a;return new Promise((o,s)=>{let c=kb(``,20);r.port1.start();let l=setTimeout(()=>{s(Error(`unsupported_event`))},n);a={messageChannel:r,onMessage(e){let t=e;if(t.data.eventId===c)switch(t.data.status){case`ack`:clearTimeout(l),i=setTimeout(()=>{s(Error(`timeout`))},3e3);break;case`done`:clearTimeout(i),o(t.data.response);break;default:clearTimeout(l),clearTimeout(i),s(Error(`invalid_response`));break}}},this.handlers.add(a),r.port1.addEventListener(`message`,a.onMessage),this.target.postMessage({eventType:e,eventId:c,data:t},[r.port2])}).finally(()=>{a&&this.removeMessageHandler(a)})}};function jb(){return window}
35function Mb(e){jb().location.href=e}function Nb(){return jb().WorkerGlobalScope!==void 0&&typeof jb().importScripts==`function`}async function Pb(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function Fb(){return(navigator==null?void 0:navigator.serviceWorker)?.controller||null}function Ib(){return Nb()?self:null}var Lb=`firebaseLocalStorageDb`,Rb=1,zb=`firebaseLocalStorage`,Bb=`fbase_key`,Vb=class{constructor(e){this.request=e}toPromise(){return new Promise((e,t)=>{this.request.addEventListener(`success`,()=>{e(this.request.result)}),this.request.addEventListener(`error`,()=>{t(this.request.error)})})}};function Hb(e,t){return e.transaction([zb],t?`readwrite`:`readonly`).objectStore(zb)}function Ub(){return new Vb(indexedDB.deleteDatabase(Lb)).toPromise()}function Wb(){let e=indexedDB.open(Lb,Rb);return new Promise((t,n)=>{e.addEventListener(`error`,()=>{n(e.error)}),e.addEventListener(`upgradeneeded`,()=>{let t=e.result;try{t.createObjectStore(zb,{keyPath:Bb})}catch(e){n(e)}}),e.addEventListener(`success`,async()=>{let n=e.result;n.objectStoreNames.contains(zb)?t(n):(n.close(),await Ub(),t(await Wb()))})})}async function Gb(e,t,n){return new Vb(Hb(e,!0).put({[Bb]:t,value:n})).toPromise()}async function Kb(e,t){let n=await new Vb(Hb(e,!1).get(t)).toPromise();return n===void 0?null:n.value}function qb(e,t){return new Vb(Hb(e,!0).delete(t)).toPromise()}var Jb=800,Yb=3,Xb=class{constructor(){this.type=`LOCAL`,this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db||=await Wb(),this.db}async _withRetries(e){let t=0;for(;;)try{return await e(await this._openDb())}catch(e){if(t++>Yb)throw e;this.db&&=(this.db.close(),void 0)}}async initializeServiceWorkerMessaging(){return Nb()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=Ob._getInstance(Ib()),this.receiver._subscribe(`keyChanged`,async(e,t)=>({keyProcessed:(await this._poll()).includes(t.key)})),this.receiver._subscribe(`ping`,async(e,t)=>[`keyChanged`])}async initializeSender(){if(this.activeServiceWorker=await Pb(),!this.activeServiceWorker)return;this.sender=new Ab(this.activeServiceWorker);let e=await this.sender._send(`ping`,{},800);e&&e[0]?.fulfilled&&e[0]?.value.includes(`keyChanged`)&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(!(!this.sender||!this.activeServiceWorker||Fb()!==this.activeServiceWorker))try{await this.sender._send(`keyChanged`,{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;let e=await Wb();return await Gb(e,hb,`1`),await qb(e,hb),!0}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,t){return this._withPendingWrite(async()=>(await this._withRetries(n=>Gb(n,e,t)),this.localCache[e]=t,this.notifyServiceWorker(e)))}async _get(e){let t=await this._withRetries(t=>Kb(t,e));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(t=>qb(t,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){let e=await this._withRetries(e=>new Vb(Hb(e,!1).getAll()).toPromise());if(!e||this.pendingWrites!==0)return[];let t=[],n=new Set;if(e.length!==0)for(let{fbase_key:r,value:i}of e)n.add(r),JSON.stringify(this.localCache[r])!==JSON.stringify(i)&&(this.notifyListeners(r,i),t.push(r));for(let e of Object.keys(this.localCache))this.localCache[e]&&!n.has(e)&&(this.notifyListeners(e,null),t.push(e));return t}notifyListeners(e,t){this.localCache[e]=t;let n=this.listeners[e];if(n)for(let e of Array.from(n))e(t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),Jb)}stopPolling(){this.pollTimer&&=(clearInterval(this.pollTimer),null)}_addListener(e,t){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),this.listeners[e].size===0&&delete this.listeners[e]),Ob
35ject.keys(this.listeners).length===0&&this.stopPolling()}};Xb.type=`LOCAL`;var Zb=Xb;function Qb(e,t){return lv(e,`POST`,`/v2/accounts/mfaSignIn:start`,cv(e,t))}function $b(e,t){return lv(e,`POST`,`/v2/accounts/mfaSignIn:finalize`,cv(e,t))}function ex(e,t){return lv(e,`POST`,`/v2/accounts/mfaSignIn:finalize`,cv(e,t))}var tx=yy(`rcb`),nx=new nv(3e4,6e4),rx=class{constructor(){this.hostLanguage=``,this.counter=0,this.librarySeparatelyLoaded=!!jb().grecaptcha?.render}load(e,t=``){return Y(ix(t),e,`argument-error`),this.shouldResolveImmediately(t)&&gv(jb().grecaptcha)?Promise.resolve(jb().grecaptcha):new Promise((n,r)=>{let i=jb().setTimeout(()=>{r(W_(e,`network-request-failed`))},nx.get());jb()[tx]=()=>{jb().clearTimeout(i),delete jb()[tx];let a=jb().grecaptcha;if(!a||!gv(a)){r(W_(e,`internal-error`));return}let o=a.render;a.render=(e,t)=>{let n=o(e,t);return this.counter++,n},this.hostLanguage=t,n(a)},hy(`${gy()}?${Dp({onload:tx,render:`explicit`,hl:t})}`).catch(()=>{clearTimeout(i),r(W_(e,`internal-error`))})})}clearedOneInstance(){this.counter--}shouldResolveImmediately(e){return!!jb().grecaptcha?.render&&(e===this.hostLanguage||this.counter>0||this.librarySeparatelyLoaded)}};function ix(e){return e.length<=6&&/^\s*[a-zA-Z0-9\-]*\s*$/.test(e)}var ax=class{async load(e){return new Cy(e)}clearedOneInstance(){}},ox=`recaptcha`,sx={theme:`light`,type:`image`},cx=class{constructor(e,t,n=Object.assign({},sx)){this.parameters=n,this.type=ox,this.destroyed=!1,this.widgetId=null,this.tokenChangeListeners=new Set,this.renderPromise=null,this.recaptcha=null,this.auth=dy(e),this.isInvisible=this.parameters.size===`invisible`,Y(typeof document<`u`,this.auth,`operation-not-supported-in-this-environment`);let r=typeof t==`string`?document.getElementById(t):t;Y(r,this.auth,`argument-error`),this.container=r,this.parameters.callback=this.makeTokenCallback(this.parameters.callback),this._recaptchaLoader=this.auth.settings.appVerificationDisabledForTesting?new ax:new rx,this.validateStartingState()}async verify(){this.assertNotDestroyed();let e=await this.render(),t=this.getAssertedRecaptcha();return t.getResponse(e)||new Promise(n=>{let r=e=>{e&&(this.tokenChangeListeners.delete(r),n(e))};this.tokenChangeListeners.add(r),this.isInvisible&&t.execute(e)})}render(){try{this.assertNotDestroyed()}catch(e){return Promise.reject(e)}return this.renderPromise||=this.makeRenderPromise().catch(e=>{throw this.renderPromise=null,e}),this.renderPromise}_reset(){this.assertNotDestroyed(),this.widgetId!==null&&this.getAssertedRecaptcha().reset(this.widgetId)}clear(){this.assertNotDestroyed(),this.destroyed=!0,this._recaptchaLoader.clearedOneInstance(),this.isInvisible||this.container.childNodes.forEach(e=>{this.container.removeChild(e)})}validateStartingState(){Y(!this.parameters.sitekey,this.auth,`argument-error`),Y(this.isInvisible||!this.container.hasChildNodes(),this.auth,`argument-error`),Y(typeof document<`u`,this.auth,`operation-not-supported-in-this-environment`)}makeTokenCallback(e){return t=>{if(this.tokenChangeListeners.forEach(e=>e(t)),typeof e==`function`)e(t);else if(typeof e==`string`){let n=jb()[e];typeof n==`function`&&n(t)}}}assertNotDestroyed(){Y(!this.destroyed,this.auth,`internal-error`)}async makeRenderPromise(){if(await this.init(),!this.widgetId){let e=this.container;if(!this.isInvisible){let t=document.createElement(`div`);e.appendChild(t),e=t}this.widgetId=this.getAssertedRecaptcha().render(e,this.parameters)}return this.widgetId}
35async init(){Y(Q_()&&!Nb(),this.auth,`internal-error`),await lx(),this.recaptcha=await this._recaptchaLoader.load(this.auth,this.auth.languageCode||void 0);let e=await yv(this.auth);Y(e,this.auth,`internal-error`),this.parameters.sitekey=e}getAssertedRecaptcha(){return Y(this.recaptcha,this.auth,`internal-error`),this.recaptcha}};function lx(){let e=null;return new Promise(t=>{if(document.readyState===`complete`){t();return}e=()=>t(),window.addEventListener(`load`,e)}).catch(t=>{throw e&&window.removeEventListener(`load`,e),t})}var ux=class{constructor(e,t){this.verificationId=e,this.onConfirmation=t}confirm(e){let t=Gy._fromVerification(this.verificationId,e);return this.onConfirmation(t)}};async function dx(e,t,n){if(ah(e.app))return Promise.reject(K_(e));let r=dy(e);return new ux(await fx(r,t,zp(n)),e=>sb(r,e))}async function fx(e,t,n){if(!e._getRecaptchaConfig())try{await Ny(e)}catch{console.log(`Failed to initialize reCAPTCHA Enterprise config. Triggering the reCAPTCHA v2 verification.`)}try{let r;if(r=typeof t==`string`?{phoneNumber:t}:t,`session`in r){let t=r.session;if(`phoneNumber`in r)return Y(t.type===`enroll`,e,`internal-error`),(await My(e,{idToken:t.credential,phoneEnrollmentInfo:{phoneNumber:r.phoneNumber,clientType:`CLIENT_TYPE_WEB`}},`mfaSmsEnrollment`,async(e,t)=>t.phoneEnrollmentInfo.captchaResponse===ky?(Y(n?.type===ox,e,`argument-error`),db(e,await px(e,t,n))):db(e,t),`PHONE_PROVIDER`).catch(e=>Promise.reject(e))).phoneSessionInfo.sessionInfo;{Y(t.type===`signin`,e,`internal-error`);let i=r.multiFactorHint?.uid||r.multiFactorUid;return Y(i,e,`missing-multi-factor-info`),(await My(e,{mfaPendingCredential:t.credential,mfaEnrollmentId:i,phoneSignInInfo:{clientType:`CLIENT_TYPE_WEB`}},`mfaSmsSignIn`,async(e,t)=>t.phoneSignInInfo.captchaResponse===ky?(Y(n?.type===ox,e,`argument-error`),Qb(e,await px(e,t,n))):Qb(e,t),`PHONE_PROVIDER`).catch(e=>Promise.reject(e))).phoneResponseInfo.sessionInfo}}else return(await My(e,{phoneNumber:r.phoneNumber,clientType:`CLIENT_TYPE_WEB`},`sendVerificationCode`,async(e,t)=>t.captchaResponse===ky?(Y(n?.type===ox,e,`argument-error`),Wy(e,await px(e,t,n))):Wy(e,t),`PHONE_PROVIDER`).catch(e=>Promise.reject(e))).sessionInfo}finally{n?._reset()}}async function px(e,t,n){Y(n.type===ox,e,`argument-error`);let r=await n.verify();Y(typeof r==`string`,e,`argument-error`);let i=Object.assign({},t);if(`phoneEnrollmentInfo`in i){let e=i.phoneEnrollmentInfo.phoneNumber,t=i.phoneEnrollmentInfo.captchaResponse,n=i.phoneEnrollmentInfo.clientType,a=i.phoneEnrollmentInfo.recaptchaVersion;return Object.assign(i,{phoneEnrollmentInfo:{phoneNumber:e,recaptchaToken:r,captchaResponse:t,clientType:n,recaptchaVersion:a}}),i}else if(`phoneSignInInfo`in i){let e=i.phoneSignInInfo.captchaResponse,t=i.phoneSignInInfo.clientType,n=i.phoneSignInInfo.recaptchaVersion;return Object.assign(i,{phoneSignInInfo:{recaptchaToken:r,captchaResponse:e,clientType:t,recaptchaVersion:n}}),i}else return Object.assign(i,{recaptchaToken:r}),i}var mx=class e{constructor(t){this.providerId=e.PROVIDER_ID,this.auth=dy(t)}verifyPhoneNumber(e,t){return fx(this.auth,e,zp(t))}static credential(e,t){return Gy._fromVerification(e,t)}static credentialFromResult(t){let n=t;return e.credentialFromTaggedObject(n)}static credentialFromError(t){return e.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{phoneNumber:t,temporaryProof:n}=e;return t&&n?Gy._fromTokenResponse(t,n):null}};mx.PROVIDER_ID=`phone`,mx.PHONE_SIGN_IN_METHOD=`phone`;function hx(e,t){return t?Hv(t):(Y(e._popupRedirectResolver,e,`argument-error`),e._popupRedirectResolver)}var gx=class extends By{constructor(e){super(`custom`,`custom`),this.params=e}_getIdTokenResponse(e){return Hy(e,this._buildIdpRequest())}_linkToIdToken(e,t){return Hy(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return Hy(e,this._buildIdpRequest())}_buildIdpRequest(e){let t={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(t.idToken=e),t}};function _x(e){return ob(e.auth,new gx(e),e.bypassAuthState)}function vx(e){let{auth:t,user:n}=e;return Y(n,t,`internal-error`),ab(n,new gx(e),e.bypassAuthState)}async function yx(e){let{auth:t,user:n}=e;return Y(n,t,`internal-error`),ib(n,new gx(e),e.bypassAuthState)}var bx=class{constructor(e,t,n,r,i=!1){this.auth=e,this.resolver=n,this.user=r,this.bypassAuthState=i,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(t)?t:[t]}execute(){return new Promise(async(e,t)=>{this.pendingPromise={resolve:e,reject:t};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(e){this.reject(e)}})}async onAuthEvent(e){let{urlResponse:t,sessionId:n,postBody:r,tenantId:i,error:a,type:o}=e;if(a){this.reject(a);return}let s={auth:this.auth,requestUri:t,sessionId:n,tenantId:i||void 0,postBody:r||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(o)(s))}catch(e){this.reject(e)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case`signInViaPopup`:case`signInViaRedirect`:return _x;case`linkViaPopup`:case`linkViaRedirect`:return yx;case`reauthViaPopup`:case`reauthViaRedirect`:return vx;default:U_(this.auth,`internal-error`)}}resolve(e){X_(this.pendingPromise,`Pending promise was never set`),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){X_(this.pendingPromise,`Pending promise was never set`),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}},xx=new nv(2e3,1e4);async function Sx(e,t,n){if(ah(e.app))return Promise.reject(W_(e,`operation-not-supported-in-this-environment`));let r=dy(e);return q_(e,t,qy),new Cx(r,`signInViaPopup`,t,hx(r,n)).executeNotNull()}var Cx=class e extends bx{constructor(t,n,r,i,a){super(t,n,i,a),this.provider=r,this.authWindow=null,this.pollId=null,e.currentPopupAction&&e.currentPopupAction.cancel(),e.currentPopupAction=this}async executeNotNull(){let e=await this.execute();return Y(e,this.auth,`internal-error`),e}async onExecution(){X_(this.filter.length===1,`Popup operations only handle one event`);let e=kb();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(e=>{this.reject(e)}),this.resolver._isIframeWebStorageSupported(this.auth,e=>{e||this.reject(W_(this.auth,`web-storage-unsupported`))}),this.pollUserCancellation()}get eventId(){return this.authWindow?.associatedEvent||null}cancel(){this.reject(W_(this.auth,`cancelled-popup-request`))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,e.currentPopupAction=null}pollUserCancellation(){let e=()=>{if(this.authWindow?.window?.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(W_(this.auth,`popup-closed-by-user`))},8e3);return}this.pollId=window.setTimeout(e,xx.get())};e()}};Cx.currentPopupAction=null;var wx=`pendingRedirect`,Tx=new Map,Ex=class extends bx{constructor(e,t,n=!1){super(e,[`signInViaRedirect`,`linkViaRedirect`,`reauthViaRedirect`,`unknown`],t,void 0,n),this.eventId=null}async execute(){let e=Tx.get(this.auth._key());if(!e){try{let t=await Dx(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(t)}catch(t){e=()=>Promise.reject(t)}Tx.set(this.auth._key(),e)}return this.bypassAuthState||Tx.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if(e.type===`signInViaRedirect`)return super.onAuthEvent(e);
35if(e.type===`unknown`){this.resolve(null);return}if(e.eventId){let t=await this.auth._redirectUserForId(e.eventId);if(t)return this.user=t,super.onAuthEvent(e);this.resolve(null)}}async onExecution(){}cleanUp(){}};async function Dx(e,t){let n=Ax(t),r=kx(e);if(!await r._isAvailable())return!1;let i=await r._get(n)===`true`;return await r._remove(n),i}function Ox(e,t){Tx.set(e._key(),t)}function kx(e){return Hv(e._redirectPersistence)}function Ax(e){return Gv(wx,e.config.apiKey,e.name)}async function jx(e,t,n=!1){if(ah(e.app))return Promise.reject(K_(e));let r=dy(e),i=await new Ex(r,hx(r,t),n).execute();return i&&!n&&(delete i.user._redirectEventId,await r._persistUserIfCurrent(i.user),await r._setRedirectUser(null,t)),i}var Mx=600*1e3,Nx=class{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let t=!1;return this.consumers.forEach(n=>{this.isEventForConsumer(e,n)&&(t=!0,this.sendToConsumer(e,n),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!Ix(e)?t:(this.hasHandledPotentialRedirect=!0,t||=(this.queuedRedirectEvent=e,!0),t)}sendToConsumer(e,t){if(e.error&&!Fx(e)){let n=e.error.code?.split(`auth/`)[1]||`internal-error`;t.onError(W_(this.auth,n))}else t.onAuthEvent(e)}isEventForConsumer(e,t){let n=t.eventId===null||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&n}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=Mx&&this.cachedEventUids.clear(),this.cachedEventUids.has(Px(e))}saveEventToCache(e){this.cachedEventUids.add(Px(e)),this.lastProcessedEventTime=Date.now()}};function Px(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter(e=>e).join(`-`)}function Fx({type:e,error:t}){return e===`unknown`&&t?.code===`auth/no-auth-event`}function Ix(e){switch(e.type){case`signInViaRedirect`:case`linkViaRedirect`:case`reauthViaRedirect`:return!0;case`unknown`:return Fx(e);default:return!1}}async function Lx(e,t={}){return lv(e,`GET`,`/v1/projects`,t)}var Rx=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,zx=/^https?/;async function Bx(e){if(e.config.emulator)return;let{authorizedDomains:t}=await Lx(e);for(let e of t)try{if(Vx(e))return}catch{}U_(e,`unauthorized-domain`)}function Vx(e){let t=Z_(),{protocol:n,hostname:r}=new URL(t);if(e.startsWith(`chrome-extension://`)){let i=new URL(e);return i.hostname===``&&r===``?n===`chrome-extension:`&&e.replace(`chrome-extension://`,``)===t.replace(`chrome-extension://`,``):n===`chrome-extension:`&&i.hostname===r}if(!zx.test(n))return!1;if(Rx.test(e))return r===e;let i=e.replace(/\./g,`\\.`);return RegExp(`^(.+\\.`+i+`|`+i+`)$`,`i`).test(r)}var Hx=new nv(3e4,6e4);function Ux(){let e=jb().___jsl;if(e?.H){for(let t of Object.keys(e.H))if(e.H[t].r=e.H[t].r||[],e.H[t].L=e.H[t].L||[],e.H[t].r=[...e.H[t].L],e.CP)for(let t=0;t<e.CP.length;t++)e.CP[t]=null}}function Wx(e){return new Promise((t,n)=>{function r(){Ux(),gapi.load(`gapi.iframes`,{callback:()=>{t(gapi.iframes.getContext())},ontimeout:()=>{Ux(),n(W_(e,`network-request-failed`))},timeout:Hx.get()})}if(jb().gapi?.iframes?.Iframe)t(gapi.iframes.getContext());else if(jb().gapi?.load)r();else{let t=yy(`iframefcb`);return jb()[t]=()=>{gapi.load?r():n(W_(e,`network-request-failed`))},hy(`${vy()}?onload=${t}`).catch(e=>n(e))}}).catch(e=>{throw Gx=null,e})}var Gx=null;function Kx(e){return Gx||=Wx(e),Gx}var qx=new nv(5e3,15e3),Jx=`__/auth/iframe`,Yx=`emulator/auth/iframe`,Xx={style:{position:`absolute`,top:`-100px`,width:`1px`,height:`1px`},"aria-hidden":`true`,tabindex:`-1`},Zx=new Map([[`identitytoolkit.googleapis.com`,`p`],[`staging-identitytoolkit.sandbox.googleapis.com`,`s`],[`test-identitytoolkit.sandbox.googleapis.com`,`t`]]);function Qx(e){let t=e.config;Y(t.authDomain,e,`auth-domain-config-required`);let n=t.emulator?rv(t,Yx):`https://${e.config.authDomain}/${Jx}
35`,r={apiKey:t.apiKey,appName:e.name,v:ch},i=Zx.get(e.config.apiHost);i&&(r.eid=i);let a=e._getFrameworks();return a.length&&(r.fw=a.join(`,`)),`${n}?${Dp(r).slice(1)}`}async function $x(e){let t=await Kx(e),n=jb().gapi;return Y(n,e,`internal-error`),t.open({where:document.body,url:Qx(e),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:Xx,dontclear:!0},t=>new Promise(async(n,r)=>{await t.restyle({setHideOnLeave:!1});let i=W_(e,`network-request-failed`),a=jb().setTimeout(()=>{r(i)},qx.get());function o(){jb().clearTimeout(a),n(t)}t.ping(o).then(o,()=>{r(i)})}))}var eS={location:`yes`,resizable:`yes`,statusbar:`yes`,toolbar:`no`},tS=500,nS=600,rS=`_blank`,iS=`http://localhost`,aS=class{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}};function oS(e,t,n,r=tS,i=nS){let a=Math.max((window.screen.availHeight-i)/2,0).toString(),o=Math.max((window.screen.availWidth-r)/2,0).toString(),s=``,c=Object.assign(Object.assign({},eS),{width:r.toString(),height:i.toString(),top:a,left:o}),l=up().toLowerCase();n&&(s=Xv(l)?rS:n),Jv(l)&&(t||=iS,c.scrollbars=`yes`);let u=Object.entries(c).reduce((e,[t,n])=>`${e}${t}=${n},`,``);if(ny(l)&&s!==`_self`)return sS(t||``,s),new aS(null);let d=window.open(t||``,s,u);Y(d,e,`popup-blocked`);try{d.focus()}catch{}return new aS(d)}function sS(e,t){let n=document.createElement(`a`);n.href=e,n.target=t;let r=document.createEvent(`MouseEvent`);r.initMouseEvent(`click`,!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(r)}var cS=`__/auth/handler`,lS=`emulator/auth/handler`,uS=`fac`;async function dS(e,t,n,r,i,a){Y(e.config.authDomain,e,`auth-domain-config-required`),Y(e.config.apiKey,e,`invalid-api-key`);let o={apiKey:e.config.apiKey,appName:e.name,authType:n,redirectUrl:r,v:ch,eventId:i};if(t instanceof qy){t.setDefaultLanguage(e.languageCode),o.providerId=t.providerId||``,wp(t.getCustomParameters())||(o.customParameters=JSON.stringify(t.getCustomParameters()));for(let[e,t]of Object.entries(a||{}))o[e]=t}if(t instanceof Jy){let e=t.getScopes().filter(e=>e!==``);e.length>0&&(o.scopes=e.join(`,`))}e.tenantId&&(o.tid=e.tenantId);let s=o;for(let e of Object.keys(s))s[e]===void 0&&delete s[e];let c=await e._getAppCheckToken(),l=c?`#${uS}=${encodeURIComponent(c)}`:``;return`${fS(e)}?${Dp(s).slice(1)}${l}`}function fS({config:e}){return e.emulator?rv(e,lS):`https://${e.authDomain}/${cS}`}var pS=`webStorageSupport`,mS=class{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=Eb,this._completeRedirectFn=jx,this._overrideRedirectResult=Ox}async _openPopup(e,t,n,r){return X_(this.eventManagers[e._key()]?.manager,`_initialize() not called before _openPopup()`),oS(e,await dS(e,t,n,Z_(),r),kb())}async _openRedirect(e,t,n,r){return await this._originValidation(e),Mb(await dS(e,t,n,Z_(),r)),new Promise(()=>{})}_initialize(e){let t=e._key();if(this.eventManagers[t]){let{manager:e,promise:n}=this.eventManagers[t];return e?Promise.resolve(e):(X_(n,`If manager is not set, promise should be`),n)}let n=this.initAndGetManager(e);return this.eventManagers[t]={promise:n},n.catch(()=>{delete this.eventManagers[t]}),n}async initAndGetManager(e){let t=await $x(e),n=new Nx(e);return t.register(`authEvent`,t=>(Y(t?.authEvent,e,`invalid-auth-event`),{status:n.onEvent(t.authEvent)?`ACK`:`ERROR`}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:n},this.iframes[e._key()]=t,n}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send(pS,{type:pS},n=>{let r=n?.[0]?.[pS];r!==void 0&&t(!!r),U_(e,`internal-error`)},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){let t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=Bx(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return iy()||Yv()||ty()}},hS=class{constructor(e){this.factorId=e}_process(e,t,n){switch(t.type){case`enroll`:return this._finalizeEnroll(e,t.credential,n);case`signin`:return this._finalizeSignIn(e,t.credential);default:return Y_(`unexpected MultiFactorSessionType`)}}}
35,gS=class e extends hS{constructor(e){super(`phone`),this.credential=e}static _fromCredential(t){return new e(t)}_finalizeEnroll(e,t,n){return fb(e,{idToken:t,displayName:n,phoneVerificationInfo:this.credential._makeVerificationRequest()})}_finalizeSignIn(e,t){return $b(e,{mfaPendingCredential:t,phoneVerificationInfo:this.credential._makeVerificationRequest()})}},_S=class{constructor(){}static assertion(e){return gS._fromCredential(e)}};_S.FACTOR_ID=`phone`;var vS=class{static assertionForEnrollment(e,t){return yS._fromSecret(e,t)}static assertionForSignIn(e,t){return yS._fromEnrollmentId(e,t)}static async generateSecret(e){let t=e;Y(t.user?.auth!==void 0,`internal-error`);let n=await pb(t.user.auth,{idToken:t.credential,totpEnrollmentInfo:{}});return bS._fromStartTotpMfaEnrollmentResponse(n,t.user.auth)}};vS.FACTOR_ID=`totp`;var yS=class e extends hS{constructor(e,t,n){super(`totp`),this.otp=e,this.enrollmentId=t,this.secret=n}static _fromSecret(t,n){return new e(n,void 0,t)}static _fromEnrollmentId(t,n){return new e(n,t)}async _finalizeEnroll(e,t,n){return Y(this.secret!==void 0,e,`argument-error`),mb(e,{idToken:t,displayName:n,totpVerificationInfo:this.secret._makeTotpVerificationInfo(this.otp)})}async _finalizeSignIn(e,t){Y(this.enrollmentId!==void 0&&this.otp!==void 0,e,`argument-error`);let n={verificationCode:this.otp};return ex(e,{mfaPendingCredential:t,mfaEnrollmentId:this.enrollmentId,totpVerificationInfo:n})}},bS=class e{constructor(e,t,n,r,i,a,o){this.sessionInfo=a,this.auth=o,this.secretKey=e,this.hashingAlgorithm=t,this.codeLength=n,this.codeIntervalSeconds=r,this.enrollmentCompletionDeadline=i}static _fromStartTotpMfaEnrollmentResponse(t,n){return new e(t.totpSessionInfo.sharedSecretKey,t.totpSessionInfo.hashingAlgorithm,t.totpSessionInfo.verificationCodeLength,t.totpSessionInfo.periodSec,new Date(t.totpSessionInfo.finalizeEnrollmentTime).toUTCString(),t.totpSessionInfo.sessionInfo,n)}_makeTotpVerificationInfo(e){return{sessionInfo:this.sessionInfo,verificationCode:e}}generateQrCodeUrl(e,t){let n=!1;return(xS(e)||xS(t))&&(n=!0),n&&(xS(e)&&(e=this.auth.currentUser?.email||`unknownuser`),xS(t)&&(t=this.auth.name)),`otpauth://totp/${t}:${e}?secret=${this.secretKey}&issuer=${t}&algorithm=${this.hashingAlgorithm}&digits=${this.codeLength}`}};function xS(e){return e===void 0||e?.length===0}var SS=`@firebase/auth`,CS=`1.10.8`,wS=class{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){return this.assertAuthConfigured(),this.auth.currentUser?.uid||null}async getToken(e){return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{accessToken:await this.auth.currentUser.getIdToken(e)}:null}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;let t=this.auth.onIdTokenChanged(t=>{e(t?.stsTokenManager.accessToken||null)});this.internalListeners.set(e,t),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();let t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}assertAuthConfigured(){Y(this.auth._initializationPromise,`dependent-sdk-initialized-before-auth`)}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}};function TS(e){switch(e){case`Node`:return`node`;case`ReactNative`:return`rn`;case`Worker`:return`webworker`;case`Cordova`:return`cordova`;case`WebExtension`:return`web-extension`;default:return}}function ES(e){rh(new Bp(`auth`,(t,{options:n})=>{let r=t.getProvider(`app`).getImmediate(),i=t.getProvider(`heartbeat`),a=t.getProvider(`app-check-internal`),{apiKey:o,authDomain:s}=r.options;Y(o&&!o.includes(`:`),`invalid-api-key`,{appName:r.name});let c=new uy(r,i,a,{apiKey:o,authDomain:s,clientPlatform:e,apiHost:`identitytoolkit.googleapis.com`,tokenApiHost:`securetoken.googleapis.com`,apiScheme:`https`,sdkClientVersion:ay(e)});return Fy(c,n),c},`PUBLIC`).setInstantiationMode(`EXPLICIT`).setInstanceCreatedCallback((e,t,n)=>{e.getProvider(`auth-internal`).initialize()})),rh(new Bp(`auth-internal`,e=>(e=>new wS(e))(dy(e.getProvider(`auth`).getImmediate())),`PRIVATE`).setInstantiationMode(`EXPLICIT`)),dh(SS,CS,TS(e)),dh(SS,CS,`esm2017`)}var DS=tp(`authIdTokenMaxAge`)||300,OS=null,kS=e=>async t=>{let n=t&&await t.getIdTokenResult(),r=n&&(new Date().getTime()-Date.parse(n.issuedAtTime))/1e3;if(r&&r>DS)return;let i=n?.token;
35OS!==i&&(OS=i,await fetch(e,{method:i?`POST`:`DELETE`,headers:i?{Authorization:`Bearer ${i}`}:{}}))};function AS(e=uh()){let t=ih(e,`auth`);if(t.isInitialized())return t.getImmediate();let n=Py(e,{popupRedirectResolver:mS,persistence:[Zb,bb,Eb]}),r=tp(`authTokenSyncURL`);if(r&&typeof isSecureContext==`boolean`&&isSecureContext){let e=new URL(r,location.origin);if(location.origin===e.origin){let t=kS(e.toString());ub(n,t,()=>t(n.currentUser)),lb(n,e=>t(e))}}let i=$f(`auth`);return i&&Iy(n,`http://${i}`),n}function jS(){return document.getElementsByTagName(`head`)?.[0]??document}my({loadJS(e){return new Promise((t,n)=>{let r=document.createElement(`script`);r.setAttribute(`src`,e),r.onload=t,r.onerror=e=>{let t=W_(`internal-error`);t.customData=e,n(t)},r.type=`text/javascript`,r.charset=`UTF-8`,jS().appendChild(r)})},gapiScript:`https://apis.google.com/js/api.js`,recaptchaV2Script:`https://www.google.com/recaptcha/api.js`,recaptchaEnterpriseScript:`https://www.google.com/recaptcha/enterprise.js?render=`}),ES(`Browser`);var MS={prod:{apiKey:`AIzaSyDpI7OlzbUsjSs1OA5YipR7DN6XAV6B-mw`,authDomain:`pinchat-app-f24fd.firebaseapp.com`,databaseURL:`https://pinchat-app.firebaseio.com`,projectId:`pinchat-app-f24fd`,storageBucket:`pinchat-app-f24fd.firebasestorage.app`,messagingSenderId:`631888065684`,appId:`1:631888065684:web:c77becdae68aaec524f081`,measurementId:`G-M76PWLNMXC`},dev:{apiKey:`AIzaSyCB3V6jgYq2Y5r5R2WZaTz_Qz_9tY6hp0I`,authDomain:`pinchat-demo.firebaseapp.com`,databaseURL:`https://pinchat-demo.firebaseio.com`,projectId:`pinchat-demo`,storageBucket:`pinchat-demo.firebasestorage.app`,messagingSenderId:`241666402397`,appId:`1:241666402397:web:9d10298bd0f070fac5c5b4`,measurementId:`G-JK542V2MM9`}},NS=wu.VITE_FIREBASE_ENV===`prod`?MS.prod:MS.dev,PS={prod:`BIsYvhz-7Jsrf9484_xH0abXL47wC5IIzCKIksqe_GoM58HdKBcBbR8DfTH5cp5b7Dy_5lVV4UvKuQYkc-2vs08`,dev:`BIK2_apDVmsao3BDxK_CExcJSmmkpfVfm-4trgI0uoeTNpR-YHLsZ9c5U0BG7aZldQjguU8ERZjNfG77cICElLE`},FS=NS,IS=wu.VITE_FIREBASE_ENV===`prod`?PS.prod:PS.dev,LS=lh(NS),RS=AS(LS),zS=null;try{zS=A_(LS)}catch{}function BS(){return{logAnalyticsEvent:(0,f.useCallback)((e,t)=>{zS&&M_(zS,e,t)},[])}}var VS=`/assets/pinchat-horizontal-color-DIkcTnOG.png`,HS=`/assets/pinchat-horizontal-white-DM10S5Eh.png`,US=n((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),X=n(((e,t)=>{t.exports=US()}))();function WS({drawerOpen:e,onClose:t}){let{t:n}=V(`common`),{pathname:r}=oa(),{logAnalyticsEvent:i}=BS(),a=zf(e=>e.userSetting),o=a===null?localStorage.getItem(Pu)===`1`:!!a.subAccount,s=!o||(a?.subAccount_rules??[]).some(e=>e.rule===`admin`||e.rule===`analyst`),c=[...o?[]:[{to:`/dashboard/analytics`,label:n(`nav.analyticsOverview`),icon:rc,end:!0}],{to:`/dashboard/analytics/link`,label:n(`nav.analyticsLink`),icon:Ac,end:!1}],l=[{to:`/dashboard`,label:n(`nav.myLinks`),icon:ac,end:!0},...s?[{to:o?`/dashboard/analytics/link`:`/dashboard/analytics`,label:n(`nav.analytics`),icon:Ps,end:!1,children:c}]:[],...o?[]:[{to:`/dashboard/settings`,label:n(`nav.subAccountManagement`),icon:Fc,end:!0},{to:`/dashboard/settings/payment`,label:n(`nav.paymentSettings`),icon:Ks,end:!1}]],[u,d]=(0,f.useState)(()=>{let e=new Set;return l.forEach(({to:t,children:n})=>{n&&r.startsWith(t)&&e.add(t)}),e}),p=e=>d(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{className:K(`fixed inset-0 z-40 bg-black/30 lg:hidden transition-opacity duration-300`,e?`opacity-100 pointer-events-auto`:`opacity-0 pointer-events-none`),onClick:t}),(0,X.jsxs)(`aside`,{className:K(`fixed inset-y-0 left-0 z-50 flex flex-col h-full bg-bg-card border-r border-border w-56`,`transition-transform duration-300 ease-out`,e?`translate-x-0`:`-translate-x-full`,`lg:relative lg:translate-x-0`),children:[(0,X.jsx)(`div`,{className:`h-16 flex items-center border-b border-border shrink-0 px-5`,children:(0,X.jsxs)(`a`,{href:`/`,children:[(0,X.jsx)(`img`,{src:VS,alt:`PinChat`,className:`h-9 w-auto block dark:hidden`}),(0,X.jsx)(`img`,{src:HS,alt:`PinChat`,className:`h-9 w-auto hidden dark:block`})]})}),(0,X.jsx)(`nav`,{className:`flex-1 pt-6 px-3 pb-3 space-y-1.5 overflow-y-auto`,children:l.map(({to:e,label:n,icon:r,end:a,children:o})=>(0,X.jsxs)(`div`,{children:[o?(0,X.jsxs)(`div`,{className:`flex items-stretch rounded-[8px] transition-colors duration-150 hover:bg-bg-subtle group`,children:[(0,X.jsxs)(Jo,{to:e,end:a,onClick:()=>{i(`main_menu_click`,{option_name:n}),t(),p(e)},className:({isActive:e})=>K(`flex-1 flex items-center gap-2.5 px-3 min-h-9 py-2 text-[15px] font-medium cursor-pointer`,`transition-colors duration-150`,e?`text-brand`:`text-text-secondary group-hover:text-text-primary`),children:[(0,X.jsx)(r,{className:`w-4 h-4 shrink-0`}),(0,X.jsx)(`span`,{className:`line-clamp-2`,children:n})]}),(0,X.jsx)(`button`,{type:`button`,"aria-label":u.has(e)?`Collapse`:`Expand`,onClick:()=>p(e),className:`min-h-9 w-9 self-stretch flex items-center justify-center cursor-pointer transition-colors duration-150 text-text-secondary group-hover:text-text-primary`,children:(0,X.jsx)(Rs,{className:K(`w-3.5 h-3.5 transition-transform duration-200`,u.has(e)&&`rotate-90`)})})]}):(0,X.jsxs)(Jo,{to:e,end:a,onClick:()=>{i(`main_menu_click`,{option_name:n}),t()},className:({isActive:e})=>K(`flex items-center gap-2.5 px-3 min-h-9 py-2 rounded-[8px] text-[15px] font-medium cursor-pointer`,`transition-all duration-150 ease-out`,e?`text-brand`:`text-text-secondary hover:bg-bg-subtle hover:text-text-primary`),children:[(0,X.jsx)(r,{className:`w-4 h-4 shrink-0`}),(0,X.jsx)(`span`,{className:`line-clamp-2`,children:n})]}),o&&u.has(e)&&(0,X.jsx)(`div`,{className:`mt-1 space-y-0.5`,children:o.map(({to:e,label:n,icon:r,end:i})=>(0,X.jsxs)(Jo,{to:e,end:i,onClick:t,className:({isActive:e})=>K(`flex items-center gap-2 pl-9 pr-3 min-h-8 py-1.5 rounded-[8px] text-[14px] curs
35or-pointer`,`transition-all duration-150 ease-out`,e?`text-brand font-medium`:`text-text-secondary hover:bg-bg-subtle hover:text-text-primary`),children:[(0,X.jsx)(r,{className:`w-3.5 h-3.5 shrink-0`}),(0,X.jsx)(`span`,{className:`line-clamp-2`,children:n})]},e))})]},e))}),(0,X.jsx)(`div`,{className:`p-3 border-t border-border`,children:(0,X.jsxs)(`p`,{className:`text-[13px] text-text-secondary px-2 tabular-nums`,children:[`PinChat v`,`1.20.0`]})})]})]})}function GS({open:e,onClose:t,title:n,children:r,className:i}){let{t:a}=V(`common`);return(0,f.useEffect)(()=>{if(!e)return;let n=e=>{e.key===`Escape`&&t()};return document.addEventListener(`keydown`,n),()=>document.removeEventListener(`keydown`,n)},[e,t]),e?(0,fs.createPortal)((0,X.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center`,children:[(0,X.jsx)(`div`,{className:`absolute inset-0 bg-black/30 backdrop-blur-sm`,onClick:t}),(0,X.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":n,className:K(`relative card w-full max-w-md mx-4 max-h-[90vh] flex flex-col overflow-hidden`,i),style:{boxShadow:`var(--shadow-4)`},children:[n&&(0,X.jsxs)(`div`,{className:`flex items-center justify-between px-6 pt-6 pb-4 shrink-0`,children:[(0,X.jsx)(`h2`,{className:`text-[16px] font-semibold text-text-primary`,children:n}),(0,X.jsx)(`button`,{onClick:t,"aria-label":a(`closeDialog`),className:`w-8 h-8 flex items-center justify-center rounded-[8px] text-text-secondary hover:bg-bg-subtle hover:text-text-primary transition-all duration-150 cursor-pointer`,children:(0,X.jsx)(Ic,{className:`w-4 h-4`})})]}),(0,X.jsx)(`div`,{className:K(`overflow-y-auto`,n?`px-6 pb-6`:`p-6`),children:r})]})]}),document.body):null}var KS={primary:`bg-brand text-white hover:bg-brand-hover active:scale-[0.97]`,secondary:`bg-bg-card border border-border text-text-primary hover:bg-bg-subtle hover:border-border-strong active:scale-[0.97]`,danger:`bg-danger text-white hover:opacity-90 active:scale-[0.97]`,ghost:`bg-transparent text-text-secondary hover:bg-bg-subtle hover:text-text-primary active:scale-[0.97]`},qS={sm:`px-3 h-9 text-[14px]`,md:`px-4 h-10 text-[15px]`},Z=(0,f.forwardRef)(({className:e,variant:t=`primary`,size:n=`md`,loading:r,children:i,disabled:a,...o},s)=>(0,X.jsxs)(`button`,{ref:s,disabled:a||r,className:K(`inline-flex items-center justify-center gap-2 rounded-[8px] font-medium cursor-pointer`,`transition-all duration-150 ease-out`,`disabled:opacity-50 disabled:cursor-not-allowed disabled:active:scale-100`,KS[t],qS[n],e),...o,children:[r&&(0,X.jsx)(`span`,{className:`w-3.5 h-3.5 border-2 border-current border-t-transparent rounded-full animate-spin`}),i]}));Z.displayName=`Button`;var JS=xu(e=>({toasts:[],add:t=>{let n=Math.random().toString(36).slice(2);e(e=>({toasts:[...e.toasts,{...t,id:n}]}));let r=t.duration??5e3;return r>0&&setTimeout(()=>e(e=>({toasts:e.toasts.filter(e=>e.id!==n)})),r),n},remove:t=>e(e=>({toasts:e.toasts.filter(e=>e.id!==t)}))})),Q={success:(e,t)=>JS.getState().add({message:e,type:`success`,action:t}),error:e=>JS.getState().add({message:e,type:`error`}),info:(e,t)=>JS.getState().add({message:e,type:`info`,action:t}),warning:(e,t)=>JS.getState().add({message:e,type:`warning`,action:t}),rich:e=>JS.getState().add(e)};function YS({token:e,onCopy:t}){let{t:n}=V(`common`),[r,i]=(0,f.useState)(!1);return(0,X.jsxs)(`button`,{onClick:()=>{t(),i(!0),setTimeout(()=>i(!1),1500)},title:n(`copyLink`),className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-[6px] bg-bg-subtle border border-border text-[12px] font-mono text-text-secondary hover:border-border-strong hover:text-text-primary transition-colors duration-150 cursor-pointer shrink-0`,children:[e,r?(0,X.jsx)(Fs,{className:`w-3 h-3 text-brand`}):(0,X.jsx)(Gs,{className:`w-3 h-3`})]})}function XS({t:e}){let{t}=V(`common`),n=JS(e=>e.remove),[r,i]=(0,f.useState)(!1);return(0,X.jsxs)(`div`,{className:`card p-4 min-w-[320px] max-w-[420px] space-y-2.5`,style:{boxShadow:`var(--shadow-3)`},children:[e.header&&(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(`span`,{className:`text-[14px] font-medium text-text-primary truncate`,children:e.header.botName}),(0,X.jsx)(YS,{token:e.header.token,onCopy:e.header.onCopyToken}),(0,X.jsx)(`div`,{className:`flex-1`}),(0,X.jsx)(`button`,{onClick:()=>n(e.id),"aria-label":t(`closeNotification`),className:`text-text-secondary hover:text-text-primary curs
35or-pointer shrink-0`,children:(0,X.jsx)(Ic,{className:`w-4 h-4`})})]}),(0,X.jsxs)(`div`,{className:`flex items-start gap-3`,children:[e.type===`success`&&(0,X.jsx)(Bs,{className:`w-5 h-5 text-brand mt-0.5 shrink-0`}),e.type===`error`&&(0,X.jsx)(zs,{className:`w-5 h-5 text-danger mt-0.5 shrink-0`}),e.type===`info`&&(0,X.jsx)(zs,{className:`w-5 h-5 text-warning mt-0.5 shrink-0`}),e.type===`warning`&&(0,X.jsx)(jc,{className:`w-5 h-5 text-warning mt-0.5 shrink-0`}),(0,X.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,X.jsx)(`p`,{className:`text-[15px] font-medium text-text-primary leading-snug`,children:e.message}),e.subtitle&&(0,X.jsx)(`p`,{className:`text-[13px] text-text-secondary mt-0.5`,children:e.subtitle}),e.action&&(0,X.jsx)(Z,{variant:`secondary`,size:`sm`,onClick:async()=>{if(!(r||!e.action)){i(!0);try{await e.action.onClick()}catch(e){console.error(`Toast action failed`,e)}finally{i(!1)}}},loading:r,className:`mt-2`,children:e.action.label})]}),!e.header&&(0,X.jsx)(`button`,{onClick:()=>n(e.id),"aria-label":t(`closeNotification`),className:`text-text-secondary hover:text-text-primary cursor-pointer shrink-0`,children:(0,X.jsx)(Ic,{className:`w-4 h-4`})})]}),e.timestamp&&(0,X.jsx)(`p`,{className:`text-[12px] text-text-secondary text-right`,children:e.timestamp})]})}function ZS({className:e}={}){let t=JS(e=>e.toasts);return(0,X.jsx)(`div`,{role:`status`,"aria-live":`polite`,"aria-atomic":`false`,className:e??`fixed top-6 right-6 z-50 flex flex-col gap-2`,children:t.map(e=>(0,X.jsx)(XS,{t:e},e.id))})}var QS=typeof window<`u`?window.matchMedia(`(min-width: 640px)`):null;function $S(){return(0,f.useSyncExternalStore)((0,f.useCallback)(e=>(QS?.addEventListener(`change`,e),()=>QS?.removeEventListener(`change`,e)),[]),()=>QS?.matches??!0)}var eC=[{value:`zh-TW`,label:`ç¹é«ä¸æ`,short:`ç¹ä¸`},{value:`zh-CN`,label:`ç®ä½ä¸æ`,short:`ç®ä¸`},{value:`en`,label:`English`,short:`EN`},{value:`ja`,label:`æ¥æ¬èª`,short:`æ¥èª`},{value:`ko`,label:`íêµì´`,short:`íêµ`},{value:`fr`,label:`Français`,short:`FR`},{value:`de`,label:`Deutsch`,short:`DE`},{value:`es`,label:`Español`,short:`ES`},{value:`pt-BR`,label:`Português (BR)`,short:`PT`},{value:`th`,label:`ภาษาà¹à¸à¸¢`,short:`à¹à¸à¸¢`},{value:`vi`,label:`Tiếng Viá»t`,short:`VI`},{value:`ro`,label:`RomânÄ`,short:`RO`}];function tC({breadcrumb:e,onMenuClick:t}){let{t:n,i18n:r}=V(`common`),i=zf(e=>e.user),a=zf(e=>e.logout),o=zf(e=>!!e.userSetting?.subAccount),s=la(),[c,l]=(0,f.useState)(!1),[u,d]=(0,f.useState)(!1),[p,m]=(0,f.useState)(!1),h=$S(),g=(0,f.useRef)(null),_=i?.name||``,v=i?.email||``,y=_?_[0]:`?`;return(0,f.useEffect)(()=>{let e=e=>{g.current&&!g.current.contains(e.target)&&(l(!1),d(!1))};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[]),(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`header`,{className:`h-16 flex items-center justify-between gap-3 px-4 border-b border-border bg-bg-page shrink-0 lg:px-8`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0 flex-1 text-[15px] text-text-secondary`,children:[t&&(0,X.jsx)(`button`,{onClick:t,"aria-label":n(`openMenu`),className:`lg:hidden shrink-0 w-9 h-9 flex items-center justify-center rounded-[8px] text-text-secondary hover:bg-bg-subtle hover:text-text-primary transition-all duration-150 cursor-pointer`,children:(0,X.jsx)(uc,{className:`w-4 h-4`})}),e]}),(0,X.jsx)(`div`,{className:`flex items-center gap-1 shrink-0`,children:(0,X.jsxs)(`div`,{ref:g,className:`relative`,children:[(0,X.jsxs)(`button`,{onClick:()=>l(e=>!e),className:`flex items-center gap-2 pl-2 pr-3 h-9 rounded-[8px] hover:bg-bg-subtle transition-all duration-150 cursor-pointer`,children:[i?.avatar?(0,X.jsx)(`img`,{src:i.avatar,alt:_,className:`w-6 h-6 rounded-full object-cover shrink-0`}):(0,X.jsx)(`div`,{className:`w-6 h-6 rounded-full bg-brand flex items-center justify-center text-white text-[12px] font-bold shrink-0`,children:y}),(0,X.jsx)(`span`,{className:`hidden sm:block text-[15px] font-medium text-text-primary`,children:_}),(0,X.jsx)(Is,{className:K(`w-3.5 h-3.5 text-text-secondary transition-transform duration-200`,c&&`rotate-180`)})]}),c&&(0,X.jsxs)(`div`,{className:`absolute right-0 top-11 w-52 bg-bg-card border border-border rounded-[12px] py-1 z-40`,style:{boxShadow:`var(--shadow-3)`},children:[(0,X.jsxs)(`div`,{className:`px-3 py-2.5 border-b border-border`,children:[(0,X.jsx)(`p`,{className:`text-[14px] font-semibold text-text-primary`,children:_}),(0,X.jsx)(`p`,{className:`text-[13px] text-text-secondary truncate`,children:v})]}),(0,X.jsx)(`div`,{className:`h-1`}),(0,X.jsx)(nC,{icon:Pc,label:n(`myAccount`),onClick:()=>{l(!1),s(`/dashboard/account`)}}),!o&&(0,X.jsx)(nC,{icon:Ks,label:n(`plansAndBilling`),onClick:()=>{l(!1),s(`/dashboard/billing`)}}),(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsxs)(`button`,{onClick:()=>{h?d(e=>!e):(l(!1),m(!0))},className:K(`w-full flex items-center gap-2.5 px-3 py-2 text-left text-[15px] transition-colors duration-100 hover:bg-bg-subtle cursor-pointer text-text-primary`,u&&`bg-bg-subtle`),children:[(0,X.jsx)($s,{className:`w-4 h-4 shrink-0`}),(0,X.jsx)(`span`,{children:n(`language`)}),(0,X.jsxs)(`span`,{className:`ml-auto flex items-center gap-1 text-[13px] text-text-secondary`,children:[eC.find(e=>e.value===r.language)?.short??``,(0,X.jsx)(Rs,{className:`w-3.5 h-3.5`})]})]}),u&&(0,X.jsx)(`div`,{className:`absolute right-full top-0 mr-1.5 w-44 bg-bg-card border border-border rounded-[12px] py-1 z-50`,style:{boxShadow:`var(--shadow-3)`},children:eC.map(({value:e,label:t})=>(0,X.jsxs)(`button`,{onClick:async()=>{e!==r.language&&(await r.changeLanguage(e),Q.success(r.t(`languageChanged`,{ns:`common`}))),d(!1),l(!1)},className:K(`w-full flex items-center justify-between px-3 h-8 text-[14px] transition-colors duration-100 hover:bg-bg-subtle cursor-pointer`,e===r.language?`text-text-primary font-medium`:`text-text-primary`),children:[t,e===r.language&&(0,X.jsx)(Fs,{className:`w-3.5 h-3.5 shrink-0 text-text-secondary`})]},e))})]}),(0,X.jsx)(`div`,{className:`border-t border-border my-1`}),(0,X.jsx)(nC,{icon:cc,label:n(`logout`),danger:!0,onClick:()=>{l(!1),a(),s(o?`/sublogin`:`/login`,{replace:!0})}})]})]})})]}),(0,X.jsx)(GS,{open:p,onClose:()=>m(!1),title:n(`language`),children:(0,X.jsx)(`div`,{className:`flex flex-col -mx-6 -mb-6`,children:eC.map(({value:e,label:t})=>(0,X.jsxs)(`button`,{onClick:async()=>{e!==r.language&&(await r.changeLanguage(e),Q.success(r.t(`languageChanged`,{ns:`common`}))),m(!1)},className:K(`w-full flex items-center justify-between px-6 h-11 text-[15px] transition-colors duration-100 hover:bg-bg-subtle cursor-pointer`,e===r.language?`text-text-primary font-medium`:`text-text-primary`),children:[t,e===r.language&&(0,X.jsx)(Fs,{className:`w-4 h-4 shrink-0 text-brand`})]},e))})})]})}function nC({icon:e,label:t,danger:n,onClick:r}){return(0,X.jsxs)(`button`,{onClick:r,className:K(`w-full flex items-center gap-2.5 px-3 py-2 text-left text-[15px] transition-colors duration-100 hover:bg-bg-subtle cursor-pointer`,n?`text-danger`:`text-text-primary`),children:[(0,X.jsx)(e,{className:`w-4 h-4 shrink-0`}),t]})}function rC({open:e,onClose:t,linkToken:n}){let{t:r}=V(`common`),i=n?Sd(n):null;return(0,X.jsx)(GS,{open:e,onClose:t,children:(0,X.jsxs)(`div`,{className:`space-y-5`,children:[(0,X.jsx)(`h2`,{className:`text-[17px] font-semibold text-text-primary`,children:r(`trialWelcome.title`)}),i&&(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary`,children:r(`trialWelcome.shareDesc`)}),(0,X.jsxs)(`div`,{className:`flex items-center gap-2 bg-bg-subtle rounded-[8px] px-3 py-2`,children:[(0,X.jsx)(`span`,{className:`flex-1 min-w-0 truncate text-[13px] font-mono text-text-primary`,children:i}),(0,X.jsx)(`button`,{type:`button`,onClick:async()=>
35{i&&(await uu(i),Q.success(r(`copiedLink`)))},"aria-label":r(`trialWelcome.copyLink`),className:`shrink-0 w-8 h-8 flex items-center justify-center rounded-[8px] text-text-secondary hover:bg-bg-card hover:text-text-primary transition-colors cursor-pointer`,children:(0,X.jsx)(Gs,{className:`w-4 h-4`})})]})]}),(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(`h3`,{className:`text-[15px] font-semibold text-text-primary`,children:r(`trialWelcome.trialHeading`)}),(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary`,children:r(`trialWelcome.trialDesc`)}),(0,X.jsxs)(`ol`,{className:`list-decimal list-inside text-[14px] text-text-secondary space-y-1`,children:[(0,X.jsx)(`li`,{children:r(`trialWelcome.feature1`)}),(0,X.jsx)(`li`,{children:r(`trialWelcome.feature2`)}),(0,X.jsx)(`li`,{children:r(`trialWelcome.feature3`)}),(0,X.jsx)(`li`,{children:r(`trialWelcome.feature4`)})]})]}),(0,X.jsx)(Z,{className:`w-full`,onClick:t,children:r(`trialWelcome.start`)})]})})}function iC({open:e,onClose:t,onLater:n}){let{t:r}=V(`common`),i=la();return(0,X.jsx)(GS,{open:e,onClose:t,children:(0,X.jsxs)(`div`,{className:`space-y-5`,children:[(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(`h2`,{className:`text-[17px] font-semibold text-text-primary`,children:r(`trialEnd.title`)}),(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary`,children:r(`trialEnd.upgradeDesc`)})]}),(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary`,children:r(`trialEnd.featureListIntro`)}),(0,X.jsxs)(`ol`,{className:`list-decimal list-inside text-[14px] text-text-secondary space-y-1`,children:[(0,X.jsx)(`li`,{children:r(`trialEnd.feature1`)}),(0,X.jsx)(`li`,{children:r(`trialEnd.feature2`)}),(0,X.jsx)(`li`,{children:r(`trialEnd.feature3`)}),(0,X.jsx)(`li`,{children:r(`trialEnd.feature4`)})]})]}),(0,X.jsxs)(`div`,{className:`flex items-center gap-3 justify-end`,children:[(0,X.jsx)(Z,{variant:`secondary`,onClick:n,children:r(`trialEnd.later`)}),(0,X.jsx)(Z,{onClick:()=>{i(`/dashboard/billing`),t()},children:r(`trialEnd.upgrade`)})]})]})})}var aC={type0:!1,type1:!1,type2:!1,type3:!1,reason0:``,reason1:``,reason2:``,reason3:``,feedback:``};function oC({checked:e,onChange:t}){return(0,X.jsx)(`button`,{type:`button`,role:`checkbox`,"aria-checked":e,onClick:t,className:`w-4 h-4 rounded border-2 shrink-0 flex items-center justify-center cursor-pointer transition-colors ${e?`bg-brand border-brand`:`border-border bg-bg-card hover:border-border-strong`}`,children:e&&(0,X.jsx)(Fs,{className:`w-2.5 h-2.5 text-white`,strokeWidth:3})})}function sC({open:e,onClose:t}){let{t:n}=V(`common`),[r,i]=(0,f.useState)(aC),[a,o]=(0,f.useState)(!1),s=r.type0||r.type1||r.type2||r.type3,c=e=>i(t=>({...t,[e]:!t[e]})),l=(e,t)=>
35i(n=>({...n,[e]:t})),u=async()=>{o(!0);try{await q.post(`/user/trial/survey`,r)}catch{}o(!1),t()},d=[{type:`type0`,reason:`reason0`,typeLabel:n(`trialSurvey.type0`),reasonPlaceholder:n(`trialSurvey.reason0`)},{type:`type1`,reason:`reason1`,typeLabel:n(`trialSurvey.type1`),reasonPlaceholder:n(`trialSurvey.reason1`)},{type:`type2`,reason:`reason2`,typeLabel:n(`trialSurvey.type2`),reasonPlaceholder:n(`trialSurvey.reason2`)},{type:`type3`,reason:`reason3`,typeLabel:n(`trialSurvey.type3`),reasonPlaceholder:n(`trialSurvey.reason3`)}];return(0,X.jsx)(GS,{open:e,onClose:t,className:`max-w-lg`,children:(0,X.jsxs)(`div`,{className:`space-y-5`,children:[(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(`h2`,{className:`text-[17px] font-semibold text-text-primary`,children:n(`trialSurvey.title`)}),(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary`,children:n(`trialSurvey.subtitle`)})]}),(0,X.jsx)(`div`,{className:`space-y-3`,children:d.map(({type:e,reason:t,typeLabel:n,reasonPlaceholder:i})=>(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsxs)(`label`,{className:`flex items-center gap-2 cursor-pointer`,children:[(0,X.jsx)(oC,{checked:r[e],onChange:()=>c(e)}),(0,X.jsx)(`span`,{className:`text-[14px] text-text-primary`,children:n})]}),r[e]&&(0,X.jsx)(`div`,{className:`pl-6`,children:(0,X.jsx)(`textarea`,{maxLength:100,rows:2,value:r[t],onChange:e=>l(t,e.target.value),placeholder:i,className:`w-full px-3 py-2 text-[14px] rounded-[8px] border border-border bg-bg-card text-text-primary placeholder:text-text-muted focus:outline-none focus:border-brand transition-colors`,style:{resize:`vertical`}})})]},e))}),(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary`,children:n(`trialSurvey.feedbackLabel`)}),(0,X.jsx)(`textarea`,{maxLength:300,value:r.feedback,onChange:e=>l(`feedback`,e.target.value),placeholder:n(`trialSurvey.feedbackPlaceholder`),rows:3,className:`w-full px-3 py-2 text-[14px] rounded-[8px] border border-border bg-bg-card text-text-primary placeholder:text-text-muted focus:outline-none focus:border-brand transition-colors`,style:{resize:`vertical`}})]}),(0,X.jsx)(Z,{className:`w-full`,onClick:u,disabled:!s,loading:a,children:n(`trialSurvey.submit`)})]})})}var cC=xu()(e=>({currentPlan:`free`,setCurrentPlan:t=>e({currentPlan:t})})),lC={free:`free`,trial:`trial`,starter_month:`starter`,starter2_month:`starter`,starter3_month:`starter`,starter_lifetime:`starter`,light_month:`light`,light2_month:`light`,light3_month:`light`,light_lifetime:`light`,standard_month:`standard`,standard_year:`standard`,standard2_month:`standard`,standard3_month:`standard`,standard4_month:`standard`,standard_lifetime:`standard`,advanced_month:`standard`,advanced_year:`standard`,enterprise_month:`enterprise`,exhibition_month:`enterprise`,TerryMon:`enterprise`,FUNTEK_demo:`enterprise`,pinchat_tier1:`appsumo`,pinchat_tier2:`appsumo`,pinchat_tier3:`appsumo`,pinchat_tier4:`appsumo`,pinchat_tier5:`appsumo`,pinchat_tier6:`appsumo`,ltd_korea:`appsumo`};function uC(e){return e?lC[e]??`free`:`free`}var dC=new Set([`standard2_month`,`enterprise_month`,`exhibition_month`,`FUNTEK_demo`,`pinchat_tier1`,`pinchat_tier2`,`pinchat_tier3`,`pinchat_tier4`,`pinchat_tier5`,`pinchat_tier6`,`ltd_korea`]),fC=3e4,pC=1e4,mC=new Map;function hC(e,t){mC.set(e,t)}function gC(e){mC.delete(e)}var _C=new Set;function vC(e){_C.add(e)}function yC(e){_C.delete(e)}var bC=`pinchat:bot-enabled`,xC=`pinchat:bot-trained`;function SC(e){e&&window.dispatchEvent(new CustomEvent(xC,{detail:{token:e}}))}var CC=null,wC=null,TC=null,EC=!1,DC=null,OC=!1;function kC(e){if(e)try{return new Intl.DateTimeFormat(Jt.language,{year:`numeric`,month:`numeric`,day:`numeric`,hour:`2-digit`,minute:`2-digit`}).format(new Date(e))}catch{return}}function AC(e,t){if(!(!e&&!t))return{botName:e??``,token:t??``,onCopyToken:async()=>{t&&(await uu(Sd(t)),Q.success(Jt.t(`aiBot.linkCopied`,{ns:`workspace`})))}}}function jC(){DC&&=(JS.getState().remove(DC),null),OC=!1}function MC(e){let t=e.payload?.status,n=AC(e.title,e.token),r=e.payload?.data?.completed_at,i=e.payload?.startedAt??e.payload?.data?.started_at;if(t===`ready`){jC(),SC(e.token);let t=e.token;Q.rich({type:`success`,message:Jt.t(`aiBot.trainDoneTitle`,{ns:`workspace`}),subtitle:Jt.t(`aiBot.trainDoneSub`,{ns:`workspace`}),header:n,timestamp:kC(r??e.timestamp),duration:0,...t&&mC.get(t)!==!0&&{action:{label:Jt.t(`aiBot.trainDoneEnableBot`,{ns:`workspace`}),onClick:async()=>{try{let n=((await q.get(`/chat/enterpoints/configs/${encodeURIComponent(t)}`))?.data??[]).find(e=>e?.bot?.type===`ai`),r=n?.bot?.id;if(r==null)throw Error(`No AI bot on this enterpoint`);let i=n?.bot?.avatar??`https://pinchat-prod.s3.ap-northeast-1.amazonaws.com/user/e2669806e2830fc502f8835f2e6e4abe.png`;await q.post(`/bot`,{keyword:``,notify_keyword:[],notify_type:`all`,byok_openai_enabled:!1,name:e.title??`Chatbot`,token:t,id:r,avatar:i,is_open:!0,type:`ai`}),window.dispatchEvent(new CustomEvent(`pinchat:bot-enabled`,{detail:{token:t}})),Q.success(Jt.t(`aiBot.botEnabled`,{ns:`workspace`}))}catch{Q.error(Jt.t(`aiBot.botEnableFailed`,{ns:`workspace`}))}}}}});return}if(t===`error`){if(jC(),SC(e.token),e.token&&_C.has(e.token))return;Q.rich({type:`error`,message:Jt.t(`aiBot.trainFailed`,{ns:`workspace`}),subtitle:Jt.t(`aiBot.trainFailedSub`,{ns:`workspace`}),header:n,timestamp:kC(r??e.timestamp),duration:0});return}if(t===`partial_failure`){if(jC(),SC(e.token),e.token&&_C.has(e.token))return;Q.rich({type:`warning`,message:Jt.t(`aiBot.trainPartialFailed`,{ns:`workspace`}),subtitle:Jt.t(`aiBot.trainFailedSub`,{ns:`workspace`}),header:n,timestamp:kC(r??e.timestamp),duration:0});return}t===`processing`&&!OC&&(OC=!0,DC=Q.rich({type:`info`,message:Jt.t(`aiBot.trainInProgressTitle`,{ns:`workspace`}),subtitle:Jt.t(`aiBot.trainInProgressSub`,{ns:`workspace`}),header:n,timestamp:kC(i??e.timestamp),duration:0}))}function NC(){TC&&clearTimeout(TC),TC=setTimeout(()=>{TC=null,FC()},pC)}function PC(e){wC=setInterval(()=>{e.readyState===WebSocket.OPEN&&e.send(JSON.stringify({type:`ping`}))},fC),e.onmessage=e=>{try{let t=JSON.parse(String(e.data));t.type===`rag`&&MC(t)}catch{}},e.onerror=e=>{console.error(`[socket] error`,e)},e.onclose=e=>{wC&&=(clearInterval(wC),null),CC=null,!(EC||e.wasClean)&&NC()}}function FC(){if(typeof window>`u`||typeof navigator<`u`&&navigator.webdriver)return;let e=localStorage.getItem(Ou);if(!e||CC&&(CC.readyState===WebSocket.OPEN||CC.readyState===WebSocket.CONNECTING))return;TC&&=(clearTimeout(TC),null);let t=wu.VITE_PINCHAT_API_BASE;if(!t)return;let n=t.replace(/^http/,`ws`);EC=!1;try{CC=new WebSocket(n,[`Bearer`,e])}catch(e){console.error(`[socket] open failed`,e),CC=null,NC();return}PC(CC)}function IC(){EC=!0,TC&&=(clearTimeout(TC),null),wC&&=(clearInterval(wC),null),CC&&=(CC.close(),null),jC()}typeof window<`u`&&window.addEventListener(Fu,()=>{IC()});var LC=Object.create(null);
35LC.open=`0`,LC.close=`1`,LC.ping=`2`,LC.pong=`3`,LC.message=`4`,LC.upgrade=`5`,LC.noop=`6`;var RC=Object.create(null);Object.keys(LC).forEach(e=>{RC[LC[e]]=e});var zC={type:`error`,data:`parser error`},BC=typeof Blob==`function`||typeof Blob<`u`&&Object.prototype.toString.call(Blob)===`[object BlobConstructor]`,VC=typeof ArrayBuffer==`function`,HC=e=>typeof ArrayBuffer.isView==`function`?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,UC=({type:e,data:t},n,r)=>BC&&t instanceof Blob?n?r(t):WC(t,r):VC&&(t instanceof ArrayBuffer||HC(t))?n?r(t):WC(new Blob([t]),r):r(LC[e]+(t||``)),WC=(e,t)=>{let n=new FileReader;return n.onload=function(){let e=n.result.split(`,`)[1];t(`b`+(e||``))},n.readAsDataURL(e)};function GC(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}var KC;function qC(e,t){if(BC&&e.data instanceof Blob)return e.data.arrayBuffer().then(GC).then(t);if(VC&&(e.data instanceof ArrayBuffer||HC(e.data)))return t(GC(e.data));UC(e,!1,e=>{KC||=new TextEncoder,t(KC.encode(e))})}var JC=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,YC=typeof Uint8Array>`u`?[]:new Uint8Array(256);for(let e=0;e<64;
35e++)YC[JC.charCodeAt(e)]=e;var XC=e=>{let t=e.length*.75,n=e.length,r,i=0,a,o,s,c;e[e.length-1]===`=`&&(t--,e[e.length-2]===`=`&&t--);let l=new ArrayBuffer(t),u=new Uint8Array(l);for(r=0;r<n;r+=4)a=YC[e.charCodeAt(r)],o=YC[e.charCodeAt(r+1)],s=YC[e.charCodeAt(r+2)],c=YC[e.charCodeAt(r+3)],u[i++]=a<<2|o>>4,u[i++]=(o&15)<<4|s>>2,u[i++]=(s&3)<<6|c&63;return l},ZC=typeof ArrayBuffer==`function`,QC=(e,t)=>{if(typeof e!=`string`)return{type:`message`,data:ew(e,t)};let n=e.charAt(0);return n===`b`?{type:`message`,data:$C(e.substring(1),t)}:RC[n]?e.length>1?{type:RC[n],data:e.substring(1)}:{type:RC[n]}:zC},$C=(e,t)=>ZC?ew(XC(e),t):{base64:!0,data:e},ew=(e,t)=>{switch(t){case`blob`:return e instanceof Blob?e:new Blob([e]);default:return e instanceof ArrayBuffer?e:e.buffer}},tw=`�`,nw=(e,t)=>{let n=e.length,r=Array(n),i=0;e.forEach((e,a)=>{UC(e,!1,e=>{r[a]=e,++i===n&&t(r.join(tw))})})},rw=(e,t)=>{let n=e.split(tw),r=[];for(let e=0;e<n.length;e++){let i=QC(n[e],t);if(r.push(i),i.type===`error`)break}return r};function iw(){return new TransformStream({transform(e,t){qC(e,n=>{let r=n.length,i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);let e=new DataView(i.buffer);e.setUint8(0,126),e.setUint16(1,r)}else{i=new Uint8Array(9);let e=new DataView(i.buffer);e.setUint8(0,127),e.setBigUint64(1,BigInt(r))}
35e.data&&typeof e.data!=`string`&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}var aw;function ow(e){return e.reduce((e,t)=>e+t.length,0)}function sw(e,t){if(e[0].length===t)return e.shift();let n=new Uint8Array(t),r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function cw(e,t){aw||=new TextDecoder;let n=[],r=0,i=-1,a=!1;return new TransformStream({transform(o,s){for(n.push(o);;){if(r===0){if(ow(n)<1)break;let e=sw(n,1);a=(e[0]&128)==128,i=e[0]&127,r=i<126?3:i===126?1:2}else if(r===1){if(ow(n)<2)break;let e=sw(n,2);i=new DataView(e.buffer,e.byteOffset,e.length).getUint16(0),r=3}else if(r===2){if(ow(n)<8)break;let e=sw(n,8),t=new DataView(e.buffer,e.byteOffset,e.length),a=t.getUint32(0);if(a>2**21-1){s.enqueue(zC);break}i=a*2**32+t.getUint32(4),r=3}else{if(ow(n)<i)break;let e=sw(n,i);s.enqueue(QC(a?e:aw.decode(e),t)),r=0}if(i===0||i>e){s.enqueue(zC);break}}}})}function lw(e){if(e)return uw(e)}function uw(e){for(var t in lw.prototype)e[t]=lw.prototype[t];return e}lw.prototype.on=lw.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks[`$`+e]=this._callbacks[`$`+e]||[]).push(t),this},lw.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},lw.prototype.off=lw.prototype.removeListener=lw.prototype.removeAllListeners=lw.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks[`$`+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks[`$`+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks[`$`+e],this},lw.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=Array(arguments.length-1),n=this._callbacks[`$`+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this},lw.prototype.emitReserved=lw.prototype.emit,lw.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks[`$`+e]||[]},lw.prototype.hasListeners=function(e){return!!this.listeners(e).length};var dw=typeof Promise==`function`&&typeof Promise.resolve==`function`?e=>Promise.resolve().then(e):(e,t)=>t(e,0),fw=typeof self<`u`?self:typeof window<`u`?window:Function(`return this`)(),pw=`arraybuffer`;function mw(e,...t){return t.reduce((t,n)=>(e.hasOwnProperty(n)&&(t[n]=e[n]),t),{})}var hw=fw.setTimeout,gw=fw.clearTimeout;function _w(e,t){t.useNativeTimers?(e.setTimeoutFn=hw.bind(fw),e.clearTimeoutFn=gw.bind(fw)):(e.setTimeoutFn=fw.setTimeout.bind(fw),e.clearTimeoutFn=fw.clearTimeout.bind(fw))}var vw=1.33;function yw(e){return typeof e==`string`?bw(e):Math.ceil((e.byteLength||e.size)*vw)}function bw(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function xw(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Sw(e){let t=``;for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+=`&`),t+=encodeURIComponent(n)+`=`+encodeURIComponent(e[n]));return t}function Cw(e){let t={},n=e.split(`&`);for(let e=0,r=n.length;e<r;e++){let r=n[e].split(`=`);t[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return t}var ww=class extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type=`TransportError`}},Tw=class extends lw{constructor(e){super(),this.writable=!1,_w(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,n){return super.emitReserved(`error`,new ww(e,t,n)),this}open(){return this.readyState=`opening`,this.doOpen(),this}close(){return(this.readyState===`opening`||this.readyState===`open`)&&(this.doClose(),this.onClose()),this}send(e){this.readyState===`open`&&this.write(e)}onOpen(){this.readyState=`open`,this.writable=!0,super.emitReserved(`open`)}onData(e){let t=QC(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved(`packet`,e)}onClose(e){this.readyState=`closed`,super.emitReserved(`close`,e)}pause(e){}createUri(e,t={}){return e+`://`+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){let e=this.opts.hostname;return e.indexOf(`:`)===-1?e:`[`+e+`]`}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?`:`+this.opts.port:``}_query(e){let t=Sw(e);return t.length?`?`+t:``}},Ew=class extends Tw{constructor(){super(...arguments),this._polling=!1}get name(){return`polling`}doOpen(){this._poll()}pause(e){this.readyState=`pausing`;let t=()=>{this.readyState=`paused`,e()};if(this._polling||!this.writable){let e=0;this._polling&&(e++,this.once(`pollComplete`,function(){--e||t()})),this.writable||(e++,this.once(`drain`,function(){--e||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved(`poll`)}
35onData(e){rw(e,this.socket.binaryType).forEach(e=>{if(this.readyState===`opening`&&e.type===`open`&&this.onOpen(),e.type===`close`)return this.onClose({description:`transport closed by the server`}),!1;this.onPacket(e)}),this.readyState!==`closed`&&(this._polling=!1,this.emitReserved(`pollComplete`),this.readyState===`open`&&this._poll())}doClose(){let e=()=>{this.write([{type:`close`}])};this.readyState===`open`?e():this.once(`open`,e)}write(e){this.writable=!1,nw(e,e=>{this.doWrite(e,()=>{this.writable=!0,this.emitReserved(`drain`)})})}uri(){let e=this.opts.secure?`https`:`http`,t=this.query||{};return!1!==this.opts.timestampRequests&&(t[this.opts.timestampParam]=xw()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}},Dw=!1;try{Dw=typeof XMLHttpRequest<`u`&&`withCredentials`in new XMLHttpRequest}catch{}var Ow=Dw;function kw(){}var Aw=class extends Ew{constructor(e){if(super(e),typeof location<`u`){let t=location.protocol===`https:`,n=location.port;n||=t?`443`:`80`,this.xd=typeof location<`u`&&e.hostname!==location.hostname||n!==e.port}}doWrite(e,t){let n=this.request({method:`POST`,data:e});n.on(`success`,t),n.on(`error`,(e,t)=>{this.onError(`xhr post error`,e,t)})}doPoll(){let e=this.request();e.on(`data`,this.onData.bind(this)),e.on(`error`,(e,t)=>{this.onError(`xhr poll error`,e,t)}),this.pollXhr=e}},jw=class e extends lw{constructor(e,t,n){super(),this.createRequest=e,_w(this,n),this._opts=n,this._method=n.method||`GET`,this._uri=t,this._data=n.data===void 0?null:n.data,this._create()}_create(){var t;let n=mw(this._opts,`agent`,`pfx`,`key`,`passphrase`,`cert`,`ca`,`ciphers`,`rejectUnauthorized`,`autoUnref`);n.xdomain=!!this._opts.xd;let r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let e in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(e)&&r.setRequestHeader(e,this._opts.extraHeaders[e])}}catch{}if(this._method===`POST`)try{r.setRequestHeader(`Content-type`,`text/plain;charset=UTF-8`)}catch{}try{r.setRequestHeader(`Accept`,`*/*`)}catch{}(t=this._opts.cookieJar)==null||t.addCookies(r),`withCredentials`in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var e;r.readyState===3&&((e=this._opts.cookieJar)==null||e.parseCookies(r.getResponseHeader(`set-cookie`))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status==`number`?r.status:0)},0))},r.send(this._data)}catch(e){this.setTimeoutFn(()=>{this._onError(e)},0);return}typeof document<`u`&&(this._index=e.requestsCount++,e.requests[this._index]=this)}_onError(e){this.emitReserved(`error`,e,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(this._xhr===void 0||this._xhr===null)){if(this._xhr.onreadystatechange=kw,t)try{this._xhr.abort()}catch{}typeof document<`u`&&delete e.requests[this._index],this._xhr=null}}_onLoad(){let e=this._xhr.responseText;e!==null&&(this.emitReserved(`data`,e),this.emitReserved(`success`),this._cleanup())}abort(){this._cleanup()}};if(jw.requestsCount=0,jw.requests={},typeof document<`u`){if(typeof attachEvent==`function`)attachEvent(`onunload`,Mw);else if(typeof addEventListener==`function`){let e=`onpagehide`in fw?`pagehide`:`unload`;addEventListener(e,Mw,!1)}}function Mw(){for(let e in jw.requests)jw.requests.hasOwnProperty(e)&&jw.requests[e].abort()}var Nw=(function(){let e=Fw({xdomain:!1});return e&&e.responseType!==null})(),Pw=class extends Aw{constructor(e){super(e);let t=e&&e.forceBase64;this.supportsBinary=Nw&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new jw(Fw,this.uri(),e)}};function Fw(e){let t=e.xdomain;try{if(typeof XMLHttpRequest<`u`&&(!t||Ow))return new XMLHttpRequest}catch{}if(!t)try{return new fw[[`Active`,`Object`].join(`X`)](`Microsoft.XMLHTTP`)}catch{}}var Iw=typeof navigator<`u`&&typeof navigator.product==`string`&&navigator.product.toLowerCase()===`reactnative`,Lw=class extends Tw{get name(){return`websocket`}doOpen(){let e=this.uri(),t=this.opts.protocols,n=Iw?{}:mw(this.opts,`agent`,`perMessageDeflate`,`pfx`,`key`,`passphrase`,`cert`,`ca`,`ciphers`,`rejectUnauthorized`,`localAddress`,`protocolVersion`,`origin`,`maxPayload`,`family`,`checkServerIdentity`);this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,n)}catch(e){return this.emitReserved(`error`,e)}
35this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:`websocket connection closed`,context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError(`websocket error`,e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){let n=e[t],r=t===e.length-1;UC(n,this.supportsBinary,e=>{try{this.doWrite(n,e)}catch{}r&&dw(()=>{this.writable=!0,this.emitReserved(`drain`)},this.setTimeoutFn)})}}doClose(){this.ws!==void 0&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){let e=this.opts.secure?`wss`:`ws`,t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=xw()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}},Rw=fw.WebSocket||fw.MozWebSocket,zw={websocket:class extends Lw{createSocket(e,t,n){return Iw?new Rw(e,t,n):t?new Rw(e,t):new Rw(e)}doWrite(e,t){this.ws.send(t)}},webtransport:class extends Tw{get name(){return`webtransport`}doOpen(){try{this._transport=new WebTransport(this.createUri(`https`),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved(`error`,e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError(`webtransport error`,e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{let t=cw(2**53-1,this.socket.binaryType),n=e.readable.pipeThrough(t).getReader(),r=iw();r.readable.pipeTo(e.writable),this._writer=r.writable.getWriter();let i=()=>{n.read().then(({done:e,value:t})=>{e||(this.onPacket(t),i())}).catch(e=>{})};i();let a={type:`open`};this.query.sid&&(a.data=`{"sid":"${this.query.sid}"}`),this._writer.write(a).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){let n=e[t],r=t===e.length-1;this._writer.write(n).then(()=>{r&&dw(()=>{this.writable=!0,this.emitReserved(`drain`)},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)==null||e.close()}},polling:Pw},Bw=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Vw=[`source`,`protocol`,`authority`,`userInfo`,`user`,`password`,`host`,`port`,`relative`,`path`,`directory`,`file`,`query`,`anchor`];function Hw(e){if(e.length>8e3)throw`URI too long`;let t=e,n=e.indexOf(`[`),r=e.indexOf(`]`);n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,`;`)+e.substring(r,e.length));let i=Bw.exec(e||``),a={},o=14;for(;o--;)a[Vw[o]]=i[o]||``;return n!=-1&&r!=-1&&(a.source=t,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,`:`),a.authority=a.authority.replace(`[`,``).replace(`]`,``).replace(/;/g,`:`),a.ipv6uri=!0),a.pathNames=Uw(a,a.path),a.queryKey=Ww(a,a.query),a}function Uw(e,t){let n=t.replace(/\/{2,9}/g,`/`).split(`/`);return(t.slice(0,1)==`/`||t.length===0)&&n.splice(0,1),t.slice(-1)==`/`&&n.splice(n.length-1,1),n}function Ww(e,t){let n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(e,t,r){t&&(n[t]=r)}),n}var Gw=typeof addEventListener==`function`&&typeof removeEventListener==`function`,Kw=[];Gw&&addEventListener(`offline`,()=>{Kw.forEach(e=>e())},!1);var qw=class e extends lw{constructor(e,t){if(super(),this.binaryType=pw,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e==`object`&&(t=e,e=null),e){let n=Hw(e);t.hostname=n.host,t.secure=n.protocol===`https`||n.protocol===`wss`,t.port=n.port,n.query&&(t.query=n.query)}else t.host&&(t.hostname=Hw(t.host).host);_w(this,t),this.secure=t.secure==null?typeof location<`u`&&location.protocol===`https:`:t.secure,t.hostname&&!t.port&&(t.port=this.secure?`443`:`80`),this.hostname=t.hostname||(typeof location<`u`?location.hostname:`localhost`),this.port=t.port||(typeof location<`u`&&location.port?location.port:this.secure?`443`:`80`),this.transports=[],this._transportsByName={},t.transports.forEach(e=>{let t=e.prototype.name;this.transports.push(t),this._transportsByName[t]=e}),this.opts=Object.assign({path:`/engine.io`,agent:!1,withCredentials:!1,upgrade:!0,timestampParam:`t`,rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,``)+(this.opts.addTrailingSlash?`/`:``),typeof this.opts.query==`string`&&(this.opts.query=Cw(this.opts.query)),Gw&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener(`beforeunload`,this._beforeunloadEventListener,!1)),this.hostname!==`localhost`&&(this._offlineEventListener=()=>{this._onClose(`transport close`,{description:`network connection lost`})},Kw.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){let t=Object.assign({},this.opts.query);t.EIO=4,t.transport=e,this.id&&(t.sid=this.id);let n=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](n)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved(`error`,`No transports available`)},0);return}let t=this.opts.rememberUpgrade&&e.priorWebsocketSuccess&&this.transports.indexOf(`websocket`)!==-1?`websocket`:this.transports[0];this.readyState=`opening`;let n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on(`drain`,this._onDrain.bind(this)).on(`packet`,this._onPacket.bind(this)).on(`error`,this._onError.bind(this)).on(`close`,e=>this._onClose(`transport close`,e))}onOpen(){this.readyState=`open`,e.priorWebsocketSuccess=this.transport.name===`websocket`,this.emitReserved(`open`),this.flush()}_onPacket(e){if(this.readyState===`opening`||this.readyState===`open`||this.readyState===`closing`)switch(this.emitReserved(`packet`,e),this.emitReserved(`heartbeat`),e.type){case`open`:this.onHandshake(JSON.parse(e.data));break;case`ping`:this._sendPacket(`pong`),this.emitReserved(`ping`),this.emitReserved(`pong`),this._resetPingTimeout();break;case`error`:let t=Error(`server error`);t.code=e.data,this._onError(t);break;case`message`:this.emitReserved(`data`,e.data),this.emitReserved(`message`,e.data);break}}onHandshake(e){this.emitReserved(`handshake`,e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!==`closed`&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);let e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose(`ping timeout`)},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved(`drain`):this.flush()}flush(){if(this.readyState!==`closed`&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){let e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved(`flush`)}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name===`polling`&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let t=0;t<this.writeBuffer.length;t++){let n=this.writeBuffer[t].data;if(n&&(e+=yw(n)),t>0&&e>this._maxPayload)return this.writeBuffer.slice(0,t);e+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;let e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,dw(()=>{this._onClose(`ping timeout`)},this.setTimeoutFn)),e}write(e,t,n){return this._sendPacket(`message`,e,t,n),this}send(e,t,n){return this._sendPacket(`message`,e,t,n),this}_sendPacket(e,t,n,r){if(typeof t==`function`&&(r=t,t=void 0),typeof n==`function`&&(r=n,n=null),this.readyState===`closing`||this.readyState===`closed`)return;n||={}
35,n.compress=!1!==n.compress;let i={type:e,data:t,options:n};this.emitReserved(`packetCreate`,i),this.writeBuffer.push(i),r&&this.once(`flush`,r),this.flush()}close(){let e=()=>{this._onClose(`forced close`),this.transport.close()},t=()=>{this.off(`upgrade`,t),this.off(`upgradeError`,t),e()},n=()=>{this.once(`upgrade`,t),this.once(`upgradeError`,t)};return(this.readyState===`opening`||this.readyState===`open`)&&(this.readyState=`closing`,this.writeBuffer.length?this.once(`drain`,()=>{this.upgrading?n():e()}):this.upgrading?n():e()),this}_onError(t){if(e.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState===`opening`)return this.transports.shift(),this._open();this.emitReserved(`error`,t),this._onClose(`transport error`,t)}_onClose(e,t){if(this.readyState===`opening`||this.readyState===`open`||this.readyState===`closing`){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners(`close`),this.transport.close(),this.transport.removeAllListeners(),Gw&&(this._beforeunloadEventListener&&removeEventListener(`beforeunload`,this._beforeunloadEventListener,!1),this._offlineEventListener)){let e=Kw.indexOf(this._offlineEventListener);e!==-1&&Kw.splice(e,1)}this.readyState=`closed`,this.id=null,this.emitReserved(`close`,e,t),this.writeBuffer=[],this._prevBufferLen=0}}};qw.protocol=4;var Jw=class extends qw{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState===`open`&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let t=this.createTransport(e),n=!1;qw.priorWebsocketSuccess=!1;let r=()=>{n||(t.send([{type:`ping`,data:`probe`}]),t.once(`packet`,e=>{if(!n)if(e.type===`pong`&&e.data===`probe`){if(this.upgrading=!0,this.emitReserved(`upgrading`,t),!t)return;qw.priorWebsocketSuccess=t.name===`websocket`,this.transport.pause(()=>{n||this.readyState!==`closed`&&(l(),this.setTransport(t),t.send([{type:`upgrade`}]),this.emitReserved(`upgrade`,t),t=null,this.upgrading=!1,this.flush())})}else{let e=Error(`probe error`);e.transport=t.name,this.emitReserved(`upgradeError`,e)}}))};function i(){n||(n=!0,l(),t.close(),t=null)}let a=e=>{let n=Error(`probe error: `+e);n.transport=t.name,i(),this.emitReserved(`upgradeError`,n)};function o(){a(`transport closed`)}function s(){a(`socket closed`)}function c(e){t&&e.name!==t.name&&i()}let l=()=>{t.removeListener(`open`,r),t.removeListener(`error`,a),t.removeListener(`close`,o),this.off(`close`,s),this.off(`upgrading`,c)};t.once(`open`,r),t.once(`error`,a),t.once(`close`,o),this.once(`close`,s),this.once(`upgrading`,c),this._upgrades.indexOf(`webtransport`)!==-1&&e!==`webtransport`?this.setTimeoutFn(()=>{n||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){let t=[];for(let n=0;n<e.length;n++)~this.transports.indexOf(e[n])&&t.push(e[n]);return t}},Yw=class extends Jw{constructor(e,t={}){let n=typeof e==`object`,r=n?{...e}:{...t};(!r.transports||r.transports&&typeof r.transports[0]==`string`)&&(r.transports=(r.transports||[`polling`,`websocket`,`webtransport`]).map(e=>zw[e]).filter(e=>!!e)),super(n?r:e,r)}};Yw.protocol;function Xw(e,t=``,n){let r=e;n||=typeof location<`u`&&location,e??=n.protocol+`//`+n.host,typeof e==`string`&&(e.charAt(0)===`/`&&(e=e.charAt(1)===`/`?n.protocol+e:n.host+e),/^(https?|wss?):\/\//.test(e)||(e=n===void 0?`https://`+e:n.protocol+`//`+e),r=Hw(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port=`80`:/^(http|ws)s$/.test(r.protocol)&&(r.port=`443`)),r.path=r.path||`/`;let i=r.host.indexOf(`:`)===-1?r.host:`[`+r.host+`]`;return r.id=r.protocol+`://`+i+`:`+r.port+t,r.href=r.protocol+`://`+i+(n&&n.port===r.port?``:`:`+r.port),r}var Zw=typeof ArrayBuffer==`function`,Qw=e=>typeof ArrayBuffer.isView==`function`?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,$w=Object.prototype.toString,eT=typeof Blob==`function`||typeof Blob<`u`&&$w.call(Blob)===`[object BlobConstructor]`,tT=typeof File==`function`||typeof File<`u`&&$w.call(File)===`[object FileConstructor]`;function nT(e){return Zw&&(e instanceof ArrayBuffer||Qw(e))||eT&&e instanceof Blob||tT&&e instanceof File}function rT(e,t){if(!e||typeof e!=`object`)return!1;if(Array.isArray(e)){for(let t=0,n=e.length;t<n;t++)if(rT(e[t]))return!0;return!1}if(nT(e))return!0;
35if(e.toJSON&&typeof e.toJSON==`function`&&arguments.length===1)return rT(e.toJSON(),!0);for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&rT(e[t]))return!0;return!1}function iT(e){let t=[],n=e.data,r=e;return r.data=aT(n,t),r.attachments=t.length,{packet:r,buffers:t}}function aT(e,t){if(!e)return e;if(nT(e)){let n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){let n=Array(e.length);for(let r=0;r<e.length;r++)n[r]=aT(e[r],t);return n}else if(typeof e==`object`&&!(e instanceof Date)){let n={};for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=aT(e[r],t));return n}return e}function oT(e,t){return e.data=sT(e.data,t),delete e.attachments,e}function sT(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num==`number`&&e.num>=0&&e.num<t.length)return t[e.num];throw Error(`illegal attachments`)}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=sT(e[n],t);else if(typeof e==`object`)for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=sT(e[n],t));return e}var cT=e({Decoder:()=>fT,Encoder:()=>dT,PacketType:()=>uT,isPacketValid:()=>yT,protocol:()=>5}),lT=[`connect`,`connect_error`,`disconnect`,`disconnecting`,`newListener`,`removeListener`],uT;(function(e){e[e.CONNECT=0]=`CONNECT`,e[e.DISCONNECT=1]=`DISCONNECT`,e[e.EVENT=2]=`EVENT`,e[e.ACK=3]=`ACK`,e[e.CONNECT_ERROR=4]=`CONNECT_ERROR`,e[e.BINARY_EVENT=5]=`BINARY_EVENT`,e[e.BINARY_ACK=6]=`BINARY_ACK`})(uT||={});var dT=class{constructor(e){this.replacer=e}encode(e){return(e.type===uT.EVENT||e.type===uT.ACK)&&rT(e)?this.encodeAsBinary({type:e.type===uT.EVENT?uT.BINARY_EVENT:uT.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=``+e.type;return(e.type===uT.BINARY_EVENT||e.type===uT.BINARY_ACK)&&(t+=e.attachments+`-`),e.nsp&&e.nsp!==`/`&&(t+=e.nsp+`,`),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){let t=iT(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}},fT=class e extends lw{constructor(e){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof e==`function`?{reviver:e}:e)}add(e){let t;if(typeof e==`string`){if(this.reconstructor)throw Error(`got plaintext data when reconstructing a packet`);t=this.decodeString(e);let n=t.type===uT.BINARY_EVENT;n||t.type===uT.BINARY_ACK?(t.type=n?uT.EVENT:uT.ACK,this.reconstructor=new pT(t),t.attachments===0&&super.emitReserved(`decoded`,t)):super.emitReserved(`decoded`,t)}else if(nT(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved(`decoded`,t));else throw Error(`got binary data when not reconstructing a packet`);else throw Error(`Unknown type: `+e)}decodeString(t){let n=0,r={type:Number(t.charAt(0))};if(uT[r.type]===void 0)throw Error(`unknown packet type `+r.type);if(r.type===uT.BINARY_EVENT||r.type===uT.BINARY_ACK){let e=n+1;for(;t.charAt(++n)!==`-`&&n!=t.length;);let i=t.substring(e,n);if(i!=Number(i)||t.charAt(n)!==`-`)throw Error(`Illegal attachments`);let a=Number(i);if(!hT(a)||a<0)throw Error(`Illegal attachments`);if(a>this.opts.maxAttachments)throw Error(`too many attachments`);r.attachments=a}if(t.charAt(n+1)===`/`){let e=n+1;for(;++n&&!(t.charAt(n)===`,`||n===t.length););r.nsp=t.substring(e,n)}else r.nsp=`/`;let i=t.charAt(n+1);if(i!==``&&Number(i)==i){let e=n+1;for(;++n;){let e=t.charAt(n);if(e==null||Number(e)!=e){--n;break}if(n===t.length)break}r.id=Number(t.substring(e,n+1))}if(t.charAt(++n)){let i=this.tryParse(t.substr(n));if(e.isPayloadValid(r.type,i))r.data=i;else throw Error(`invalid payload`)}return r}tryParse(e){try{return JSON.parse(e,this.opts.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case uT.CONNECT:return _T(t);case uT.DISCONNECT:return t===void 0;case uT.CONNECT_ERROR:return typeof t==`string`||_T(t);case uT.EVENT:case uT.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]==`number`||typeof t[0]==`string`&&lT.indexOf(t[0])===-1);case uT.ACK:case uT.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&=(this.reconstructor.finishedReconstruction(),null)}},pT=class{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){let e=oT(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function mT(e){return typeof e==`string`}var hT=Number.isInteger||function(e){return typeof e==`number`&&isFinite(e)&&Math.floor(e)===e};function gT(e){return e===void 0||hT(e)}function _T(e){return Object.prototype.toString.call(e)===`[object Object]`}function vT(e,t){switch(e){case uT.CONNECT:return t===void 0||_T(t);case uT.DISCONNECT:return t===void 0;case uT.EVENT:return Array.isArray(t)&&(typeof t[0]==`number`||typeof t[0]==`string`&&lT.indexOf(t[0])===-1);case uT.ACK:return Array.isArray(t);case uT.CONNECT_ERROR:return typeof t==`string`||_T(t);default:return!1}}function yT(e){return mT(e.nsp)&&gT(e.id)&&vT(e.type,e.data)}function bT(e,t,n){return e.on(t,n),function(){e.off(t,n)}}var xT=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),ST=class extends lw{constructor(e,t,n){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let e=this.io;this.subs=[bT(e,`open`,this.onopen.bind(this)),bT(e,`packet`,this.onpacket.b
35ind(this)),bT(e,`error`,this.onerror.bind(this)),bT(e,`close`,this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState===`open`&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift(`message`),this.emit.apply(this,e),this}emit(e,...t){if(xT.hasOwnProperty(e))throw Error(`"`+e.toString()+`" is a reserved event name`);if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;let n={type:uT.EVENT,data:t};if(n.options={},n.options.compress=this.flags.compress!==!1,typeof t[t.length-1]==`function`){let e=this.ids++,r=t.pop();this._registerAckCallback(e,r),n.id=e}let r=this.io.engine?.transport?.writable,i=this.connected&&!this.io.engine?._hasPingExpired();return this.flags.volatile&&!r||(i?(this.notifyOutgoingListeners(n),this.packet(n)):this.sendBuffer.push(n)),this.flags={},this}_registerAckCallback(e,t){let n=this.flags.timeout??this._opts.ackTimeout;if(n===void 0){this.acks[e]=t;return}let r=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let t=0;t<this.sendBuffer.length;t++)this.sendBuffer[t].id===e&&this.sendBuffer.splice(t,1);t.call(this,Error(`operation has timed out`))},n),i=(...e)=>{this.io.clearTimeoutFn(r),t.apply(this,e)};i.withError=!0,this.acks[e]=i}emitWithAck(e,...t){return new Promise((n,r)=>{let i=(e,t)=>e?r(e):n(t);i.withError=!0,t.push(i),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]==`function`&&(t=e.pop());let n={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((e,...r)=>(this._queue[0],e===null?(this._queue.shift(),t&&t(null,...r)):n.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(e)),n.pending=!1,this._drainQueue())),this._queue.push(n),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;let t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth==`function`?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:uT.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved(`connect_error`,e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved(`disconnect`,e,t),this._clearAcks()}
35_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(t=>String(t.id)===e)){let t=this.acks[e];delete this.acks[e],t.withError&&t.call(this,Error(`socket has been disconnected`))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case uT.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved(`connect_error`,Error(`It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)`));break;case uT.EVENT:case uT.BINARY_EVENT:this.onevent(e);break;case uT.ACK:case uT.BINARY_ACK:this.onack(e);break;case uT.DISCONNECT:this.ondisconnect();break;case uT.CONNECT_ERROR:this.destroy();let t=Error(e.data.message);t.data=e.data.data,this.emitReserved(`connect_error`,t);break}}onevent(e){let t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){let t=this._anyListeners.slice();for(let n of t)n.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]==`string`&&(this._lastOffset=e[e.length-1])}ack(e){let t=this,n=!1;return function(...r){n||(n=!0,t.packet({type:uT.ACK,id:e,data:r}))}}onack(e){let t=this.acks[e.id];typeof t==`function`&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved(`connect`)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose(`io server disconnect`)}destroy(){this.subs&&=(this.subs.forEach(e=>e()),void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:uT.DISCONNECT}),this.destroy(),this.connected&&this.onclose(`io client disconnect`),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){let t=this._anyListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){let t=this._anyOutgoingListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){let t=this._anyOutgoingListeners.slice();for(let n of t)n.apply(this,e.data)}}};function CT(e){e||={},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}CT.prototype.duration=function(){var e=this.ms*this.factor**+ this.attempts++;if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0},CT.prototype.reset=function(){this.attempts=0},CT.prototype.setMin=function(e){this.ms=e},CT.prototype.setMax=function(e){this.max=e},CT.prototype.setJitter=function(e){this.jitter=e};var wT=class extends lw{constructor(e,t){super(),this.nsps={},this.subs=[],e&&typeof e==`object`&&(t=e,e=void 0),t||={},t.path=t.path||`/socket.io`,this.opts=t,_w(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(t.randomizationFactor??.5),this.backoff=new CT({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState=`closed`,this.uri=e;let n=t.parser||cT;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)==null||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)==null||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)==null||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf(`open`))return this;this.engine=new Yw(this.uri,this.opts);let t=this.engine,n=this;this._readyState=`opening`,this.skipReconnect=!1;let r=bT(t,`open`,function(){n.onopen(),e&&e()}),i=t=>{this.cleanup(),this._readyState=`closed`,this.emitReserved(`error`,t),e?e(t):this.maybeReconnectOnOpen()},a=bT(t,`error`,i);if(!1!==this._timeout){let e=this._timeout,n=this.setTimeoutFn(()=>{r(),i(Error(`timeout`)),t.close()},e);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}return this.subs.push(r),this.subs.push(a),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState=`open`,this.emitReserved(`open`);let e=this.engine;this.subs.push(bT(e,`ping`,this.onping.bind(this)),bT(e,`data`,this.ondata.bind(this)),bT(e,`error`,this.onerror.bind(this)),bT(e,`close`,this.onclose.bind(this)),bT(this.decoder,`decoded`,this.ondecoded.bind(this)))}onping(){this.emitReserved(`ping`)}ondata(e){try{this.decoder.add(e)}catch(e){this.onclose(`parse error`,e)}}ondecoded(e){dw(()=>{this.emitReserved(`packet`,e)},this.setTimeoutFn)}onerror(e){this.emitReserved(`error`,e)}socket(e,t){let n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new ST(this,e,t),this.nsps[e]=n),n}_destroy(e){let t=Object.keys(this.nsps);for(let e of t)if(this.nsps[e].active)return;this._close()}_packet(e){let t=this.encoder.encode(e);for(let n=0;n<t.length;
35n++)this.engine.write(t[n],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose(`forced close`)}disconnect(){return this._close()}onclose(e,t){var n;this.cleanup(),(n=this.engine)==null||n.close(),this.backoff.reset(),this._readyState=`closed`,this.emitReserved(`close`,e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved(`reconnect_failed`),this._reconnecting=!1;else{let t=this.backoff.duration();this._reconnecting=!0;let n=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved(`reconnect_attempt`,e.backoff.attempts),!e.skipReconnect&&e.open(t=>{t?(e._reconnecting=!1,e.reconnect(),this.emitReserved(`reconnect_error`,t)):e.onreconnect()}))},t);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}}onreconnect(){let e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved(`reconnect`,e)}},TT={};function ET(e,t){typeof e==`object`&&(t=e,e=void 0),t||={};let n=Xw(e,t.path||`/socket.io`),r=n.source,i=n.id,a=n.path,o=TT[i]&&a in TT[i].nsps,s=t.forceNew||t[`force new connection`]||!1===t.multiplex||o,c;return s?c=new wT(r,t):(TT[i]||(TT[i]=new wT(r,t)),c=TT[i]),n.query&&!t.query&&(t.query=n.queryKey),c.socket(n.path,t)}Object.assign(ET,{Manager:wT,Socket:ST,io:ET,connect:ET});var DT=xu()(e=>({badges:{},totalBadge:null,setBadges:t=>e(e=>({badges:{...e.badges,...t}})),setTotalBadge:t=>e({totalBadge:t}),reset:()=>e({badges:{},totalBadge:null})}));typeof window<`u`&&window.addEventListener(Fu,()=>{DT.getState().reset()});var OT=`pinchat_imkit_0703_2018_001_clientkey`,kT=1e3,AT=500,jT=5e3,MT=10,NT=null,PT=new Set,FT=null;function IT(e){if(localStorage.getItem(`imkit-token`)){for(let t of e)PT.add(t);FT&&clearTimeout(FT),FT=setTimeout(()=>{FT=null;let e=[...PT];PT=new Set,e.length!==0&&HT(e).then(({badges:e})=>{Object.keys(e).length>0&&DT.getState().setBadges(e)})},AT)}}function LT(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return``}}function RT(){let e=localStorage.getItem(ju);return{"Content-Type":`application/json`,"IM-Client-Key":localStorage.getItem(`imkit-client-key`)||OT,...e?{"IM-Authorization":e}:{},"x-timezone":LT(),"accept-language":Jt.language}}function zT(e){if(typeof e!=`string`)return e;try{return JSON.parse(atob(e))}catch{try{return JSON.parse(e)}catch{return e}}}async function BT(){let e=wu.VITE_CHAT_API_BASE;if(!e||!localStorage.getItem(`imkit-token`))return 0;try{let t=await fetch(`${e}/me/badge`,{headers:RT()});if(!t.ok)return 0;let n=await t.json();return typeof n?.result?.badge==`number`?n.result.badge:0}catch{return 0}}var VT=null;async function HT(e){let t=wu.VITE_CHAT_API_BASE;if(!t||e.length===0||!localStorage.getItem(`imkit-token`))return{badges:{}};VT&&VT.abort(),VT=new AbortController;try{let n=await fetch(`${t}/badges/byRoomTags`,{method:`POST`,headers:RT(),body:JSON.stringify({tags:e}),signal:VT.signal});if(!n.ok)return{badges:{}};let r=(await n.json())?.result;if(r&&typeof r==`object`){let e={};if(r.data&&typeof r.data==`object`)for(let[t,n]of Object.entries(r.data))typeof n==`number`&&(e[t]=n);return{badges:e,totalBadge:typeof r.totalBadge==`number`?r.totalBadge:void 0}}return{badges:{}}}catch{return{badges:{}}}}async function UT(e){if(e.length===0||typeof navigator<`u`&&navigator.webdriver)return;let{badges:t,totalBadge:n}=await HT(e);Object.keys(t).length>0&&DT.getState().setBadges(t),typeof n==`number`&&DT.getState().setTotalBadge(n)}var WT=0;function GT(e,t){if(t!==WT||!NT?.connected||e>=MT)return;let n=!1,r=setTimeout(()=>{n||(n=!0,GT(e+1,t))},jT);NT.emit(`auth2`,localStorage.getItem(ju),{"IM-Device-ID":``},i=>{if(!n&&(n=!0,clearTimeout(r),t===WT)){if(zT(i)?.RC!==0){GT(e+1,t);return}BT().then(e=>{DT.getState().setTotalBadge(e)})}})}function KT(){if(typeof window>`u`||typeof navigator<`u`&&navigator.webdriver||!localStorage.getItem(`imkit-token`))return;let e=wu.VITE_CHAT_API_BASE;if(e){if(NT){NT.disconnected&&NT.connect();return}NT=ET(e,{transports:[`websocket`,`webtransport`],forceBase64:!0,reconnection:!0,reconnectionAttempts:1/0,reconnectionDelay:1e3,reconnectionDelayMax:5e3,autoConnect:!0,extraHeaders:{"x-timezone":LT(),"accept-language":Jt.language}}
35),NT.on(`connect`,()=>{let e=++WT;setTimeout(()=>GT(0,e),kT)}),NT.on(`lastRead`,e=>{let t=zT(e);t&&(t.roomTags&&t.roomTags.length>0&&IT(t.roomTags),typeof t.totalBadge==`number`&&DT.getState().setTotalBadge(t.totalBadge))}),NT.on(`unreadChange`,e=>{let t=zT(e),n=typeof t==`number`?t:t?.count;typeof n==`number`&&DT.getState().setTotalBadge(n)})}}function qT(){WT++,NT&&=(NT.removeAllListeners(),NT.disconnect(),null)}typeof window<`u`&&window.addEventListener(Fu,()=>{qT()});var JT=`pinchat-widget-script`;function YT(){document.getElementById(`pcb`)?.remove(),document.getElementById(`mobile-close-flag`)?.remove(),document.getElementById(`pinchat-widget-css`)?.remove(),document.getElementById(JT)?.remove()}function XT(e){(0,f.useEffect)(()=>{if(document.getElementById(JT))return;let t=document.createElement(`script`);return t.id=JT,t.src=`${wu.VITE_WIDGET_BASE}/pinchat.js?token=${e}`,t.defer=!0,document.head.appendChild(t),()=>{YT()}},[e])}function ZT(){let[e,t]=(0,f.useState)(!1),[n,r]=(0,f.useState)(!1),[i,a]=(0,f.useState)(!1),[o,s]=(0,f.useState)(!1),[c,l]=(0,f.useState)(null),u=(0,f.useRef)(!1),d=oa(),{logAnalyticsEvent:p}=BS();(0,f.useEffect)(()=>{p(`page_view`,{page_path:d.pathname})},[d.pathname,p]);let{data:m}=Hu(!0),h=zf(e=>e.setUser),g=cC(e=>e.setCurrentPlan);return(0,f.useEffect)(()=>{m&&(h(m),g(uC(m.plan_uid)),KT())},[m,h,g]),(0,f.useEffect)(()=>{if(!m||u.current)return;u.current=!0;let e=m.trial_status??-1;if(e===0){let e=(m.plan_uid??``).toLowerCase()===`free`,t=!m.appsumo_invoice_item_uuid;if(!e||!t)return;q.get(`/chat/enterpoints/list?sort=createdAt&order=desc&page=1&pageSize=1`).then(e=>{l((e?.data??[])[0]?.token??null)}).catch(()=>{}).finally(()=>r(!0));return}if(e===2){let e=!!m.trial_option?.submit_end_survey_at,t=d.pathname.includes(`settings`);if(e||t)return;queueMicrotask(()=>a(!0))}},[m,d.pathname]),XT(`customersupport`),(0,f.useEffect)(()=>{FC()},[]),(0,X.jsxs)(`div`,{className:`flex h-full w-full bg-bg-page`,children:[(0,X.jsx)(WS,{drawerOpen:e,onClose:()=>t(!1)}),(0,X.jsxs)(`div`,{className:`flex-1 flex flex-col min-w-0`,children:[(0,X.jsx)(tC,{onMenuClick:()=>t(!0)}),(0,X.jsx)(`main`,{className:`flex-1 overflow-y-auto overflow-x-clip pt-6 px-4 pb-8 lg:px-8 [scrollbar-gutter:stable]`,children:(0,X.jsx)(`div`,{className:`max-w-screen-2xl mx-auto`,children:(0,X.jsx)(Xa,{})})})]}),(0,X.jsx)(rC,{open:n,onClose:()=>{localStorage.removeItem(`email_verified`),r(!1),Qu().catch(()=>{})},linkToken:c}),(0,X.jsx)(iC,{open:i,onClose:()=>a(!1),onLater:()=>{a(!1),s(!0)}}),(0,X.jsx)(sC,{open:o,onClose:()=>s(!1)}),(0,X.jsx)(ZS,{})]})}var QT=(0,f.createContext)({linkName:``}),$T=()=>(0,f.useContext)(QT),eE=8;function tE({content:e,children:t,className:n}){let[r,i]=(0,f.useState)(!1),[a,o]=(0,f.useState)({top:0,left:0,arrowLeft:0}),s=(0,f.useRef)(null),c=(0,f.useRef)(null),[l,u]=(0,f.useState)(`top`),d=(0,f.useCallback)(e=>{s.current&&!s.current.contains(e.target)&&i(!1)},[]);return(0,f.useEffect)(()=>{if(r)return document.addEventListener(`pointerdown`,d),()=>document.removeEventListener(`pointerdown`,d)},[r,d]),(0,f.useLayoutEffect)(()=>{if(!r)return;let e=()=>{let e=s.current,t=c.current;if(!e||!t)return;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=n.left+n.width/2,a=i-r.width/2,l=Math.max(eE,Math.min(a,window.innerWidth-r.width-eE)),d=n.top,f=window.innerHeight-n.bottom,p=d>=r.height+12||d>=f?`top`:`bottom`;u(p),o({top:p===`top`?n.top-8:n.bottom+8,left:l,arrowLeft:i-l})};return e(),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[r,e]),(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{ref:s,className:K(`inline-flex`,n),onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),onClick:()=>i(e=>!e),children:t??(0,X.jsx)(`button`,{type:`button`,className:`cursor-help`,tabIndex:-1,children:(0,X.jsx)(Hs,{className:`w-3.5 h-3.5 text-text-secondary`})})}),r&&e&&(0,fs.createPortal)((0,X.jsxs)(`div`,{ref:c,className:`fixed z-[9999] max-w-[240px] rounded-[8px] bg-[#1A1C22] text-white text-[13px] leading-relaxed px-3 py-2 pointer-events-none`,style:{to
35p:a.top,left:a.left,transform:l===`top`?`translateY(-100%)`:`translateY(0)`,boxShadow:`var(--shadow-3)`},children:[e,l===`top`?(0,X.jsx)(`div`,{className:`absolute top-full border-4 border-transparent border-t-[#1A1C22]`,style:{left:a.arrowLeft,transform:`translateX(-50%)`}}):(0,X.jsx)(`div`,{className:`absolute bottom-full border-4 border-transparent border-b-[#1A1C22]`,style:{left:a.arrowLeft,transform:`translateX(-50%)`}})]}),document.body)]})}function nE(){let{t:e}=V(`workspace`),{linkId:t}=pa(),{data:n,loading:r}=pd(t),i=n?wd(n):void 0,a=oa(),{logAnalyticsEvent:o}=BS();(0,f.useEffect)(()=>{o(`page_view`,{page_path:a.pathname})},[a.pathname,o]);let[s,c]=(0,f.useState)(!0),[l,u]=(0,f.useState)(!1),[d,p]=(0,f.useState)(!1),m=()=>{i&&(uu(i.url),p(!0),setTimeout(()=>p(!1),1500))},{data:h}=Hu(!0),g=zf(e=>e.setUser),_=cC(e=>e.setCurrentPlan);(0,f.useEffect)(()=>{h&&(g(h),_(uC(h.plan_uid)))},[h,g,_]),(0,f.useEffect)(()=>{FC()},[]),XT(`customersupport`);let v=()=>u(!1),y=[{to:`data`,label:e(`nav.dataOverview`),icon:Ps},{to:`customers`,label:e(`nav.customers`),icon:Fc}],b=!r&&n?.type===`group`,x=[{to:`settings/info`,label:e(`nav.linkInfo`),icon:_c,disabled:!1,tooltip:``},{to:`settings/automation`,label:e(`nav.automation`),icon:js,disabled:b,tooltip:e(`nav.automationGroupTooltip`)},{to:`settings/integrations`,label:e(`nav.integrations`),icon:bc,disabled:!1,tooltip:``},{to:`settings/sub-accounts`,label:e(`nav.subAccountAssignment`),icon:Nc,disabled:!1,tooltip:``}],S=(0,X.jsxs)(`div`,{className:`flex items-center gap-1.5 min-w-0 text-[15px]`,children:[(0,X.jsx)(qo,{to:`/dashboard`,className:`shrink-0 hidden sm:inline hover:text-text-primary transition-colors duration-150`,children:e(`breadcrumb.myLinks`)}),(0,X.jsx)(Rs,{className:`w-3.5 h-3.5 shrink-0 hidden sm:inline-block`}),(0,X.jsx)(`span`,{className:`text-text-primary font-medium truncate`,children:i?.title??i?.name??e(`breadcrumb.fallback`)}),i&&(0,X.jsx)(tE,{content:e(d?`breadcrumb.copied`:`breadcrumb.copyLink`),children:(0,X.jsxs)(`button`,{onClick:m,className:`shrink-0 hidden sm:inline-flex items-center gap-1 px-2 py-0.5 rounded-[6px] bg-bg-subtle text-[12px] font-mono border border-border cursor-pointer transition-colors duration-150 hover:border-border-strong hover:text-text-primary text-text-secondary`,children:[i.token,d?(0,X.jsx)(Fs,{className:`w-3 h-3 text-brand`}):(0,X.jsx)(Gs,{className:`w-3 h-3`})]})})]});return(0,X.jsxs)(`div`,{className:`flex h-full w-full bg-bg-page`,children:[(0,X.jsx)(`div`,{className:K(`fixed inset-0 z-40 bg-black/30 lg:hidden transition-opacity duration-300`,l?`opacity-100 pointer-events-auto`:`opacity-0 pointer-events-none`),onClick:v}),(0,X.jsxs)(`aside`,{className:K(`fixed inset-y-0 left-0 z-50 flex flex-col h-full bg-bg-card border-r border-border w-56`,`transition-transform duration-300 ease-out`,l?`translate-x-0`:`-translate-x-full`,`lg:relative lg:translate-x-0`),children:[(0,X.jsx)(`div`,{className:`h-16 flex items-center border-b border-border shrink-0 px-5`,children:(0,X.jsxs)(`a`,{href:`/`,children:[(0,X.jsx)(`img`,{src:VS,alt:`PinChat`,className:`h-9 w-auto block dark:hidden`}),(0,X.jsx)(`img`,{src:HS,alt:`PinChat`,className:`h-9 w-auto hidden dark:block`})]})}),(0,X.jsxs)(`nav`,{className:`flex-1 pt-6 px-3 pb-3 space-y-1.5 overflow-y-auto`,children:[(0,X.jsxs)(qo,{to:`/dashboard`,onClick:v,className:`flex items-center gap-2 px-3 min-h-9 py-2 mb-1.5 rounded-[8px] text-[14px] font-medium text-text-secondary hover:bg-bg-subtle hover:text-text-primary transition-all duration-150 ease-out lg:hidden`,children:[(0,X.jsx)(Ds,{className:`w-4 h-4 shrink-0`}),e(`breadcrumb.myLinks`)]}),y.map(({to:e,label:t,icon:n})=>(0,X.jsxs)(Jo,{to:e,onClick:v,className:({isActive:e})=>K(`flex items-center gap-2.5 px-3 min-h-9 py-2 rounded-[8px] text-[15px] font-medium cursor-pointer`,`transition-all duration-150 ease-out`,e?`text-brand`:`text-text-secondary hover:bg-bg-subtle hover:text-text-primary`),children:[(0,X.jsx)(n,{className:`w-4 h-4 shrink-0`}),(0,X.jsx)(`span`,{className:`line-clamp-2`,children:t})]},e)),(0,X.jsxs)(`div`,{className:`flex items-stretch gap-px`,children:[(0,X.jsxs)(Jo,{to:`settings/info`,onClick:v,className:({isActive:e})=>K(`flex-1 flex items-center gap-2.5 px-3 min-h-9 py-2 text-[15px] font-medium cursor-pointer`,`transition-all duration-150 ease-out rounded-l-[8px]`,e?`text-brand`:`text-text-secondary hover:bg-bg-subtle hover:text-text-primary`),children:[(0,X.jsx)(wc,{className:`w-4 h-4 shrink-0`}),(0,X.jsx)(`span`,{className:`line-clamp-2`,children:e(`nav.linkSettings`)})]}),(0,X.jsx)(`button`,{type:`button`,"aria-label":s?`Collapse`:`Expand`,onClick:()=>c(e=>!e),className:K(`min-h-9 w-9 self-stretch flex items-center justify-center cursor-pointer rounded-r-[8px]`,`transition-colors duration-150 text-text-secondary hover:bg-bg-subtle hover:text-text-primary`),children:(0,X.jsx)(Rs,{className:K(`w-3.5 h-3.5 transition-transform duration-200`,s&&`rotate-90`)})})]}),s&&(0,X.jsx)(`div`,{className:`pl-4 space-y-1`,children:x.map(({to:e,label:t,icon:n,disabled:r,tooltip:i})=>{let a=K(`flex items-center gap-2.5 px-3 min-h-9 py-2 rounded-[8px] text-[14px] font-medium`,`transition-all duration-150 ease-out`,r?`text-text-secondary opacity-40 cursor-not-allowed`:`cursor-pointer text-text-secondary hover:bg-bg-subtle hover:text-text-primary`),o=(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(n,{className:`w-3.5 h-3.5 shrink-0`}),(0,X.jsx)(`span`,{className:`line-clamp-2`,children:t})]});
35return r?(0,X.jsx)(tE,{content:i,className:`block`,children:(0,X.jsx)(`div`,{className:a,children:o})},e):(0,X.jsx)(Jo,{to:e,onClick:v,className:({isActive:e})=>K(a,e&&`text-brand opacity-100`),children:o},e)})})]})]}),(0,X.jsxs)(`div`,{className:`flex-1 flex flex-col min-w-0`,children:[(0,X.jsx)(tC,{breadcrumb:S,onMenuClick:()=>u(!0)}),(0,X.jsx)(`main`,{className:`flex-1 overflow-y-auto overflow-x-clip pt-6 px-4 pb-8 lg:px-8 [scrollbar-gutter:stable]`,children:(0,X.jsx)(`div`,{className:`max-w-screen-2xl mx-auto`,children:(0,X.jsx)(QT.Provider,{value:{linkName:i?.title||i?.name||``},children:(0,X.jsx)(Xa,{})})})})]}),(0,X.jsx)(ZS,{})]})}function rE({children:e}){let t=oa();if(!ld()){let e=t.pathname+t.search;return(0,X.jsx)(Ya,{to:`/login${e&&e!==`/dashboard`?`?redirect=${encodeURIComponent(e)}`:``}`,replace:!0})}return(0,X.jsx)(X.Fragment,{children:e})}var iE=(0,f.forwardRef)(({className:e,error:t,label:n,id:r,...i},a)=>(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[n&&(0,X.jsx)(`label`,{htmlFor:r,className:`text-[14px] font-medium text-text-primary`,children:n}),(0,X.jsx)(`input`,{ref:a,id:r,className:K(`h-10 w-full rounded-[8px] border px-3 text-[15px] bg-bg-card text-text-primary`,`placeholder:text-text-secondary placeholder:opacity-50 outline-none transition-colors`,`border-border focus:border-border-strong`,t&&`border-danger focus:border-danger`,e),...i}),t&&(0,X.jsx)(`p`,{className:`text-[13px] text-danger`,children:t})]}));iE.displayName=`Input`;var aE=`data:image/svg+xml,%3csvg%20width='20'%20height='21'%20viewBox='0%200%2020%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10%205.31c1.69%200%202.83.73%203.48%201.34l2.54-2.48C14.46%202.72%2012.43%201.83%2010%201.83c-3.52%200-6.56%202.02-8.04%204.96l2.91%202.26C5.6%206.88%207.62%205.31%2010%205.31z'%20fill='%23EA4335'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M18.64%2011.03c0-.74-.06-1.28-.19-1.84H10v3.34h4.96c-.1.83-.64%202.08-1.84%202.92l2.84%202.2c1.7-1.57%202.68-3.88%202.68-6.62z'%20fill='%234285F4'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4.88%2012.61a5.54%205.54%200%200%201-.3-1.78c0-.62.11-1.22.29-1.78L1.96%206.79A9.008%209.008%200%200%200%201%2010.83c0%201.45.35%202.82.96%204.04l2.92-2.26z'%20fill='%23FBBC05'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10%2019.83c2.43%200%204.47-.8%205.96-2.18l-2.84-2.2c-.76.53-1.78.9-3.12.9-2.38%200-4.4-1.57-5.12-3.74l-2.91%202.26c1.48%202.94%204.51%204.96%208.03%204.96z'%20fill='%2334A853'/%3e%3c/svg%3e`,oE=`data:image/svg+xml,%3csvg%20width='20'%20height='21'%20viewBox='0%200%2020%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M12.824%204.689c.563-.68.961-1.606.961-2.543a1.74%201.74%200%200%200-.035-.363c-.914.035-2.016.61-2.672%201.383-.515.585-.996%201.523-.996%202.46%200%20.141.023.282.035.329.059.011.152.023.246.023.82%200%201.852-.55%202.461-1.289zm.645%201.488c-1.371%200-2.485.832-3.2.832-.761%200-1.757-.785-2.953-.785-2.261%200-4.558%201.875-4.558%205.402%200%202.204.844%204.524%201.898%206.024.903%201.266%201.688%202.309%202.824%202.309%201.125%200%201.618-.75%203.012-.75%201.418%200%201.735.726%202.977.726%201.23%200%202.05-1.125%202.824-2.238.867-1.278%201.23-2.52%201.242-2.578-.07-.024-2.426-.985-2.426-3.68%200-2.332%201.852-3.375%201.957-3.457-1.218-1.758-3.082-1.805-3.597-1.805z'%20fill='%23000'/%3e%3c/svg%3e`,See=`data:image/svg+xml,%3csvg%20width='20'%20height='21'%20viewBox='0%200%2020%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23u4tmxr432a)'%3e%3cpath%20d='M20%2010.83c0-5.523-4.477-10-10-10s-10%204.477-10%2010c0%204.99%203.657%209.128%208.438%209.878V13.72h-2.54v-2.89h2.54V8.625c0-2.506%201.492-3.89%203.777-3.89%201.094%200%202.238.195%202.238.195v2.461h-1.26c-1.243%200-1.63.77-1.63%201.562v1.875h2.773l-.443%202.891h-2.33v6.988c4.78-.75%208.437-4.887%208.437-9.878z'%20fill='%231877F2'/%3e%3cpath%20d='m13.893%2013.72.443-2.89h-2.774V8.954c0-.791.388-1.562%201.63-1.562h1.261v-2.46s-1.144-.196-2.238-.196c-2.285%200-3.777%201.384-3.777%203.89v2.204h-2.54v2.89h2.54v6.988a10.073%2010.073%200%200%200%203.124%200V13.72h2.33z'%20fill='%23fff'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='u4tmxr432a'%3e%3cpath%20fill='%23fff'%20transform='translate(0%20.83)'%20d='M0%200h20v20H0z'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e`;function sE(e){return e?`${e} | PinChat`:`PinChat`}function cE(e){(0,f.useEffect)(()=>{let t=document.title;return document.title=sE(e),()=>{document.title=t}},[e])}function lE(e){(0,f.useEffect)(()=>
35{if(!e)return;let t=document.title;return document.title=e,()=>{document.title=t}},[e])}function Cee(){let{t:e}=V(`common`);cE(e(`login.pageTitle`));let t=la(),n=oa(),r=Vu(),i=td(),a=nd(),o=rd(),{logAnalyticsEvent:s}=BS(),[c,l]=(0,f.useState)(``),[u,d]=(0,f.useState)(``),[p,m]=(0,f.useState)(!1),[h,g]=(0,f.useState)(!1),[_,v]=(0,f.useState)(!1),y=/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(c.trim()),b=_&&c.trim().length>0&&!y,x=async i=>{if(i.preventDefault(),v(!0),!(!c.trim()||!y||!u)){s(`login_click`,{login_type:`email`});try{sd(await r.mutate({account:c.trim(),password:u})),s(`login_click`,{login_type:`email`,result:`success`}),t(new URLSearchParams(n.search).get(`redirect`)||`/dashboard`,{replace:!0})}catch(t){s(`login_click`,{login_type:`email`,result:`fail`});let n=t instanceof Du&&t.status===401?e(`login.invalidCredentials`):t instanceof Du&&t.message?t.message:e(`login.loginFailed`);Q.error(n)}}},S=async r=>{s(`login_click`,{login_type:r}),g(!0);try{let e=await Sx(RS,r===`facebook`?new Xy:r===`google`?new Zy:new Yy(`apple.com`));sd(await(r===`facebook`?i:r===`google`?a:o).mutate({token:e.user.accessToken})),s(`login_click`,{login_type:r,result:`success`}),t(new URLSearchParams(n.search).get(`redirect`)||`/dashboard`,{replace:!0})}catch(t){let n=t?.code;if(n===`auth/popup-closed-by-user`||n===`auth/cancelled-popup-request`)return;let r;r=t instanceof Du&&t.message?t.message:e(n===`auth/popup-blocked`?`login.oauthPopupBlocked`:n===`auth/network-request-failed`?`login.oauthNetworkError`:`login.oauthFailed`),Q.error(r)}finally{g(!1)}};return(0,X.jsxs)(`div`,{className:`fixed inset-0 overflow-y-auto bg-bg-page`,children:[(0,X.jsx)(ZS,{}),(0,X.jsx)(`div`,{className:`flex min-h-full items-center justify-center px-4 py-8`,children:(0,X.jsxs)(`div`,{className:`w-full max-w-sm`,children:[(0,X.jsxs)(`a`,{href:`/`,className:`flex items-center justify-center mb-8`,children:[(0,X.jsx)(`img`,{src:VS,alt:`PinChat`,className:`h-12 w-auto block dark:hidden`}),(0,X.jsx)(`img`,{src:HS,alt:`PinChat`,className:`h-12 w-auto hidden dark:block`})]}),(0,X.jsxs)(`div`,{className:`card p-6 space-y-5`,children:[(0,X.jsx)(`h1`,{className:`text-[20px] font-semibold text-text-primary text-center`,children:e(`login.title`)}),(0,X.jsxs)(`form`,{onSubmit:x,className:`space-y-4`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsx)(`label`,{className:`text-[14px] font-medium text-text-primary`,children:e(`login.accountLabel`)}),(0,X.jsx)(iE,{type:`email`,value:c,onChange:e=>l(e.target.value),onBlur:()=>v(!0),placeholder:e(`login.accountPlaceholder`),autoComplete:`username`,autoFocus:!0,required:!0}),b&&(0,X.jsx)(`p`,{className:`text-[13px] text-danger mt-0.5`,children:e(`emailInvalid`)})]}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,X.jsx)(`label`,{className:`text-[14px] font-medium text-text-primary`,children:e(`login.passwordLabel`)}),(0,X.jsx)(qo,{to:`/forgot-password`,className:`text-[13px] text-brand hover:underline`,children:e(`login.forgotPassword`)})]}),(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsx)(iE,{type:p?`text`:`password`,value:u,onChange:e=>d(e.target.value),placeholder:e(`login.passwordPlaceholder`),autoComplete:`current-password`,required:!0,className:`pr-10`}),(0,X.jsx)(`button`,{type:`button`,onClick:()=>m(e=>!e),className:`absolute right-2.5 top-1/2 -translate-y-1/2 text-text-secondary hover:text-text-primary cursor-pointer p-1`,"aria-label":e(p?`login.hidePassword`:`login.showPassword`),children:p?(0,X.jsx)(Xs,{className:`w-4 h-4`}):(0,X.jsx)(Zs,{className:`w-4 h-4`})})]})]}),(0,X.jsx)(Z,{type:`submit`,disabled:!c.trim()||!y||!u||r.loading,className:`w-full disabled:opacity-40`,children:r.loading?e(`loading`):e(`login.submitBtn`)})]}),(0,X.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,X.jsx)(`div`,{className:`flex-1 h-px bg-border`}),(0,X.jsx)(`span`,{className:`text-[13px] text-text-secondary`,children:e(`login.orDivider`)}),(0,X.jsx)(`div`,{className:`flex-1 h-px bg-border`})]}),(0,X.jsxs)(`div`,{className:`space-y-3`,children:[(0,X.jsxs)(Z,{type:`button`,variant:`secondary`,className:`w-full`,onClick:()=>S(`google`),disabled:h,children:[(0,X.jsx)(`img`,{src:aE,alt:``,className:`w-5 h-5 shrink-0`}),e(`login.continueWithGoogle`)]}),(0,X.jsxs)(Z,{type:`button`,variant:`secondary`,className:`w-full`,onClick:()=>S(`facebook`),disabled:h,children:[(0,X.jsx)(`img`,{src:See,alt:``,className:`w-5 h-5 shrink-0`}
35),e(`login.continueWithFacebook`)]}),(0,X.jsxs)(Z,{type:`button`,variant:`secondary`,className:`w-full`,onClick:()=>S(`apple`),disabled:h,children:[(0,X.jsx)(`img`,{src:oE,alt:``,className:`w-5 h-5 shrink-0`}),e(`login.continueWithApple`)]})]})]}),(0,X.jsxs)(`p`,{className:`text-[13px] text-text-secondary text-center mt-4`,children:[e(`login.noAccount`),` `,(0,X.jsx)(qo,{to:`/register`,className:`text-brand hover:underline`,children:e(`login.registerLink`)})]}),(0,X.jsxs)(`p`,{className:`text-[13px] text-text-secondary text-center mt-2`,children:[(0,X.jsx)(qo,{to:`/login-phone`,className:`hover:text-text-primary hover:underline`,children:e(`login.loginWithPhone`)}),(0,X.jsx)(`span`,{className:`mx-2`,children:`·`}),(0,X.jsx)(qo,{to:`/sublogin`,className:`hover:text-text-primary hover:underline`,children:e(`login.subAccountLogin`)})]})]})})]})}var wee={"zh-TW":`TW`,"zh-CN":`CN`,ja:`JP`,ko:`KR`,th:`TH`,vi:`VN`,de:`DE`,es:`ES`,fr:`FR`,"pt-BR":`BR`,ro:`RO`,en:`US`},uE=[{code:`CA`,dial:`+1`,flag:`ð¨ð¦`,name:`Canada`,placeholder:`204 123 4567`},{code:`US`,dial:`+1`,flag:`ðºð¸`,name:`United States`,placeholder:`201 555 0123`},{code:`KZ`,dial:`+7`,flag:`ð°ð¿`,name:`Kazakhstan`,placeholder:`701 234 5678`},{code:`RU`,dial:`+7`,flag:`ð·ðº`,name:`Russia`,placeholder:`912 345 6789`},{code:`EG`,dial:`+20`,flag:`ðªð¬`,name:`Egypt`,placeholder:`10 1234 5678`},{code:`ZA`,dial:`+27`,flag:`ð¿ð¦`,name:`South Africa`,placeholder:`71 123 4567`},{code:`GR`,dial:`+30`,flag:`ð¬ð·`,name:`Greece`,placeholder:`691 234 5678`},{code:`NL`,dial:`+31`,flag:`ð³ð±`,name:`Netherlands`,placeholder:`6 12345678`},{code:`BE`,dial:`+32`,flag:`ð§ðª`,name:`Belgium`,placeholder:`470 12 34 56`},{code:`FR`,dial:`+33`,flag:`ð«ð·`,name:`France`,placeholder:`6 12 34 56 78`},{code:`ES`,dial:`+34`,flag:`ðªð¸`,name:`Spain`,placeholder:`612 345 678`},{code:`HU`,dial:`+36`,flag:`ððº`,name:`Hungary`,placeholder:`20 123 4567`},{code:`IT`,dial:`+39`,flag:`ð®ð¹`,name:`Italy`,placeholder:`312 345 6789`},{code:`RO`,dial:`+40`,flag:`ð·ð´`,name:`Romania`,placeholder:`712 345 678`},{code:`CH`,dial:`+41`,flag:`ð¨ð`,name:`Switzerland`,placeholder:`78 123 45 67`},{code:`AT`,dial:`+43`,flag:`ð¦ð¹`,name:`Austria`,placeholder:`664 123456`},{code:`GB`,dial:`+44`,flag:`ð¬ð§`,name:`United Kingdom`,placeholder:`7911 123456`},{code:`DK`,dial:`+45`,flag:`ð©ð°`,name:`Denmark`,placeholder:`20 12 34 56`},{code:`SE`,dial:`+46`,flag:`ð¸ðª`,name:`Sweden`,placeholder:`70 123 45 67`},{code:`NO`,dial:`+47`,flag:`ð³ð´`,name:`Norway`,placeholder:`412 34 567`},{code:`PL`,dial:`+48`,flag:`ðµð±`,name:`Poland`,placeholder:`512 345 678`},{code:`DE`,dial:`+49`,flag:`ð©ðª`,name:`Germany`,placeholder:`151 23456789`},{code:`PE`,dial:`+51`,flag:`ðµðª`,name:`Peru`,placeholder:`912 345 678`},{code:`MX`,dial:`+52`,flag:`ð²ð½`,name:`Mexico`,placeholder:`222 123 4567`},{code:`AR`,dial:`+54`,flag:`ð¦ð·`,name:`Argentina`,placeholder:`11 1234 5678`},{code:`BR`,dial:`+55`,flag:`ð§ð·`,name:`Brazil`,placeholder:`11 91234 5678`},{code:`CL`,dial:`+56`,flag:`ð¨ð±`,name:`Chile`,placeholder:`9 1234 5678`},{code:`CO`,dial:`+57`,flag:`ð¨ð´`,name:`Colombia`,placeholder:`321 123 4567`},{code:`VE`,dial:`+58`,flag:`ð»ðª`,name:`Venezuela`,placeholder:`412 123 4567`},{code:`MY`,dial:`+60`,flag:`ð²ð¾`,name:`Malaysia`,placeholder:`12 345 6789`},{code:`AU`,dial:`+61`,flag:`ð¦ðº`,name:`Australia`,placeholder:`412 345 678`},{code:`ID`,dial:`+62`,flag:`ð®ð©`,name:`Indonesia`,placeholder:`812 3456 7890`},{code:`PH`,dial:`+63`,flag:`ðµð`,name:`Philippines`,placeholder:`912 345 6789`},{code:`NZ`,dial:`+64`,flag:`ð³ð¿`,name:`New Zealand`,placeholder:`21 123 4567`},{code:`SG`,dial:`+65`,flag:`ð¸ð¬`,name:`Singapore`,placeholder:`8123 4567`},{code:`TH`,dial:`+66`,flag:`ð¹ð`,name:`Thailand`,placeholder:`81 234 5678`},{code:`JP`,dial:`+81`,flag:`ð¯ðµ`,name:`Japan`,placeholder:`90 1234 5678`},{code:`KR`,dial:`+82`,flag:`ð°ð·`,name:`Korea`,placeholder:`10 1234 5678`},{code:`VN`,dial:`+84`,flag:`ð»ð³`,name:`Vietnam`,placeholder:`91 234 5678`},{code:`CN`,dial:`+86`,flag:`ð¨ð³`,name:`China`,placeholder:`131 2345 6789`},{code:`TR`,dial:`+90`,flag:`ð¹ð·`,name:`Turkey`,placeholder:`501 234 5678`},{code:`IN`,dial:`+91`,flag:`ð®ð³`,name:`India`,placeholder:`98765 43210`},{code:`PK`,dial:`+92`,flag:`ðµð°`,name:`Pakistan`,placeholder:`301 234 5678`},{code:`AF`,dial:`+93`,flag:`ð¦ð«`,name:`Afghanistan`,placeholder:`701 234 567`},{code:`LK`,dial:`+94`,flag:`ð±ð°`,name:`Sri Lanka`,placeholder:`71 234 5678`}
35,{code:`MM`,dial:`+95`,flag:`ð²ð²`,name:`Myanmar`,placeholder:`9 212 3456`},{code:`MA`,dial:`+212`,flag:`ð²ð¦`,name:`Morocco`,placeholder:`6 12 34 56 78`},{code:`DZ`,dial:`+213`,flag:`ð©ð¿`,name:`Algeria`,placeholder:`551 23 45 67`},{code:`TN`,dial:`+216`,flag:`ð¹ð³`,name:`Tunisia`,placeholder:`20 123 456`},{code:`GH`,dial:`+233`,flag:`ð¬ð`,name:`Ghana`,placeholder:`23 123 4567`},{code:`NG`,dial:`+234`,flag:`ð³ð¬`,name:`Nigeria`,placeholder:`802 123 4567`},{code:`ET`,dial:`+251`,flag:`ðªð¹`,name:`Ethiopia`,placeholder:`91 123 4567`},{code:`KE`,dial:`+254`,flag:`ð°ðª`,name:`Kenya`,placeholder:`712 345678`},{code:`TZ`,dial:`+255`,flag:`ð¹ð¿`,name:`Tanzania`,placeholder:`621 234 567`},{code:`PT`,dial:`+351`,flag:`ðµð¹`,name:`Portugal`,placeholder:`912 345 678`},{code:`IE`,dial:`+353`,flag:`ð®ðª`,name:`Ireland`,placeholder:`85 123 4567`},{code:`FI`,dial:`+358`,flag:`ð«ð®`,name:`Finland`,placeholder:`41 234 5678`},{code:`BG`,dial:`+359`,flag:`ð§ð¬`,name:`Bulgaria`,placeholder:`87 123 4567`},{code:`UA`,dial:`+380`,flag:`ðºð¦`,name:`Ukraine`,placeholder:`50 123 4567`},{code:`RS`,dial:`+381`,flag:`ð·ð¸`,name:`Serbia`,placeholder:`60 1234567`},{code:`HR`,dial:`+385`,flag:`ðð·`,name:`Croatia`,placeholder:`91 234 5678`},{code:`CZ`,dial:`+420`,flag:`ð¨ð¿`,name:`Czech Republic`,placeholder:`601 123 456`},{code:`SK`,dial:`+421`,flag:`ð¸ð°`,name:`Slovakia`,placeholder:`912 123 456`},{code:`EC`,dial:`+593`,flag:`ðªð¨`,name:`Ecuador`,placeholder:`99 123 4567`},{code:`BN`,dial:`+673`,flag:`ð§ð³`,name:`Brunei`,placeholder:`712 3456`},{code:`HK`,dial:`+852`,flag:`ðð°`,name:`Hong Kong`,placeholder:`5123 4567`},{code:`MO`,dial:`+853`,flag:`ð²ð´`,name:`Macao`,placeholder:`6612 3456`},{code:`KH`,dial:`+855`,flag:`ð°ð`,name:`Cambodia`,placeholder:`12 345 678`},{code:`LA`,dial:`+856`,flag:`ð±ð¦`,name:`Laos`,placeholder:`20 234 5678`},{code:`BD`,dial:`+880`,flag:`ð§ð©`,name:`Bangladesh`,placeholder:`1812 345678`},{code:`TW`,dial:`+886`,flag:`ð¹ð¼`,name:`Taiwan`,placeholder:`912 345 678`},{code:`MV`,dial:`+960`,flag:`ð²ð»`,name:`Maldives`,placeholder:`771 2345`},{code:`LB`,dial:`+961`,flag:`ð±ð§`,name:`Lebanon`,placeholder:`71 123 456`},{code:`JO`,dial:`+962`,flag:`ð¯ð´`,name:`Jordan`,placeholder:`7 9012 3456`},{code:`KW`,dial:`+965`,flag:`ð°ð¼`,name:`Kuwait`,placeholder:`5000 0000`},{code:`SA`,dial:`+966`,flag:`ð¸ð¦`,name:`Saudi Arabia`,placeholder:`51 234 5678`},{code:`OM`,dial:`+968`,flag:`ð´ð²`,name:`Oman`,placeholder:`9212 3456`},{code:`AE`,dial:`+971`,flag:`ð¦ðª`,name:`UAE`,placeholder:`50 123 4567`},{code:`IL`,dial:`+972`,flag:`ð®ð±`,name:`Israel`,placeholder:`50 234 5678`},{code:`BH`,dial:`+973`,flag:`ð§ð`,name:`Bahrain`,placeholder:`3600 0000`},{code:`QA`,dial:`+974`,flag:`ð¶ð¦`,name:`Qatar`,placeholder:`3312 3456`},{code:`MN`,dial:`+976`,flag:`ð²ð³`,name:`Mongolia`,placeholder:`8812 3456`},{code:`NP`,dial:`+977`,flag:`ð³ðµ`,name:`Nepal`,placeholder:`984 123 4567`}];function dE({onChange:e,autoFocus:t,required:n}){let{i18n:r}=V(),[i,a]=(0,f.useState)(()=>wee[r.language]??`TW`),[o,s]=(0,f.useState)(``),c=uE.find(e=>e.code===i)??uE[0],l=(t,n)=>{let r=uE.find(e=>e.code===t)??uE[0];e(n.trim()?r.dial+n.replace(/\s+/g,``):``)};return(0,X.jsxs)(`div`,{className:`flex h-10 w-full rounded-[8px] border border-border bg-bg-card text-[15px] text-text-primary transition-colors focus-within:border-border-strong overflow-hidden`,children:[(0,X.jsxs)(`div`,{className:`relative shrink-0 border-r border-border flex items-center`,children:[(0,X.jsx)(`select`,{value:i,onChange:e=>{a(e.target.value),l(e.target.value,o)},className:`appearance-none bg-transparent pl-3 pr-7 h-full outline-none cursor-pointer`,"aria-label":`Country code`,children:uE.map(e=>(0,X.jsxs)(`option`,{value:e.code,children:[e.flag,` `,e.dial]},e.code))}),(0,X.jsx)(Is,{className:`pointer-events-none absolute right-2 w-3.5 h-3.5 text-text-secondary`})]}),(0,X.jsx)(`input`,{type:`tel`,value:o,onChange:e=>{s(e.target.value),l(i,e.target.value)},placeholder:c.placeholder,className:`flex-1 min-w-0 bg-transparent px-3 outline-none placeholder:text-text-secondary placeholder:opacity-50`,autoFocus:t,required:n,autoComplete:`tel-national`,inputMode:`tel`})]})}function Tee(){let{t:e}=V(`common`);cE(e(`phoneLogin.pageTitle`));let t=la(),n=oa(),r=ed(),{logAnalyticsEvent:i}=BS(),[a,o]=(0,f.useState)(``),[s,c]=(0,f.useState)(``),[l,u]=(0,f.useState)(!1);return(0,X.jsxs)(`div`,{className:`fixed inset-0 overflow-y-auto bg-bg-page`,children:[(0,X.jsx)(ZS,{}),(0,X.jsx)(`div`,{className:`flex min-h-full items-center justify-center px-4 py-8`,children:(0,X.jsxs)(`div`,{className:`w-full max-w-sm`,children:[(0,X.jsxs)(`a`,{href:`/`,className:`flex items-center justify-center mb-8`,children:[(0,X.jsx)(`img`,{src:VS,alt:`PinChat`,className:`h-12 w-auto block dark:hidden`}),(0,X.jsx)(`img`,{src:HS,alt:`PinChat`,className:`h-12 w-auto hidden dark:block`})]}),(0,X.jsxs)(`div`,{className:`card p-6 space-y-5`,children:[(0,X.jsx)(`h1`,{className:`text-[20px] font-semibold text-text-primary text-center`,children:e(`phoneLogin.title`)}),(0,X.jsxs)(`form`,{onSubmit:async o=>{if(o.preventDefault(),!(!a||!s)){i(`login_click`,{login_type:`phone`});try{sd(await r.mutate({phone:a,password:s})),i(`login_click`,{login_type:`phone`,result:`success`}),t(new URLSearchParams(n.search).get(`redirect`)||`/dashboard`,{replace:!0})}catch(t){i(`login_click`,{login_type:`phone`,result:`fail`});
35let n=t instanceof Du&&t.status===401?e(`login.invalidCredentials`):t instanceof Du&&t.message?t.message:e(`login.loginFailed`);Q.error(n)}}},className:`space-y-4`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsx)(`label`,{className:`text-[14px] font-medium text-text-primary`,children:e(`phoneLogin.phoneLabel`)}),(0,X.jsx)(dE,{onChange:o,autoFocus:!0})]}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,X.jsx)(`label`,{className:`text-[14px] font-medium text-text-primary`,children:e(`login.passwordLabel`)}),(0,X.jsx)(qo,{to:`/forgot-password-phone`,className:`text-[13px] text-brand hover:underline`,children:e(`phoneLogin.forgotPassword`)})]}),(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsx)(iE,{type:l?`text`:`password`,value:s,onChange:e=>c(e.target.value),placeholder:e(`login.passwordPlaceholder`),autoComplete:`current-password`,required:!0,className:`pr-10`}),(0,X.jsx)(`button`,{type:`button`,onClick:()=>u(e=>!e),className:`absolute right-2.5 top-1/2 -translate-y-1/2 text-text-secondary hover:text-text-primary cursor-pointer p-1`,"aria-label":e(l?`login.hidePassword`:`login.showPassword`),children:l?(0,X.jsx)(Xs,{className:`w-4 h-4`}):(0,X.jsx)(Zs,{className:`w-4 h-4`})})]})]}),(0,X.jsx)(Z,{type:`submit`,disabled:!a||!s||r.loading,className:`w-full disabled:opacity-40`,children:r.loading?e(`loading`):e(`login.submitBtn`)})]})]}),(0,X.jsx)(`p`,{className:`text-[13px] text-text-secondary text-center mt-4`,children:(0,X.jsxs)(qo,{to:`/login`,className:`text-brand hover:underline`,children:[`â `,e(`phoneLogin.backToLogin`)]})})]})})]})}function Eee(){let{t:e}=V(`common`);cE(e(`subLogin.pageTitle`));let t=la(),n=od(),{logAnalyticsEvent:r}=BS(),[i,a]=(0,f.useState)(``),[o,s]=(0,f.useState)(``),[c,l]=(0,f.useState)(!1);return(0,X.jsxs)(`div`,{className:`fixed inset-0 overflow-y-auto bg-bg-page`,children:[(0,X.jsx)(ZS,{}),(0,X.jsx)(`div`,{className:`flex min-h-full items-center justify-center px-4 py-8`,children:(0,X.jsxs)(`div`,{className:`w-full max-w-sm`,children:[(0,X.jsxs)(`a`,{href:`/`,className:`flex items-center justify-center mb-8`,children:[(0,X.jsx)(`img`,{src:VS,alt:`PinChat`,className:`h-12 w-auto block dark:hidden`}),(0,X.jsx)(`img`,{src:HS,alt:`PinChat`,className:`h-12 w-auto hidden dark:block`})]}),(0,X.jsxs)(`div`,{className:`card p-6 space-y-5`,children:[(0,X.jsx)(`h1`,{className:`text-[20px] font-semibold text-text-primary text-center`,children:e(`subLogin.title`)}),(0,X.jsxs)(`form`,{onSubmit:async a=>{if(a.preventDefault(),!(!i.trim()||!o)){r(`login_click`,{login_type:`sub_account`});try{sd(await n.mutate({account:i.trim(),password:o})),r(`login_click`,{login_type:`sub_account`,result:`success`}),localStorage.setItem(Pu,`1`),t(`/dashboard`,{replace:!0})}catch(t){r(`login_click`,{login_type:`sub_account`,result:`fail`});let n=t instanceof Du&&t.message?t.message:e(`login.loginFailed`);Q.error(n)}}},className:`space-y-4`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsx)(`label`,{className:`text-[14px] font-medium text-text-primary`,children:e(`subLogin.accountLabel`)}),(0,X.jsx)(iE,{type:`text`,value:i,onChange:e=>a(e.target.value),placeholder:e(`subLogin.accountPlaceholder`),autoComplete:`username`,autoFocus:!0,required:!0})]}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsx)(`label`,{className:`text-[14px] font-medium text-text-primary`,children:e(`login.passwordLabel`)}),(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsx)(iE,{type:c?`text`:`password`,value:o,onChange:e=>s(e.target.value),placeholder:e(`login.passwordPlaceholder`),autoComplete:`current-password`,required:!0,className:`pr-10`}),(0,X.jsx)(`button`,{type:`button`,onClick:()=>l(e=>!e),className:`absolute right-2.5 top-1/2 -translate-y-1/2 text-text-secondary hover:text-text-primary cursor-pointer p-1`,"aria-label":e(c?`login.hidePassword`:`login.showPassword`),children:c?(0,X.jsx)(Xs,{className:`w-4 h-4`}):(0,X.jsx)(Zs,{className:`w-4 h-4`})})]})]}),(0,X.jsx)(Z,{type:`submit`,disabled:!i.trim()||!o||n.loading,className:`w-full disabled:opacity-40`,children:n.loading?e(`loading`):e(`login.submitBtn`)})]})]}),(0,X.jsx)(`p`,{className:`text-[13px] text-text-secondary text-center mt-4`,children:(0,X.jsxs)(qo,{to:`/login`,className:`text-brand hover:underline`,children:[`â `,e(`subLogin.backToLogin`)]})})]})})]})}function Dee(){let{t:e}=V(`common`);cE(e(`forgotPasswordPhone.pageTitle`));let t=la(),n=id(),[r,i]=(0,f.useState)(1),[a,o]=(0,f.useState)(``),[s,c]=(0,f.useState)(``),[l,u]=(0,f.useState)(!1),[d,p]=(0,f.useState)(0),m=(0,f.useRef)(null),h=(0,f.useRef)(null),g=(0,f.useRef)(null);(0,f.useEffect)(()=>
35(cb(RS),m.current=new cx(RS,`send-sms-btn`,{size:`invisible`,callback:()=>{}}),m.current.render(),()=>{m.current?.clear(),m.current=null,g.current&&clearInterval(g.current)}),[]);let _=()=>{p(60),g.current=setInterval(()=>{p(e=>e<=1?(clearInterval(g.current),0):e-1)},1e3)},v=async()=>{if(!(!a||l||!m.current)){u(!0);try{h.current=await dx(RS,a,m.current),i(2),_(),Q.success(e(`forgotPasswordPhone.codeSent`))}catch{Q.error(e(`forgotPasswordPhone.sendFailed`)),m.current?.clear(),m.current=null}finally{u(!1)}}};return(0,X.jsxs)(`div`,{className:`fixed inset-0 overflow-y-auto bg-bg-page`,children:[(0,X.jsx)(ZS,{}),(0,X.jsx)(`div`,{className:`flex min-h-full items-center justify-center px-4 py-8`,children:(0,X.jsxs)(`div`,{className:`w-full max-w-sm`,children:[(0,X.jsxs)(`a`,{href:`/`,className:`flex items-center justify-center mb-8`,children:[(0,X.jsx)(`img`,{src:VS,alt:`PinChat`,className:`h-12 w-auto block dark:hidden`}),(0,X.jsx)(`img`,{src:HS,alt:`PinChat`,className:`h-12 w-auto hidden dark:block`})]}),(0,X.jsxs)(`div`,{className:`card p-6 space-y-5`,children:[(0,X.jsx)(`h1`,{className:`text-[20px] font-semibold text-text-primary text-center`,children:e(`forgotPasswordPhone.title`)}),r===1?(0,X.jsxs)(`div`,{className:`space-y-4`,children:[(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary`,children:e(`forgotPasswordPhone.desc`)}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsx)(`label`,{className:`text-[14px] font-medium text-text-primary`,children:e(`forgotPasswordPhone.phoneLabel`)}),(0,X.jsx)(dE,{onChange:o,autoFocus:!0})]}),(0,X.jsx)(Z,{id:`send-sms-btn`,type:`button`,onClick:v,disabled:!a||l,className:`w-full disabled:opacity-40`,children:e(l?`loading`:`forgotPasswordPhone.sendCode`)})]}):(0,X.jsxs)(`div`,{className:`space-y-4`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsx)(`label`,{className:`text-[14px] font-medium text-text-primary`,children:e(`forgotPasswordPhone.codeLabel`)}),(0,X.jsx)(iE,{type:`text`,value:s,onChange:e=>c(e.target.value.replace(/\D/g,``).slice(0,6)),placeholder:e(`forgotPasswordPhone.codePlaceholder`),autoFocus:!0,autoComplete:`one-time-code`,inputMode:`numeric`})]}),(0,X.jsx)(Z,{type:`button`,onClick:async()=>{if(!(!s||!h.current))try{let e=await(await h.current.confirm(s)).user.getIdToken();t(`/set-password-phone`,{state:{token:(await n.mutate(e)).access_token}})}catch{Q.error(e(`forgotPasswordPhone.verifyFailed`))}},disabled:s.length<4||n.loading,className:`w-full disabled:opacity-40`,children:n.loading?e(`loading`):e(`forgotPasswordPhone.verifyBtn`)}),(0,X.jsx)(`p`,{className:`text-[13px] text-text-secondary text-center`,children:d>0?e(`forgotPasswordPhone.resendIn`,{n:d}):(0,X.jsx)(`button`,{type:`button`,onClick:async()=>{d>0||(c(``),await v())},className:`text-brand hover:underline cursor-pointer`,children:e(`forgotPasswordPhone.resend`)})})]})]}),(0,X.jsx)(`p`,{className:`text-[13px] text-text-secondary text-center mt-4`,children:(0,X.jsxs)(qo,{to:`/login-phone`,className:`text-brand hover:underline`,children:[`â `,e(`forgotPasswordPhone.backToLogin`)]})})]})})]})}function Oee({password:e,t}){let n=[{key:`passwordRuleLength`,pass:e.length>=8},{key:`passwordRuleUppercase`,pass:/[A-Z]/.test(e)},{key:`passwordRuleNumber`,pass:/[0-9]/.test(e)}];return n.every(e=>e.pass)?null:(0,X.jsxs)(`div`,{className:`mt-1.5`,children:[(0,X.jsx)(`p`,{className:`text-[13px] text-text-secondary mb-1`,children:t(`register.passwordRuleTitle`)}),(0,X.jsx)(`ul`,{className:`space-y-1`,children:n.map(e=>(0,X.jsxs)(`li`,{className:`flex items-center gap-1.5 text-[13px] ${e.pass?`text-brand`:`text-text-secondary`}`,children:[e.pass?(0,X.jsx)(Fs,{className:`w-3.5 h-3.5`}):(0,X.jsx)(Ic,{className:`w-3.5 h-3.5`}),t(`register.${e.key}`)]},e.key))})]})}function kee(){let{t:e}=V(`common`);cE(e(`setPasswordPhone.pageTitle`));let t=oa().state?.token,n=ad(),[r,i]=(0,f.useState)(``),[a,o]=(0,f.useState)(``),[s,c]=(0,f.useState)(!1),[l,u]=(0,f.useState)(!1),[d,p]=(0,f.useState)(!1),m=r.length>=8&&/[A-Z]/.test(r)&&/[0-9]/.test(r),h=r===a&&a.length>0,g=m&&h&&!!t;return t?(0,X.jsxs)(`div`,{className:`fixed inset-0 overflow-y-auto bg-bg-page`,children:[(0,X.jsx)(ZS,{}),(0,X.jsx)(`div`,{className:`flex min-h-full items-center justify-center px-4 py-8`,children:(0,X.jsxs)(`div`,{className:`w-full max-w-sm`,children:[(0,X.jsxs)(`a`,{href:`/`,className:`flex items-center justify-center mb-8`,children:[(0,X.jsx)(`img`,{src:VS,alt:`PinChat`,className:`h-12 w-auto block dark:hidden`}),(0,X.jsx)(`img`,{src:HS,alt:`PinChat`,className:`h-12 w-auto hidden dark:block`})]}),d?(0,X.jsxs)(`div`,{className:`card p-6 space-y-3 text-center`,children:[(0,X.jsx)(`h1`,{className:`text-[20px] font-semibold text-text-primary`,children:e(`setPasswordPhone.successTitle`)}),(0,X.jsxs)(qo,{to:`/login-phone`,className:`block text-[14px] text-brand hover:underline mt-2`,children:[`â `,e(`phoneLogin.backToLogin`)]})]}):(0,X.jsxs)(`div`,{className:`card p-6 space-y-5`,children:[(0,X.jsx)(`h1`,{className:`text-[20px] font-semibold text-text-primary text-center`,children:e(`setPasswordPhone.title`)}),(0,X.jsxs)(`form`,{onSubmit:async i=>{if(i.preventDefault(),g)try{await n.mutate({new_password:r,new_password_confirmation:a,resetToken:t}),p(!0)}catch(t){let n=t instanceof Du&&t.message?t.message:e(`setPasswordPhone.failed`);Q.error(n)}},className:`space-y-4`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsx)(`label`,{className:`text-[14px] font-medium text-text-primary`,children:e(`setPasswordPhone.newPassword`)}),(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsx)(iE,{type:s?`text`:`password`,value:r,onChange:e=>i(e.target.value),placeholder:e(`setPasswordPhone.newPasswordPlaceholder`),autoComplete:`new-password`,autoFocus:!0,required:!0,className:`pr-10`}),(0,X.jsx)(`button`,{type:`button`,onClick:()=>c(e=>!e),className:`absolute right-2.5 top-1/2 -translate-y-1/2 text-text-secondary hover:text-text-primary curs
35or-pointer p-1`,"aria-label":e(s?`login.hidePassword`:`login.showPassword`),children:s?(0,X.jsx)(Xs,{className:`w-4 h-4`}):(0,X.jsx)(Zs,{className:`w-4 h-4`})})]}),(0,X.jsx)(Oee,{password:r,t:e})]}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsx)(`label`,{className:`text-[14px] font-medium text-text-primary`,children:e(`setPasswordPhone.confirmPassword`)}),(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsx)(iE,{type:l?`text`:`password`,value:a,onChange:e=>o(e.target.value),placeholder:e(`setPasswordPhone.confirmPasswordPlaceholder`),autoComplete:`new-password`,required:!0,className:`pr-10`}),(0,X.jsx)(`button`,{type:`button`,onClick:()=>u(e=>!e),className:`absolute right-2.5 top-1/2 -translate-y-1/2 text-text-secondary hover:text-text-primary cursor-pointer p-1`,"aria-label":e(l?`login.hidePassword`:`login.showPassword`),children:l?(0,X.jsx)(Xs,{className:`w-4 h-4`}):(0,X.jsx)(Zs,{className:`w-4 h-4`})})]}),a&&!h&&(0,X.jsx)(`p`,{className:`text-[13px] text-danger mt-0.5`,children:e(`register.passwordMismatch`)})]}),(0,X.jsx)(Z,{type:`submit`,disabled:!g||n.loading,className:`w-full disabled:opacity-40`,children:n.loading?e(`loading`):e(`setPasswordPhone.submitBtn`)})]})]}),!d&&(0,X.jsx)(`p`,{className:`text-[13px] text-text-secondary text-center mt-4`,children:(0,X.jsxs)(qo,{to:`/login-phone`,className:`text-brand hover:underline`,children:[`â `,e(`phoneLogin.backToLogin`)]})})]})})]}):(0,X.jsx)(`div`,{className:`fixed inset-0 overflow-y-auto bg-bg-page`,children:(0,X.jsx)(`div`,{className:`flex min-h-full items-center justify-center px-4 py-8`,children:(0,X.jsxs)(`div`,{className:`w-full max-w-sm card p-6 space-y-3 text-center`,children:[(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary`,children:e(`setPasswordPhone.invalidSession`)}),(0,X.jsx)(qo,{to:`/forgot-password-phone`,className:`block text-[14px] text-brand hover:underline`,children:e(`setPasswordPhone.tryAgain`)})]})})})}function fE(){let e=``;for(let t=0;t<5;t++)e+=`ABCDEFGHJKLMNPQRSTUVWXYZ23456789`.charAt(Math.floor(Math.random()*32));return e}var pE={chat_header_color:`#006b25`,chat_header_text_color:`#ffffff`,chat_bubble_color:`#ddefe0`,chat_bubble_border_color:`#ddefe0`,chat_bubble_text_color:`#000000`,start_btn_color:`#02b13f`,start_btn_text_color:`#ffffff`,float_button_color:`#02b13f`,float_button_text_color:`#ffffff`,welcome_text_color:`#7d8a97`,welcome_link_prime_color:`#02b13f`,welcome_link_second_color:`#ffffff`,hr_color:`#7d8a97`,background_color:`#f7f8f9`},Aee=5141,mE={welcome:`Hello`,welcome_message:`Hello`,float_button_text:`Contact Us`,show_landing:!0,is_valid:!0,welcome_bg_type:`image`,welcome_bg_image:`https://pinchat-prod.s3.ap-northeast-1.amazonaws.com/enterpoint/1f77b4ff50d6279648b27a42ed999826.png`,chat_logo:``,widget_logo:``,welcome_link_setting:[{open:!1,title:``,type:`link`,url:``}]};function hE(e){let t=e.toLowerCase(),n={en:`Engage now`,"zh-tw":`ä¸éµäºå`,"zh-cn":`ä¸é®äºå¨`,ja:`ä»ãã対話ãã`,ko:`ì§ê¸ ììí기`,de:`One-Click-Interaktion`,fr:`Interaction en un clic`,"pt-br":`Interação com um clique`,ro:`InteracÈiune cu un singur clic`,es:`Participar ahora`,vi:`Tương tác ngay`,th:`à¹à¸£à¸´à¹à¸¡à¸à¸²à¸£à¸ªà¸à¸à¸à¸²`},r={en:`Your nickname (optional)`,"zh-tw":`輸å
¥æ¨çæ±ç¨± (é¸å¡«)`,"zh-cn":`è¾å
¥æ¨çæ±ç§° (éå¡«)`,ja:`表示åãå
¥åãã¦ãã ããï¼ãªãã·ã§ã³ï¼`,ko:`ëë¤ì ì
ë ¥ (ì í)`,de:`Ihr Spitzname (optional)`,fr:`Votre nom (facultatif)`,"pt-br":`Seu apelido (opcional)`,ro:`Porecla ta (opÈional)`,es:`Tu apodo (opcional)`,vi:`Nháºp biá»t danh cá»§a bạn (tuỳ chá»n)`,th:`à¹à¸ªà¹à¸à¸·à¹à¸à¹à¸¥à¹à¸à¸à¸à¸à¸à¸¸à¸ (à¹à¸¡à¹à¸à¸³à¹à¸à¹à¸)`},i={en:`Check out our social media`,"zh-tw":`ççæåå
¶ä»ç¤¾ç¾¤åªé«`,"zh-cn":`ççæä»¬å
¶ä»ç¤¾ç¾¤åªä½`,ja:`ç§ãã¡ã®ã½ã¼ã·ã£ã«ã¡ãã£ã¢`,ko:`ìì
미ëì´ë¥¼ íì¸íì¸ì`,de:`Schauen Sie sich unsere sozialen Medien an`,fr:`Nos réseaux sociaux`,"pt-br":`Confira nossas redes sociais`,ro:`Check out noastre sociale mass-media`,es:`Mira nuestras redes sociales`,vi:`Xem mạng xã há»i cá»
35§a chúng tôi`,th:`à¸à¸´à¸à¸à¸²à¸¡à¹à¸à¹à¸à¸µà¸¢à¸¥à¸¡à¸µà¹à¸à¸µà¸¢à¸à¸à¸à¹à¸£à¸²`};return{start_btn_text:n[t]??n.en,nickname_input_placeholder:r[t]??r.en,hr_text:i[t]??i.en}}var gE={en:`My first chat`,"zh-tw":`æç第ä¸åè天室`,"zh-cn":`æç第ä¸ä¸ªè天室`,ja:`åãã¦ã®ãã£ããã«ã¼ã `,ko:`ëì 첫 ì±í
ë°©`,de:`Mein erster Chat`,fr:`Mon premier chat`,"pt-br":`Meu primeiro chat`,ro:`Primul meu chat`,es:`Mi primer chat`,vi:`Phòng chat Äầu tiên`,th:`à¹à¸à¸à¹à¸£à¸à¸à¸à¸à¸à¸±à¸`};function jee(e){return gE[e.toLowerCase()]??gE.en}function Mee({password:e,t}){let n=[{key:`passwordRuleLength`,pass:e.length>=8},{key:`passwordRuleUppercase`,pass:/[A-Z]/.test(e)},{key:`passwordRuleNumber`,pass:/[0-9]/.test(e)}];return n.every(e=>e.pass)?null:(0,X.jsxs)(`div`,{className:`mt-1.5`,children:[(0,X.jsx)(`p`,{className:`text-[13px] text-text-secondary mb-1`,children:t(`register.passwordRuleTitle`)}),(0,X.jsx)(`ul`,{className:`space-y-1`,children:n.map(e=>(0,X.jsxs)(`li`,{className:`flex items-center gap-1.5 text-[13px] ${e.pass?`text-brand`:`text-text-secondary`}`,children:[e.pass?(0,X.jsx)(Fs,{className:`w-3.5 h-3.5`}):(0,X.jsx)(Ic,{className:`w-3.5 h-3.5`}),t(`register.${e.key}`)]},e.key))})]})}function Nee(){let{t:e,i18n:t}=V(`common`);cE(e(`register.pageTitle`));let n=la(),r=Ju(),i=nd(),a=rd(),o=hd(),s=md(),{logAnalyticsEvent:c}=BS(),[l,u]=(0,f.useState)(``),[d,p]=(0,f.useState)(``),[m,h]=(0,f.useState)(``),[g,_]=(0,f.useState)(!1),[v,y]=(0,f.useState)(!1),[b,x]=(0,f.useState)(!1),[S,C]=(0,f.useState)(!1),[w,T]=(0,f.useState)(!1),[E,D]=(0,f.useState)(!1),[O,k]=(0,f.useState)(!1),A=/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(l.trim()),j=E&&l.trim().length>0&&!A,M=d.length>=8&&/[A-Z]/.test(d)&&/[0-9]/.test(d),N=d===m&&m.length>0,ee=l.trim().length>0&&A&&M&&N&&b,P=async i=>{if(i.preventDefault(),D(!0),ee){c(`signup_click`,{login_type:`email`}),k(!0);try{sd(await r.mutate({account:l.trim(),name:l.split(`@`)[0],password:d,password_confirmation:m,sendMail:!0,guestToken:null}));try{await Qu()}catch{}try{let e=fE(),n=l.split(`@`)[0],r=await o.mutate({token:e,name:n,title:jee(t.language),type:`direct`});await s.mutate({id:r.id,token:r.token,image_id:Aee,...pE,...mE,...hE(t.language)})}catch{}c(`signup_click`,{login_type:`email`,result:`success`}),n(`/check-email`,{replace:!0})}catch(t){k(!1),c(`signup_click`,{login_type:`email`,result:`fail`});let n=t instanceof Du&&t.message?t.message:e(`register.failed`);Q.error(n)}}},F=async t=>{c(`signup_click`,{login_type:t}),T(!0);try{let e=await Sx(RS,t===`google`?new Zy:new Yy(`apple.com`));sd(await(t===`google`?i:a).mutate({token:e.user.accessToken})),c(`signup_click`,{login_type:t,result:`success`}),n(`/dashboard`,{replace:!0})}catch(t){let n=t instanceof Du&&t.message?t.message:e(`login.oauthFailed`);Q.error(n)}finally{T(!1)}};return(0,X.jsxs)(`div`,{className:`fixed inset-0 overflow-y-auto bg-bg-page`,children:[(0,X.jsx)(ZS,{}),(0,X.jsx)(`div`,{className:`flex min-h-full items-center justify-center px-4 py-8`,children:(0,X.jsxs)(`div`,{className:`w-full max-w-sm`,children:[(0,X.jsxs)(`a`,{href:`/`,className:`flex items-center justify-center mb-8`,children:[(0,X.jsx)(`img`,{src:VS,alt:`PinChat`,className:`h-12 w-auto block dark:hidden`}),(0,X.jsx)(`img`,{src:HS,alt:`PinChat`,className:`h-12 w-auto hidden dark:block`})]}),(0,X.jsxs)(`div`,{className:`card p-6 space-y-5`,children:[(0,X.jsx)(`h1`,{className:`text-[20px] font-semibold text-text-primary text-center`,children:e(`register.title`)}),(0,X.jsxs)(`form`,{onSubmit:P,className:`space-y-4`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsx)(`label`,{className:`text-[14px] font-medium text-text-primary`,children:e(`register.email`)}),(0,X.jsx)(iE,{type:`email`,value:l,onChange:e=>u(e.target.value),onBlur:()=>D(!0),placeholder:e(`register.emailPlaceholder`),autoComplete:`username`,autoFocus:!0,required:!0}),j&&(0,X.jsx)(`p`,{className:`text-[13px] text-danger mt-0.5`,children:e(`emailInvalid`)})]}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsx)(`label`,{className:`text-[14px] font-medium text-text-primary`,children:e(`register.password`)}),(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsx)(iE,{type:g?`text`:`password`,value:d,onChange:e=>p(e.target.value),placeholder:e(`register.passwordPlaceholder`),autoComplete:`new-password`,required:!0,className:`pr-10`}),(0,X.jsx)(`button`,{type:`button`,onClick:()=>_(e=>!e),className:`absolute right-2.5 top-1/2 -translate-y-1/2 text-text-secondary hover:text-text-primary curs
35or-pointer p-1`,"aria-label":e(g?`login.hidePassword`:`login.showPassword`),children:g?(0,X.jsx)(Xs,{className:`w-4 h-4`}):(0,X.jsx)(Zs,{className:`w-4 h-4`})})]}),(0,X.jsx)(Mee,{password:d,t:e})]}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsx)(`label`,{className:`text-[14px] font-medium text-text-primary`,children:e(`register.confirmPassword`)}),(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsx)(iE,{type:v?`text`:`password`,value:m,onChange:e=>h(e.target.value),placeholder:e(`register.confirmPasswordPlaceholder`),autoComplete:`new-password`,required:!0,className:`pr-10`}),(0,X.jsx)(`button`,{type:`button`,onClick:()=>y(e=>!e),className:`absolute right-2.5 top-1/2 -translate-y-1/2 text-text-secondary hover:text-text-primary cursor-pointer p-1`,"aria-label":e(v?`login.hidePassword`:`login.showPassword`),children:v?(0,X.jsx)(Xs,{className:`w-4 h-4`}):(0,X.jsx)(Zs,{className:`w-4 h-4`})})]}),m&&!N&&(0,X.jsx)(`p`,{className:`text-[13px] text-danger mt-0.5`,children:e(`register.passwordMismatch`)})]}),(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(`button`,{type:`button`,role:`checkbox`,"aria-checked":b,onClick:()=>x(e=>!e),className:`w-[18px] h-[18px] shrink-0 rounded-[4px] border flex items-center justify-center cursor-pointer transition-colors ${b?`bg-brand border-brand`:`border-border bg-bg-card hover:border-border-strong`}`,children:b&&(0,X.jsx)(Fs,{className:`w-[10px] h-[10px] text-white`,strokeWidth:3})}),(0,X.jsxs)(`p`,{className:`text-[13px] text-text-secondary leading-snug`,children:[e(`register.termsPrefix`),` `,(0,X.jsx)(`a`,{href:`https://pinchat.app/terms`,target:`_blank`,rel:`noopener noreferrer`,className:`text-brand hover:underline`,children:e(`register.termsLink`)}),` `,e(`register.termsAnd`),` `,(0,X.jsx)(`a`,{href:`https://pinchat.app/privacy`,target:`_blank`,rel:`noopener noreferrer`,className:`text-brand hover:underline`,children:e(`register.privacyLink`)})]})]}),(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(`button`,{type:`button`,role:`checkbox`,"aria-checked":S,onClick:()=>C(e=>!e),className:`w-[18px] h-[18px] shrink-0 rounded-[4px] border flex items-center justify-center cursor-pointer transition-colors ${S?`bg-brand border-brand`:`border-border bg-bg-card hover:border-border-strong`}`,children:S&&(0,X.jsx)(Fs,{className:`w-[10px] h-[10px] text-white`,strokeWidth:3})}),(0,X.jsx)(`p`,{className:`text-[13px] text-text-secondary leading-snug`,children:e(`register.receiveEdm`)})]}),(0,X.jsx)(Z,{type:`submit`,disabled:!ee||O,className:`w-full disabled:opacity-40`,children:e(O?`loading`:`register.submitBtn`)})]}),(0,X.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,X.jsx)(`div`,{className:`flex-1 h-px bg-border`}),(0,X.jsx)(`span`,{className:`text-[13px] text-text-secondary`,children:e(`register.orDivider`)}),(0,X.jsx)(`div`,{className:`flex-1 h-px bg-border`})]}),(0,X.jsxs)(`div`,{className:`space-y-3`,children:[(0,X.jsxs)(Z,{type:`button`,variant:`secondary`,className:`w-full`,onClick:()=>F(`google`),disabled:w,children:[(0,X.jsx)(`img`,{src:aE,alt:``,className:`w-5 h-5 shrink-0`}),e(`register.continueWithGoogle`)]}),(0,X.jsxs)(Z,{type:`button`,variant:`secondary`,className:`w-full`,onClick:()=>F(`apple`),disabled:w,children:[(0,X.jsx)(`img`,{src:oE,alt:``,className:`w-5 h-5 shrink-0`}),e(`register.continueWithApple`)]})]})]}),(0,X.jsxs)(`p`,{className:`text-[13px] text-text-secondary text-center mt-4`,children:[e(`register.alreadyHaveAccount`),` `,(0,X.jsx)(qo,{to:`/login`,className:`text-brand hover:underline`,children:e(`register.loginLink`)})]})]})})]})}function Pee(){let{t:e}=V(`common`);cE(e(`forgotPassword.pageTitle`));let t=Xu(),[n,r]=(0,f.useState)(``),[i,a]=(0,f.useState)(!1),[o,s]=(0,f.useState)(!1),c=/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n.trim()),l=o&&n.trim().length>0&&!c;return(0,X.jsxs)(`div`,{className:`fixed inset-0 overflow-y-auto bg-bg-page`,children:[(0,X.jsx)(ZS,{}),(0,X.jsx)(`div`,{className:`flex min-h-full items-center justify-center px-4 py-8`,children:(0,X.jsxs)(`div`,{className:`w-full max-w-sm`,children:[(0,X.jsxs)(`a`,{href:`/`,className:`flex items-center justify-center mb-8`,children:[(0,X.jsx)(`img`,{src:VS,alt:`PinChat`,className:`h-12 w-auto block dark:hidden`}),(0,X.jsx)(`img`,{src:HS,alt:`PinChat`,className:`h-12 w-auto hidden dark:block`})]}),i?(0,X.jsxs)(`div`,{className:`card p-6 space-y-3 text-center`,children:[(0,X.jsx)(`h1`,{className:`text-[20px] font-semibold text-text-primary`,children:e(`forgotPassword.successTitle`)}),(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary`,children:e(`forgotPassword.successDesc`)}),(0,X.jsxs)(qo,{to:`/login`,className:`block text-[14px] text-brand hover:underline mt-2`,children:[`â `,e(`forgotPassword.backToLogin`)]})]}):(0,X.jsxs)(`div`,{className:`card p-6 space-y-5`,children:[(0,X.jsxs)(`div`,{className:`space-y-1 text-center`,children:[(0,X.jsx)(`h1`,{className:`text-[20px] font-semibold text-text-primary`,children:e(`forgotPassword.title`)}),(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary`,children:e(`forgotPassword.desc`)})]}),(0,X.jsxs)(`form`,{onSubmit:async r=>{if(r.preventDefault(),s(!0),!(!n.trim()||!c))try{await t.mutate({email:n.trim()}),a(!0)}catch(t){let n=t instanceof Du&&t.message?t.message:e(`forgotPassword.failed`);Q.error(n)}},className:`space-y-4`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsx)(`label`,{className:`text-[14px] font-medium text-text-primary`,children:e(`forgotPassword.email`)}),(0,X.jsx)(iE,{type:`email`,value:n,onChange:e=>r(e.target.value),onBlur:()=>s(!0),placeholder:e(`forgotPassword.emailPlaceholder`),autoComplete:`email`,autoF
35ocus:!0,required:!0}),l&&(0,X.jsx)(`p`,{className:`text-[13px] text-danger mt-0.5`,children:e(`emailInvalid`)})]}),(0,X.jsx)(Z,{type:`submit`,disabled:!n.trim()||!c||t.loading,className:`w-full disabled:opacity-40`,children:t.loading?e(`loading`):e(`forgotPassword.submitBtn`)})]})]}),!i&&(0,X.jsx)(`p`,{className:`text-[13px] text-text-secondary text-center mt-4`,children:(0,X.jsxs)(qo,{to:`/login`,className:`text-brand hover:underline`,children:[`â `,e(`forgotPassword.backToLogin`)]})})]})})]})}function Fee(){let{t:e}=V(`common`);cE(e(`verifyEmail.pageTitle`));let[t]=ts(),n=la(),r=Zu(),i=t.get(`token`),a=t.get(`type`)??void 0,o=(0,f.useRef)(!1);return(0,f.useEffect)(()=>{!i||o.current||(o.current=!0,r.mutate({token:i,type:a}).then(e=>{sd(e),localStorage.setItem(`email_verified`,`1`),n(`/dashboard`,{replace:!0})}).catch(()=>{}))},[i,a]),(0,X.jsxs)(`div`,{className:`fixed inset-0 overflow-y-auto bg-bg-page`,children:[(0,X.jsx)(ZS,{}),(0,X.jsx)(`div`,{className:`flex min-h-full items-center justify-center px-4 py-8`,children:(0,X.jsxs)(`div`,{className:`w-full max-w-sm`,children:[(0,X.jsxs)(`a`,{href:`/`,className:`flex items-center justify-center mb-8`,children:[(0,X.jsx)(`img`,{src:VS,alt:`PinChat`,className:`h-12 w-auto block dark:hidden`}),(0,X.jsx)(`img`,{src:HS,alt:`PinChat`,className:`h-12 w-auto hidden dark:block`})]}),!i||r.error?(0,X.jsxs)(`div`,{className:`card p-6 space-y-3 text-center`,children:[(0,X.jsx)(`h1`,{className:`text-[20px] font-semibold text-danger`,children:e(`verifyEmail.failureTitle`)}),(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary`,children:e(`verifyEmail.failureDesc`)}),(0,X.jsxs)(qo,{to:`/login`,className:`block text-[14px] text-brand hover:underline mt-2`,children:[`â `,e(`verifyEmail.backToLogin`)]})]}):(0,X.jsxs)(`div`,{className:`card p-6 space-y-3 text-center`,children:[(0,X.jsx)(`h1`,{className:`text-[20px] font-semibold text-text-primary`,children:r.data?e(`verifyEmail.successTitle`):e(`verifyEmail.verifying`)}),r.data&&(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary`,children:e(`verifyEmail.successDesc`)}),r.loading&&(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary`,children:e(`loading`)})]}),(0,X.jsx)(`p`,{className:`text-[13px] text-text-secondary text-center mt-4`,children:e(`login.brand`)})]})})]})}function Iee(){let{t:e}=V(`common`);cE(e(`register.successTitle`));let t=la(),n=Yu();(0,f.useEffect)(()=>{localStorage.getItem(`email_verified`)&&t(`/dashboard`,{replace:!0})},[t]),(0,f.useEffect)(()=>{let e=e=>{e.key===`email_verified`&&e.newValue&&t(`/dashboard`,{replace:!0})};return window.addEventListener(`storage`,e),()=>window.removeEventListener(`storage`,e)},[t]);let[r,i]=(0,f.useState)(60),a=(0,f.useRef)(void 0),o=(0,f.useCallback)(()=>{i(60),clearInterval(a.current),a.current=setInterval(()=>{i(e=>e<=1?(clearInterval(a.current),0):e-1)},1e3)},[]);return(0,f.useEffect)(()=>{let e=setInterval(()=>{i(t=>t<=1?(clearInterval(e),0):t-1)},1e3);return a.current=e,()=>clearInterval(e)},[]),(0,X.jsxs)(`div`,{className:`fixed inset-0 overflow-y-auto bg-bg-page`,children:[(0,X.jsx)(ZS,{}),(0,X.jsx)(`div`,{className:`flex min-h-full items-center justify-center px-4 py-8`,children:(0,X.jsxs)(`div`,{className:`w-full max-w-sm`,children:[(0,X.jsxs)(`a`,{href:`/`,className:`flex items-center justify-center mb-8`,children:[(0,X.jsx)(`img`,{src:VS,alt:`PinChat`,className:`h-12 w-auto block dark:hidden`}),(0,X.jsx)(`img`,{src:HS,alt:`PinChat`,className:`h-12 w-auto hidden dark:block`})]}),(0,X.jsxs)(`div`,{className:`card p-6 space-y-3 text-center`,children:[(0,X.jsx)(`h1`,{className:`text-[20px] font-semibold text-text-primary`,children:e(`register.successTitle`)}),(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary`,children:e(`register.successDesc`)}),(0,X.jsx)(Z,{disabled:r>0||n.loading,loading:n.loading,onClick:async()=>{try{await n.mutate(),o(),Q.success(e(`register.resendSuccess`))}catch(t){let n=t instanceof Du&&t.message?t.message:e(`register.resendFailed`);Q.error(n)}},className:`w-full disabled:opacity-40`,children:r>0?e(`register.resendCooldown`,{seconds:r}):e(`register.resendBtn`)})]}),(0,X.jsxs)(`p`,{className:`text-[13px] text-text-secondary text-center mt-4`,children:[e(`register.verifiedPrompt`),` `,(0,X.jsx)(qo,{to:`/login`,className:`text-brand hover:underline`,children:e(`register.loginLink`)})]})]})})]})}function Lee({password:e,t}){let n=[{key:`passwordRuleLength`,pass:e.length>=8},{key:`passwordRuleUppercase`,pass:/[A-Z]/.test(e)},{key:`passwordRuleNumber`,pass:/[0-9]/.test(e)}];return n.every(e=>e.pass)?null:(0,X.jsxs)(`div`,{className:`mt-1.5`,children:[(0,X.jsx)(`p`,{className:`text-[13px] text-text-secondary mb-1`,children:t(`register.passwordRuleTitle`)}),(0,X.jsx)(`ul`,{className:`space-y-1`,children:n.map(e=>(0,X.jsxs)(`li`,{className:`flex items-center gap-1.5 text-[13px] ${e.pass?`text-brand`:`text-text-secondary`}`,children:[e.pass?(0,X.jsx)(Fs,{className:`w-3.5 h-3.5`}):(0,X.jsx)(Ic,{className:`w-3.5 h-3.5`}),t(`register.${e.key}`)]},e.key))})]})}function Ree(){let{t:e}=V(`common`);cE(e(`resetPassword.pageTitle`));let[t]=ts(),n=la(),r=$u(),i=t.get(`token`),[a,o]=(0,f.useState)(``),[s,c]=(0,f.useState)(``),[l,u]=(0,f.useState)(!1),[d,p]=(0,f.useState)(!1),m=a.length>=8&&/[A-Z]/.test(a)&&/[0-9]/.test(a),h=a===s&&s.length>0,g=m&&h;return i?(0,X.jsxs)(`div`,{className:`fixed inset-0 overflow-y-auto bg-bg-page`,children:[(0,X.jsx)(ZS,{}),(0,X.jsx)(`div`,{className:`flex min-h-full items-center justify-center px-4 py-8`,children:(0,X.jsxs)(`div`,{className:`w-full max-w-sm`,children:[(0,X.jsxs)(`a`,{href:`/`,className:`flex items-center justify-center mb-8`,children:[(0,X.jsx)(`img`,{src:VS,alt:`PinChat`,className:`h-12 w-auto block dark:hidden`}),(0,X.jsx)(`img`,{src:HS,alt:`PinChat`,className:`h-12 w-auto hidden dark:block`})]}),(0,X.jsxs)(`div`,{className:`card p-6 space-y-5`,children:[(0,X.jsx)(`h1`,{className:`text-[20px] font-semibold text-text-primary text-center`,children:e(`resetPassword.title`)}),(0,X.jsxs)(`form`,{onSubmit:async t=>{if(t.preventDefault(),!(!g||!i))try{await r.mutate({new_password:a,new_password_confirmation:s,token:i}),Q.success(e(`resetPassword.successTitle`)),n(`/login`,{replace:!0})}catch(t){let n=t instanceof Du&&t.message?t.message:e(`resetPassword.failed`);Q.error(n)}},className:`space-y-4`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsx)(`label`,{className:`text-[14px] font-medium text-text-primary`,children:e(`resetPassword.newPassword`)}),(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsx)(iE,{type:l?`text`:`password`,value:a,onChange:e=>o(e.target.value),placeholder:e(`resetPassword.newPasswordPlaceholder`),autoComplete:`new-password`,autoFocus:!0,required:!0,className:`pr-10`}),(0,X.jsx)(`button`,{type:`button`,onClick:()=>u(e=>!e),className:`absolute right-2.5 top-1/2 -translate-y-1/2 text-text-secondary hover:text-text-primary curs
35or-pointer p-1`,"aria-label":e(l?`login.hidePassword`:`login.showPassword`),children:l?(0,X.jsx)(Xs,{className:`w-4 h-4`}):(0,X.jsx)(Zs,{className:`w-4 h-4`})})]}),(0,X.jsx)(Lee,{password:a,t:e})]}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsx)(`label`,{className:`text-[14px] font-medium text-text-primary`,children:e(`resetPassword.confirmPassword`)}),(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsx)(iE,{type:d?`text`:`password`,value:s,onChange:e=>c(e.target.value),placeholder:e(`resetPassword.confirmPasswordPlaceholder`),autoComplete:`new-password`,required:!0,className:`pr-10`}),(0,X.jsx)(`button`,{type:`button`,onClick:()=>p(e=>!e),className:`absolute right-2.5 top-1/2 -translate-y-1/2 text-text-secondary hover:text-text-primary cursor-pointer p-1`,"aria-label":e(d?`login.hidePassword`:`login.showPassword`),children:d?(0,X.jsx)(Xs,{className:`w-4 h-4`}):(0,X.jsx)(Zs,{className:`w-4 h-4`})})]}),s&&!h&&(0,X.jsx)(`p`,{className:`text-[13px] text-danger mt-0.5`,children:e(`register.passwordMismatch`)})]}),(0,X.jsx)(Z,{type:`submit`,disabled:!g||r.loading,className:`w-full disabled:opacity-40`,children:r.loading?e(`loading`):e(`resetPassword.submitBtn`)})]})]}),(0,X.jsx)(`p`,{className:`text-[13px] text-text-secondary text-center mt-4`,children:(0,X.jsxs)(qo,{to:`/login`,className:`text-brand hover:underline`,children:[`â `,e(`resetPassword.backToLogin`)]})})]})})]}):(0,X.jsxs)(`div`,{className:`fixed inset-0 overflow-y-auto bg-bg-page`,children:[(0,X.jsx)(ZS,{}),(0,X.jsx)(`div`,{className:`flex min-h-full items-center justify-center px-4 py-8`,children:(0,X.jsxs)(`div`,{className:`w-full max-w-sm`,children:[(0,X.jsxs)(`a`,{href:`/`,className:`flex items-center justify-center mb-8`,children:[(0,X.jsx)(`img`,{src:VS,alt:`PinChat`,className:`h-12 w-auto block dark:hidden`}),(0,X.jsx)(`img`,{src:HS,alt:`PinChat`,className:`h-12 w-auto hidden dark:block`})]}),(0,X.jsxs)(`div`,{className:`card p-6 space-y-3 text-center`,children:[(0,X.jsx)(`h1`,{className:`text-[20px] font-semibold text-danger`,children:e(`resetPassword.noToken`)}),(0,X.jsx)(qo,{to:`/forgot-password`,className:`block text-[14px] text-brand hover:underline`,children:e(`resetPassword.requestNew`)})]}),(0,X.jsx)(`p`,{className:`text-[13px] text-text-secondary text-center mt-4`,children:e(`login.brand`)})]})})]})}var _E=[{id:5141,url:`/avatars/avatar-1.png`},{id:5142,url:`/avatars/avatar-2.png`},{id:5143,url:`/avatars/avatar-3.png`},{id:5144,url:`/avatars/avatar-4.png`}];typeof window<`u`&&_E.forEach(({url:e})=>{new Image().src=e});function vE({open:e,onClose:t,onSubmit:n,sourceLink:r}){let{t:i,i18n:a}=V(`myLinks`),{t:o}=V(`common`),s=!!r,{logAnalyticsEvent:c}=BS(),l=(0,f.useRef)(null),[u,d]=(0,f.useState)(`direct`),[p,m]=(0,f.useState)(``),[h,g]=(0,f.useState)(``),[_,v]=(0,f.useState)(``),[y,b]=(0,f.useState)(null),[x,S]=(0,f.useState)(),[C,w]=(0,f.useState)(_E[0].id),[T,E]=(0,f.useState)(``),[D,O]=(0,f.useState)(``),k=hd(),A=md(),j=gd(),M=Ed(`image`),N=yd(),ee=k.loading||A.loading||j.loading||M.loading;(0,f.useEffect)(()=>{if(!e)return;d(r?.type??`direct`);let t=fE();m(t),g(r?`${r.name} (1)`.slice(0,30):``),v(r?.title??``),b(null),r?(S(r.avatar),w(void 0)):(S(_E[0].url),w(_E[0].id)),E(``),O(``),N.mutate(t).catch(e=>{e instanceof Du&&e.message&&E(e.message)})},[e]);let P=e=>/^[a-zA-Z0-9]{5,30}$/.test(e)?(E(``),!0):(E(i(`urlError`)),!1),F=e=>{let t=e.target.files?.[0];t&&(b(t),S(URL.createObjectURL(t)))},I=async()=>{let e=!0;if(P(p)||(e=!1),h.trim()?O(``):(O(i(`nameRequired`)),e=!1),e)try{let e=null;y&&(e=(await M.mutate(y)).id);let o=_.trim()||h.trim(),l=h.trim();if(s&&r)await j.mutate({source:r.token,target:p,name:o,title:l,image_id:e});else{let t=await k.mutate({token:p,name:o,title:l,type:u});await A.mutate({id:t.id,token:t.token,image_id:e??C??null,...pE,...mE,...hE(a.language)})}c(`link_add_confirm_click`,{link_type:u}),n({id:``,token:p,name:o,type:u,url:Sd(p),title:l||void 0,unreadCount:0,createdAt:new Date().toISOString(),avatar:x}),Q.success(i(s?`linkDuplicated`:`linkCreated`)),t()}catch(e){if(e instanceof Du&&e.code===40004)Q.error(i(`linkLimitReached`));else{let t=e instanceof Du&&e.message?e.message:i(`linkCreateFailed`);Q.error(t)}}},te=[`#6366F1`,`#3B82F6`,`#06B6D4`,`var(--brand)`,`#F59E0B`,`#EF4444`,`#8B5CF6`,`#EC4899`],L=te[h.charCodeAt(0)%te.length]??te[0];return(0,X.jsxs)(GS,{open:e,onClose:t,title:i(s?`duplicateLinkTitle`:`createLinkTitle`),children:[(0,X.jsxs)(`div`,{className:`space-y-4`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`p`,{className:`text-[14px] font-medium text-text-primary mb-2`,children:i(`fieldType`)}),(0,X.jsx)(`div`,{className:`flex gap-2`,children:[`direct`,`group`].map(e=>(0,X.jsx)(`button`,{type:`button`,onClick:()=>{s||d(e)},disabled:s,className:K(`flex-1 h-10 rounded-[8px] text-[15px] border transition-all duration-150`,s?`cursor-not-allowed opacity-60`:`cursor-pointer`,u===e?`border-brand bg-brand-tint text-brand font-medium`:`border-border bg-bg-card text-text-primary hover:border-border-strong`),children:i(e===`direct`?`typeDirect`:`typeGroup`)},e))})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`p`,{className:`text-[14px] font-medium text-text-primary mb-2`,children:i(`fieldUrl`)}),(0,X.jsxs)(`div`,{className:K(`flex items-center rounded-[8px] border bg-bg-card overflow-hidden transition-colors`,T?`border-danger`:`border-border focus-within:border-border-strong`),children:[(0,X.jsx)(`span`,{className:`px-3 text-[14px] text-text-secondary border-r border-border h-10 flex items-center shrink-0 select-none`,children:typeof window<`u`?`${window.location.host}/`:`pinchat.app/`}),(0,X.jsx)(`input`,{value:p,onChange:e=>{m(e.target.value),T&&P(e.target.value)},onBlur:()=>P(p),maxLength:30,className:`flex-1 h-10 px-3 bg-transparent text-[15px] text-text-primary outline-none`})]}),T?(0,X.jsx)(`p`,{className:`text-[13px] text-danger mt-1`,children:T}):(0,X.jsx)(`p`,{className:`text-[13px] text-text-secondary mt-1`,children:i(`urlHint`)})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`p`,{className:`text-[14px] font-medium text-text-primary mb-2`,children:i(`fieldChatName`)}),(0,X.jsx)(`input`,{value:h,onChange:e=>{g(e.target.value.slice(0,30)),D&&O(``)},placeholder:i(`chatNamePlaceholder`),maxLength:30,className:K(`w-full h-10 px-3 rounded-[8px] border bg-bg-card text-[15px] text-text-primary outline-none transition-colors`,D?`border-danger`:`border-border focus:border-border-strong`)}),(0,X.jsxs)(`div`,{className:`flex justify-between mt-1`,children:[D?(0,X.jsx)(`p`,{className:`text-[13px] text-danger`,children:D}):(0,X.jsx)(`span`,{}),(0,X.jsxs)(`p`,{className:`text-[13px] text-text-secondary`,children:[h.length,`/30`]})]})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`p`,{className:`text-[14px] font-medium text-text-primary mb-2`,children:i(`fieldNickname`)}
35),(0,X.jsx)(`input`,{value:_,onChange:e=>v(e.target.value.slice(0,25)),placeholder:i(`nicknamePlaceholder`),maxLength:25,className:`w-full h-10 px-3 rounded-[8px] border border-border bg-bg-card text-[15px] text-text-primary outline-none focus:border-border-strong transition-colors`}),(0,X.jsxs)(`p`,{className:`text-[13px] text-text-secondary mt-1 text-right`,children:[_.length,`/25`]})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`p`,{className:`text-[14px] font-medium text-text-primary mb-2`,children:i(`fieldAvatar`)}),(0,X.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,X.jsxs)(`div`,{className:`relative w-20 h-20 rounded-full overflow-hidden shrink-0 flex items-center justify-center text-white text-[28px] font-semibold select-none`,style:{backgroundColor:x?void 0:L},children:[x?(0,X.jsx)(`img`,{src:x,alt:``,className:`w-full h-full object-cover`}):h.charAt(0).toUpperCase()||`?`,M.loading&&(0,X.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-black/40 rounded-full`,children:(0,X.jsx)(sc,{className:`w-6 h-6 text-white animate-spin`})})]}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[!s&&(0,X.jsx)(`div`,{className:`flex gap-2`,children:_E.map(e=>(0,X.jsx)(`button`,{type:`button`,onClick:()=>{b(null),S(e.url),w(e.id),l.current&&(l.current.value=``)},className:K(`w-10 h-10 rounded-full overflow-hidden border-2 transition-all duration-150 cursor-pointer shrink-0`,!y&&C===e.id?`border-brand`:`border-transparent hover:border-border-strong`),children:(0,X.jsx)(`img`,{src:e.url,alt:``,className:`w-full h-full object-cover`})},e.id))}),(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(`input`,{type:`file`,accept:`image/*`,ref:l,onChange:F,className:`hidden`}),(0,X.jsxs)(Z,{type:`button`,variant:`secondary`,size:`sm`,onClick:()=>l.current?.click(),className:`gap-1.5`,children:[(0,X.jsx)(Mc,{className:`w-3.5 h-3.5`}),o(y?`changeImage`:`uploadImage`)]}),y&&(0,X.jsx)(`button`,{type:`button`,onClick:()=>{b(null),S(s?r?.avatar:_E[0].url),w(s?void 0:_E[0].id),l.current&&(l.current.value=``)},className:`text-[14px] text-text-secondary hover:text-danger transition-colors cursor-pointer`,children:o(`remove`)})]})]})]})]})]}),(0,X.jsxs)(`div`,{className:`flex gap-2 justify-end mt-6 pt-4 border-t border-border`,children:[(0,X.jsx)(Z,{variant:`secondary`,size:`md`,onClick:t,disabled:ee,children:o(`cancel`)}),(0,X.jsx)(Z,{size:`md`,onClick:I,disabled:ee,className:`disabled:opacity-40`,children:o(ee?`loading`:`create`)})]})]})}var zee=Object.defineProperty,yE=Object.getOwnPropertySymbols,bE=Object.prototype.hasOwnProperty,xE=Object.prototype.propertyIsEnumerable,SE=(e,t,n)=>t in e?zee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,CE=(e,t)=>{for(var n in t||={})bE.call(t,n)&&SE(e,n,t[n]);if(yE)for(var n of yE(t))xE.call(t,n)&&SE(e,n,t[n]);return e},wE=(e,t)=>{var n={};for(var r in e)bE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&yE)for(var r of yE(e))t.indexOf(r)<0&&xE.call(e,r)&&(n[r]=e[r]);return n},TE;(e=>{let t=class t{constructor(e,n,r,a){if(this.version=e,this.errorCorrectionLevel=n,this.modules=[],this.isFunction=[],e<t.MIN_VERSION||e>t.MAX_VERSION)throw RangeError(`Version value out of range`);if(a<-1||a>7)throw RangeError(`Mask value out of range`);this.size=e*4+17;let o=[];for(let e=0;e<this.size;e++)o.push(!1);for(let e=0;e<this.size;e++)this.modules.push(o.slice()),this.isFunction.push(o.slice());this.drawFunctionPatterns();let s=this.addEccAndInterleave(r);if(this.drawCodewords(s),a==-1){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);let n=this.getPenaltyScore();n<e&&(a=t,e=n),this.applyMask(t)}}i(0<=a&&a<=7),this.mask=a,this.applyMask(a),this.drawFormatBits(a),this.isFunction=[]}static encodeText(n,r){let i=e.QrSegment.makeSegments(n);return t.encodeSegments(i,r)}static encodeBinary(n,r){let i=e.QrSegment.makeBytes(n);return t.encodeSegments([i],r)}static encodeSegments(e,r,a=1,s=40,c=-1,l=!0){if(!(t.MIN_VERSION<=a&&a<=s&&s<=t.MAX_VERSION)||c<-1||c>7)throw RangeError(`Invalid value`);let u,d;for(u=a;;u++){let n=t.getNumDataCodewords(u,r)*8,i=o.getTotalBits(e,u);if(i<=n){d=i;break}if(u>=s)throw RangeError(`Data too long`)}for(let e of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])l&&d<=t.getNumDataCodewords(u,e)*8&&(r=e);let f=[];for(let t of e){n(t.mode.modeBits,4,f),n(t.numChars,t.mode.numCharCountBits(u),f);for(let e of t.getData())f.push(e)}i(f.length==d);let p=t.getNumDataCodewords(u,r)*8;i(f.length<=p),n(0,Math.min(4,p-f.length),f),n(0,(8-f.length%8)%8,f),i(f.length%8==0);for(let e=236;f.length<p;e^=253)n(e,8,f);let m=[];for(;m.length*8<f.length;)m.push(0);return f.forEach((e,t)=>m[t>>>3]|=e<<7-(t&7)),new t(u,r,m,c)}getModule(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]}getModules(){return this.modules}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let e=this.getAlignmentPatternPositions(),t=e.length;for(let n=0;n<t;n++)for(let r=0;r<t;r++)n==0&&r==0||n==0&&r==t-1||n==t-1&&r==0||this.drawAlignmentPattern(e[n],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){let t=this.errorCorrectionLevel.formatBits<<3|e,n=t;
35for(let e=0;e<10;e++)n=n<<1^(n>>>9)*1335;let a=(t<<10|n)^21522;i(a>>>15==0);for(let e=0;e<=5;e++)this.setFunctionModule(8,e,r(a,e));this.setFunctionModule(8,7,r(a,6)),this.setFunctionModule(8,8,r(a,7)),this.setFunctionModule(7,8,r(a,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,r(a,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,r(a,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,r(a,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^(e>>>11)*7973;let t=this.version<<12|e;i(t>>>18==0);for(let e=0;e<18;e++){let n=r(t,e),i=this.size-11+e%3,a=Math.floor(e/3);this.setFunctionModule(i,a,n),this.setFunctionModule(a,i,n)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let r=-4;r<=4;r++){let i=Math.max(Math.abs(r),Math.abs(n)),a=e+r,o=t+n;0<=a&&a<this.size&&0<=o&&o<this.size&&this.setFunctionModule(a,o,i!=2&&i!=4)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,t+n,Math.max(Math.abs(r),Math.abs(n))!=1)}setFunctionModule(e,t,n){this.modules[t][e]=n,this.isFunction[t][e]=!0}addEccAndInterleave(e){let n=this.version,r=this.errorCorrectionLevel;if(e.length!=t.getNumDataCodewords(n,r))throw RangeError(`Invalid argument`);let a=t.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][n],o=t.ECC_CODEWORDS_PER_BLOCK[r.ordinal][n],s=Math.floor(t.getNumRawDataModules(n)/8),c=a-s%a,l=Math.floor(s/a),u=[],d=t.reedSolomonComputeDivisor(o);for(let n=0,r=0;n<a;n++){let i=e.slice(r,r+l-o+(n<c?0:1));r+=i.length;let a=t.reedSolomonComputeRemainder(i,d);n<c&&i.push(0),u.push(i.concat(a))}let f=[];for(let e=0;e<u[0].length;e++)u.forEach((t,n)=>{(e!=l-o||n>=c)&&f.push(t[e])});return i(f.length==s),f}drawCodewords(e){if(e.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw RangeError(`Invalid argument`);let n=0;for(let t=this.size-1;t>=1;t-=2){t==6&&(t=5);for(let i=0;i<this.size;i++)for(let a=0;a<2;a++){let o=t-a,s=t+1&2?i:this.size-1-i;!this.isFunction[s][o]&&n<e.length*8&&(this.modules[s][o]=r(e[n>>>3],7-(n&7)),n++)}}i(n==e.length*8)}applyMask(e){if(e<0||e>7)throw RangeError(`Mask value out of range`);for(let t=0;t<this.size;t++)for(let n=0;n<this.size;n++){let r;switch(e){case 0:r=(n+t)%2==0;break;case 1:r=t%2==0;break;case 2:r=n%3==0;break;case 3:r=(n+t)%3==0;break;case 4:r=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:r=n*t%2+n*t%3==0;break;case 6:r=(n*t%2+n*t%3)%2==0;break;case 7:r=((n+t)%2+n*t%3)%2==0;break;default:throw Error(`Unreachable`)}!this.isFunction[t][n]&&r&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let n=0;n<this.size;n++){let r=!1,i=0,a=[0,0,0,0,0,0,0];for(let o=0;o<this.size;o++)this.modules[n][o]==r?(i++,i==5?e+=t.PENALTY_N1:i>5&&e++):(this.finderPenaltyAddHistory(i,a),r||(e+=this.finderPenaltyCountPatterns(a)*t.PENALTY_N3),r=this.modules[n][o],i=1);e+=this.finderPenaltyTerminateAndCount(r,i,a)*t.PENALTY_N3}for(let n=0;n<this.size;n++){let r=!1,i=0,a=[0,0,0,0,0,0,0];for(let o=0;o<this.size;o++)this.modules[o][n]==r?(i++,i==5?e+=t.PENALTY_N1:i>5&&e++):(this.finderPenaltyAddHistory(i,a),r||(e+=this.finderPenaltyCountPatterns(a)*t.PENALTY_N3),r=this.modules[o][n],i=1);e+=this.finderPenaltyTerminateAndCount(r,i,a)*t.PENALTY_N3}for(let n=0;n<this.size-1;n++)for(let r=0;r<this.size-1;r++){let i=this.modules[n][r];i==this.modules[n][r+1]&&i==this.modules[n+1][r]&&i==this.modules[n+1][r+1]&&(e+=t.PENALTY_N2)}let n=0;for(let e of this.modules)n=e.reduce((e,t)=>e+ +!!t,n);let r=this.size*this.size,a=Math.ceil(Math.abs(n*20-r*10)/r)-1;return i(0<=a&&a<=9),e+=a*t.PENALTY_N4,i(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(this.version==1)return[];{let e=Math.floor(this.version/7)+2,t=this.version==32?26:Math.ceil((this.version*4+4)/(e*2-2))*2,n=[6];for(let r=this.size-7;n.length<e;r-=t)n.splice(1,0,r);return n}}static getNumRawDataModules(e){if(e<t.MIN_VERSION||e>t.MAX_VERSION)throw RangeError(`Version number out of range`);let n=(16*e+128)*e+64;if(e>=2){let t=Math.floor(e/7)+2;n-=(25*t-10)*t-55,e>=7&&(n-=36)}return i(208<=n&&n<=29648),n}static getNumDataCodewords(e,n){return Math.floor(t.getNumRawDataModules(e)/8)-t.ECC_CODEWORDS_PER_BLOCK[n.ordinal][e]*t.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw RangeError(`Degree out of range`);let n=[];for(let t=0;t<e-1;t++)n.push(0);n.push(1);let r=1;for(let i=0;i<e;i++){for(let e=0;e<n.length;e++)n[e]=t.reedSolomonMultiply(n[e],r),e+1<n.length&&(n[e]^=n[e+1]);r=t.reedSolomonMultiply(r,2)}return n}static reedSolomonComputeRemainder(e,n){let r=n.map(e=>0);for(let i of e){let e=i^r.shift();
35r.push(0),n.forEach((n,i)=>r[i]^=t.reedSolomonMultiply(n,e))}return r}static reedSolomonMultiply(e,t){if(e>>>8||t>>>8)throw RangeError(`Byte out of range`);let n=0;for(let r=7;r>=0;r--)n=n<<1^(n>>>7)*285,n^=(t>>>r&1)*e;return i(n>>>8==0),n}finderPenaltyCountPatterns(e){let t=e[1];i(t<=this.size*3);let n=t>0&&e[2]==t&&e[3]==t*3&&e[4]==t&&e[5]==t;return(n&&e[0]>=t*4&&e[6]>=t?1:0)+(n&&e[6]>=t*4&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){t[0]==0&&(e+=this.size),t.pop(),t.unshift(e)}};t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;function n(e,t,n){if(t<0||t>31||e>>>t)throw RangeError(`Value out of range`);for(let r=t-1;r>=0;r--)n.push(e>>>r&1)}function r(e,t){return(e>>>t&1)!=0}function i(e){if(!e)throw Error(`Assertion error`)}let a=class e{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw RangeError(`Invalid argument`);this.bitData=n.slice()}static makeBytes(t){let r=[];for(let e of t)n(e,8,r);return new e(e.Mode.BYTE,t.length,r)}static makeNumeric(t){if(!e.isNumeric(t))throw RangeError(`String contains non-numeric characters`);let r=[];for(let e=0;e<t.length;){let i=Math.min(t.length-e,3);n(parseInt(t.substring(e,e+i),10),i*3+1,r),e+=i}return new e(e.Mode.NUMERIC,t.length,r)}static makeAlphanumeric(t){if(!e.isAlphanumeric(t))throw RangeError(`String contains unencodable characters in alphanumeric mode`);let r=[],i;for(i=0;i+2<=t.length;i+=2){let a=e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(i))*45;a+=e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(i+1)),n(a,11,r)}return i<t.length&&n(e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(i)),6,r),new e(e.Mode.ALPHANUMERIC,t.length,r)}static makeSegments(t){return t==``?[]:e.isNumeric(t)?[e.makeNumeric(t)]:e.isAlphanumeric(t)?[e.makeAlphanumeric(t)]:[e.makeBytes(e.toUtf8ByteArray(t))]}static makeEci(t){let r=[];if(t<0)throw RangeError(`ECI assignment value out of range`);if(t<128)n(t,8,r);else if(t<16384)n(2,2,r),n(t,14,r);else if(t<1e6)n(6,3,r),n(t,21,r);else throw RangeError(`ECI assignment value out of range`);return new e(e.Mode.ECI,0,r)}static isNumeric(t){return e.NUMERIC_REGEX.test(t)}static isAlphanumeric(t){return e.ALPHANUMERIC_REGEX.test(t)}getData(){return this.bitData.slice()}static getTotalBits(e,t){let n=0;for(let r of e){let e=r.mode.numCharCountBits(t);if(r.numChars>=1<<e)return 1/0;n+=4+e+r.bitData.length}return n}static toUtf8ByteArray(e){e=encodeURI(e);let t=[];for(let n=0;n<e.length;n++)e.charAt(n)==`%`?(t.push(parseInt(e.substring(n+1,n+3),16)),n+=2):t.push(e.charCodeAt(n));return t}};a.NUMERIC_REGEX=/^[0-9]*$/,a.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,a.ALPHANUMERIC_CHARSET=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`;let o=a;e.QrSegment=a})(TE||={}),(e=>{(e=>{let t=class{constructor(e,t){this.ordinal=e,this.formatBits=t}};t.LOW=new t(0,1),t.MEDIUM=new t(1,0),t.QUARTILE=new t(2,3),t.HIGH=new t(3,2),e.Ecc=t})(e.QrCode||={})})(TE||={}),(e=>{(e=>{let t=class{constructor(e,t){this.modeBits=e,this.numBitsCharCount=t}numCharCountBits(e){return this.numBitsCharCount[Math.floor((e+7)/17)]}};t.NUMERIC=new t(1,[10,12,14]),t.ALPHANUMERIC=new t(2,[9,11,13]),t.BYTE=new t(4,[8,16,16]),t.KANJI=new t(8,[8,10,12]),t.ECI=new t(7,[0,0,0]),e.Mode=t})(e.QrSegment||={})})(TE||={});var EE=TE,Bee={L:EE.QrCode.Ecc.LOW,M:EE.QrCode.Ecc.MEDIUM,Q:EE.QrCode.Ecc.QUARTILE,H:EE.QrCode.Ecc.HIGH},DE=128,OE=`L`,kE=`#FFFFFF`,AE=`#000000`,jE=!1,ME=1,NE=4,PE=0,FE=.1;function IE(e,t=0){let n=[];return e.forEach(function(e,r){let i=null;e.forEach(function(a,o){if(!a&&i!==null){n.push(`M${i+t} ${r+t}h${o-i}v1H${i+t}z`),i=null;return}if(o===e.length-1){if(!a)return;i===null?n.push(`M${o+t},${r+t} h1v1H${o+t}z`):n.push(`M${i+t},${r+t} h${o+1-i}v1H${i+t}z`);return}a&&i===null&&(i=o)})}),n.join(``)}function LE(e,t){return e.slice().map((e,n)=>n<t.y||n>=t.y+t.h?e:e.map((e,n)=>n<t.x||n>=t.x+t.w?e:!1))}function RE(e,t,n,r){if(r==null)return null;let i=e.length+n*2,a=Math.floor(t*FE),o=i/t,s=(r.width||a)*o,c=(r.height||a)*o,l=r.x==null?e.length/2-s/2:r.x*o,u=r.y==null?e.length/2-c/2:r.y*o,d=r.opacity==null?1:r.opacity,f=null;if(r.excavate){let e=Math.floor(l),t=Math.floor(u);f={x:e,y:t,w:Math.ceil(s+l-e),h:Math.ceil(c+u-t)}}let p=r.crossOrigin;return{x:l,y:u,h:c,w:s,excavation:f,opacity:d,crossOrigin:p}}function zE(e,t){return t==null?e?NE:PE:Math.max(Math.floor(t),0)}function BE({value:e,level:t,minVersion:n,includeMargin:r,marginSize:i,imageSettings:a,size:o,boostLevel:s}){let c=f.useMemo(()=>{let r=(Array.isArray(e)?e:[e]).reduce((e,t)=>
35(e.push(...EE.QrSegment.makeSegments(t)),e),[]);return EE.QrCode.encodeSegments(r,Bee[t],n,void 0,void 0,s)},[e,t,n,s]),{cells:l,margin:u,numCells:d,calculatedImageSettings:p}=f.useMemo(()=>{let e=c.getModules(),t=zE(r,i);return{cells:e,margin:t,numCells:e.length+t*2,calculatedImageSettings:RE(e,o,t,a)}},[c,o,a,r,i]);return{qrcode:c,margin:u,cells:l,numCells:d,calculatedImageSettings:p}}var VE=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),HE=f.forwardRef(function(e,t){let n=e,{value:r,size:i=DE,level:a=OE,bgColor:o=kE,fgColor:s=AE,includeMargin:c=jE,minVersion:l=ME,boostLevel:u,marginSize:d,imageSettings:p}=n,m=wE(n,[`value`,`size`,`level`,`bgColor`,`fgColor`,`includeMargin`,`minVersion`,`boostLevel`,`marginSize`,`imageSettings`]),{style:h}=m,g=wE(m,[`style`]),_=p?.src,v=f.useRef(null),y=f.useRef(null),b=f.useCallback(e=>{v.current=e,typeof t==`function`?t(e):t&&(t.current=e)},[t]),[x,S]=f.useState(!1),{margin:C,cells:w,numCells:T,calculatedImageSettings:E}=BE({value:r,level:a,minVersion:l,boostLevel:u,includeMargin:c,marginSize:d,imageSettings:p,size:i});f.useEffect(()=>{if(v.current!=null){let e=v.current,t=e.getContext(`2d`);if(!t)return;let n=w,r=y.current,a=E!=null&&r!==null&&r.complete&&r.naturalHeight!==0&&r.naturalWidth!==0;a&&E.excavation!=null&&(n=LE(w,E.excavation));let c=window.devicePixelRatio||1;e.height=e.width=i*c;let l=i/T*c;t.scale(l,l),t.fillStyle=o,t.fillRect(0,0,T,T),t.fillStyle=s,VE?t.fill(new Path2D(IE(n,C))):w.forEach(function(e,n){e.forEach(function(e,r){e&&t.fillRect(r+C,n+C,1,1)})}),E&&(t.globalAlpha=E.opacity),a&&t.drawImage(r,E.x+C,E.y+C,E.w,E.h)}}),f.useEffect(()=>{S(!1)},[_]);let D=CE({height:i,width:i},h),O=null;return _!=null&&(O=f.createElement(`img`,{src:_,key:_,style:{display:`none`},onLoad:()=>{S(!0)},ref:y,crossOrigin:E?.crossOrigin})),f.createElement(f.Fragment,null,f.createElement(`canvas`,CE({style:D,height:i,width:i,ref:b,role:`img`},g)),O)});HE.displayName=`QRCodeCanvas`;var UE=f.forwardRef(function(e,t){let n=e,{value:r,size:i=DE,level:a=OE,bgColor:o=kE,fgColor:s=AE,includeMargin:c=jE,minVersion:l=ME,boostLevel:u,title:d,marginSize:p,imageSettings:m}=n,h=wE(n,[`value`,`size`,`level`,`bgColor`,`fgColor`,`includeMargin`,`minVersion`,`boostLevel`,`title`,`marginSize`,`imageSettings`]),{margin:g,cells:_,numCells:v,calculatedImageSettings:y}=BE({value:r,level:a,minVersion:l,boostLevel:u,includeMargin:c,marginSize:p,imageSettings:m,size:i}),b=_,x=null;m!=null&&y!=null&&(y.excavation!=null&&(b=LE(_,y.excavation)),x=f.createElement(`image`,{href:m.src,height:y.h,width:y.w,x:y.x+g,y:y.y+g,preserveAspectRatio:`none`,opacity:y.opacity,crossOrigin:y.crossOrigin}));let S=IE(b,g);return f.createElement(`svg`,CE({height:i,width:i,viewBox:`0 0 ${v} ${v}`,ref:t,role:`img`},h),!!d&&f.createElement(`title`,null,d),f.createElement(`path`,{fill:o,d:`M0,0 h${v}v${v}H0z`,shapeRendering:`crispEdges`}),f.createElement(`path`,{fill:s,d:S,shapeRendering:`crispEdges`}),x)});UE.displayName=`QRCodeSVG`;function WE({open:e,onClose:t,linkName:n,linkUrl:r}){let{t:i}=V(`myLinks`),[a,o]=(0,f.useState)(!1);return(0,X.jsx)(GS,{open:e,onClose:t,title:i(`shareQrCode`),children:(0,X.jsxs)(`div`,{className:`flex flex-col items-center gap-5`,children:[(0,X.jsx)(`p`,{className:`text-[18px] font-semibold text-text-primary text-center`,children:n}),(0,X.jsx)(`div`,{className:`p-4 rounded-[12px] border border-border bg-white`,children:(0,X.jsx)(UE,{id:`qr-svg`,value:r,size:200,bgColor:`#ffffff`,fgColor:`#1A1C22`,level:`M`})}),(0,X.jsxs)(`div`,{className:`flex items-center justify-center gap-1.5`,children:[(0,X.jsx)(`p`,{className:`text-[13px] text-text-secondary font-mono break-all text-center max-w-xs`,children:r}),(0,X.jsx)(tE,{content:i(a?`copied`:`copyLinkUrl`),children:(0,X.jsx)(`button`,{onClick:async()=>{await uu(r),o(!0),setTimeout(()=>o(!1),2e3)},className:K(`w-7 h-7 shrink-0 flex items-center justify-center rounded-[8px] border transition-all duration-150 cursor-pointer`,a?`border-brand bg-brand-tint text-brand`:`border-border bg-bg-card text-text-secondary hover:text-text-primary hover:border-border-strong`),children:a?(0,X.jsx)(Fs,{className:`w-3.5 h-3.5`}):(0,X.jsx)(Gs,{className:`w-3.5 h-3.5`})})})]}),(0,X.jsxs)(`div`,{className:`flex items-center gap-2 w-full`,children:[(0,X.jsx)(tE,{content:i(`downloadQrCode`),children:(0,X.jsx)(`button`,{onClick:()=>{let e=document.getElementById(`qr-svg`);if(!e)return;let t=new XMLSerializer().serializeToString(e),r=new Blob([t],{type:`image/svg+xml`}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=`${n}-qrcode.svg`,a.click(),URL.revokeObjectURL(i)},className:`w-10 h-10 shrink-0 flex items-center justify-center rounded-[8px] border border-border bg-bg-card text-text-secondary hover:text-text-primary hover:border-border-strong transition-all duration-150 cursor-pointer`,children:(0,X.jsx)(qs,{className:`w-4 h-4`})})}),(0,X.jsxs)(Z,{size:`md`,onClick:()=>{let e=new URLSearchParams({name:n,url:r});window.open(`/showcase?${e.toString()}`,`_blank`)},className:`gap-1.5 flex-1`,children:[(0,X.jsx)(Ys,{className:`w-4 h-4`}),i(`openShowcase`)]})]})]})})}var GE=`imkit-token`;function KE(e){let t=typeof window>`u`?``:localStorage.getItem(GE)??``,n=new URLSearchParams;t&&n.set(`token`,t),e&&n.set(`roomTag`,e);let r=n.toString();return r?`/dashboard/chat?${r}`:`/dashboard/chat`}function qE({link:e,onDelete:t,onDuplicate:n}){let{t:r}=V(`myLinks`),i=la(),a=zf(e=>e.userSetting),o=!!a?.subAccount,s=o?(a?.subAccount_rules??[]).find(t=>t.token===e.token)?.rule??null:null,c=!o||s===`admin`||s===`editor`,{logAnalyticsEvent:l}=BS(),[u,d]=(0,f.useState)(!1),[p,m]=(0,f.useState)(!1),[h,g]=(0,f.useState)(!1),[_,v]=(0,f.useState)(!1),y=(0,f.useRef)(null);(0,f.useEffect)(()=>
35{if(!u)return;let e=e=>{y.current?.contains(e.target)||d(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[u]);let b=()=>{l(`link_copy_click`,{element_id:e.token}),uu(e.url),v(!0),setTimeout(()=>v(!1),1500)},x=e.title||e.name;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:K(`card-interactive p-6 relative flex flex-col justify-between gap-4`,u&&`z-10`),children:[(0,X.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[e.avatar?(0,X.jsx)(`img`,{src:e.avatar,alt:x,className:`w-10 h-10 rounded-full object-cover shrink-0`}):(0,X.jsx)(`div`,{className:`w-10 h-10 rounded-full flex items-center justify-center shrink-0 text-white text-[15px] font-semibold select-none`,style:{backgroundColor:`var(--brand)`},children:x.charAt(0)}),(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-1.5 mb-0.5 min-w-0`,children:[(0,X.jsx)(`h3`,{className:`text-[15px] font-semibold text-text-primary truncate`,children:x}),e.type===`group`&&(0,X.jsx)(`span`,{className:`inline-flex items-center px-1.5 h-[18px] rounded-full text-[11px] font-medium bg-bg-subtle text-text-secondary border border-border shrink-0`,children:r(`typeGroup`)})]}),(0,X.jsxs)(`button`,{onClick:b,className:`flex items-center gap-2 min-w-0 w-full group cursor-pointer text-left`,"aria-label":r(_?`copied`:`copyLinkUrl`),children:[(0,X.jsx)(`span`,{className:`text-[13px] text-text-secondary font-mono truncate`,children:e.url}),_?(0,X.jsx)(Fs,{className:`w-3.5 h-3.5 text-brand shrink-0`}):(0,X.jsx)(Gs,{className:`w-3.5 h-3.5 shrink-0 text-text-secondary sm:text-transparent sm:group-hover:text-text-secondary transition-colors duration-150`})]})]})]}),(0,X.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[e.unreadCount>0&&(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[12px] font-medium text-brand bg-brand-tint px-2 h-5 rounded-full whitespace-nowrap`,children:[(0,X.jsx)(dc,{className:`w-3 h-3`}),e.unreadCount,` `,r(`unread`)]}),(0,X.jsxs)(`div`,{className:`relative`,ref:y,children:[(0,X.jsx)(tE,{content:r(`moreActions`),children:(0,X.jsx)(`button`,{onClick:()=>d(e=>!e),"aria-label":r(`moreActions`),className:`w-8 h-8 flex items-center justify-center rounded-[8px] text-text-secondary cursor-pointer transition-all duration-150 hover:bg-bg-hover hover:text-text-primary`,children:(0,X.jsx)(Js,{className:`w-5 h-5`})})}),u&&(0,X.jsx)(X.Fragment,{children:(0,X.jsxs)(`div`,{className:`absolute right-0 top-9 min-w-[176px] w-max bg-bg-card border border-border rounded-[12px] py-1 z-50 overflow-hidden`,style:{boxShadow:`var(--shadow-3)`},children:[(0,X.jsx)(JE,{icon:Sc,label:r(`shareQrCode`),onClick:()=>{l(`link_share_click`,{element_id:e.token}),d(!1),g(!0)}}),!o&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(JE,{icon:ac,label:r(`duplicateLink`),onClick:()=>{d(!1),m(!0)}}),(0,X.jsx)(JE,{icon:Fc,label:r(`assignSubAccounts`),onClick:()=>{d(!1),i(`/dashboard/workspace/${e.token}/settings/sub-accounts`)}}),(0,X.jsx)(`div`,{className:`border-t border-border my-1`}),(0,X.jsx)(JE,{icon:kc,label:r(`deleteLink`),danger:!0,onClick:()=>{t(e),d(!1)}})]})]})})]})]})]}),(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsxs)(Z,{size:`sm`,onClick:()=>{l(`view_chat_under_link_click`,{element_id:e.token}),window.open(KE(e.token),`_blank`)},className:`gap-1.5`,children:[(0,X.jsx)(Ys,{className:`w-3.5 h-3.5`}),r(`openChatRoom`)]}),c&&(0,X.jsxs)(Z,{variant:`secondary`,size:`sm`,onClick:()=>{l(`link_edit_click`,{element_id:e.token}),i(`/dashboard/workspace/${e.token}/data`)},className:`gap-1.5`,children:[(0,X.jsx)(vc,{className:`w-3.5 h-3.5`}),r(`manageLink`)]})]})]}),(0,X.jsx)(vE,{open:p,onClose:()=>m(!1),onSubmit:n,sourceLink:e}),(0,X.jsx)(WE,{open:h,onClose:()=>g(!1),linkName:x,linkUrl:e.url})]})}function JE({icon:e,label:t,danger:n,onClick:r}){return(0,X.jsxs)(`button`,{onClick:r,className:K(`w-full flex items-center gap-2.5 px-3 h-9 text-[15px] transition-colors duration-100 hover:bg-bg-subtle text-left cursor-pointer`,n?`text-danger`:`text-text-primary`),children:[(0,X.jsx)(e,{className:`w-4 h-4 shrink-0`}),t]})}function YE({link:e,onDelete:t,onDuplicate:n}){let{t:r}=V(`myLinks`),i=la(),a=zf(e=>e.userSetting),o=!!a?.subAccount,s=o?(a?.subAccount_rules??[]).find(t=>t.token===e.token)?.rule??null:null,c=!o||s===`admin`||s===`editor`,{logAnalyticsEvent:l}=BS(),[u,d]=(0,f.useState)(!1),[p,m]=(0,f.useState)(!1),[h,g]=(0,f.useState)(!1),[_,v]=(0,f.useState)(!1),y=(0,f.useRef)(null);(0,f.useEffect)(()=>
35{if(!u)return;let e=e=>{y.current?.contains(e.target)||d(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[u]);let b=()=>{l(`link_copy_click`,{element_id:e.token}),uu(e.url),v(!0),setTimeout(()=>v(!1),1500)},x=e.title||e.name;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:K(`card flex items-center gap-4 px-5 py-5 relative`,u&&`z-10`),children:[e.avatar?(0,X.jsx)(`img`,{src:e.avatar,alt:x,className:`w-10 h-10 rounded-full object-cover shrink-0`}):(0,X.jsx)(`div`,{className:`w-10 h-10 rounded-full flex items-center justify-center shrink-0 text-white text-[15px] font-semibold select-none`,style:{backgroundColor:`var(--brand)`},children:x.charAt(0)}),(0,X.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-1.5 mb-1 min-w-0`,children:[(0,X.jsx)(`p`,{className:`text-[15px] font-medium text-text-primary truncate`,children:x}),e.type===`group`&&(0,X.jsx)(`span`,{className:`inline-flex items-center px-1.5 h-[18px] rounded-full text-[11px] font-medium bg-bg-subtle text-text-secondary border border-border shrink-0`,children:r(`typeGroup`)})]}),(0,X.jsxs)(`button`,{onClick:b,className:`flex items-center gap-2 min-w-0 w-full group cursor-pointer text-left`,"aria-label":r(_?`copied`:`copyLinkUrl`),children:[(0,X.jsx)(`span`,{className:`text-[13px] text-text-secondary font-mono truncate`,children:e.url}),_?(0,X.jsx)(Fs,{className:`w-3.5 h-3.5 text-brand shrink-0`}):(0,X.jsx)(Gs,{className:`w-3.5 h-3.5 shrink-0 text-text-secondary sm:text-transparent sm:group-hover:text-text-secondary transition-colors duration-150`})]})]}),e.unreadCount>0&&(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[12px] font-medium text-brand bg-brand-tint px-2 h-5 rounded-full whitespace-nowrap shrink-0`,children:[(0,X.jsx)(dc,{className:`w-3 h-3`}),e.unreadCount]}),(0,X.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0`,children:[(0,X.jsx)(tE,{content:r(`openChatRoom`),children:(0,X.jsx)(`button`,{onClick:()=>{l(`view_chat_under_link_click`,{element_id:e.token}),window.open(KE(e.token),`_blank`)},"aria-label":r(`openChatRoom`),className:`hidden sm:flex w-8 h-8 items-center justify-center rounded-[8px] text-text-secondary hover:bg-bg-subtle hover:text-text-primary transition-all duration-150 cursor-pointer`,children:(0,X.jsx)(Ys,{className:`w-4 h-4`})})}),c&&(0,X.jsx)(tE,{content:r(`manageLink`),children:(0,X.jsx)(`button`,{onClick:()=>{l(`link_edit_click`,{element_id:e.token}),i(`/dashboard/workspace/${e.token}/data`)},"aria-label":r(`manageLink`),className:`w-8 h-8 flex items-center justify-center rounded-[8px] text-text-secondary hover:bg-bg-subtle hover:text-text-primary transition-all duration-150 cursor-pointer`,children:(0,X.jsx)(vc,{className:`w-4 h-4`})})}),(0,X.jsxs)(`div`,{className:`relative`,ref:y,children:[(0,X.jsx)(tE,{content:r(`moreActions`),children:(0,X.jsx)(`button`,{onClick:()=>d(e=>!e),"aria-label":r(`moreActions`),className:`w-8 h-8 flex items-center justify-center rounded-[8px] text-text-secondary hover:bg-bg-subtle hover:text-text-primary transition-all duration-150 cursor-pointer`,children:(0,X.jsx)(Js,{className:`w-5 h-5`})})}),u&&(0,X.jsx)(X.Fragment,{children:(0,X.jsxs)(`div`,{className:`absolute right-0 top-9 min-w-[176px] w-max bg-bg-card border border-border rounded-[12px] py-1 z-50 overflow-hidden`,style:{boxShadow:`var(--shadow-3)`},children:[(0,X.jsx)(XE,{icon:Sc,label:r(`shareQrCode`),onClick:()=>{l(`link_share_click`,{element_id:e.token}),d(!1),g(!0)}}),!o&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(XE,{icon:ac,label:r(`duplicateLink`),onClick:()=>{d(!1),m(!0)}}),(0,X.jsx)(XE,{icon:Fc,label:r(`assignSubAccounts`),onClick:()=>{d(!1),i(`/dashboard/workspace/${e.token}/settings/sub-accounts`)}}),(0,X.jsx)(`div`,{className:`border-t border-border my-1`}),(0,X.jsx)(XE,{icon:kc,label:r(`deleteLink`),danger:!0,onClick:()=>{t(e),d(!1)}})]})]})})]})]})]}),(0,X.jsx)(vE,{open:p,onClose:()=>m(!1),onSubmit:n,sourceLink:e}),(0,X.jsx)(WE,{open:h,onClose:()=>g(!1),linkName:x,linkUrl:e.url})]})}function XE({icon:e,label:t,danger:n,onClick:r}){return(0,X.jsxs)(`button`,{onClick:r,className:K(`w-full flex items-center gap-2.5 px-3 h-9 text-[15px] transition-colors duration-100 hover:bg-bg-subtle text-left cursor-pointer`,n?`text-danger`:`text-text-primary`),children:[(0,X.jsx)(e,{className:`w-4 h-4 shrink-0`}),t]})}function ZE(e,t){let[n,r]=(0,f.useState)(e);return(0,f.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}var QE=10;function $E(e,t){if(e<=7)return Array.from({length:e},(e,t)=>t+1);let n=[...new Set([1,e,t,t-1,t+1])].filter(t=>t>=1&&t<=e).sort((e,t)=>
35e-t),r=[];for(let e=0;e<n.length;e++)e>0&&n[e]-n[e-1]>1&&r.push(`ellipsis`),r.push(n[e]);return r}function eD(){let{t:e}=V(`myLinks`),{t}=V(`common`);cE(e(`pageTitle`));let n=zf(e=>e.userSetting),r=!!n?.subAccount,{logAnalyticsEvent:i}=BS(),[a,o]=(0,f.useState)(``),[s,c]=(0,f.useState)(`createdAt`),[l,u]=(0,f.useState)(`desc`),[d,p]=(0,f.useState)(1),[m,h]=(0,f.useState)(`grid`),[g,_]=(0,f.useState)(!1),[v,y]=(0,f.useState)(!1),[b,x]=(0,f.useState)(null),S=ZE(a,300),{data:C,loading:w,error:T,refetch:E}=dd({page:d,sort:s,order:l,keyword:S}),D=_d(),O=C?.counts??0,k=Math.max(1,Math.ceil(O/QE)),A=DT(e=>e.badges),j=(0,f.useMemo)(()=>(C?.data??[]).map(Cd).map(e=>({...e,unreadCount:A[e.token]??e.unreadCount})),[C,A]),M=(0,f.useMemo)(()=>(C?.data??[]).map(e=>e.token).join(`,`),[C]);(0,f.useEffect)(()=>{M&&UT(M.split(`,`))},[M]);let N=[{value:`name`,label:t(`sortByName`)},{value:`unread`,label:t(`sortByUnread`)},{value:`createdAt`,label:t(`sortByCreatedAt`)}],ee=e=>{x(e)},P=async()=>{if(b)try{await D.mutate({id:b.id,token:b.token}),Q.success(e(`linkDeleted`)),x(null),E()}catch(t){let n=t instanceof Du&&t.message?t.message:e(`linkDeleteFailed`);Q.error(n)}},F=()=>{p(1),E()},I=()=>{i(`link_add_click`);let e=n?.chat_link??0;if(e>0&&O>=e){y(!0);return}_(!0)},te=()=>{p(1),E()};return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{children:[(0,X.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 mb-6`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h1`,{className:`text-[28px] font-semibold text-text-primary`,children:e(`pageTitle`)}),(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary mt-0.5`,children:e(`linkCount_other`,{count:O})})]}),(0,X.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,X.jsxs)(Z,{variant:`secondary`,size:`md`,onClick:()=>{i(`all_chatrooms_click`),window.location.href=KE()},className:`gap-1.5 flex-1 sm:flex-none`,children:[(0,X.jsx)(pc,{className:`w-4 h-4`}),(0,X.jsx)(`span`,{className:`hidden xs:inline`,children:e(`allChatRooms`)})]}),!r&&(0,X.jsxs)(Z,{size:`md`,onClick:I,className:`gap-1.5 flex-1 sm:flex-none`,children:[(0,X.jsx)(xc,{className:`w-4 h-4`}),e(`addLink`)]})]})]}),(()=>{let t=n?.used_MAU??0,r=n?.active_MAU??0,i=n?.used_AI_bot_msg??0,a=n?.active_ai_usage??0,o=r>0&&t>r,s=a>0&&a!==99999&&i>a;return!o&&!s?null:(0,X.jsxs)(`div`,{className:`flex items-start gap-3 rounded-[8px] border border-danger/20 bg-[rgba(235,87,87,0.08)] px-4 py-3 mb-4`,children:[(0,X.jsx)(jc,{className:`w-4 h-4 text-danger shrink-0 mt-0.5`}),(0,X.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,X.jsxs)(`div`,{className:`space-y-0.5 mb-2`,children:[o&&(0,X.jsx)(`p`,{className:`text-[14px] text-danger leading-snug`,children:e(`overQuotaMau`)}),s&&(0,X.jsx)(`p`,{className:`text-[14px] text-danger leading-snug`,children:e(`overQuotaAi`)})]}),(0,X.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,X.jsx)(qo,{to:`/dashboard/billing`,className:`text-[13px] font-medium text-brand hover:underline`,children:e(`overQuotaUpgrade`)}),(0,X.jsx)(`span`,{className:`text-text-secondary text-[13px]`,children:`·`}),(0,X.jsx)(`a`,{href:`mailto:[email protected]`,className:`text-[13px] font-medium text-text-secondary hover:text-text-primary hover:underline`,children:e(`overQuotaContact`)})]})]})]})})(),(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 mb-6`,children:[(0,X.jsxs)(`div`,{className:`relative w-full sm:flex-1`,children:[(0,X.jsx)(Cc,{className:`absolute left-3 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-text-secondary pointer-events-none`}),(0,X.jsx)(`input`,{value:a,onChange:e=>{o(e.target.value),p(1)},placeholder:e(`searchPlaceholder`),className:`w-full h-10 pl-9 pr-3 rounded-[8px] border border-border bg-bg-card text-[15px] text-text-primary placeholder:text-text-secondary outline-none focus:border-border-strong transition-colors`})]}),(0,X.jsxs)(`div`,{className:`flex items-center shrink-0`,children:[(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsx)(`select`,{value:s,onChange:e=>{c(e.target.value),p(1)},className:`h-10 pl-3 pr-8 rounded-l-[8px] border border-r-0 border-border bg-bg-card text-[15px] text-text-primary outline-none focus:border-border-strong cursor-pointer appearance-none`,children:N.map(e=>(0,X.jsx)(`option`,{value:e.value,children:e.label},e.value))}),(0,X.jsx)(Is,{className:`absolute right-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-text-secondary pointer-events-none`})]}),(0,X.jsx)(`button`,{onClick:()=>{u(e=>e===`asc`?`desc`:`asc`),p(1)},"aria-label":t(l===`asc`?`switchToDescending`:`switchToAscending`),className:`w-10 h-10 flex items-center justify-center rounded-r-[8px] border border-border bg-bg-card text-text-secondary hover:text-text-primary hover:bg-bg-subtle transition-colors cursor-pointer`,children:l===`asc`?(0,X.jsx)(Os,{className:`w-4 h-4`}):(0,X.jsx)(Es,{className:`w-4 h-4`})})]}),(0,X.jsxs)(`div`,{className:`flex items-center rounded-[8px] border border-border bg-bg-card overflow-hidden shrink-0`,children:[(0,X.jsx)(`button`,{onClick:()=>h(`grid`),"aria-label":e(`viewGrid`),className:K(`w-10 h-10 flex items-center justify-center transition-all duration-150 cursor-pointer`,m===`grid`?`bg-bg-subtle text-text-primary`:`text-text-secondary hover:text-text-primary hover:bg-bg-subtle`),children:(0,X.jsx)(ic,{className:`w-4 h-4`})}),(0,X.jsx)(`button`,{onClick:()=>h(`list`),"aria-label":e(`viewList`),className:K(`w-10 h-10 flex items-center justify-center transition-all duration-150 cursor-pointer`,m===`list`?`bg-bg-subtle text-text-primary`:`text-text-secondary hover:text-text-primary hover:bg-bg-subtle`),children:(0,X.jsx)(oc,{className:`w-4 h-4`})})]})]}),T?(0,X.jsxs)(`div`,{className:`card flex flex-col items-center justify-center py-16 text-center`,children:[(0,X.jsx)(jc,{className:`w-8 h-8 text-danger opacity-60 mb-3`}),(0,X.jsx)(`p`,{className:`text-[17px] font-semibold text-text-primary mb-1`,children:t(`loadFailed`)}),(0,X.jsx)(Z,{variant:`secondary`,size:`md`,onClick:()=>void E(),className:`mt-3`,children:t(`retry`)}
35)]}):w&&!C?(0,X.jsx)(`div`,{className:`card flex items-center justify-center py-16 text-text-secondary text-[14px]`,children:t(`loading`)}):j.length===0?S?(0,X.jsxs)(`div`,{className:`card flex flex-col items-center justify-center py-16 text-center`,children:[(0,X.jsx)(Cc,{className:`w-8 h-8 text-text-secondary opacity-30 mb-3`}),(0,X.jsx)(`p`,{className:`text-[17px] font-semibold text-text-primary mb-1`,children:e(`noResultsTitle`)}),(0,X.jsx)(`p`,{className:`text-[15px] text-text-secondary`,children:e(`noResultsTip`)})]}):(0,X.jsx)(tD,{onCreateClick:r?void 0:I}):(0,X.jsxs)(`div`,{className:K(`transition-opacity duration-150`,w&&`opacity-50 pointer-events-none`),children:[m===`grid`?(0,X.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-4`,children:j.map(e=>(0,X.jsx)(qE,{link:e,onDelete:ee,onDuplicate:te},e.id))}):(0,X.jsx)(`div`,{className:`flex flex-col gap-3`,children:j.map(e=>(0,X.jsx)(YE,{link:e,onDelete:ee,onDuplicate:te},e.id))}),k>1&&(0,X.jsxs)(`div`,{className:`flex items-center justify-between mt-6 pt-4 border-t border-border`,children:[(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary`,children:e(`paginationInfo`,{start:(d-1)*QE+1,end:Math.min(d*QE,O),total:O})}),(0,X.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,X.jsx)(`button`,{onClick:()=>p(e=>Math.max(1,e-1)),disabled:d===1||w,"aria-label":t(`previousPage`),className:K(`w-8 h-8 flex items-center justify-center rounded-[8px] transition-colors cursor-pointer`,d===1||w?`text-text-secondary opacity-40 cursor-not-allowed`:`hover:bg-bg-subtle text-text-primary`),children:(0,X.jsx)(Ls,{className:`w-4 h-4`})}),$E(k,d).map((e,t)=>e===`ellipsis`?(0,X.jsx)(`span`,{className:`w-8 h-8 flex items-center justify-center text-[14px] text-text-secondary select-none`,"aria-hidden":`true`,children:`â¦`},`ell-${t}`):(0,X.jsx)(`button`,{onClick:()=>p(e),disabled:w,className:K(`w-8 h-8 flex items-center justify-center rounded-[8px] text-[14px] transition-colors`,w?`cursor-not-allowed`:`cursor-pointer`,e===d?`bg-brand-tint text-brand font-medium`:`hover:bg-bg-subtle text-text-primary`),children:e},e)),(0,X.jsx)(`button`,{onClick:()=>p(e=>Math.min(k,e+1)),disabled:d===k||w,"aria-label":t(`nextPage`),className:K(`w-8 h-8 flex items-center justify-center rounded-[8px] transition-colors cursor-pointer`,d===k||w?`text-text-secondary opacity-40 cursor-not-allowed`:`hover:bg-bg-subtle text-text-primary`),children:(0,X.jsx)(Rs,{className:`w-4 h-4`})})]})]})]})]}),(0,X.jsx)(vE,{open:g,onClose:()=>_(!1),onSubmit:F}),(0,X.jsxs)(GS,{open:v,onClose:()=>y(!1),title:e(`linkLimitTitle`),children:[(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary mb-5`,children:e(`linkLimitBody`,{limit:n?.chat_link??0})}),(0,X.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,X.jsx)(Z,{variant:`secondary`,onClick:()=>y(!1),children:t(`cancel`)}),(0,X.jsx)(qo,{to:`/dashboard/billing`,children:(0,X.jsx)(Z,{onClick:()=>y(!1),children:e(`overQuotaUpgrade`)})})]})]}),(0,X.jsxs)(GS,{open:!!b,onClose:()=>x(null),title:e(`deleteConfirmTitle`),children:[(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary mb-5`,children:e(`deleteConfirmMessage`,{name:b?.name??``})}),(0,X.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,X.jsx)(Z,{variant:`secondary`,onClick:()=>x(null),disabled:D.loading,children:t(`cancel`)}),(0,X.jsx)(Z,{onClick:P,disabled:D.loading,className:`!bg-danger !text-white hover:!bg-danger/90 disabled:opacity-40`,children:D.loading?t(`loading`):t(`delete`)})]})]})]})}function tD({onCreateClick:e}){let{t}=V(`myLinks`);return(0,X.jsxs)(`div`,{className:`card flex flex-col items-center justify-center py-20 text-center`,children:[(0,X.jsx)(`div`,{className:`w-12 h-12 rounded-full bg-brand-tint flex items-center justify-center mb-4`,children:(0,X.jsx)(ac,{className:`w-5 h-5 text-brand`})}),(0,X.jsx)(`h2`,{className:`text-[17px] font-semibold text-text-primary mb-1`,children:t(`emptyTitle`)}),(0,X.jsx)(`p`,{className:`text-[15px] text-text-secondary mb-5`,children:t(`emptySubtitle`)}),e&&(0,X.jsxs)(Z,{onClick:e,className:`gap-1.5`,children:[(0,X.jsx)(xc,{className:`w-4 h-4`}),t(`createFirstLink`)]})]})}function nD(){return(0,X.jsx)(`div`,{children:(0,X.jsx)(Xa,{})})}function rD({className:e}){return(0,X.jsx)(`div`,{className:K(`animate-pulse rounded-[8px] bg-bg-subtle`,e)})}function iD(){return(0,X.jsxs)(`div`,{className:`bg-bg-card border border-border rounded-[12px] p-5`,children:[(0,X.jsx)(rD,{className:`w-8 h-8 rounded-[8px] mb-3`}),(0,X.jsx)(`div`,{className:`min-h-[30px] mb-1`,children:(0,X.jsx)(rD,{className:`h-3 w-3/4`})}),(0,X.jsx)(rD,{className:`h-7 w-16`})]})}var aD=`dangerouslySetInnerHTML.onCopy.onCopyCapture.onCut.onCutCapture.onPaste.onPasteCapture.onCompositionEnd.onCompositionEndCapture.onCompositionStart.onCompositionStartCapture.onCompositionUpdate.onCompositionUpdateCapture.onFocus.onFocusCapture.onBlur.onBlurCapture.onChange.onChangeCapture.onBeforeInput.onBeforeInputCapture.onInput.onInputCapture.onReset.onResetCapture.onSubmit.onSubmitCapture.onInvalid.onInvalidCapture.onLoad.onLoadCapture.onError.onErrorCapture.onKeyDown.onKeyDownCapture.onKeyPress.onKeyPressCapture.onKeyUp.onKeyUpCapture.onAbort.onAbortCapture.onCanPlay.onCanPlayCapture.onCanPlayThrough.onCanPlayThroughCapture.onDurationChange.onDurationChangeCapture.onEmptied.onEmptiedCapture.onEncrypted.onEncryptedCapture.onEnded.onEndedCapture.onLoadedData.onLoadedDataCapture.onLoadedMetadata.onLoadedMetadataCapture.onLoadStart.onLoadStartCapture.onPause.onPauseCapture.onPlay.onPlayCapture.onPlaying.onPlayingCapture.onProgress.onProgressCapture.onRateChange.onRateChangeCapture.onSeeked.onSeekedCapture.onSeeking.onSeekingCapture.onStalled.onStalledCapture.onSuspend.onSuspendCapture.onTimeUpdate.onTimeUpdate
35Capture.onVolumeChange.onVolumeChangeCapture.onWaiting.onWaitingCapture.onAuxClick.onAuxClickCapture.onClick.onClickCapture.onContextMenu.onContextMenuCapture.onDoubleClick.onDoubleClickCapture.onDrag.onDragCapture.onDragEnd.onDragEndCapture.onDragEnter.onDragEnterCapture.onDragExit.onDragExitCapture.onDragLeave.onDragLeaveCapture.onDragOver.onDragOverCapture.onDragStart.onDragStartCapture.onDrop.onDropCapture.onMouseDown.onMouseDownCapture.onMouseEnter.onMouseLeave.onMouseMove.onMouseMoveCapture.onMouseOut.onMouseOutCapture.onMouseOver.onMouseOverCapture.onMouseUp.onMouseUpCapture.onSelect.onSelectCapture.onTouchCancel.onTouchCancelCapture.onTouchEnd.onTouchEndCapture.onTouchMove.onTouchMoveCapture.onTouchStart.onTouchStartCapture.onPointerDown.onPointerDownCapture.onPointerMove.onPointerMoveCapture.onPointerUp.onPointerUpCapture.onPointerCancel.onPointerCancelCapture.onPointerEnter.onPointerEnterCapture.onPointerLeave.onPointerLeaveCapture.onPointerOver.onPointerOverCapture.onPointerOut.onPointerOutCapture.onGotPointerCapture.onGotPointerCaptureCapture.onLostPointerCapture.onLostPointerCaptureCapture.onScroll.onScrollCapture.onWheel.onWheelCapture.onAnimationStart.onAnimationStartCapture.onAnimationEnd.onAnimationEndCapture.onAnimationIteration.onAnimationIterationCapture.onTransitionEnd.onTransitionEndCapture`.split(`.`);function oD(e){return typeof e==`string`?aD.includes(e):!1}var sD=new Set(`aria-activedescendant.aria-atomic.aria-autocomplete.aria-busy.aria-checked.aria-colcount.aria-colindex.aria-colspan.aria-controls.aria-current.aria-describedby.aria-details.aria-disabled.aria-errormessage.aria-expanded.aria-flowto.aria-haspopup.aria-hidden.aria-invalid.aria-keyshortcuts.aria-label.aria-labelledby.aria-level.aria-live.aria-modal.aria-multiline.aria-multiselectable.aria-orientation.aria-owns.aria-placeholder.aria-posinset.aria-pressed.aria-readonly.aria-relevant.aria-required.aria-roledescription.aria-rowcount.aria-rowindex.aria-rowspan.aria-selected.aria-setsize.aria-sort.aria-valuemax.aria-valuemin.aria-valuenow.aria-valuetext.className.color.height.id.lang.max.media.method.min.name.style.target.width.role.tabIndex.accentHeight.accumulate.additive.alignmentBaseline.allowReorder.alphabetic.amplitude.arabicForm.ascent.attributeName.attributeType.autoReverse.azimuth.baseFrequency.baselineShift.baseProfile.bbox.begin.bias.by.calcMode.capHeight.clip.clipPath.clipPathUnits.clipRule.colorInterpolation.colorInterpolationFilters.colorProfile.colorRendering.contentScriptType.contentStyleType.cursor.cx.cy.d.decelerate.descent.diffuseConstant.direction.display.divisor.dominantBaseline.dur.dx.dy.edgeMode.elevation.enableBackground.end.exponent.externalResourcesRequired.fill.fillOpacity.fillRule.filter.filterRes.filterUnits.floodColor.floodOpacity.focusable.fontFamily.fontSize.fontSizeAdjust.fontStretch.fontStyle.fontVariant.fontWeight.format.from.fx.fy.g1.g2.glyphName.glyphOrientationHorizontal.glyphOrientationVertical.glyphRef.gradientTransform.gradientUnits.hanging.horizAdvX.horizOriginX.href.ideographic.imageRendering.in2.in.intercept.k1.k2.k3.k4.k.kernelMatrix.kernelUnitLength.kerning.keyPoints.keySplines.keyTimes.lengthAdjust.letterSpacing.lightingColor.limitingConeAngle.local.markerEnd.markerHeight.markerMid.markerStart.markerUnits.markerWidth.mask.maskContentUnits.maskUnits.mathematical.mode.numOctaves.offset.opacity.operator.order.orient.orientation.origin.overflow.overlinePosition.overlineThickness.paintOrder.panose1.pathLength.patternContentUnits.patternTransform.patternUnits.pointerEvents.pointsAtX.pointsAtY.pointsAtZ.preserveAlpha.preserveAspectRatio.primitiveUnits.r.radius.refX.refY.renderingIntent.repeatCount.repeatDur.requiredExtensions.requiredFeatures.restart.result.rotate.rx.ry.seed.shapeRendering.slope.spacing.specularConstant.specularExponent.speed.spreadMethod.startOffset.stdDeviation.stemh.stemv.stitchTiles.stopColor.stopOpacity.strikethroughPosition.strikethroughThickness.string.stroke.strokeDasharray.strokeDashoffset.strokeLinecap.strokeLinejoin.strokeMiterlimit.strokeOpacity.strokeWidth.surfaceScale.systemLanguage.tableValues.targetX.targetY.textAnchor.textDecoration.textLength.textRendering.to.transform.u1.u2.underlinePosition.underlineThickness.unicode.unicodeBidi.unicodeRange.unitsPerEm.vAlphabetic.values.vectorEffect.version.vertAdvY.vertOriginX.vertOriginY.vHanging.vIdeographic.viewTarget.visibility.vMathematical.widths.wordSpacing.writingMode.x1.x2.x.xChannelSelector.xHeight.xlinkActuate.xlinkArcrole.xlinkHref.xlinkRole.xlinkShow.xlinkTitle.xlinkType.xmlBase.xmlLang.xmlns.xmlnsXlink.xmlSpace.y1.y2.y.yChannelSelector.z.zoomAndPan.ref.key.angle`.split(`.`));function cD(e){return typeof e==`string`?sD.has(e):!1}function lD(e){return typeof e==`string`&&e.startsWith(`data-`)}function uD(e){if(typeof e!=`object`||!e)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(cD(n)||lD(n))&&(t[n]=e[n]);return t}function dD(e){if(e==null)return null;if((0,f.isValidElement)(e)&&typeof e.props==`object`&&e.props!==null){var t=e.props;return uD(t)}return typeof e==`object`&&!Array.isArray(e)?uD(e):null}function fD(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(cD(n)||lD(n)||oD(n))&&(t[n]=e[n]);return t}function pD(e){return e==null?null:(0,f.isValidElement)(e)?fD(e.props):typeof e==`object`&&!Array.isArray(e)?fD(e):null}var mD=[`children`,`width`,`height`,`viewBox`,`className`,`style`,`title`,`desc`];function hD(){return hD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hD.apply(null,arguments)}function gD(e,t){if(e==null)return{};var n,r,i=_D(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function _D(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var vD=(0,f.forwardRef)((e,t)=>{var{children:n,width:r,height:i,viewBox:a,className:o,style:s,title:c,desc:l}=e,u=gD(e,mD),d=a||{width:r,height:i,x:0,y:0},p=zc(`recharts-surface`,o);return f.createElement(`svg`,hD({},fD(u),{className:p,width:r,height:i,style:s,viewBox:`${d.x} ${d.y} ${d.width} ${d.height}`,ref:t}),f.createElement(`title`,null,c),f.createElement(`desc`,null,l),n)}),yD=[`children`,`className`];function bD(){return bD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bD.apply(null,arguments)}function xD(e,t){if(e==null)return{};var n,r,i=SD(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function SD(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var CD=f.forwardRef((e,t)=>
35{var{children:n,className:r}=e,i=xD(e,yD),a=zc(`recharts-layer`,r);return f.createElement(`g`,bD({className:a},fD(i),{ref:t}),n)}),wD=(0,f.createContext)(null),TD=()=>(0,f.useContext)(wD);function ED(e){return function(){return e}}var DD=Math.cos,OD=Math.sin,kD=Math.sqrt,AD=Math.PI;AD/2;var jD=2*AD,MD=Math.PI,ND=2*MD,PD=1e-6,FD=ND-PD;function ID(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function LD(e){let t=Math.floor(e);if(!(t>=0))throw Error(`invalid digits: ${e}`);if(t>15)return ID;let n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}var RD=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._=``,this._append=e==null?ID:LD(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,r){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(e,t,n,r,i,a){this._append`C${+e},${+t},${+n},${+r},${this._x1=+i},${this._y1=+a}`}arcTo(e,t,n,r,i){if(e=+e,t=+t,n=+n,r=+r,i=+i,i<0)throw Error(`negative radius: ${i}`);let a=this._x1,o=this._y1,s=n-e,c=r-t,l=a-e,u=o-t,d=l*l+u*u;if(this._x1===null)this._append`M${this._x1=e},${this._y1=t}`;else if(d>PD)if(!(Math.abs(u*s-c*l)>PD)||!i)this._append`L${this._x1=e},${this._y1=t}`;else{let f=n-a,p=r-o,m=s*s+c*c,h=f*f+p*p,g=Math.sqrt(m),_=Math.sqrt(d),v=i*Math.tan((MD-Math.acos((m+d-h)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>PD&&this._append`L${e+y*l},${t+y*u}`,this._append`A${i},${i},0,0,${+(u*f>l*p)},${this._x1=e+b*s},${this._y1=t+b*c}`}}arc(e,t,n,r,i,a){if(e=+e,t=+t,n=+n,a=!!a,n<0)throw Error(`negative radius: ${n}`);let o=n*Math.cos(r),s=n*Math.sin(r),c=e+o,l=t+s,u=1^a,d=a?r-i:i-r;this._x1===null?this._append`M${c},${l}`:(Math.abs(this._x1-c)>PD||Math.abs(this._y1-l)>PD)&&this._append`L${c},${l}`,n&&(d<0&&(d=d%ND+ND),d>FD?this._append`A${n},${n},0,1,${u},${e-o},${t-s}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`:d>PD&&this._append`A${n},${n},0,${+(d>=MD)},${u},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}};function zD(){return new RD}zD.prototype=RD.prototype;function BD(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{let e=Math.floor(n);if(!(e>=0))throw RangeError(`invalid digits: ${n}`);t=e}return e},()=>new RD(t)}Array.prototype.slice;function VD(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function HD(e){this._context=e}HD.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function UD(e){return new HD(e)}function WD(e){return e[0]}function GD(e){return e[1]}function KD(e,t){var n=ED(!0),r=null,i=UD,a=null,o=BD(s);e=typeof e==`function`?e:e===void 0?WD:ED(e),t=typeof t==`function`?t:t===void 0?GD:ED(t);function s(s){var c,l=(s=VD(s)).length,u,d=!1,f;for(r??(a=i(f=o())),c=0;c<=l;++c)!(c<l&&n(u=s[c],c,s))===d&&((d=!d)?a.lineStart():a.lineEnd()),d&&a.point(+e(u,c,s),+t(u,c,s));if(f)return a=null,f+``||null}return s.x=function(t){return arguments.length?(e=typeof t==`function`?t:ED(+t),s):e},s.y=function(e){return arguments.length?(t=typeof e==`function`?e:ED(+e),s):t},s.defined=function(e){return arguments.length?(n=typeof e==`function`?e:ED(!!e),s):n},s.curve=function(e){return arguments.length?(i=e,r!=null&&(a=i(r)),s):i},s.context=function(e){return arguments.length?(e==null?r=a=null:a=i(r=e),s):r},s}function qD(e,t,n){var r=null,i=ED(!0),a=null,o=UD,s=null,c=BD(l);e=typeof e==`function`?e:e===void 0?WD:ED(+e),t=typeof t==`function`?t:ED(t===void 0?0:+t),n=typeof n==`function`?n:n===void 0?GD:ED(+n);function l(l){var u,d,f,p=(l=VD(l)).length,m,h=!1,g,_=Array(p),v=Array(p);for(a??(s=o(g=c())),u=0;u<=p;++u){if(!(u<p&&i(m=l[u],u,l))===h)if(h=!h)d=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),f=u-1;f>=d;--f)s.point(_[f],v[f]);s.lineEnd(),s.areaEnd()}h&&(_[u]=+e(m,u,l),v[u]=+t(m,u,l),s.point(r?+r(m,u,l):_[u],n?+n(m,u,l):v[u]))}if(g)return s=null,g+``||null}function u(){return KD().defined(i).curve(o).context(a)}return l.x=function(t){return arguments.length?(e=typeof t==`function`?t:ED(+t),r=null,l):e},l.x0=function(t){return arguments.length?(e=typeof t==`function`?t:ED(+t),l):e},l.x1=function(e){return arguments.length?(r=e==null?null:typeof e==`function`?e:ED(+e),l):r},l.y=function(e){return arguments.length?(t=typeof e==`function`?e:ED(+e),n=null,l):t},l.y0=function(e){return arguments.length?(t=typeof e==`function`?e:ED(+e),l):t},l.y1=function(e){return arguments.length?(n=e==null?null:typeof e==`function`?e:ED(+e),l):n},l.lineX0=l.lineY0=function(){return u().x(e).y(t)},l.lineY1=function(){return u().x(e).y(n)},l.lineX1=function(){return u().x(r).y(t)},l.defined=function(e){return arguments.length?(i=typeof e==`function`?e:ED(!!e),l):i},l.curve=function(e){return arguments.length?(o=e,a!=null&&(s=o(a)),l):o},l.context=function(e){return arguments.length?(e==null?a=s=null:s=o(a=e),l):a},l}var JD=class{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t);break}this._x0=e,this._y0=t}};function YD(e){return new JD(e,!0)}function XD(e){return new JD(e,!1)}var ZD={draw(e,t){let n=kD(t/AD);e.moveTo(n,0),e.arc(0,0,n,0,jD)}},QD={draw(e,t){let n=kD(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},$D=kD(1/3),eO=$D*2,tO={draw(e,t){let n=kD(t/eO),r=n*$D;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},nO={draw(e,t){let n=kD(t),r=-n/2;e.rect(r,r,n,n)}},rO=.8908130915292852,iO=OD(AD/10)/OD(7*AD/10),aO=OD(jD/10)*iO,oO=-DD(jD/10)*iO,sO={draw(e,t){let n=kD(t*rO),r=aO*n,i=oO*n;e.moveTo(0,-n),e.lineTo(r,i);for(let t=1;t<5;++t){let a=jD*t/5,o=DD(a),s=OD(a);e.lineTo(s*n,-o*n),e.lineTo(o*r-s*i,s*r+o*i)}e.closePath()}},cO=kD(3),lO={draw(e,t){let n=-kD(t/(cO*3));e.moveTo(0,n*2),e.lineTo(-cO*n,-n),e.lineTo(cO*n,-n),e.closePath()}},uO=-.5,dO=kD(3)/2,fO=1/kD(12),pO=(fO/2+1)*3,mO={draw(e,t){let n=kD(t/pO),r=n/2,i=n*fO,a=r,o=n*fO+n,s=-a,c=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(s,c),e.lineTo(uO*r-dO*i,dO*r+uO*i),e.lineTo(uO*a-dO*o,dO*a+uO*o),e.lineTo(uO*s-dO*c,dO*s+uO*c),e.lineTo(uO*r+dO*i,uO*i-dO*r),e.lineTo(uO*a+dO*o,uO*o-dO*a),e.lineTo(uO*s+dO*c,uO*c-dO*s),e.closePath()}};function hO(e,t){let n=null,r=BD(i);e=typeof e==`function`?e:ED(e||ZD),t=typeof t==`function`?t:ED(t===void 0?64:+t);function i(){let i;if(n||=i=r(),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),i)return n=null,i+``||null}return i.type=function(t){return arguments.length?(e=typeof t==`function`?t:ED(t),i):e},i.size=function(e){return arguments.length?(t=typeof e==`function`?e:ED(+e),i):t}
35,i.context=function(e){return arguments.length?(n=e??null,i):n},i}function gO(){}function _O(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function vO(e){this._context=e}vO.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:_O(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:_O(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function yO(e){return new vO(e)}function bO(e){this._context=e}bO.prototype={areaStart:gO,areaEnd:gO,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:_O(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function xO(e){return new bO(e)}function SO(e){this._context=e}SO.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:_O(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function CO(e){return new SO(e)}function wO(e){this._context=e}wO.prototype={areaStart:gO,areaEnd:gO,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function TO(e){return new wO(e)}function EO(e){return e<0?-1:1}function DO(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(EO(a)+EO(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function OO(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function kO(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function AO(e){this._context=e}AO.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:kO(this,this._t0,OO(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,kO(this,OO(this,n=DO(this,e,t)),n);break;default:kO(this,this._t0,n=DO(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function jO(e){this._context=new MO(e)}(jO.prototype=Object.create(AO.prototype)).point=function(e,t){AO.prototype.point.call(this,t,e)};function MO(e){this._context=e}MO.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function NO(e){return new AO(e)}function PO(e){return new jO(e)}function FO(e){this._context=e}FO.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=IO(e),i=IO(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[o],t[o]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function IO(e){var t,n=e.length-1,r,i=Array(n),a=Array(n),o=Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function LO(e){return new FO(e)}function RO(e,t){this._context=e,this._t=t}RO.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}this._x=e,this._y=t}};function zO(e){return new RO(e,.5)}function BO(e){return new RO(e,0)}function VO(e){return new RO(e,1)}function HO(e,t){if((o=e.length)>1)for(var n=1,r,i,a=e[t[0]],o,s=a.length;n<o;++n)for(i=a,a=e[t[n]],r=0;r<s;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function UO(e){for(var t=e.length,n=Array(t);--t>=0;)n[t]=t;return n}function WO(e,t){return e[t]}function GO(e){let t=[];return t.key=e,t}function KO(){var e=ED([]),t=UO,n=HO,r=WO;function i(i){var a=Array.from(e.apply(this,arguments),GO),o,s=a.length,c=-1,l;for(let e of i)for(o=0,++c;o<s;++o)(a[o][c]=[0,+r(e,a[o].key,c,i)]).data=e;for(o=0,l=VD(t(a));o<s;++o)a[l[o]].index=o;return n(a,l),a}return i.keys=function(t){return arguments.length?(e=typeof t==`function`?t:ED(Array.from(t)),i):e},i.value=function(e){return arguments.length?(r=typeof e==`function`?e:ED(+e),i):r},i.order=function(e){return arguments.length?(t=e==null?UO:typeof e==`function`?e:ED(Array.from(e)),i):t},i.offset=function(e){return arguments.length?(n=e??HO,i):n},i}function qO(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,o;i<a;++i){for(o=n=0;n<r;++n)o+=e[n][i][1]||0;if(o)for(n=0;n<r;++n)e[n][i][1]/=o}HO(e,t)}}function JO(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var o=0,s=0;o<i;++o)s+=e[o][n][1]||0;r[n][1]+=r[n][0]=-s/2}HO(e,t)}}function YO(e,t){if(!(!((o=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,o;r<a;++r){for(var s=0,c=0,l=0;s<o;++s){for(var u=e[t[s]],d=u[r][1]||0,f=(d-(u[r-1][1]||0))/2,p=0;p<s;++p){var m=e[t[p]],h=m[r][1]||0,g=m[r-1][1]||0;f+=h-g}c+=d,l+=f*d}i[r-1][1]+=i[r-1][0]=n,c&&(n-=l/c)}i[r-1][1]+=i[r-1][0]=n,HO(e,t)}}var XO=n((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return e===`__proto__`}e.isUnsafeProperty=t})),ZO=n((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){switch(typeof e){case`number`:case`symbol`:return!1;case`string`:return e.includes(`.`)||e.includes(`[`)||e.includes(`]`)}}e.isDeepKey=t})),QO=n((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return typeof e==`string`||typeof e==`symbol`?e:Object.is(e?.valueOf?.(),-0)?`-0`
35:String(e)}e.toKey=t})),$O=n((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){if(e==null)return``;if(typeof e==`string`)return e;if(Array.isArray(e))return e.map(t).join(`,`);let n=String(e);return n===`0`&&Object.is(Number(e),-0)?`-0`:n}e.toString=t})),ek=n((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=$O(),n=QO();function r(e){if(Array.isArray(e))return e.map(n.toKey);if(typeof e==`symbol`)return[e];e=t.toString(e);let r=[],i=e.length;if(i===0)return r;let a=0,o=``,s=``,c=!1;for(e.charCodeAt(0)===46&&(r.push(``),a++);a<i;){let t=e[a];s?t===`\\`&&a+1<i?(a++,o+=e[a]):t===s?s=``:o+=t:c?t===`"`||t===`'`?s=t:t===`]`?(c=!1,r.push(o),o=``):o+=t:t===`[`?(c=!0,o&&=(r.push(o),``)):t===`.`?o&&=(r.push(o),``):o+=t,a++}return o&&r.push(o),r}e.toPath=r})),tk=n((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=XO(),n=ZO(),r=QO(),i=ek();function a(e,s,c){if(e==null)return c;switch(typeof s){case`string`:{if(t.isUnsafeProperty(s))return c;let r=e[s];return r===void 0?n.isDeepKey(s)?a(e,i.toPath(s),c):c:r}case`number`:case`symbol`:{typeof s==`number`&&(s=r.toKey(s));let t=e[s];return t===void 0?c:t}default:{if(Array.isArray(s))return o(e,s,c);if(s=Object.is(s?.valueOf(),-0)?`-0`:String(s),t.isUnsafeProperty(s))return c;let n=e[s];return n===void 0?c:n}}}function o(e,n,r){if(n.length===0)return r;let i=e;for(let e=0;e<n.length;e++){if(i==null||t.isUnsafeProperty(n[e]))return r;i=i[n[e]]}return i===void 0?r:i}e.get=a})),nk=n(((e,t)=>{t.exports=tk().get})),rk=4;function ik(e){var t=10**(arguments.length>1&&arguments[1]!==void 0?arguments[1]:rk),n=Math.round(e*t)/t;return Object.is(n,-0)?0:n}function ak(e){var t=[...arguments].slice(1);return e.reduce((e,n,r)=>{var i=t[r-1];return typeof i==`string`?e+i+n:i===void 0?e+n:e+ik(i)+n},``)}var ok=t(nk()),sk=e=>e===0?0:e>0?1:-1,ck=e=>typeof e==`number`&&e!=+e,lk=e=>typeof e==`string`&&e.indexOf(`%`)===e.length-1,uk=e=>(typeof e==`number`||e instanceof Number)&&!ck(e),dk=e=>uk(e)||typeof e==`string`,fk=0,pk=e=>{var t=++fk;return`${e||``}${t}`},mk=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!uk(e)&&typeof e!=`string`)return n;var i;if(lk(e)){if(t==null)return n;var a=e.indexOf(`%`);i=t*parseFloat(e.slice(0,a))/100}else i=+e;return ck(i)&&(i=n),r&&t!=null&&i>t&&(i=t),i},hk=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++)if(!n[String(e[r])])n[String(e[r])]=!0;else return!0;return!1};function gk(e,t,n){return uk(e)&&uk(t)?ik(e+n*(t-e)):t}function _k(e,t,n){if(!(!e||!e.length))return e.find(e=>e&&(typeof t==`function`?t(e):(0,ok.default)(e,t))===n)}var vk=e=>e==null,yk=e=>vk(e)?e:`${e.charAt(0).toUpperCase()}${e.slice(1)}`;function bk(e){return e!=null}function xk(){}var Sk=[`type`,`size`,`sizeType`];function Ck(){return Ck=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ck.apply(null,arguments)}function wk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Tk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?wk(Object(n),!0).forEach(function(t){Ek(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wk(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ek(e,t,n){return(t=Dk(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dk(e){var t=Ok(e,`string`);return typeof t==`symbol`?t:t+``}function Ok(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function kk(e,t){if(e==null)return{};var n,r,i=Ak(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Ak(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var jk={symbolCircle:ZD,symbolCross:QD,symbolDiamond:tO,symbolSquare:nO,symbolStar:sO,symbolTriangle:lO,symbolWye:mO},Mk=Math.PI/180,Nk=e=>jk[`symbol${yk(e)}`]||ZD,Pk=(e,t,n)=>{if(t===`area`)return e;switch(n){case`cross`:return 5*e*e/9;case`diamond`:return .5*e*e/Math.sqrt(3);case`square`:return e*e;case`star`:var r=18*Mk;return 1.25*e*e*(Math.tan(r)-Math.tan(r*2)*Math.tan(r)**2);
35case`triangle`:return Math.sqrt(3)*e*e/4;case`wye`:return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},Fk=(e,t)=>{jk[`symbol${yk(e)}`]=t},Ik=e=>{var{type:t=`circle`,size:n=64,sizeType:r=`area`}=e,i=Tk(Tk({},kk(e,Sk)),{},{type:t,size:n,sizeType:r}),a=`circle`;typeof t==`string`&&(a=t);var o=()=>{var e=Nk(a),t=hO().type(e).size(Pk(n,r,a))();if(t!==null)return t},{className:s,cx:c,cy:l}=i,u=fD(i);return uk(c)&&uk(l)&&uk(n)?f.createElement(`path`,Ck({},u,{className:zc(`recharts-symbols`,s),transform:`translate(${c}, ${l})`,d:o()})):null};Ik.registerSymbol=Fk;var Lk=e=>`radius`in e&&`startAngle`in e&&`endAngle`in e,Rk=(e,t)=>{if(!e||typeof e==`function`||typeof e==`boolean`)return null;var n=e;if((0,f.isValidElement)(e)&&(n=e.props),typeof n!=`object`&&typeof n!=`function`)return null;var r={};return Object.keys(n).forEach(e=>{oD(e)&&typeof n[e]==`function`&&(r[e]=t||(t=>n[e](n,t)))}),r},zk=(e,t,n)=>r=>(e(t,n,r),null),Bk=(e,t,n)=>{if(e===null||typeof e!=`object`&&typeof e!=`function`)return null;var r=null;return Object.keys(e).forEach(i=>{var a=e[i];oD(i)&&typeof a==`function`&&(r||={},r[i]=zk(a,t,n))}),r};function Vk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Hk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Vk(Object(n),!0).forEach(function(t){Uk(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vk(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Uk(e,t,n){return(t=Wk(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wk(e){var t=Gk(e,`string`);return typeof t==`symbol`?t:t+``}function Gk(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Kk(e,t){var n=Hk({},e),r=t;return Object.keys(t).reduce((e,t)=>(e[t]===void 0&&r[t]!==void 0&&(e[t]=r[t]),e),n)}function qk(){return qk=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qk.apply(null,arguments)}function Jk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Yk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Jk(Object(n),!0).forEach(function(t){Xk(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Jk(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Xk(e,t,n){return(t=Zk(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zk(e){var t=Qk(e,`string`);return typeof t==`symbol`?t:t+``}function Qk(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var $k=32,eA={align:`center`,iconSize:14,inactiveColor:`#ccc`,layout:`horizontal`,verticalAlign:`middle`,labelStyle:{}};function tA(e){if(typeof e==`object`&&e&&`strokeDasharray`in e)return String(e.strokeDasharray)}function nA(e){var{data:t,iconType:n,inactiveColor:r}=e,i=$k/2,a=$k/6,o=$k/3,s=t.inactive?r:t.color,c=n??t.type;if(c===`none`)return null;if(c===`plainline`)return f.createElement(`line`,{strokeWidth:4,fill:`none`,stroke:s,strokeDasharray:tA(t.payload),x1:0,y1:i,x2:$k,y2:i,className:`recharts-legend-icon`});if(c===`line`)return f.createElement(`path`,{strokeWidth:4,fill:`none`,stroke:s,d:`M0,${i}h${o} 36 A${a},${a},0,1,1,${2*o},${i} 37 H${$k}M${2*o},${i} 38 A${a},${a},0,1,1,${o},${i}`,className:`recharts-legend-icon`});if(c===`rect`)return f.createElement(`path`,{stroke:`none`,fill:s,d:`M0,${$k/8}h${$k}v${$k*3/4}h${-$k}z`,className:`recharts-legend-icon`});if(f.isValidElement(t.legendIcon)){var l=Yk({},t);return delete l.legendIcon,f.cloneElement(t.legendIcon,l)}return f.createElement(Ik,{fill:s,cx:i,cy:i,size:$k,sizeType:`diameter`,type:c})}function rA(e){var{payload:t,iconSize:n,layout:r,formatter:i,inactiveColor:a,iconType:o,labelStyle:s}=e,c={x:0,y:0,width:$k,height:$k},l={display:r===`horizontal`?`inline-block`:`block`,marginRight:10},u={display:`inline-block`,verticalAlign:`middle`,marginRight:4};return t.map((t,r)=>{var d=t.formatter||i,p=zc({"recharts-legend-item":!0,[`legend-item-${r}`]:!0,inactive:t.inactive});if(t.type===`none`)return null;var m=typeof s==`object`?Yk({},s):{};m.color=t.inactive?a:m.color||t.color;var h=d?d(t.value,t,r):t.value;return f.createElement(`li`,qk({className:p,style:l,key:`legend-item-${r}`},Bk(e,t,r)),f.createElement(vD,{width:n,height:n,viewBox:c,style:u,"aria-label":`${t.value} legend icon`},f.createElement(nA,{data:t,iconType:o,inactiveColor:a})),f.createElement(`span`,{className:`recharts-legend-item-text`,style:m},h))})}var iA=e=>{var t=Kk(e,eA),{payload:n,layout:r,align:i}=t;if(!n||!n.length)return null;var a={padding:0,margin:0,textAlign:r===`horizontal`?i:`left`};return f.createElement(`ul`,{className:`recharts-default-legend`,style:a},f.createElement(rA,qk({},t,{payload:n})))},aA=n((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e,t){let n=new Map;for(let r=0;r<e.length;r++){let i=e[r],a=t(i,r,e);n.has(a)||n.set(a,i)}return Array.from(n.values())}e.uniqBy=t})),oA=n((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e,t){return function(...n){return e.apply(this,n.slice(0,t))}}e.ary=t})),sA=n((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return e}e.identity=t})),cA=n((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return Number.isSafeInteger(e)&&e>=0}e.isLength=t})),lA=n((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=cA();function n(e){return e!=null&&typeof e!=`function`&&t.isLength(e.length)}e.isArrayLike=n})),uA=n((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return typeof e==`object`&&!!e}e.isObjectLike=t})),dA=n((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=lA(),n=uA();function r(e){return n.isObjectLike(e)&&t.isArrayLike(e)}e.isArrayLikeObject=r})),fA=n((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=tk();function n(e){return function(n){return t.get(n,e)}}e.property=n})),pA=n((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return e!==null&&(typeof e==`object`||typeof e==`function`)}e.isObject=t})),mA=n((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return e==null||typeof e!=`object`&&typeof e!=`function`}e.isPrimitive=t})),hA=n((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}e.isEqualsSameValueZero=t})),gA=n((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=pA(),n=mA(),r=hA();function i(e,t,n){return typeof n==`function`?a(e,t,function e(t,r,i,o,s,c){let l=n(t,r,i,o,s,c);return l===void 0?a(t,r,e,c):!!l},new Map):i(e,t,()=>void 0)}function a(e,n,i,s){if(n===e)return!0;switch(typeof n){case`object`:return o(e,n,i,s);case`function`:return Object.keys(n).length>0?a(e,{...n},i,s):r.isEqualsSameValueZero(e,n);default:return t.isObject(e)?typeof n==`string`?n===``:!0:r.isEqualsSameValueZero(e,n)}}function o(e,t,r,i){if(t==null)return!0;
38if(Array.isArray(t))return c(e,t,r,i);if(t instanceof Map)return s(e,t,r,i);if(t instanceof Set)return l(e,t,r,i);let a=Object.keys(t);if(e==null||n.isPrimitive(e))return a.length===0;if(a.length===0)return!0;if(i?.has(t))return i.get(t)===e;i?.set(t,e);try{for(let o=0;o<a.length;o++){let s=a[o];if(!n.isPrimitive(e)&&!(s in e)||t[s]===void 0&&e[s]!==void 0||t[s]===null&&e[s]!==null||!r(e[s],t[s],s,e,t,i))return!1}return!0}finally{i?.delete(t)}}function s(e,t,n,r){if(t.size===0)return!0;if(!(e instanceof Map))return!1;for(let[i,a]of t.entries())if(n(e.get(i),a,i,e,t,r)===!1)return!1;return!0}function c(e,t,n,r){if(t.length===0)return!0;if(!Array.isArray(e))return!1;let i=new Set;for(let a=0;a<t.length;a++){let o=t[a],s=!1;for(let c=0;c<e.length;c++){if(i.has(c))continue;let l=e[c],u=!1;if(n(l,o,a,e,t,r)&&(u=!0),u){i.add(c),s=!0;break}}if(!s)return!1}return!0}function l(e,t,n,r){return t.size===0?!0:e instanceof Set?c([...e],[...t],n,r):!1}e.isMatchWith=i,e.isSetMatch=l})),_A=n((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=gA();function n(e,n){return t.isMatchWith(e,n,()=>void 0)}e.isMatch=n})),vA=n((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}e.getSymbols=t})),yA=n((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}e.getTag=t})),bA=n((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`}),e.argumentsTag=`[object Arguments]`,e.arrayBufferTag=`[object ArrayBuffer]`,e.arrayTag=`[object Array]`,e.bigInt64ArrayTag=`[object BigInt64Array]`,e.bigUint64ArrayTag=`[object BigUint64Array]`,e.booleanTag=`[object Boolean]`,e.dataViewTag=`[object DataView]`,e.dateTag=`[object Date]`,e.errorTag=`[object Error]`,e.float32ArrayTag=`[object Float32Array]`,e.float64ArrayTag=`[object Float64Array]`,e.functionTag=`[object Function]`,e.int16ArrayTag=`[object Int16Array]`,e.int32ArrayTag=`[object Int32Array]`,e.int8ArrayTag=`[object Int8Array]`,e.mapTag=`[object Map]`,e.numberTag=`[object Number]`,e.objectTag=`[object Object]`,e.regexpTag=`[object RegExp]`,e.setTag=`[object Set]`,e.stringTag=`[object String]`,e.symbolTag=`[object Symbol]`,e.uint16ArrayTag=`[object Uint16Array]`,e.uint32ArrayTag=`[object Uint32Array]`,e.uint8ArrayTag=`[object Uint8Array]`,e.uint8ClampedArrayTag=`[object Uint8ClampedArray]`})),xA=n((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}e.isTypedArray=t})),SA=n((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=vA(),n=yA(),r=bA(),i=mA(),a=xA();function o(e,t){return s(e,void 0,e,new Map,t)}function s(e,t,n,r=new Map,o=void 0){let u=o?.(e,t,n,r);if(u!==void 0)return u;if(i.isPrimitive(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){let t=Array(e.length);r.set(e,t);for(let i=0;i<e.length;i++)t[i]=s(e[i],i,n,r,o);return Object.hasOwn(e,`index`)&&(t.index=e.index),Object.hasOwn(e,`input`)&&(t.input=e.input),t}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){let t=new RegExp(e.source,e.flags);return t.lastIndex=e.lastIndex,t}if(e instanceof Map){let t=new Map;r.set(e,t);for(let[i,a]of e)t.set(i,s(a,i,n,r,o));return t}if(e instanceof Set){let t=new Set;r.set(e,t);for(let i of e)t.add(s(i,void 0,n,r,o));return t}if(typeof Buffer<`u`&&Buffer.isBuffer(e))return e.subarray();if(a.isTypedArray(e)){let t=new(Object.getPrototypeOf(e)).constructor(e.length);r.set(e,t);for(let i=0;i<e.length;i++)t[i]=s(e[i],i,n,r,o);return t}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){let t=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return r.set(e,t),c(t,e,n,r,o),t}if(typeof File<`u`&&e instanceof File){let t=new File([e],e.name,{type:e.type});return r.set(e,t),c(t,e,n,r,o),t}if(typeof Blob<`u`&&e instanceof Blob){let t=new Blob([e],{type:e.type});return r.set(e,t),c(t,e,n,r,o),t}if(e instanceof Error){let t=structuredClone(e);return r.set(e,t),t.message=e.message,t.name=e.name,t.stack=e.stack,t.cause=e.cause,t.constructor=e.constructor,c(t,e,n,r,o),t}if(e instanceof Boolean){let t=new Boolean(e.valueOf());return r.set(e,t),c(t,e,n,r,o),t}if(e instanceof Number){let t=new Number(e.valueOf());return r.set(e,t),c(t,e,n,r,o),t}if(e instanceof String){let t=new String(e.valueOf());return r.set(e,t),c(t,e,n,r,o),t}if(typeof e==`object`&&l(e)){let t=Object.create(Object.getPrototypeOf(e));return r.set(e,t),c(t,e,n,r,o),t}return e}function c(e,n,r=e,i,a){let o=[...Object.keys(n),...t.getSymbols(n)];for(let t=0;t<o.length;t++){let c=o[t],l=Object.getOwnPropertyDescriptor(e,c);(l==null||l.writable)&&(e[c]=s(n[c],c,r,i,a))}}function l(e){switch(n.getTag(e)){case r.argumentsTag:case r.arrayTag:case r.arrayBufferTag:case r.dataViewTag:case r.booleanTag:case r.dateTag:case r.float32ArrayTag:case r.float64ArrayTag:case r.int8ArrayTag:case r.int16ArrayTag:case r.int32ArrayTag:case r.mapTag:case r.numberTag:case r.objectTag:case r.regexpTag:case r.setTag:case r.stringTag:case r.symbolTag:case r.uint8ArrayTag:case r.uint8ClampedArrayTag:case r.uint16ArrayTag:case r.uint32ArrayTag:return!0;default:return!1}}e.cloneDeepWith=o,e.cloneDeepWithImpl=s,e.copyProperties=c}
38)),CA=n((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=SA();function n(e){return t.cloneDeepWithImpl(e,void 0,e,new Map,void 0)}e.cloneDeep=n})),wA=n((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=_A(),n=CA();function r(e){return e=n.cloneDeep(e),n=>t.isMatch(n,e)}e.matches=r})),TA=n((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=SA(),n=yA(),r=bA();function i(e,i){return t.cloneDeepWith(e,(a,o,s,c)=>{let l=i?.(a,o,s,c);if(l!==void 0)return l;if(typeof e==`object`){if(n.getTag(e)===r.objectTag&&typeof e.constructor!=`function`){let n={};return c.set(e,n),t.copyProperties(n,e,s,c),n}switch(Object.prototype.toString.call(e)){case r.numberTag:case r.stringTag:case r.booleanTag:{let n=new e.constructor(e?.valueOf());return t.copyProperties(n,e),n}case r.argumentsTag:{let n={};return t.copyProperties(n,e),n.length=e.length,n[Symbol.iterator]=e[Symbol.iterator],n}default:return}}})}e.cloneDeepWith=i})),EA=n((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=TA();function n(e){return t.cloneDeepWith(e)}e.cloneDeep=n})),DA=n((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=/^(?:0|[1-9]\d*)$/;function n(e,n=2**53-1){switch(typeof e){case`number`:return Number.isInteger(e)&&e>=0&&e<n;case`symbol`:return!1;case`string`:return t.test(e)}}e.isIndex=n})),OA=n((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=yA();function n(e){return typeof e==`object`&&!!e&&t.getTag(e)===`[object Arguments]`}e.isArguments=n})),kA=n((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=ZO(),n=DA(),r=OA(),i=ek();function a(e,a){let o;if(o=Array.isArray(a)?a:typeof a==`string`&&t.isDeepKey(a)&&e?.[a]==null?i.toPath(a):[a],o.length===0)return!1;let s=e;for(let e=0;e<o.length;e++){let t=o[e];if((s==null||!Object.hasOwn(s,t))&&!((Array.isArray(s)||r.isArguments(s))&&n.isIndex(t)&&t<s.length))return!1;s=s[t]}return!0}e.has=a})),AA=n((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=_A(),n=QO(),r=EA(),i=tk(),a=kA();function o(e,o){switch(typeof e){case`object`:Object.is(e?.valueOf(),-0)&&(e=`-0`);break;case`number`:e=n.toKey(e);break}return o=r.cloneDeep(o),function(n){let r=i.get(n,e);return r===void 0?a.has(n,e):o===void 0?r===void 0:t.isMatch(r,o)}}e.matchesProperty=o})),jA=n((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=sA(),n=fA(),r=wA(),i=AA();function a(e){if(e==null)return t.identity;switch(typeof e){case`function`:return e;case`object`:return Array.isArray(e)&&e.length===2?i.matchesProperty(e[0],e[1]):r.matches(e);case`string`:case`symbol`:case`number`:return n.property(e)}}e.iteratee=a})),MA=n((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=aA(),n=oA(),r=sA(),i=dA(),a=jA();function o(e,o=r.identity){return i.isArrayLikeObject(e)?t.uniqBy(Array.from(e),n.ary(a.iteratee(o),1)):[]}e.uniqBy=o})),NA=t(n(((e,t)=>{t.exports=MA().uniqBy}))());function PA(e,t,n){return t===!0?(0,NA.default)(e,n):typeof t==`function`?(0,NA.default)(e,t):e}var FA=n((e=>{var t=a(),n=_t();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,o=n.useSyncExternalStore,s=t.useRef,c=t.useEffect,l=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,a){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),a!==void 0&&f.hasValue){var t=f.value;if(a(t,e))return c=t}return c=e}if(t=c,i(s,e))return t;var n=r(e);return a!==void 0&&a(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,a]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),IA=n(((e,t)=>{t.exports=FA()})),LA=(0,f.createContext)(null),RA=IA(),zA=e=>e,BA=()=>{var e=(0,f.useContext)(LA);return e?e.store.dispatch:zA},VA=()=>{},HA=()=>VA,UA=(e,t)=>e===t;function WA(e){var t=(0,f.useContext)(LA),n=(0,f.useMemo)(()=>t?t=>{if(t!=null)return e(t)}:VA,[t,e]);return(0,RA.useSyncExternalStoreWithSelector)(t?t.subscription.addNestedSub:HA,t?t.store.getState:VA,t?t.store.getState:VA,n,UA)}function GA(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!=`function`)throw TypeError(t)}function KA(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!=`object`)throw TypeError(t)}function qA(e,t=`expected all items to be functions, instead received the following types: `){if(!e.every(e=>typeof e==`function`)){let n=e.map(e=>typeof e==`function`?`function ${e.name||`unnamed`}()`:typeof e).join(`, `);throw TypeError(`${t}[${n}]`)}}var JA=e=>Array.isArray(e)?e:[e];function YA(e){let t=Array.isArray(e[0])?e[0]:e;return qA(t,`createSelector expects all input-selectors to be functions, but received the following types: `),t}function XA(e,t){let n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var ZA=class{constructor(e){this.value=e}deref(){return this.value}},QA=typeof WeakRef<`u`?WeakRef:ZA,$A=0,ej=1;function tj(){return{s:$A,v:void 0,o:null,p:null}}function nj(e,t={}){let n=tj(),{resultEqualityCheck:r}=t,i,a=0;function o(){let t=n,{length:o}=arguments;for(let e=0,n=o;e<n;e++){let n=arguments[e];if(typeof n==`function`||typeof n==`object`&&n){let e=t.o;e===null&&(t.o=e=new WeakMap);let r=e.get(n);r===void 0?(t=tj(),e.set(n,t)):t=r}else{let e=t.p;e===null&&(t.p=e=new Map);let r=e.get(n);r===void 0?(t=tj(),e.set(n,t)):t=r}}let s=t,c;if(t.s===ej)c=t.v;else if(c=e.apply(null,arguments),a++,r){let e=i?.deref?.()??i;e!=null&&r(e,c)&&(c=e,a!==0&&a--),i=typeof c==`object`&&c||typeof c==`function`?new QA(c):c}return s.s=ej,s.v=c,c}return o.clearCache=()=>{n=tj(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function rj(e,...t){let n=typeof e==`function`?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t=0,r=0,i,a={},o=e.pop();typeof o==`object`&&(a=o,o=e.pop()),GA(o,`createSelector expects an output function after the inputs, but received: [${typeof o}]`);let{memoize:s,memoizeOptions:c=[],argsMemoize:l=nj,argsMemoizeOptions:u=[],devModeChecks:d={}}={...n,...a},f=JA(c),p=JA(u),m=YA(e),h=s(function(){return t++,o.apply(null,arguments)},...f),g=l(function(){r++;let e=XA(m,arguments);return i=h.apply(null,e),i},...p);return Object.assign(g,{resultFunc:o,memoizedResultFunc:h,dependencies:m,depen
38dencyRecomputations:()=>r,resetDependencyRecomputations:()=>{r=0},lastResult:()=>i,recomputations:()=>t,resetRecomputations:()=>{t=0},memoize:s,argsMemoize:l})};return Object.assign(r,{withTypes:()=>r}),r}var $=rj(nj),ij=Object.assign((e,t=$)=>{KA(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let n=Object.keys(e);return t(n.map(t=>e[t]),(...e)=>e.reduce((e,t,r)=>(e[n[r]]=t,e),{}))},{withTypes:()=>ij}),aj=n((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return typeof e==`symbol`?1:e===null?2:e===void 0?3:e===e?0:4}e.compareValues=(e,n,r)=>{if(e!==n){let i=t(e),a=t(n);if(i===a&&i===0){if(e<n)return r===`desc`?1:-1;if(e>n)return r===`desc`?-1:1}return r===`desc`?a-i:i-a}return 0}})),oj=n((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return typeof e==`symbol`||e instanceof Symbol}e.isSymbol=t})),sj=n((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=oj(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(e,i){return Array.isArray(e)?!1:typeof e==`number`||typeof e==`boolean`||e==null||t.isSymbol(e)?!0:typeof e==`string`&&(r.test(e)||!n.test(e))||i!=null&&Object.hasOwn(i,e)}e.isKey=i})),cj=n((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=aj(),n=sj(),r=ek();function i(e,i,a,o){if(e==null)return[];a=o?void 0:a,Array.isArray(e)||(e=Object.values(e)),Array.isArray(i)||(i=i==null?[null]:[i]),i.length===0&&(i=[null]),Array.isArray(a)||(a=a==null?[]:[a]),a=a.map(e=>String(e));let s=(e,t)=>{let n=e;for(let e=0;e<t.length&&n!=null;++e)n=n[t[e]];return n},c=(e,t)=>t==null||e==null?t:typeof e==`object`&&`key`in e?Object.hasOwn(t,e.key)?t[e.key]:s(t,e.path):typeof e==`function`?e(t):Array.isArray(e)?s(t,e):typeof t==`object`?t[e]:t,l=i.map(e=>(Array.isArray(e)&&e.length===1&&(e=e[0]),e==null||typeof e==`function`||Array.isArray(e)||n.isKey(e)?e:{key:e,path:r.toPath(e)}));return e.map(e=>({original:e,criteria:l.map(t=>c(t,e))})).slice().sort((e,n)=>{for(let r=0;r<l.length;r++){let i=t.compareValues(e.criteria[r],n.criteria[r],a[r]);if(i!==0)return i}return 0}).map(e=>e.original)}e.orderBy=i})),lj=n((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e,t=1){let n=[],r=Math.floor(t),i=(e,t)=>{for(let a=0;a<e.length;a++){let o=e[a];Array.isArray(o)&&t<r?i(o,t+1):n.push(o)}};return i(e,0),n}e.flatten=t})),uj=n((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=DA(),n=lA(),r=pA(),i=hA();function a(e,a,o){return r.isObject(o)&&(typeof a==`number`&&n.isArrayLike(o)&&t.isIndex(a)&&a<o.length||typeof a==`string`&&a in o)?i.isEqualsSameValueZero(o[a],e):!1}e.isIterateeCall=a})),dj=n((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=cj(),n=lj(),r=uj();function i(e,...i){let a=i.length;return a>1&&r.isIterateeCall(e,i[0],i[1])?i=[]:a>2&&r.isIterateeCall(i[0],i[1],i[2])&&(i=[i[0]]),t.orderBy(e,n.flatten(i),[`asc`])}e.sortBy=i})),fj=t(n(((e,t)=>{t.exports=dj().sortBy}))()),pj=e=>e.legend.settings,mj=e=>e.legend.size,hj=$([e=>e.legend.payload,pj],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?(0,fj.default)(r,n):r});function gj(){return WA(hj)}var _j=1;function vj(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,n]=(0,f.useState)({height:0,left:0,top:0,width:0});return[t,(0,f.useCallback)(e=>{if(e!=null){var r=e.getBoundingClientRect(),i={height:r.height,left:r.left,top:r.top,width:r.width};(Math.abs(i.height-t.height)>_j||Math.abs(i.left-t.left)>_j||Math.abs(i.top-t.top)>_j||Math.abs(i.width-t.width)>_j)&&n({height:i.height,left:i.left,top:i.top,width:i.width})}},[t.width,t.height,t.top,t.left,...e])]}function yj(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var bj=typeof Symbol==`function`&&Symbol.observable||`@@observable`,xj=()=>Math.random().toString(36).substring(7).split(``).join(`.`),Sj={INIT:`@@redux/INIT${xj()}`,REPLACE:`@@redux/REPLACE${xj()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${xj()}`};function Cj(e){if(typeof e!=`object`||!e)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function wj(e,t,n){if(typeof e!=`function`)throw Error(yj(2));if(typeof t==`function`&&typeof n==`function`||typeof n==`function`&&typeof arguments[3]==`function`)throw Error(yj(0));if(typeof t==`function`&&n===void 0&&(n=t,t=void 0),n!==void 0){if(typeof n!=`function`)throw Error(yj(1));return n(wj)(e,t)}let r=e,i=t,a=new Map,o=a,s=0,c=!1;function l(){o===a&&(o=new Map,a.forEach((e,t)=>{o.set(t,e)}))}function u(){if(c)throw Error(yj(3));return i}function d(e){if(typeof e!=`function`)throw Error(yj(4));if(c)throw Error(yj(5));let t=!0;l();let n=s++;return o.set(n,e),function(){if(t){if(c)throw Error(yj(6));t=!1,l(),o.delete(n),a=null}}}function f(e){if(!Cj(e))throw Error(yj(7));if(e.type===void 0)throw Error(yj(8));if(typeof e.type!=`string`)throw Error(yj(17));if(c)throw Error(yj(9));try{c=!0,i=r(i,e)}finally{c=!1}
38return(a=o).forEach(e=>{e()}),e}function p(e){if(typeof e!=`function`)throw Error(yj(10));r=e,f({type:Sj.REPLACE})}function m(){let e=d;return{subscribe(t){if(typeof t!=`object`||!t)throw Error(yj(11));function n(){let e=t;e.next&&e.next(u())}return n(),{unsubscribe:e(n)}},[bj](){return this}}}return f({type:Sj.INIT}),{dispatch:f,subscribe:d,getState:u,replaceReducer:p,[bj]:m}}function Tj(e){Object.keys(e).forEach(t=>{let n=e[t];if(n(void 0,{type:Sj.INIT})===void 0)throw Error(yj(12));if(n(void 0,{type:Sj.PROBE_UNKNOWN_ACTION()})===void 0)throw Error(yj(13))})}function Ej(e){let t=Object.keys(e),n={};for(let r=0;r<t.length;r++){let i=t[r];typeof e[i]==`function`&&(n[i]=e[i])}let r=Object.keys(n),i;try{Tj(n)}catch(e){i=e}return function(e={},t){if(i)throw i;let a=!1,o={};for(let i=0;i<r.length;i++){let s=r[i],c=n[s],l=e[s],u=c(l,t);if(u===void 0)throw t&&t.type,Error(yj(14));o[s]=u,a||=u!==l}return a||=r.length!==Object.keys(e).length,a?o:e}}function Dj(...e){return e.length===0?e=>e:e.length===1?e[0]:e.reduce((e,t)=>(...n)=>e(t(...n)))}function Oj(...e){return t=>(n,r)=>{let i=t(n,r),a=()=>{throw Error(yj(15))},o={getState:i.getState,dispatch:(e,...t)=>a(e,...t)};return a=Dj(...e.map(e=>e(o)))(i.dispatch),{...i,dispatch:a}}}function kj(e){return Cj(e)&&`type`in e&&typeof e.type==`string`}var Aj=Symbol.for(`immer-nothing`),jj=Symbol.for(`immer-draftable`),Mj=Symbol.for(`immer-state`);function Nj(e,...t){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Pj=Object,Fj=Pj.getPrototypeOf,Ij=`constructor`,Lj=`prototype`,Rj=`configurable`,zj=`enumerable`,Bj=`writable`,Vj=`value`,Hj=e=>!!e&&!!e[Mj];function Uj(e){return e?Kj(e)||$j(e)||!!e[jj]||!!e[Ij]?.[jj]||eM(e)||tM(e):!1}var Wj=Pj[Lj][Ij].toString(),Gj=new WeakMap;function Kj(e){if(!e||!nM(e))return!1;let t=Fj(e);if(t===null||t===Pj[Lj])return!0;let n=Pj.hasOwnProperty.call(t,Ij)&&t[Ij];if(n===Object)return!0;if(!rM(n))return!1;let r=Gj.get(n);return r===void 0&&(r=Function.toString.call(n),Gj.set(n,r)),r===Wj}function qj(e,t,n=!0){Jj(e)===0?(n?Reflect.ownKeys(e):Pj.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function Jj(e){let t=e[Mj];return t?t.type_:$j(e)?1:eM(e)?2:tM(e)?3:0}var Yj=(e,t,n=Jj(e))=>n===2?e.has(t):Pj[Lj].hasOwnProperty.call(e,t),Xj=(e,t,n=Jj(e))=>n===2?e.get(t):e[t],Zj=(e,t,n,r=Jj(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function Qj(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}var $j=Array.isArray,eM=e=>e instanceof Map,tM=e=>e instanceof Set,nM=e=>typeof e==`object`,rM=e=>typeof e==`function`,iM=e=>typeof e==`boolean`;function aM(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var oM=e=>e.copy_||e.base_,sM=e=>e.modified_?e.copy_:e.base_;function cM(e,t){if(eM(e))return new Map(e);if(tM(e))return new Set(e);if($j(e))return Array[Lj].slice.call(e);let n=Kj(e);if(t===!0||t===`class_only`&&!n){let t=Pj.getOwnPropertyDescriptors(e);delete t[Mj];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){let i=n[r],a=t[i];a[Bj]===!1&&(a[Bj]=!0,a[Rj]=!0),(a.get||a.set)&&(t[i]={[Rj]:!0,[Bj]:!0,[zj]:a[zj],[Vj]:e[i]})}return Pj.create(Fj(e),t)}else{let t=Fj(e);if(t!==null&&n)return{...e};let r=Pj.create(t);return Pj.assign(r,e)}}function lM(e,t=!1){return fM(e)||Hj(e)||!Uj(e)?e:(Jj(e)>1&&Pj.defineProperties(e,{set:dM,add:dM,clear:dM,delete:dM}),Pj.freeze(e),t&&qj(e,(e,t)=>{lM(t,!0)},!1),e)}function uM(){Nj(2)}var dM={[Vj]:uM};function fM(e){return e===null||!nM(e)?!0:Pj.isFrozen(e)}var pM=`MapSet`,mM=`Patches`,hM=`ArrayMethods`,gM={};function _M(e){let t=gM[e];return t||Nj(0,e),t}var vM=e=>!!gM[e],yM,bM=()=>yM,xM=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:vM(pM)?_M(pM):void 0,arrayMethodsPlugin_:vM(hM)?_M(hM):void 0});function SM(e,t){t&&(e.patchPlugin_=_M(mM),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function CM(e){wM(e),e.drafts_.forEach(EM),e.drafts_=null}function wM(e){e===yM&&(yM=e.parent_)}var TM=e=>yM=xM(yM,e);function EM(e){let t=e[Mj];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function DM(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];if(e!==void 0&&e!==n){n[Mj].modified_&&(CM(t),Nj(4)),Uj(e)&&(e=OM(t,e));let{patchPlugin_:r}=t;r&&r.generateReplacementPatches_(n[Mj].base_,e,t)}else e=OM(t,n);return kM(t,e,!0),CM(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e===Aj?void 0:e}function OM(e,t){if(fM(t))return t;let n=t[Mj];if(!n)return LM(t,e.handledSet_,e);if(!jM(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){let{callbacks_:t}=n;if(t)for(;t.length>0;)t.pop()(e);FM(n,e)}return n.copy_}function kM(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&lM(t,n)}function AM(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var jM=(e,t)=>e.scope_===t,MM=[];function NM(e,t,n,r){let i=oM(e),a=e.type_;if(r!==void 0&&Xj(i,r,a)===t){Zj(i,r,n,a);return}if(!e.draftLocations_){let t=e.draftLocations_=new Map;qj(i,(e,n)=>{if(Hj(n)){let r=t.get(n)||[];r.push(e),t.set(n,r)}})}let o=e.draftLocations_.get(t)??MM;for(let e of o)Zj(i,e,n,a)}function PM(e,t,n){e.callbacks_.push(function(r){let i=t;if(!i||!jM(i,r))return;r.mapSetPlugin_?.fixSetContents(i);let a=sM(i);NM(e,i.draft_??i,a,n),FM(i,r)})}function FM(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:n}=t;if(n){let r=n.getPath(e);r&&n.generatePatches_(e,r,t)}AM(e)}}
38function IM(e,t,n){let{scope_:r}=e;if(Hj(n)){let i=n[Mj];jM(i,r)&&i.callbacks_.push(function(){GM(e),NM(e,n,sM(i),t)})}else Uj(n)&&e.callbacks_.push(function(){let i=oM(e);e.type_===3?i.has(n)&&LM(n,r.handledSet_,r):Xj(i,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&LM(Xj(e.copy_,t,e.type_),r.handledSet_,r)})}function LM(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||Hj(e)||t.has(e)||!Uj(e)||fM(e)?e:(t.add(e),qj(e,(r,i)=>{if(Hj(i)){let t=i[Mj];jM(t,n)&&(Zj(e,r,sM(t),e.type_),AM(t))}else Uj(i)&&LM(i,t,n)}),e)}function RM(e,t){let n=$j(e),r={type_:+!!n,scope_:t?t.scope_:bM(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},i=r,a=zM;n&&(i=[r],a=BM);let{revoke:o,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=o,[s,r]}var zM={get(e,t){if(t===Mj)return e;let n=e.scope_.arrayMethodsPlugin_,r=e.type_===1&&typeof t==`string`;if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);let i=oM(e);if(!Yj(i,t,e.type_))return HM(e,i,t);let a=i[t];if(e.finalized_||!Uj(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&aM(t))return a;if(a===VM(e.base_,t)){GM(e);let n=e.type_===1?+t:t,r=qM(e.scope_,a,e,n);return e.copy_[n]=r}return a},has(e,t){return t in oM(e)},ownKeys(e){return Reflect.ownKeys(oM(e))},set(e,t,n){let r=UM(oM(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let r=VM(oM(e),t),i=r?.[Mj];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(Qj(n,r)&&(n!==void 0||Yj(e.base_,t,e.type_)))return!0;GM(e),WM(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])?!0:(e.copy_[t]=n,e.assigned_.set(t,!0),IM(e,t,n),!0)},deleteProperty(e,t){return GM(e),VM(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),WM(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=oM(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[Bj]:!0,[Rj]:e.type_!==1||t!==`length`,[zj]:r[zj],[Vj]:n[t]}},defineProperty(){Nj(11)},getPrototypeOf(e){return Fj(e.base_)},setPrototypeOf(){Nj(12)}},BM={};for(let e in zM){let t=zM[e];BM[e]=function(){let e=arguments;return e[0]=e[0][0],t.apply(this,e)}}BM.deleteProperty=function(e,t){return BM.set.call(this,e,t,void 0)},BM.set=function(e,t,n){return zM.set.call(this,e[0],t,n,e[0])};function VM(e,t){let n=e[Mj];return(n?oM(n):e)[t]}function HM(e,t,n){let r=UM(t,n);return r?Vj in r?r[Vj]:r.get?.call(e.draft_):void 0}function UM(e,t){if(!(t in e))return;let n=Fj(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=Fj(n)}}function WM(e){e.modified_||(e.modified_=!0,e.parent_&&WM(e.parent_))}function GM(e){e.copy_||=(e.assigned_=new Map,cM(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var KM=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{if(rM(e)&&!rM(t)){let n=t;t=e;let r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}rM(t)||Nj(6),n!==void 0&&!rM(n)&&Nj(7);let r;if(Uj(e)){let i=TM(this),a=qM(i,e,void 0),o=!0;try{r=t(a),o=!1}finally{o?CM(i):wM(i)}return SM(i,n),DM(r,i)}else if(!e||!nM(e)){if(r=t(e),r===void 0&&(r=e),r===Aj&&(r=void 0),this.autoFreeze_&&lM(r,!0),n){let t=[],i=[];_M(mM).generateReplacementPatches_(e,r,{patches_:t,inversePatches_:i}),n(t,i)}return r}else Nj(1,e)},this.produceWithPatches=(e,t)=>{if(rM(e))return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},iM(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),iM(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),iM(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Uj(e)||Nj(8),Hj(e)&&(e=JM(e));let t=TM(this),n=qM(t,e,void 0);return n[Mj].isManual_=!0,wM(t),n}finishDraft(e,t){let n=e&&e[Mj];(!n||!n.isManual_)&&Nj(9);let{scope_:r}=n;return SM(r,t),DM(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let r=t[n];if(r.path.length===0&&r.op===`replace`){e=r.value;break}}n>
38-1&&(t=t.slice(n+1));let r=_M(mM).applyPatches_;return Hj(e)?r(e,t):this.produce(e,e=>r(e,t))}};function qM(e,t,n,r){let[i,a]=eM(t)?_M(pM).proxyMap_(t,n):tM(t)?_M(pM).proxySet_(t,n):RM(t,n);return(n?.scope_??bM()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?PM(n,a,r):a.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(a);let{patchPlugin_:t}=e;a.modified_&&t&&t.generatePatches_(a,[],e)}),i}function JM(e){return Hj(e)||Nj(10,e),YM(e)}function YM(e){if(!Uj(e)||fM(e))return e;let t=e[Mj],n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=cM(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=cM(e,!0);return qj(n,(e,t)=>{Zj(n,e,YM(t))},r),t&&(t.finalized_=!1),n}var XM=new KM().produce;function ZM(e){return({dispatch:t,getState:n})=>r=>i=>typeof i==`function`?i(t,n,e):r(i)}var QM=ZM(),$M=ZM,eN=typeof window<`u`&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]==`object`?Dj:Dj.apply(null,arguments)};typeof window<`u`&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;function tN(e,t){function n(...n){if(t){let r=t(...n);if(!r)throw Error(lP(0));return{type:e,payload:r.payload,...`meta`in r&&{meta:r.meta},...`error`in r&&{error:r.error}}}return{type:e,payload:n[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=t=>kj(t)&&t.type===e,n}var nN=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function rN(e){return Uj(e)?XM(e,()=>{}):e}function iN(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function aN(e){return typeof e==`boolean`}var oN=()=>function(e){let{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0,actionCreatorCheck:i=!0}=e??{},a=new nN;return t&&(aN(t)?a.push(QM):a.push($M(t.extraArgument))),a},sN=`RTK_autoBatch`,cN=()=>e=>({payload:e,meta:{[sN]:!0}}),lN=e=>t=>{setTimeout(t,e)},uN=(e={type:`raf`})=>t=>(...n)=>{let r=t(...n),i=!0,a=!1,o=!1,s=new Set,c=e.type===`tick`?queueMicrotask:e.type===`raf`?typeof window<`u`&&window.requestAnimationFrame?window.requestAnimationFrame:lN(10):e.type===`callback`?e.queueNotification:lN(e.timeout),l=()=>{o=!1,a&&(a=!1,s.forEach(e=>e()))};return Object.assign({},r,{subscribe(e){let t=r.subscribe(()=>i&&e());return s.add(e),()=>{t(),s.delete(e)}},dispatch(e){try{return i=!e?.meta?.[sN],a=!i,a&&(o||(o=!0,c(l))),r.dispatch(e)}finally{i=!0}}})},dN=e=>function(t){let{autoBatch:n=!0}=t??{},r=new nN(e);return n&&r.push(uN(typeof n==`object`?n:void 0)),r};function fN(e){let t=oN(),{reducer:n=void 0,middleware:r,devTools:i=!0,duplicateMiddlewareCheck:a=!0,preloadedState:o=void 0,enhancers:s=void 0}=e||{},c;if(typeof n==`function`)c=n;else if(Cj(n))c=Ej(n);else throw Error(lP(1));let l;l=typeof r==`function`?r(t):t();let u=Dj;i&&(u=eN({trace:!1,...typeof i==`object`&&i}));let d=dN(Oj(...l)),f=typeof s==`function`?s(d):d(),p=u(...f);return wj(c,o,p)}function pN(e){let t={},n=[],r,i={addCase(e,n){let r=typeof e==`string`?e:e.type;if(!r)throw Error(lP(28));if(r in t)throw Error(lP(29));return t[r]=n,i},addAsyncThunk(e,r){return r.pending&&(t[e.pending.type]=r.pending),r.rejected&&(t[e.rejected.type]=r.rejected),r.fulfilled&&(t[e.fulfilled.type]=r.fulfilled),r.settled&&n.push({matcher:e.settled,reducer:r.settled}),i},addMatcher(e,t){return n.push({matcher:e,reducer:t}),i},addDefaultCase(e){return r=e,i}};return e(i),[t,n,r]}function mN(e){return typeof e==`function`}function hN(e,t){let[n,r,i]=pN(t),a;if(mN(e))a=()=>rN(e());else{let t=rN(e);a=()=>t}function o(e=a(),t){let o=[n[t.type],...r.filter(({matcher:e})=>e(t)).map(({reducer:e})=>e)];return o.filter(e=>!!e).length===0&&(o=[i]),o.reduce((e,n)=>{if(n)if(Hj(e)){let r=n(e,t);return r===void 0?e:r}else if(Uj(e))return XM(e,e=>n(e,t));else{let r=n(e,t);if(r===void 0){if(e===null)return e;throw Error(`A case reducer on a non-draftable value must not return undefined`)}return r}return e},e)}return o.getInitialState=a,o}var gN=`ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW`,_N=(e=21)=>{let t=``,n=e;for(;n--;)t+=gN[Math.random()*64|0];return t},vN=Symbol.for(`rtk-slice-createasyncthunk`);function yN(e,t){return`${e}/${t}`}function bN({creators:e}={}){let t=e?.asyncThunk?.[vN];return function(e){let{name:n,reducerPath:r=n}=e;if(!n)throw Error(lP(11));let i=(typeof e.reducers==`function`?e.reducers(CN()):e.reducers)||{},a=Object.keys(i),o={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},s={addCase(e,t){let n=typeof e==`string`?e:e.type;if(!n)throw Error(lP(12));if(n in o.sliceCaseReducersByType)throw Error(lP(13));return o.sliceCaseReducersByType[n]=t,s},addMatcher(e,t){return o.sliceMatchers.push({matcher:e,reducer:t}),s},exposeAction(e,t){return o.actionCreators[e]=t,s},exposeCaseReducer(e,t){return o.sliceCaseReducersByName[e]=t,s}};a.forEach(r=>{let a=i[r],o={reducerName:r,type:yN(n,r),createNotation:typeof e.reducers==`function`};TN(a)?DN(o,a,s,t):wN(o,a,s)});function c(){let[t={},n=[],r=void 0]=typeof e.extraReducers==`function`?pN(e.extraReducers):[e.extraReducers],i={...t,...o.sliceCaseReducersByType};return hN(e.initialState,e=>{for(let t in i)e.addCase(t,i[t]);for(let t of o.sliceMatchers)e.addMatcher(t.matcher,t.reducer);for(let t of n)e.addMatcher(t.matcher,t.reducer);r&&e.addDefaultCase(r)})}let l=e=>e,u=new Map,d=new WeakMap,f;function p(e,t){return f||=c(),f(e,t)}function m(){return f||=c(),f.getInitialState()}function h(t,n=!1){function r(e){let i=e[t];return i===void 0&&n&&(i=iN(d,r,m)),i}function i(t=l){return iN(iN(u,n,()=>new WeakMap),t,()=>{let r={};for(let[i,a]of Object.entries(e.selectors??{}))r[i]=xN(a,t,()=>iN(d,t,m),n);return r})}return{reducerPath:t,getSelectors:i,get selectors(){return i(r)},selectSlice:r}}let g={name:n,reducer:p,actions:o.actionCreators,caseReducers:o.sliceCaseReducersByName,getInitialState:m,...h(r),injectInto(e,{reducerPath:t,...n}={}){let i=t??r;return e.inject({reducerPath:i,reducer:p},n),{...g,...h(i,!0)}}};return g}}function xN(e,t,n,r){function i(i,...a){let o=t(i);
38return o===void 0&&r&&(o=n()),e(o,...a)}return i.unwrapped=e,i}var SN=bN();function CN(){function e(e,t){return{_reducerDefinitionType:`asyncThunk`,payloadCreator:e,...t}}return e.withTypes=()=>e,{reducer(e){return Object.assign({[e.name](...t){return e(...t)}}[e.name],{_reducerDefinitionType:`reducer`})},preparedReducer(e,t){return{_reducerDefinitionType:`reducerWithPrepare`,prepare:e,reducer:t}},asyncThunk:e}}function wN({type:e,reducerName:t,createNotation:n},r,i){let a,o;if(`reducer`in r){if(n&&!EN(r))throw Error(lP(17));a=r.reducer,o=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,o?tN(e,o):tN(e))}function TN(e){return e._reducerDefinitionType===`asyncThunk`}function EN(e){return e._reducerDefinitionType===`reducerWithPrepare`}function DN({type:e,reducerName:t},n,r,i){if(!i)throw Error(lP(18));let{payloadCreator:a,fulfilled:o,pending:s,rejected:c,settled:l,options:u}=n,d=i(e,a,u);r.exposeAction(t,d),o&&r.addCase(d.fulfilled,o),s&&r.addCase(d.pending,s),c&&r.addCase(d.rejected,c),l&&r.addMatcher(d.settled,l),r.exposeCaseReducer(t,{fulfilled:o||ON,pending:s||ON,rejected:c||ON,settled:l||ON})}function ON(){}var kN=`task`,AN=`listener`,jN=`completed`,MN=`cancelled`,NN=`task-${MN}`,PN=`task-${jN}`,FN=`${AN}-${MN}`,IN=`${AN}-${jN}`,LN=class{constructor(e){this.code=e,this.message=`${kN} ${MN} (reason: ${e})`}name=`TaskAbortError`;message},RN=(e,t)=>{if(typeof e!=`function`)throw TypeError(lP(32))},zN=()=>{},BN=(e,t=zN)=>(e.catch(t),e),VN=(e,t)=>(e.addEventListener(`abort`,t,{once:!0}),()=>e.removeEventListener(`abort`,t)),HN=e=>{if(e.aborted)throw new LN(e.reason)};function UN(e,t){let n=zN;return new Promise((r,i)=>{let a=()=>i(new LN(e.reason));if(e.aborted){a();return}n=VN(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=zN})}var WN=async(e,t)=>{try{return await Promise.resolve(),{status:`ok`,value:await e()}}catch(e){return{status:e instanceof LN?`cancelled`:`rejected`,error:e}}finally{t?.()}},GN=e=>t=>BN(UN(e,t).then(t=>(HN(e),t))),KN=e=>{let t=GN(e);return e=>t(new Promise(t=>setTimeout(t,e)))},{assign:qN}=Object,JN={},YN=`listenerMiddleware`,XN=(e,t)=>{let n=t=>VN(e,()=>t.abort(e.reason));return(r,i)=>{RN(r,`taskExecutor`);let a=new AbortController;n(a);let o=WN(async()=>{HN(e),HN(a.signal);let t=await r({pause:GN(a.signal),delay:KN(a.signal),signal:a.signal});return HN(a.signal),t},()=>a.abort(PN));return i?.autoJoin&&t.push(o.catch(zN)),{result:GN(e)(o),cancel(){a.abort(NN)}}}},ZN=(e,t)=>{let n=async(n,r)=>{HN(t);let i=()=>{},a=[new Promise((t,r)=>{let a=e({predicate:n,effect:(e,n)=>{n.unsubscribe(),t([e,n.getState(),n.getOriginalState()])}});i=()=>{a(),r()}})];r!=null&&a.push(new Promise(e=>setTimeout(e,r,null)));try{let e=await UN(t,Promise.race(a));return HN(t),e}finally{i()}};return(e,t)=>BN(n(e,t))},QN=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=tN(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw Error(lP(21));return RN(a,`options.listener`),{predicate:i,type:t,effect:a}},$N=qN(e=>{let{type:t,predicate:n,effect:r}=QN(e);return{id:_N(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw Error(lP(22))}}},{withTypes:()=>$N}),eP=(e,t)=>{let{type:n,effect:r,predicate:i}=QN(t);return Array.from(e.values()).find(e=>(typeof n==`string`?e.type===n:e.predicate===i)&&e.effect===r)},tP=e=>{e.pending.forEach(e=>{e.abort(FN)})},nP=(e,t)=>()=>{for(let e of t.keys())tP(e);e.clear()},rP=(e,t,n)=>{try{e(t,n)}catch(e){setTimeout(()=>{throw e},0)}},iP=qN(tN(`${YN}/add`),{withTypes:()=>iP}),aP=tN(`${YN}/removeAll`),oP=qN(tN(`${YN}/remove`),{withTypes:()=>oP}),sP=(...e)=>{console.error(`${YN}/error`,...e)},cP=(e={})=>{let t=new Map,n=new Map,r=e=>{let t=n.get(e)??0;n.set(e,t+1)},i=e=>{let t=n.get(e)??1;t===1?n.delete(e):n.set(e,t-1)},{extra:a,onError:o=sP}=e;RN(o,`onError`);let s=e=>(e.unsubscribe=()=>t.delete(e.id),t.set(e.id,e),t=>{e.unsubscribe(),t?.cancelActive&&tP(e)}),c=e=>s(eP(t,e)??$N(e));qN(c,{withTypes:()=>c});let l=e=>{let n=eP(t,e);return n&&(n.unsubscribe(),e.cancelActive&&tP(n)),!!n};qN(l,{withTypes:()=>l});let u=async(e,n,s,l)=>{let u=new AbortController,d=ZN(c,u.signal),f=[];try{e.pending.add(u),r(e),await Promise.resolve(e.effect(n,qN({},s,{getOriginalState:l,condition:(e,t)=>
38d(e,t).then(Boolean),take:d,delay:KN(u.signal),pause:GN(u.signal),extra:a,signal:u.signal,fork:XN(u.signal,f),unsubscribe:e.unsubscribe,subscribe:()=>{t.set(e.id,e)},cancelActiveListeners:()=>{e.pending.forEach((e,t,n)=>{e!==u&&(e.abort(FN),n.delete(e))})},cancel:()=>{u.abort(FN),e.pending.delete(u)},throwIfCancelled:()=>{HN(u.signal)}})))}catch(e){e instanceof LN||rP(o,e,{raisedBy:`effect`})}finally{await Promise.all(f),u.abort(IN),i(e),e.pending.delete(u)}},d=nP(t,n);return{middleware:e=>n=>r=>{if(!kj(r))return n(r);if(iP.match(r))return c(r.payload);if(aP.match(r)){d();return}if(oP.match(r))return l(r.payload);let i=e.getState(),a=()=>{if(i===JN)throw Error(lP(23));return i},s;try{if(s=n(r),t.size>0){let n=e.getState(),s=Array.from(t.values());for(let t of s){let s=!1;try{s=t.predicate(r,n,i)}catch(e){s=!1,rP(o,e,{raisedBy:`predicate`})}s&&u(t,r,e,a)}}}finally{i=JN}return s},startListening:c,stopListening:l,clearListeners:d}};function lP(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var uP=SN({name:`chartLayout`,initialState:{layoutType:`horizontal`,width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){e.margin.top=t.payload.top??0,e.margin.right=t.payload.right??0,e.margin.bottom=t.payload.bottom??0,e.margin.left=t.payload.left??0},setScale(e,t){e.scale=t.payload}}}),{setMargin:dP,setLayout:fP,setChartSize:pP,setScale:mP}=uP.actions,hP=uP.reducer;function gP(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function _P(e){return Number.isFinite(e)}function vP(e){return typeof e==`number`&&e>0&&Number.isFinite(e)}function yP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function bP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?yP(Object(n),!0).forEach(function(t){xP(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yP(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function xP(e,t,n){return(t=SP(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SP(e){var t=CP(e,`string`);return typeof t==`symbol`?t:t+``}function CP(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function wP(e,t,n){return vk(e)||vk(t)?n:dk(t)?(0,ok.default)(e,t,n):typeof t==`function`?t(e):n}var TP=(e,t,n)=>{if(t&&n){var{width:r,height:i}=n,{align:a,verticalAlign:o,layout:s}=t;if((s===`vertical`||s===`horizontal`&&o===`middle`)&&a!==`center`&&uk(e[a]))return bP(bP({},e),{},{[a]:e[a]+(r||0)});if((s===`horizontal`||s===`vertical`&&a===`center`)&&o!==`middle`&&uk(e[o]))return bP(bP({},e),{},{[o]:e[o]+(i||0)})}return e},EP=(e,t)=>e===`horizontal`&&t===`xAxis`||e===`vertical`&&t===`yAxis`||e===`centric`&&t===`angleAxis`||e===`radial`&&t===`radiusAxis`,DP=(e,t,n,r)=>{if(r)return e.map(e=>e.coordinate);var i,a,o=e.map(e=>(e.coordinate===t&&(i=!0),e.coordinate===n&&(a=!0),e.coordinate));return i||o.push(t),a||o.push(n),o},OP=(e,t,n)=>{if(!e)return null;var{duplicateDomain:r,type:i,range:a,scale:o,realScaleType:s,isCategorical:c,categoricalDomain:l,tickCount:u,ticks:d,niceTicks:f,axisType:p}=e;if(!o)return null;var m=s===`scaleBand`&&o.bandwidth?o.bandwidth()/2:2,h=(t||n)&&i===`category`&&o.bandwidth?o.bandwidth()/m:0;return h=p===`angleAxis`&&a&&a.length>=2?sk(a[0]-a[1])*2*h:h,t&&(d||f)?(d||f||[]).map((e,t)=>{var n=r?r.indexOf(e):e,i=o.map(n);return _P(i)?{coordinate:i+h,value:e,offset:h,index:t}:null}).filter(bk):c&&l?l.map((e,t)=>{var n=o.map(e);return _P(n)?{coordinate:n+h,value:e,index:t,offset:h}:null}).filter(bk):o.ticks&&!n&&u!=null?o.ticks(u).map((e,t)=>{var n=o.map(e);return _P(n)?{coordinate:n+h,value:e,index:t,offset:h}:null}).filter(bk):o.domain().map((e,t)=>{var n=o.map(e);return _P(n)?{coordinate:n+h,value:r?r[e]:e,index:t,offset:h}:null}).filter(bk)},kP={sign:e=>{var t=e.length;if(!(t<=0)){var n=e[0]?.length;if(!(n==null||n<=0))for(var r=0;r<n;++r)for(var i=0,a=0,o=0;o<t;++o){var s=e[o]?.[r];if(s!=null){var c=s[1],l=s[0],u=ck(c)?l:c;u>=0?(s[0]=i,i+=u,s[1]=i):(s[0]=a,a+=u,s[1]=a)}}}},expand:qO,none:HO,silhouette:JO,wiggle:YO,positive:e=>{var t=e.length;if(!(t<=0)){var n=e[0]?.length;if(!(n==null||n<=0))for(var r=0;r<n;++r)for(var i=0,a=0;a<t;
38++a){var o=e[a]?.[r];if(o!=null){var s=ck(o[1])?o[0]:o[1];s>=0?(o[0]=i,i+=s,o[1]=i):(o[0]=0,o[1]=0)}}}}},AP=(e,t,n)=>{var r=kP[n]??HO,i=KO().keys(t).value((e,t)=>Number(wP(e,t,0))).order(UO).offset(r)(e);return i.forEach((n,r)=>{n.forEach((n,i)=>{var a=wP(e[i],t[r],0);Array.isArray(a)&&a.length===2&&uk(a[0])&&uk(a[1])&&(n[0]=a[0],n[1]=a[1])})}),i};function jP(e){var{axis:t,ticks:n,bandSize:r,entry:i,index:a,dataKey:o}=e;if(t.type===`category`){if(!t.allowDuplicatedCategory&&t.dataKey&&!vk(i[t.dataKey])){var s=_k(n,`value`,i[t.dataKey]);if(s)return s.coordinate+r/2}return n!=null&&n[a]?n[a].coordinate+r/2:null}var c=wP(i,vk(o)?t.dataKey:o),l=t.scale.map(c);return uk(l)?l:null}var MP=e=>{var t=e.flat(2).filter(uk);return[Math.min(...t),Math.max(...t)]},NP=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],PP=(e,t,n)=>{if(e!=null)return NP(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var{stackedData:o}=a,s=o.reduce((e,r)=>{var i=MP(gP(r,t,n));return!_P(i[0])||!_P(i[1])?e:[Math.min(e[0],i[0]),Math.max(e[1],i[1])]},[1/0,-1/0]);return[Math.min(s[0],r[0]),Math.max(s[1],r[1])]},[1/0,-1/0]))},FP=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,IP=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,LP=(e,t,n)=>{if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var i=(0,fj.default)(t,e=>e.coordinate),a=1/0,o=1,s=i.length;o<s;o++){var c=i[o],l=i[o-1];a=Math.min((c?.coordinate||0)-(l?.coordinate||0),a)}return a===1/0?0:a}return n?void 0:0};function RP(e){var{tooltipEntrySettings:t,dataKey:n,payload:r,value:i,name:a}=e;return bP(bP({},t),{},{dataKey:n,payload:r,value:i,name:a})}function zP(e,t){if(e)return String(e);if(typeof t==`string`)return t}var BP=(e,t)=>{if(t===`horizontal`)return e.relativeX;if(t===`vertical`)return e.relativeY},VP=(e,t)=>t===`centric`?e.angle:e.radius,HP=e=>e.layout.width,UP=e=>e.layout.height,WP=e=>e.layout.scale,GP=e=>e.layout.margin,KP=$(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),qP=$(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),JP=`data-recharts-item-index`;function YP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function XP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?YP(Object(n),!0).forEach(function(t){ZP(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YP(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ZP(e,t,n){return(t=QP(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function QP(e){var t=$P(e,`string`);return typeof t==`symbol`?t:t+``}function $P(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var eF=e=>e.brush.height;function tF(e){return qP(e).reduce((e,t)=>t.orientation===`left`&&!t.mirror&&!t.hide?e+(typeof t.width==`number`?t.width:60):e,0)}function nF(e){return qP(e).reduce((e,t)=>t.orientation===`right`&&!t.mirror&&!t.hide?e+(typeof t.width==`number`?t.width:60):e,0)}function rF(e){return KP(e).reduce((e,t)=>t.orientation===`top`&&!t.mirror&&!t.hide?e+t.height:e,0)}function iF(e){return KP(e).reduce((e,t)=>t.orientation===`bottom`&&!t.mirror&&!t.hide?e+t.height:e,0)}var aF=$([HP,UP,GP,eF,tF,nF,rF,iF,pj,mj],(e,t,n,r,i,a,o,s,c,l)=>{var u={left:(n.left||0)+i,right:(n.right||0)+a},d=XP(XP({},{top:(n.top||0)+o,bottom:(n.bottom||0)+s}),u),f=d.bottom;d.bottom+=r,d=TP(d,c,l);var p=e-d.left-d.right,m=t-d.top-d.bottom;return XP(XP({brushBottom:f},d),{},{width:Math.max(p,0),height:Math.max(m,0)})}),oF=$(aF,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),sF=$(HP,UP,(e,t)=>({x:0,y:0,width:e,height:t})),cF=(0,f.createContext)(null),lF=()=>(0,f.useContext)(cF)!=null,uF=e=>e.brush,dF=$([uF,aF,GP],(e,t,n)=>({height:e.height,x:uk(e.x)?e.x:t.left,y:uk(e.y)?e.y:t.top+t.height+t.brushBottom-(n?.bottom||0),width:uk(e.width)?e.width:t.width})),fF=n((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e,t,{signal:n,edges:r}={}){let i,a=null,o=r!=null&&r.includes(`leading`),s=r==null||r.includes(`trailing`),c=()=>{a!==null&&(e.apply(i,a),i=void 0,a=null)},l=()=>{s&&c(),p()},u=null,d=()=>{u!=null&&clearTimeout(u),u=setTimeout(()=>{u=null,l()},t)},f=()=>{u!==null&&(clearTimeout(u),u=null)},p=()=>{f(),i=void 0,a=null},m=()=>{c()},h=function(...e){if(n?.aborted)return;i=this,a=e;let t=u==null;d(),o&&t&&c()};return h.schedule=d,h.cancel=p,h.flush=m,n?.addEventListener(`abort`,p,{once:!0}),h}e.debounce=t})),pF=n((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=fF();function n(e,n=0,r={}){typeof r!=`object`&&(r={});let{leading:i=!1,trailing:a=!0,maxWait:o}=r,s=[,,];i&&(s[0]=`leading`),a&&(s[1]=`trailing`);let c,l=null,u=t.debounce(function(...t){c=e.apply(this,t),l=null},n,{edges:s}
38),d=function(...t){return o!=null&&(l===null&&(l=Date.now()),Date.now()-l>=o)?(c=e.apply(this,t),l=Date.now(),u.cancel(),u.schedule(),c):(u.apply(this,t),c)};return d.cancel=u.cancel,d.flush=()=>(u.flush(),c),d}e.debounce=n})),mF=n((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=pF();function n(e,n=0,r={}){let{leading:i=!0,trailing:a=!0}=r;return t.debounce(e,n,{leading:i,maxWait:n,trailing:a})}e.throttle=n})),hF=n(((e,t)=>{t.exports=mF().throttle})),gF=!0,_F=function(e,t){var n=[...arguments].slice(2);if(gF&&typeof console<`u`&&console.warn&&(t===void 0&&console.warn(`LogUtils requires an error message argument`),!e))if(t===void 0)console.warn(`Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.`);else{var r=0;console.warn(t.replace(/%s/g,()=>n[r++]))}},vF={width:`100%`,height:`100%`,debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},yF=(e,t,n)=>{var{width:r=vF.width,height:i=vF.height,aspect:a,maxHeight:o}=n,s=lk(r)?e:Number(r),c=lk(i)?t:Number(i);return a&&a>0&&(s?c=s/a:c&&(s=c*a),o&&c!=null&&c>o&&(c=o)),{calculatedWidth:s,calculatedHeight:c}},bF={width:0,height:0,overflow:`visible`},xF={width:0,overflowX:`visible`},SF={height:0,overflowY:`visible`},CF={},wF=e=>{var{width:t,height:n}=e,r=lk(t),i=lk(n);return r&&i?bF:r?xF:i?SF:CF};function TF(e){var{width:t,height:n,aspect:r}=e,i=t,a=n;return i===void 0&&a===void 0?(i=vF.width,a=vF.height):i===void 0?i=r&&r>0?void 0:vF.width:a===void 0&&(a=r&&r>0?void 0:vF.height),{width:i,height:a}}var EF=t(hF());function DF(){return DF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},DF.apply(null,arguments)}function OF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function kF(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?OF(Object(n),!0).forEach(function(t){AF(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OF(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function AF(e,t,n){return(t=jF(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jF(e){var t=MF(e,`string`);return typeof t==`symbol`?t:t+``}function MF(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var NF=(0,f.createContext)(vF.initialDimension);function PF(e){return vP(e.width)&&vP(e.height)}function FF(e){var{children:t,width:n,height:r}=e,i=(0,f.useMemo)(()=>({width:n,height:r}),[n,r]);return PF(i)?f.createElement(NF.Provider,{value:i},t):null}var IF=()=>(0,f.useContext)(NF),LF=(0,f.forwardRef)((e,t)=>{var{aspect:n,initialDimension:r=vF.initialDimension,width:i,height:a,minWidth:o=vF.minWidth,minHeight:s,maxHeight:c,children:l,debounce:u=vF.debounce,id:d,className:p,onResize:m,style:h={}}=e,g=(0,f.useRef)(null),_=(0,f.useRef)();_.current=m,(0,f.useImperativeHandle)(t,()=>g.current);var[v,y]=(0,f.useState)({containerWidth:r.width,containerHeight:r.height}),b=(0,f.useCallback)((e,t)=>{y(n=>{var r=Math.round(e),i=Math.round(t);return n.containerWidth===r&&n.containerHeight===i?n:{containerWidth:r,containerHeight:i}})},[]);(0,f.useEffect)(()=>{if(g.current==null||typeof ResizeObserver>`u`)return xk;var e=e=>{var t,n=e[0];if(n!=null){var{width:r,height:i}=n.contentRect;b(r,i),(t=_.current)==null||t.call(_,r,i)}};u>0&&(e=(0,EF.default)(e,u,{trailing:!0,leading:!1}));var t=new ResizeObserver(e),{width:n,height:r}=g.current.getBoundingClientRect();return b(n,r),t.observe(g.current),()=>{t.disconnect()}},[b,u]);var{containerWidth:x,containerHeight:S}=v;_F(!n||n>0,`The aspect(%s) must be greater than zero.`,n);var{calculatedWidth:C,calculatedHeight:w}=yF(x,S,{width:i,height:a,aspect:n,maxHeight:c});return _F(C!=null&&C>0||w!=null&&w>0,`The width(%s) and height(%s) of chart should be greater than 0, 39 please check the style of container, or the props width(%s) and height(%s), 40 or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the 41 height and width.`,C,w,i,a,o,s,n),f.createElement(`div`,{id:d?`${d}`:void 0,className:zc(`recharts-responsive-container`,p),style:kF(kF({},h),{},{width:i,height:a,minWidth:o,minHeight:s,maxHeight:c}),ref:g},f.createElement(`div`,{style:wF({width:i,height:a})},f.createElement(FF,{width:C,height:w},l)))}),RF=(0,f.forwardRef)((e,t)=>{var n=IF();if(vP(n.width)&&vP(n.height))return e.children;var{width:r,height:i}=TF({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:o}=yF(void 0,void 0,{width:r,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return uk(a)&&uk(o)?f.createElement(FF,{width:a,height:o},e.children):f.createElement(LF,DF({},e,{width:r,height:i,ref:t}))});function zF(e){if(e)return{x:e.x,y:e.y,upperWidth:`upperWidth`in e?e.upperWidth:e.width,lowerWidth:`lowerWidth`in e?e.lowerWidth:e.width,width:e.width,height:e.height}}var BF=()=>{var e=lF(),t=WA(oF),n=WA(dF),r=WA(uF)?.padding;return!e||!n||!r?t:{width:n.width-r.left-r.right,height:n.height-r.top-r.bottom,x:r.left,y:r.top}},VF={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},HF=()=>WA(aF)??VF,UF=()=>WA(HP),WF=()=>WA(UP),GF=()=>WA(e=>e.layout.margin),KF=e=>e.layout.layoutType,qF=()=>WA(KF),JF=()=>{var e=qF();if(e===`horizontal`||e===`vertical`)return e},YF=e=>{var t=e.layout.layoutType;if(t===`centric`||t===`radial`)return t},XF=()=>qF()!==void 0,ZF=e=>{var t=BA(),n=lF(),{width:r,height:i}=e,a=IF(),o=r,s=i;return a&&(o=a.width>0?a.width:r,s=a.height>0?a.height:i),(0,f.useEffect)(()=>{!n&&vP(o)&&vP(s)&&t(pP({width:o,height:s}))},[t,n,o,s]),null},QF=Symbol.for(`immer-nothing`),$F=Symbol.for(`immer-draftable`),eI=Symbol.for(`immer-state`);function tI(e,...t){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var nI=Object.getPrototypeOf;function rI(e){return!!e&&!!e[eI]}function iI(e){return e?sI(e)||Array.isArray(e)||!!e[$F]||!!e.constructor?.[$F]||pI(e)||mI(e):!1}var aI=Object.prototype.constructor.toString(),oI=new WeakMap;function sI(e){if(!e||typeof e!=`object`)return!1;let t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;let n=Object.hasOwnProperty.call(t,`constructor`)&&t.constructor;if(n===Object)return!0;
41if(typeof n!=`function`)return!1;let r=oI.get(n);return r===void 0&&(r=Function.toString.call(n),oI.set(n,r)),r===aI}function cI(e,t,n=!0){lI(e)===0?(n?Reflect.ownKeys(e):Object.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function lI(e){let t=e[eI];return t?t.type_:Array.isArray(e)?1:pI(e)?2:mI(e)?3:0}function uI(e,t){return lI(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function dI(e,t,n){let r=lI(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function fI(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}function pI(e){return e instanceof Map}function mI(e){return e instanceof Set}function hI(e){return e.copy_||e.base_}function gI(e,t){if(pI(e))return new Map(e);if(mI(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let n=sI(e);if(t===!0||t===`class_only`&&!n){let t=Object.getOwnPropertyDescriptors(e);delete t[eI];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){let i=n[r],a=t[i];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(t[i]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[i]})}return Object.create(nI(e),t)}else{let t=nI(e);return t!==null&&n?{...e}:Object.assign(Object.create(t),e)}}function _I(e,t=!1){return bI(e)||rI(e)||!iI(e)?e:(lI(e)>1&&Object.defineProperties(e,{set:yI,add:yI,clear:yI,delete:yI}),Object.freeze(e),t&&Object.values(e).forEach(e=>_I(e,!0)),e)}function vI(){tI(2)}var yI={value:vI};function bI(e){return typeof e!=`object`||!e?!0:Object.isFrozen(e)}var xI={};function SI(e){let t=xI[e];return t||tI(0,e),t}var CI;function wI(){return CI}function TI(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function EI(e,t){t&&(SI(`Patches`),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function DI(e){OI(e),e.drafts_.forEach(AI),e.drafts_=null}function OI(e){e===CI&&(CI=e.parent_)}function kI(e){return CI=TI(CI,e)}function AI(e){let t=e[eI];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function jI(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];return e!==void 0&&e!==n?(n[eI].modified_&&(DI(t),tI(4)),iI(e)&&(e=MI(t,e),t.parent_||PI(t,e)),t.patches_&&SI(`Patches`).generateReplacementPatches_(n[eI].base_,e,t.patches_,t.inversePatches_)):e=MI(t,n,[]),DI(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e===QF?void 0:e}function MI(e,t,n){if(bI(t))return t;let r=e.immer_.shouldUseStrictIteration(),i=t[eI];if(!i)return cI(t,(r,a)=>NI(e,i,t,r,a,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return PI(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;let t=i.copy_,a=t,o=!1;i.type_===3&&(a=new Set(t),t.clear(),o=!0),cI(a,(r,a)=>NI(e,i,t,r,a,n,o),r),PI(e,t,!1),n&&e.patches_&&SI(`Patches`).generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function NI(e,t,n,r,i,a,o){if(i==null||typeof i!=`object`&&!o)return;let s=bI(i);if(!(s&&!o)){if(rI(i)){let o=MI(e,i,a&&t&&t.type_!==3&&!uI(t.assigned_,r)?a.concat(r):void 0);if(dI(n,r,o),rI(o))e.canAutoFreeze_=!1;else return}else o&&n.add(i);if(iI(i)&&!s){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&s)return;MI(e,i),(!t||!t.scope_.parent_)&&typeof r!=`symbol`&&(pI(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&PI(e,i)}}}function PI(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&_I(t,n)}function FI(e,t){let n=Array.isArray(e),r={type_:+!!n,scope_:t?t.scope_:wI(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},i=r,a=II;n&&(i=[r],a=LI);let{revoke:o,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=o,s}var II={get(e,t){if(t===eI)return e;let n=hI(e);if(!uI(n,t))return zI(e,n,t);let r=n[t];return e.finalized_||!iI(r)?r:r===RI(e.base_,t)?(HI(e),e.copy_[t]=WI(r,e)):r},has(e,t){return t in hI(e)},ownKeys(e){return Reflect.ownKeys(hI(e))},set(e,t,n){let r=BI(hI(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let r=RI(hI(e),t),i=r?.[eI];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(fI(n,r)&&(n!==void 0||uI(e.base_,t)))return!0;HI(e),VI(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])?!0:(e.copy_[t]=n,e.assigned_[t]=!0,!0)},deleteProperty(e,t){return RI(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,HI(e),VI(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=hI(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!==`length`,enumerable:r.enumerable,value:n[t]}},defineProperty(){tI(11)},getPrototypeOf(e){return nI(e.base_)},setPrototypeOf(){tI(12)}},LI={};cI(II,(e,t)=>{LI[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),LI.deleteProperty=function(e,t){return LI.set.call(this,e,t,void 0)}
41,LI.set=function(e,t,n){return II.set.call(this,e[0],t,n,e[0])};function RI(e,t){let n=e[eI];return(n?hI(n):e)[t]}function zI(e,t,n){let r=BI(t,n);return r?`value`in r?r.value:r.get?.call(e.draft_):void 0}function BI(e,t){if(!(t in e))return;let n=nI(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=nI(n)}}function VI(e){e.modified_||(e.modified_=!0,e.parent_&&VI(e.parent_))}function HI(e){e.copy_||=gI(e.base_,e.scope_.immer_.useStrictShallowCopy_)}var UI=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(e,t,n)=>{if(typeof e==`function`&&typeof t!=`function`){let n=t;t=e;let r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}typeof t!=`function`&&tI(6),n!==void 0&&typeof n!=`function`&&tI(7);let r;if(iI(e)){let i=kI(this),a=WI(e,void 0),o=!0;try{r=t(a),o=!1}finally{o?DI(i):OI(i)}return EI(i,n),jI(r,i)}else if(!e||typeof e!=`object`){if(r=t(e),r===void 0&&(r=e),r===QF&&(r=void 0),this.autoFreeze_&&_I(r,!0),n){let t=[],i=[];SI(`Patches`).generateReplacementPatches_(e,r,t,i),n(t,i)}return r}else tI(1,e)},this.produceWithPatches=(e,t)=>{if(typeof e==`function`)return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},typeof e?.autoFreeze==`boolean`&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy==`boolean`&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof e?.useStrictIteration==`boolean`&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){iI(e)||tI(8),rI(e)&&(e=GI(e));let t=kI(this),n=WI(e,void 0);return n[eI].isManual_=!0,OI(t),n}finishDraft(e,t){let n=e&&e[eI];(!n||!n.isManual_)&&tI(9);let{scope_:r}=n;return EI(r,t),jI(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let r=t[n];if(r.path.length===0&&r.op===`replace`){e=r.value;break}}n>-1&&(t=t.slice(n+1));let r=SI(`Patches`).applyPatches_;return rI(e)?r(e,t):this.produce(e,e=>r(e,t))}};function WI(e,t){let n=pI(e)?SI(`MapSet`).proxyMap_(e,t):mI(e)?SI(`MapSet`).proxySet_(e,t):FI(e,t);return(t?t.scope_:wI()).drafts_.push(n),n}function GI(e){return rI(e)||tI(10,e),KI(e)}function KI(e){if(!iI(e)||bI(e))return e;let t=e[eI],n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=gI(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=gI(e,!0);return cI(n,(e,t)=>{dI(n,e,KI(t))},r),t&&(t.finalized_=!1),n}new UI().produce;function qI(e){return e}var JI=SN({name:`legend`,initialState:{settings:{layout:`horizontal`,align:`center`,verticalAlign:`middle`,itemSorter:`value`},size:{width:0,height:0},payload:[]},reducers:{setLegendSize(e,t){e.size.width=t.payload.width,e.size.height=t.payload.height},setLegendSettings(e,t){e.settings.align=t.payload.align,e.settings.layout=t.payload.layout,e.settings.verticalAlign=t.payload.verticalAlign,e.settings.itemSorter=t.payload.itemSorter},addLegendPayload:{reducer(e,t){e.payload.push(qI(t.payload))},prepare:cN()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:r}=t.payload,i=JM(e).payload.indexOf(qI(n));i>-1&&(e.payload[i]=qI(r))},prepare:cN()},removeLegendPayload:{reducer(e,t){var n=JM(e).payload.indexOf(qI(t.payload));n>-1&&e.payload.splice(n,1)},prepare:cN()}}}),{setLegendSize:YI,setLegendSettings:XI,addLegendPayload:ZI,replaceLegendPayload:QI,removeLegendPayload:$I}=JI.actions,eL=JI.reducer,tL=n((e=>{var t=a();t.useSyncExternalStore,t.useRef,t.useEffect,t.useMemo,t.useDebugValue}));n(((e,t)=>{t.exports=tL()}))();function nL(e){e()}function rL(){let e=null,t=null;return{clear(){e=null,t=null},notify(){nL(()=>{let t=e;for(;t;)t.callback(),t=t.next})},get(){let t=[],n=e;for(;n;)t.push(n),n=n.next;return t},subscribe(n){let r=!0,i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!r||e===null||(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var iL={notify(){},get:()=>[]};function aL(e,t){let n,r=iL,i=0,a=!1;function o(e){u();let t=r.subscribe(e),n=!1;return()=>{n||(n=!0,t(),d())}}function s(){r.notify()}function c(){m.onStateChange&&m.onStateChange()}function l(){return a}function u(){i++,n||(n=t?t.addNestedSub(c):e.subscribe(c),r=rL())}function d(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=iL)}function f(){a||(a=!0,u())}function p(){a&&(a=!1,d())}let m={addNestedSub:o,notifyNestedSubs:s,handleChangeWrapper:c,isSubscribed:l,trySubscribe:f,tryUnsubscribe:p,getListeners:()=>r};return m}var oL=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,sL=typeof navigator<`u`&&navigator.product===`ReactNative`,cL=oL||sL?f.useLayoutEffect:f.useEffect;function lL(e,t){return e===t?e!==0||t!==0||1/e==1/t:e!==e&&t!==t}function uL(e,t){if(lL(e,t))return!0;
41if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!lL(e[n[r]],t[n[r]]))return!1;return!0}var dL=Symbol.for(`react-redux-context`),fL=typeof globalThis<`u`?globalThis:{};function pL(){if(!f.createContext)return{};let e=fL[dL]??=new Map,t=e.get(f.createContext);return t||(t=f.createContext(null),e.set(f.createContext,t)),t}var mL=pL();function hL(e){let{children:t,context:n,serverState:r,store:i}=e,a=f.useMemo(()=>({store:i,subscription:aL(i),getServerState:r?()=>r:void 0}),[i,r]),o=f.useMemo(()=>i.getState(),[i]);cL(()=>{let{subscription:e}=a;return e.onStateChange=e.notifyNestedSubs,e.trySubscribe(),o!==i.getState()&&e.notifyNestedSubs(),()=>{e.tryUnsubscribe(),e.onStateChange=void 0}},[a,o]);let s=n||mL;return f.createElement(s.Provider,{value:a},t)}var gL=hL,_L=new Set([`axisLine`,`tickLine`,`activeBar`,`activeDot`,`activeLabel`,`activeShape`,`allowEscapeViewBox`,`background`,`cursor`,`dot`,`label`,`line`,`margin`,`padding`,`position`,`shape`,`style`,`tick`,`wrapperStyle`,`radius`,`throttledEvents`]);function vL(e,t){return e==null&&t==null?!0:typeof e==`number`&&typeof t==`number`?e===t||e!==e&&t!==t:e===t}function yL(e,t){for(var n of new Set([...Object.keys(e),...Object.keys(t)]))if(_L.has(n)){if(e[n]==null&&t[n]==null)continue;if(!uL(e[n],t[n]))return!1}else if(!vL(e[n],t[n]))return!1;return!0}var bL=[`contextPayload`];function xL(){return xL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xL.apply(null,arguments)}function SL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function CL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?SL(Object(n),!0).forEach(function(t){wL(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SL(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function wL(e,t,n){return(t=TL(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function TL(e){var t=EL(e,`string`);return typeof t==`symbol`?t:t+``}function EL(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function DL(e,t){if(e==null)return{};var n,r,i=OL(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function OL(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function kL(e){return e.value}function Vee(e){var{contextPayload:t}=e,n=DL(e,bL),r=PA(t,e.payloadUniqBy,kL),i=CL(CL({},n),{},{payload:r});return f.isValidElement(e.content)?f.cloneElement(e.content,i):typeof e.content==`function`?f.createElement(e.content,i):f.createElement(iA,i)}function Hee(e,t,n,r,i,a){var{layout:o,align:s,verticalAlign:c}=t,l,u;return(!e||(e.left===void 0||e.left===null)&&(e.right===void 0||e.right===null))&&(l=s===`center`&&o===`vertical`?{left:((r||0)-a.width)/2}:s===`right`?{right:n&&n.right||0}:{left:n&&n.left||0}),(!e||(e.top===void 0||e.top===null)&&(e.bottom===void 0||e.bottom===null))&&(u=c===`middle`?{top:((i||0)-a.height)/2}:c===`bottom`?{bottom:n&&n.bottom||0}:{top:n&&n.top||0}),CL(CL({},l),u)}function Uee(e){var t=BA();return(0,f.useEffect)(()=>{t(XI(e))},[t,e]),null}function Wee(e){var t=BA();return(0,f.useEffect)(()=>(t(YI(e)),()=>{t(YI({width:0,height:0}))}),[t,e]),null}function Gee(e,t,n,r){return e===`vertical`&&t!=null?{height:t}
41:e===`horizontal`?{width:n||r}:null}var Kee={align:`center`,iconSize:14,inactiveColor:`#ccc`,itemSorter:`value`,layout:`horizontal`,verticalAlign:`bottom`};function qee(e){var t=Kk(e,Kee),n=gj(),r=TD(),i=GF(),{width:a,height:o,wrapperStyle:s,portal:c}=t,[l,u]=vj([n]),d=UF(),p=WF();if(d==null||p==null)return null;var m=d-(i?.left||0)-(i?.right||0),h=Gee(t.layout,o,a,m),g=c?s:CL(CL({position:`absolute`,width:h?.width||a||`auto`,height:h?.height||o||`auto`},Hee(s,t,i,d,p,l)),s),_=c??r;return _==null||n==null?null:(0,fs.createPortal)(f.createElement(`div`,{className:`recharts-legend-wrapper`,style:g,ref:u},f.createElement(Uee,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!c&&f.createElement(Wee,{width:l.width,height:l.height}),f.createElement(Vee,xL({},t,h,{margin:i,chartWidth:d,chartHeight:p,contextPayload:n}))),_)}var AL=f.memo(qee,yL);AL.displayName=`Legend`;function jL(){return jL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jL.apply(null,arguments)}function ML(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function NL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ML(Object(n),!0).forEach(function(t){Jee(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ML(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Jee(e,t,n){return(t=Yee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yee(e){var t=Xee(e,`string`);return typeof t==`symbol`?t:t+``}function Xee(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Zee(e){return Array.isArray(e)&&dk(e[0])&&dk(e[1])?e.join(` ~ `):e}var PL={separator:` : `,contentStyle:{margin:0,padding:10,backgroundColor:`#fff`,border:`1px solid #ccc`,whiteSpace:`nowrap`},itemStyle:{display:`block`,paddingTop:4,paddingBottom:4,color:`#000`},labelStyle:{},accessibilityLayer:!1};function Qee(e,t){return t==null?e:(0,fj.default)(e,t)}var $ee=e=>{var{separator:t=PL.separator,contentStyle:n,itemStyle:r,labelStyle:i=PL.labelStyle,payload:a,formatter:o,itemSorter:s,wrapperClassName:c,labelClassName:l,label:u,labelFormatter:d,accessibilityLayer:p=PL.accessibilityLayer}=e,m=()=>{if(a&&a.length){var e={padding:0,margin:0},n=Qee(a,s).map((e,n)=>{if(!e||e.type===`none`)return null;var i=e.formatter||o||Zee,{value:s,name:c}=e,l=s,u=c;if(i){var d=i(s,c,e,n,a);if(Array.isArray(d))[l,u]=d;else if(d!=null)l=d;else return null}var p=NL(NL({},PL.itemStyle),{},{color:e.color||PL.itemStyle.color},r);return f.createElement(`li`,{className:`recharts-tooltip-item`,key:`tooltip-item-${n}`,style:p},dk(u)?f.createElement(`span`,{className:`recharts-tooltip-item-name`},u):null,dk(u)?f.createElement(`span`,{className:`recharts-tooltip-item-separator`},t):null,f.createElement(`span`,{className:`recharts-tooltip-item-value`},l),f.createElement(`span`,{className:`recharts-tooltip-item-unit`},e.unit||``))});return f.createElement(`ul`,{className:`recharts-tooltip-item-list`,style:e},n)}return null},h=NL(NL({},PL.contentStyle),n),g=NL({margin:0},i),_=!vk(u),v=_?u:``,y=zc(`recharts-default-tooltip`,c),b=zc(`recharts-tooltip-label`,l);_&&d&&a!=null&&(v=d(u,a));var x=p?{role:`status`,"aria-live":`assertive`}:{};return f.createElement(`div`,jL({className:y,style:h},x),f.createElement(`p`,{className:b,style:g},f.isValidElement(v)?v:`${v}`),m())},FL=`recharts-tooltip-wrapper`,ete={visibility:`hidden`};function tte(e){var{coordinate:t,translateX:n,translateY:r}=e;return zc(FL,{[`${FL}-right`]:uk(n)&&t&&uk(t.x)&&n>=t.x,[`${FL}-left`]:uk(n)&&t&&uk(t.x)&&n<t.x,[`${FL}-bottom`]:uk(r)&&t&&uk(t.y)&&r>=t.y,[`${FL}-top`]:uk(r)&&t&&uk(t.y)&&r<t.y})}function IL(e){var{allowEscapeViewBox:t,coordinate:n,key:r,offset:i,position:a,reverseDirection:o,tooltipDimension:s,viewBox:c,viewBoxDimension:l}=e;if(a&&uk(a[r]))return a[r];var u=n[r]-s-(i>0?i:0),d=n[r]+i;if(t[r])return o[r]?u:d;var f=c[r];return f==null?0:o[r]?Math.max(u<f?d:u,f):l==null?0:d+s>f+l?Math.max(u,f):Math.max(d,f)}function nte(e){var{translateX:t,translateY:n,useTranslate3d:r}=e;return{transform:r?`translate3d(${t}px, ${n}px, 0)`:`translate(${t}px, ${n}px)`}}function rte(e){var{allowEscapeViewBox:t,coordinate:n,offsetTop:r,offsetLeft:i,position:a,reverseDirection:o,tooltipBox:s,useTranslate3d:c,viewBox:l}=e,u,d,f;return s.height>0&&s.width>0&&n?(d=IL({allowEscapeViewBox:t,coordinate:n,key:`x`,offset:i,position:a,reverseDirection:o,tooltipDimension:s.width,viewBox:l,viewBoxDimension:l.width}),f=IL({allowEscapeViewBox:t,coordinate:n,key:`y`,offset:r,position:a,reverseDirection:o,tooltipDimension:s.height,viewBox:l,viewBoxDimension:l.height}),u=nte({translateX:d,translateY:f,useTranslate3d:c}
41)):u=ete,{cssProperties:u,cssClasses:tte({translateX:d,translateY:f,coordinate:n})}}var LL={devToolsEnabled:!0,isSsr:!(typeof window<`u`&&window.document&&window.document.createElement&&window.setTimeout)};function RL(){var[e,t]=(0,f.useState)(()=>LL.isSsr||!window.matchMedia?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches);return(0,f.useEffect)(()=>{if(window.matchMedia){var e=window.matchMedia(`(prefers-reduced-motion: reduce)`),n=()=>{t(e.matches)};return e.addEventListener(`change`,n),()=>{e.removeEventListener(`change`,n)}}},[]),e}function zL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function BL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?zL(Object(n),!0).forEach(function(t){ite(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zL(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ite(e,t,n){return(t=ate(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ate(e){var t=ote(e,`string`);return typeof t==`symbol`?t:t+``}function ote(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function ste(e){if(!(e.prefersReducedMotion&&e.isAnimationActive===`auto`)&&e.isAnimationActive&&e.active)return`transform ${e.animationDuration}ms ${e.animationEasing}`}function cte(e){var t=RL(),[n,r]=f.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}));f.useEffect(()=>{var t=t=>{t.key===`Escape`&&r({dismissed:!0,dismissedAtCoordinate:{x:e.coordinate?.x??0,y:e.coordinate?.y??0}})};return document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`keydown`,t)}},[e.coordinate?.x,e.coordinate?.y]),n.dismissed&&((e.coordinate?.x??0)!==n.dismissedAtCoordinate.x||(e.coordinate?.y??0)!==n.dismissedAtCoordinate.y)&&r(BL(BL({},n),{},{dismissed:!1}));var{cssClasses:i,cssProperties:a}=rte({allowEscapeViewBox:e.allowEscapeViewBox,coordinate:e.coordinate,offsetLeft:typeof e.offset==`number`?e.offset:e.offset.x,offsetTop:typeof e.offset==`number`?e.offset:e.offset.y,position:e.position,reverseDirection:e.reverseDirection,tooltipBox:{height:e.lastBoundingBox.height,width:e.lastBoundingBox.width},useTranslate3d:e.useTranslate3d,viewBox:e.viewBox}),o=BL(BL({},e.hasPortalFromProps?{}:BL(BL({transition:ste({prefersReducedMotion:t,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},a),{},{pointerEvents:`none`,position:`absolute`,top:0,left:0})),{},{visibility:!n.dismissed&&e.active&&e.hasPayload?`visible`:`hidden`},e.wrapperStyle);return f.createElement(`div`,{xmlns:`http://www.w3.org/1999/xhtml`,tabIndex:-1,className:i,style:o,ref:e.innerRef},e.children)}var lte=f.memo(cte),VL=()=>WA(e=>e.rootProps.accessibilityLayer)??!0;function HL(){return HL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},HL.apply(null,arguments)}function UL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function WL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?UL(Object(n),!0).forEach(function(t){ute(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):UL(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ute(e,t,n){return(t=dte(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dte(e){var t=fte(e,`string`);return typeof t==`symbol`?t:t+``}function fte(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var GL={curveBasisClosed:xO,curveBasisOpen:CO,curveBasis:yO,curveBumpX:YD,curveBumpY:XD,curveLinearClosed:TO,curveLinear:UD,curveMonotoneX:NO,curveMonotoneY:PO,curveNatural:LO,curveStep:zO,curveStepAfter:VO,curveStepBefore:BO},KL=e=>_P(e.x)&&_P(e.y),qL=e=>e.base!=null&&KL(e.base)&&KL(e),JL=e=>e.x,YL=e=>e.y,pte=(e,t)=>
41{if(typeof e==`function`)return e;var n=`curve${yk(e)}`;if((n===`curveMonotone`||n===`curveBump`)&&t){var r=GL[`${n}${t===`vertical`?`Y`:`X`}`];if(r)return r}return GL[n]||UD},XL={connectNulls:!1,type:`linear`},mte=e=>{var{type:t=XL.type,points:n=[],baseLine:r,layout:i,connectNulls:a=XL.connectNulls}=e,o=pte(t,i),s=a?n.filter(KL):n;if(Array.isArray(r)){var c,l=n.map((e,t)=>WL(WL({},e),{},{base:r[t]}));return c=i===`vertical`?qD().y(YL).x1(JL).x0(e=>e.base.x):qD().x(JL).y1(YL).y0(e=>e.base.y),c.defined(qL).curve(o)(a?l.filter(qL):l)}return(i===`vertical`&&uk(r)?qD().y(YL).x1(JL).x0(r):uk(r)?qD().x(JL).y1(YL).y0(r):KD().x(JL).y(YL)).defined(KL).curve(o)(s)},ZL=e=>{var{className:t,points:n,path:r,pathRef:i}=e,a=qF();if((!n||!n.length)&&!r)return null;var o={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||a,connectNulls:e.connectNulls},s=n&&n.length?mte(o):r;return f.createElement(`path`,HL({},uD(e),Rk(e),{className:zc(`recharts-curve`,t),d:s===null?void 0:s,ref:i}))},hte=[`x`,`y`,`top`,`left`,`width`,`height`,`className`];function QL(){return QL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},QL.apply(null,arguments)}function $L(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function gte(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?$L(Object(n),!0).forEach(function(t){_te(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$L(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _te(e,t,n){return(t=vte(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vte(e){var t=yte(e,`string`);return typeof t==`symbol`?t:t+``}function yte(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function bte(e,t){if(e==null)return{};var n,r,i=xte(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function xte(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Ste=(e,t,n,r,i,a)=>`M${e},${i}v${r}M${a},${t}h${n}`,Cte=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:a=0,height:o=0,className:s}=e,c=bte(e,hte),l=gte({x:t,y:n,top:r,left:i,width:a,height:o},c);return!uk(t)||!uk(n)||!uk(a)||!uk(o)||!uk(r)||!uk(i)?null:f.createElement(`path`,QL({},fD(l),{className:zc(`recharts-cross`,s),d:Ste(t,n,a,o,r,i)}))};function wte(e,t,n,r){var i=r/2;return{stroke:`none`,fill:`#ccc`,x:e===`horizontal`?t.x-i:n.left+.5,y:e===`horizontal`?n.top+.5:t.y-i,width:e===`horizontal`?r:n.width-1,height:e===`horizontal`?n.height-1:r}}function eR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function tR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?eR(Object(n),!0).forEach(function(t){Tte(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Tte(e,t,n){return(t=Ete(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ete(e){var t=Dte(e,`string`);return typeof t==`symbol`?t:t+``}function Dte(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var Ote=e=>e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`),nR=(e,t,n)=>e.map(e=>`${Ote(e)} ${t}ms ${n}`).join(`,`),kte=(e,t)=>
41[Object.keys(e),Object.keys(t)].reduce((e,t)=>e.filter(e=>t.includes(e))),rR=(e,t)=>Object.keys(t).reduce((n,r)=>tR(tR({},n),{},{[r]:e(r,t[r])}),{});function iR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function aR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?iR(Object(n),!0).forEach(function(t){Ate(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ate(e,t,n){return(t=jte(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jte(e){var t=Mte(e,`string`);return typeof t==`symbol`?t:t+``}function Mte(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var oR=(e,t,n)=>e+(t-e)*n,sR=e=>{var{from:t,to:n}=e;return t!==n},cR=(e,t,n)=>{var r=rR((t,n)=>{if(sR(n)){var[r,i]=e(n.from,n.to,n.velocity);return aR(aR({},n),{},{from:r,velocity:i})}return n},t);return n<1?rR((e,t)=>sR(t)&&r[e]!=null?aR(aR({},t),{},{velocity:oR(t.velocity,r[e].velocity,n),from:oR(t.from,r[e].from,n)}):t,t):cR(e,r,n-1)};function Nte(e,t,n,r,i,a){var o,s=r.reduce((n,r)=>aR(aR({},n),{},{[r]:{from:e[r],velocity:0,to:t[r]}}),{}),c=()=>rR((e,t)=>t.from,s),l=()=>!Object.values(s).filter(sR).length,u=null,d=r=>{o||=r;var f=(r-o)/n.dt;s=cR(n,s,f),i(aR(aR(aR({},e),t),c())),o=r,l()||(u=a.setTimeout(d))};return()=>(u=a.setTimeout(d),()=>{var e;(e=u)==null||e()})}function Pte(e,t,n,r,i,a,o){var s=null,c=i.reduce((n,r)=>{var i=e[r],a=t[r];return i==null||a==null?n:aR(aR({},n),{},{[r]:[i,a]})},{}),l,u=i=>{l||=i;var d=(i-l)/r,f=rR((e,t)=>oR(...t,n(d)),c);if(a(aR(aR(aR({},e),t),f)),d<1)s=o.setTimeout(u);else{var p=rR((e,t)=>oR(...t,n(1)),c);a(aR(aR(aR({},e),t),p))}};return()=>(s=o.setTimeout(u),()=>{var e;(e=s)==null||e()})}var Fte=(e,t,n,r,i,a)=>{var o=kte(e,t);return n==null?()=>(i(aR(aR({},e),t)),()=>{}):n.isStepper===!0?Nte(e,t,n,o,i,a):Pte(e,t,n,r,o,i,a)},lR=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],uR=(e,t)=>e.map((e,n)=>e*t**n).reduce((e,t)=>e+t),dR=(e,t)=>n=>uR(lR(e,t),n),Ite=(e,t)=>n=>uR([...lR(e,t).map((e,t)=>e*t).slice(1),0],n),Lte=e=>{var t,n=e.split(`(`);if(n.length!==2||n[0]!==`cubic-bezier`)return null;var r=(t=n[1])==null||(t=t.split(`)`)[0])==null?void 0:t.split(`,`);if(r==null||r.length!==4)return null;var i=r.map(e=>parseFloat(e));return[i[0],i[1],i[2],i[3]]},Rte=function(){var e=[...arguments];if(e.length===1)switch(e[0]){case`linear`:return[0,0,1,1];case`ease`:return[.25,.1,.25,1];case`ease-in`:return[.42,0,1,1];case`ease-out`:return[.42,0,.58,1];case`ease-in-out`:return[0,0,.58,1];default:var t=Lte(e[0]);if(t)return t}return e.length===4?e:[0,0,1,1]},zte=(e,t,n,r)=>{var i=dR(e,n),a=dR(t,r),o=Ite(e,n),s=e=>e>1?1:e<0?0:e,c=e=>{for(var t=e>1?1:e,n=t,r=0;r<8;++r){var c=i(n)-t,l=o(n);if(Math.abs(c-t)<1e-4||l<1e-4)return a(n);n=s(n-c/l)}return a(n)};return c.isStepper=!1,c},fR=function(){return zte(...Rte(...arguments))},Bte=function(){var{stiff:e=100,damping:t=8,dt:n=17}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=(r,i,a)=>{var o=a+(-(r-i)*e-a*t)*n/1e3,s=a*n/1e3+r;return Math.abs(s-i)<1e-4&&Math.abs(o)<1e-4?[i,0]:[s,o]};return r.isStepper=!0,r.dt=n,r},Vte=e=>{if(typeof e==`string`)switch(e){case`ease`:case`ease-in-out`:case`ease-out`:case`ease-in`:case`linear`:return fR(e);case`spring`:return Bte();default:if(e.split(`(`)[0]===`cubic-bezier`)return fR(e)}return typeof e==`function`?e:null};function Hte(e){var t,n=()=>null,r=!1,i=null,a=o=>{if(!r){if(Array.isArray(o)){if(!o.length)return;var[s,...c]=o;if(typeof s==`number`){i=e.setTimeout(a.bind(null,c),s);return}a(s),i=e.setTimeout(a.bind(null,c));return}typeof o==`string`&&(t=o,n(t)),typeof o==`object`&&(t=o,n(t)),typeof o==`function`&&o()}};return{stop:()=>{r=!0},start:e=>{r=!1,i&&=(i(),null),a(e)},subscribe:e=>(n=e,()=>{n=()=>null}),getTimeoutController:()=>e}}
41var Ute=class{setTimeout(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=performance.now(),r=null,i=a=>{a-n>=t?e(a):typeof requestAnimationFrame==`function`&&(r=requestAnimationFrame(i))};return r=requestAnimationFrame(i),()=>{r!=null&&cancelAnimationFrame(r)}}};function Wte(){return Hte(new Ute)}var Gte=(0,f.createContext)(Wte);function Kte(e,t){var n=(0,f.useContext)(Gte);return(0,f.useMemo)(()=>t??n(e),[e,t,n])}var qte={begin:0,duration:1e3,easing:`ease`,isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},pR={t:0},mR={t:1};function hR(e){var t=Kk(e,qte),{isActive:n,canBegin:r,duration:i,easing:a,begin:o,onAnimationEnd:s,onAnimationStart:c,children:l}=t,u=RL(),d=n===`auto`?!LL.isSsr&&!u:n,p=Kte(t.animationId,t.animationManager),[m,h]=(0,f.useState)(d?pR:mR),g=(0,f.useRef)(null);return(0,f.useEffect)(()=>{d||h(mR)},[d]),(0,f.useEffect)(()=>{if(!d||!r)return xk;var e=Fte(pR,mR,Vte(a),i,h,p.getTimeoutController());return p.start([c,o,()=>{g.current=e()},i,s]),()=>{p.stop(),g.current&&g.current(),s()}},[d,r,i,a,o,c,s,p]),l(m.t)}function gR(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`animation-`,n=(0,f.useRef)(pk(t)),r=(0,f.useRef)(e);return r.current!==e&&(n.current=pk(t),r.current=e),n.current}var Jte=[`radius`],Yte=[`radius`],Xte,Zte,Qte,$te,ene,tne,nne,_R,vR,yR;function bR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function xR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?bR(Object(n),!0).forEach(function(t){SR(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function SR(e,t,n){return(t=CR(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function CR(e){var t=wR(e,`string`);return typeof t==`symbol`?t:t+``}function wR(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function TR(){return TR=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},TR.apply(null,arguments)}function ER(e,t){if(e==null)return{};var n,r,i=DR(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function DR(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function OR(e,t){return t||=e.slice(0),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var kR=(e,t,n,r,i)=>{var a=ik(n),o=ik(r),s=Math.min(Math.abs(a)/2,Math.abs(o)/2),c=o>=0?1:-1,l=a>=0?1:-1,u=+(o>=0&&a>=0||o<0&&a<0),d;if(s>0&&Array.isArray(i)){for(var f=[0,0,0,0],p=0,m=4;p<m;p++){var h=i[p]??0;f[p]=h>s?s:h}d=ak(Xte||=OR([`M`,`,`,``]),e,t+c*f[0]),f[0]>0&&(d+=ak(Zte||=OR([`A `,`,`,`,0,0,`,`,`,`,`,``]),f[0],f[0],u,e+l*f[0],t)),d+=ak(Qte||=OR([`L `,`,`,``]),e+n-l*f[1],t),f[1]>0&&(d+=ak($te||=OR([`A `,`,`,`,0,0,`,`, 42 `,`,`,``]),f[1],f[1],u,e+n,t+c*f[1])),d+=ak(ene||=OR([`L `,`,`,``]),e+n,t+r-c*f[2]),f[2]>0&&(d+=ak(tne||=OR([`A `,`,`,`,0,0,`,`, 43 `,`,`,``]),f[2],f[2],u,e+n-l*f[2],t+r)),d+=ak(nne||=OR([`L `,`,`,``]),e+l*f[3],t+r),f[3]>0&&(d+=ak(_R||=OR([`A `,`,`,`,0,0,`,`, 44 `,`,`,``]),f[3],f[3],u,e,t+r-c*f[3])),d+=`Z`}else if(s>0&&i===+i&&i>0){var g=Math.min(s,i);d=ak(vR||=OR(`M .,. 45 A .,.,0,0,.,.,. 46 L .,. 47 A .,.,0,0,.,.,. 48 L .,. 49 A .,.,0,0,.,.,. 50 L .,. 51 A .,.,0,0,.,.,. Z`.split(`.`)),e,t+c*g,g,g,u,e+l*g,t,e+n-l*g,t,g,g,u,e+n,t+c*g,e+n,t+r-c*g,g,g,u,e+n-l*g,t+r,e+l*g,t+r,g,g,u,e,t+r-c*g)}else d=ak(yR||=OR([`M `,`,`,` h `,` v `,` h `,` Z`]),e,t,n,r,-n);return d},AR={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:`ease`},jR=e=>{var t=Kk(e,AR),n=(0,f.useRef)(null),[r,i]=(0,f.useState)(-1);(0,f.useEffect)(()=>
51{if(n.current&&n.current.getTotalLength)try{var e=n.current.getTotalLength();e&&i(e)}catch{}},[]);var{x:a,y:o,width:s,height:c,radius:l,className:u}=t,{animationEasing:d,animationDuration:p,animationBegin:m,isAnimationActive:h,isUpdateAnimationActive:g}=t,_=(0,f.useRef)(s),v=(0,f.useRef)(c),y=(0,f.useRef)(a),b=(0,f.useRef)(o),x=gR((0,f.useMemo)(()=>({x:a,y:o,width:s,height:c,radius:l}),[a,o,s,c,l]),`rectangle-`);if(a!==+a||o!==+o||s!==+s||c!==+c||s===0||c===0)return null;var S=zc(`recharts-rectangle`,u);if(!g){var C=fD(t),{radius:w}=C,T=ER(C,Jte);return f.createElement(`path`,TR({},T,{x:ik(a),y:ik(o),width:ik(s),height:ik(c),radius:typeof l==`number`?l:void 0,className:S,d:kR(a,o,s,c,l)}))}var E=_.current,D=v.current,O=y.current,k=b.current,A=`0px ${r===-1?1:r}px`,j=`${r}px ${r}px`,M=nR([`strokeDasharray`],p,typeof d==`string`?d:AR.animationEasing);return f.createElement(hR,{animationId:x,key:x,canBegin:r>0,duration:p,easing:d,isActive:g,begin:m},e=>{var r=gk(E,s,e),i=gk(D,c,e),u=gk(O,a,e),d=gk(k,o,e);n.current&&(_.current=r,v.current=i,y.current=u,b.current=d);var p=h?e>0?{transition:M,strokeDasharray:j}:{strokeDasharray:A}:{strokeDasharray:j},m=fD(t),{radius:g}=m,x=ER(m,Yte);return f.createElement(`path`,TR({},x,{radius:typeof l==`number`?l:void 0,className:S,d:kR(u,d,r,i,l),ref:n,style:xR(xR({},p),t.style)}
51))})};function MR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function NR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?MR(Object(n),!0).forEach(function(t){PR(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function PR(e,t,n){return(t=FR(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function FR(e){var t=IR(e,`string`);return typeof t==`symbol`?t:t+``}function IR(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var LR=Math.PI/180,RR=e=>e*180/Math.PI,zR=(e,t,n,r)=>({x:e+Math.cos(-LR*r)*n,y:t+Math.sin(-LR*r)*n}),BR=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0,width:0,height:0,brushBottom:0};return Math.min(Math.abs(e-(n.left||0)-(n.right||0)),Math.abs(t-(n.top||0)-(n.bottom||0)))/2},VR=(e,t)=>{var{x:n,y:r}=e,{x:i,y:a}=t;return Math.sqrt((n-i)**2+(r-a)**2)},HR=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:a}=t,o=VR({x:n,y:r},{x:i,y:a});if(o<=0)return{radius:o,angle:0};var s=(n-i)/o,c=Math.acos(s);return r>a&&(c=2*Math.PI-c),{radius:o,angle:RR(c),angleInRadian:c}},UR=e=>{var{startAngle:t,endAngle:n}=e,r=Math.floor(t/360),i=Math.floor(n/360),a=Math.min(r,i);return{startAngle:t-a*360,endAngle:n-a*360}},WR=(e,t)=>{var{startAngle:n,endAngle:r}=t,i=Math.floor(n/360),a=Math.floor(r/360);return e+Math.min(i,a)*360},GR=(e,t)=>{var{relativeX:n,relativeY:r}=e,{radius:i,angle:a}=HR({x:n,y:r},t),{innerRadius:o,outerRadius:s}=t;if(i<o||i>s||i===0)return null;var{startAngle:c,endAngle:l}=UR(t),u=a,d;if(c<=l){for(;u>l;)u-=360;for(;u<c;)u+=360;d=u>=c&&u<=l}else{for(;u>c;)u-=360;for(;u<l;)u+=360;d=u>=l&&u<=c}return d?NR(NR({},t),{},{radius:i,angle:WR(u,t)}):null};function KR(e){var{cx:t,cy:n,radius:r,startAngle:i,endAngle:a}=e;return{points:[zR(t,n,r,i),zR(t,n,r,a)],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}var qR,JR,YR,XR,ZR,QR,$R;function ez(){return ez=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ez.apply(null,arguments)}function tz(e,t){return t||=e.slice(0),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var nz=(e,t)=>sk(t-e)*Math.min(Math.abs(t-e),359.999),rz=e=>{var{cx:t,cy:n,radius:r,angle:i,sign:a,isExternal:o,cornerRadius:s,cornerIsExternal:c}=e,l=s*(o?1:-1)+r,u=Math.asin(s/l)/LR,d=c?i:i+a*u,f=zR(t,n,l,d),p=zR(t,n,r,d),m=c?i-a*u:i;return{center:f,circleTangency:p,lineTangency:zR(t,n,l*Math.cos(u*LR),m),theta:u}},iz=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:a,endAngle:o}=e,s=nz(a,o),c=a+s,l=zR(t,n,i,a),u=zR(t,n,i,c),d=ak(qR||=tz([`M `,`,`,` 52 A `,`,`,`,0, 53 `,`,`,`, 54 `,`,`,` 55 `]),l.x,l.y,i,i,+(Math.abs(s)>180),+(a>c),u.x,u.y);if(r>0){var f=zR(t,n,r,a),p=zR(t,n,r,c);d+=ak(JR||=tz([`L `,`,`,` 56 A `,`,`,`,0, 57 `,`,`,`, 58 `,`,`,` Z`]),p.x,p.y,r,r,+(Math.abs(s)>180),+(a<=c),f.x,f.y)}else d+=ak(YR||=tz([`L `,`,`,` Z`]),t,n);return d},az=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,cornerRadius:a,forceCornerRadius:o,cornerIsExternal:s,startAngle:c,endAngle:l}=e,u=sk(l-c),{circleTangency:d,lineTangency:f,theta:p}=rz({cx:t,cy:n,radius:i,angle:c,sign:u,cornerRadius:a,cornerIsExternal:s}),{circleTangency:m,lineTangency:h,theta:g}=rz({cx:t,cy:n,radius:i,angle:l,sign:-u,cornerRadius:a,cornerIsExternal:s}),_=s?Math.abs(c-l):Math.abs(c-l)-p-g;if(_<0)return o?ak(XR||=tz([`M `,`,`,` 59 a`,`,`,`,0,0,1,`,`,0 60 a`,`,`,`,0,0,1,`,`,0 61 `]),f.x,f.y,a,a,a*2,a,a,-a*2):iz({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:c,endAngle:l});var v=ak(ZR||=tz([`M `,`,`,` 62 A`,`,`,`,0,0,`,`,`,`,`,` 63 A`,`,`,`,0,`,`,`,`,`,`,`,` 64 A`,`,`,`,0,0,`,`,`,`,`,` 65 `]),f.x,f.y,a,a,+(u<0),d.x,d.y,i,i,+(_>180),+(u<0),m.x,m.y,a,a,+(u<0),h.x,h.y);if(r>0){var{circleTangency:y,lineTangency:b,theta:x}=rz({cx:t,cy:n,radius:r,angle:c,sign:u,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),{circleTangency:S,lineTangency:C,theta:w}=rz({cx:t,cy:n,radius:r,angle:l,sign:-u,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),T=s?Math.abs(c-l):Math.abs(c-l)-x-w;if(T<0&&a===0)return`${v}L${t},${n}Z`;v+=ak(QR||=tz([`L`,`,`,` 66 A`,`,`,`,0,0,`,`,`,`,`,` 67 A`,`,`,`,0,`,`,`,`,`,`,`,` 68 A`,`,`,`,0,0,`,`,`,`,`,`Z`]),C.x,C.y,a,a,+(u<0),S.x,S.y,r,r,+(T>180),+(u>0),y.x,y.y,a,a,+(u<0),b.x,b.y)}else v+=ak($R||=tz([`L`,`,`,`Z`]),t,n);return v},oz={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},sz=e=>{var t=Kk(e,oz),{cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:o,forceCornerRadius:s,cornerIsExternal:c,startAngle:l,endAngle:u,className:d}=t;if(a<i||l===u)return null;var p=zc(`recharts-sector`,d),m=a-i,h=mk(o,m,0,!0),g=h>0&&Math.abs(l-u)<360?az({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(h,m/2),forceCornerRadius:s,cornerIsExternal:c,startAngle:l,endAngle:u}):iz({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:l,endAngle:u});return f.createElement(`path`,ez({},fD(t),{className:p,d:g}))};function cz(e,t,n){if(e===`horizontal`)return[{x:t.x,y:n.top},{x:t.x,y:n.top+n.height}];if(e===`vertical`)return[{x:n.left,y:t.y},{x:n.left+n.width,y:t.y}];if(Lk(t)){if(e===`centric`){var{cx:r,cy:i,innerRadius:a,outerRadius:o,angle:s}=t,c=zR(r,i,a,s),l=zR(r,i,o,s);return[{x:c.x,y:c.y},{x:l.x,y:l.y}]}return KR(t)}}var lz=n((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=oj();function n(e){return t.isSymbol(e)?NaN:Number(e)}e.toNumber=n})),uz=n((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=lz();function n(e){return e?(e=t.toNumber(e),e===1/0||e===-1/0?(e<0?-1:1)*Number.MAX_VALUE:e===e?e:0):e===0?e:0}e.toFinite=n})),dz=n((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=uj(),n=uz();function r(e,r,i){i&&typeof i!=`number`&&t.isIterateeCall(e,r,i)&&(r=i=void 0),e=n.toFinite(e),r===void 0?(r=e,e=0):r=n.toFinite(r),i=i===void 0?e<r?1:-1:n.toFinite(i);let a=Math.max(Math.ceil((r-e)/(i||1)),0),o=Array(a);for(let t=0;t<a;t++)o[t]=e,e+=i;return o}e.range=r})),fz=n(((e,t)=>{t.exports=dz().range})),pz=e=>e.chartData,mz=$([pz],e=>{var t=e.chartData==null?0:e.chartData.length-1;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),hz=(e,t,n,r)=>r?mz(e):pz(e),gz=$([hz],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t==null?[]:t.slice(n,r+1)});$([mz],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t==null?[]:t.slice(n,r+1)});var _z=$([pz],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t==null?[]:t.slice(n,r+1)});function vz(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(_P(t)&&_P(n))return!0}return!1}function yz(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function bz(e,t){if(t&&typeof e!=`function`&&Array.isArray(e)&&e.length===2){var[n,r]=e,i,a;if(_P(n))i=n;else if(typeof n==`function`)return;if(_P(r))a=r;else if(typeof r==`function`)return;var o=[i,a];if(vz(o))return o}}function xz(e,t,n){if(!(!n&&t==null)){if(typeof e==`function`&&t!=null)try{var r=e(t,n);if(vz(r))return yz(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var[i,a]=e,o,s;if(i===`auto`)t!=null&&(o=Math.min(...t));else if(uk(i))o=i;else if(typeof i==`function`)try{t!=null&&(o=i(t?.[0]))}catch{}else if(typeof i==`string`&&FP.test(i)){var c=FP.exec(i);if(c==null||c[1]==null||t==null)o=void 0;else{var l=+c[1];o=t[0]-l}}else o=t?.[0];if(a===`auto`)t!=null&&(s=Math.max(...t));else if(uk(a))s=a;else if(typeof a==`function`)try{t!=null&&(s=a(t?.[1]))}catch{}else if(typeof a==`string`&&IP.test(a)){var u=IP.exec(a);if(u==null||u[1]==null||t==null)s=void 0;else{var d=+u[1];s=t[1]+d}}else s=t?.[1];var f=[o,s];if(vz(f))return t==null?f:yz(f,t,n)}}}var Sz=t(n(((e,t)=>
68{(function(e){var n=1e9,r={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:`2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286`},i=!0,a=`[DecimalError] `,o=a+`Invalid argument: `,s=a+`Exponent out of range: `,c=Math.floor,l=Math.pow,u=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,d,f=1e7,p=7,m=9007199254740991,h=c(m/p),g={};g.absoluteValue=g.abs=function(){var e=new this.constructor(this);return e.s&&=1,e},g.comparedTo=g.cmp=function(e){var t,n,r,i,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(r=a.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1},g.decimalPlaces=g.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*p;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n},g.dividedBy=g.div=function(e){return b(this,new this.constructor(e))},g.dividedToIntegerBy=g.idiv=function(e){var t=this,n=t.constructor;return D(b(t,new n(e),0,1),n.precision)},g.equals=g.eq=function(e){return!this.cmp(e)},g.exponent=function(){return S(this)},g.greaterThan=g.gt=function(e){return this.cmp(e)>0},g.greaterThanOrEqualTo=g.gte=function(e){return this.cmp(e)>=0},g.isInteger=g.isint=function(){return this.e>this.d.length-2},g.isNegative=g.isneg=function(){return this.s<0},g.isPositive=g.ispos=function(){return this.s>0},g.isZero=function(){return this.s===0},g.lessThan=g.lt=function(e){return this.cmp(e)<0},g.lessThanOrEqualTo=g.lte=function(e){return this.cmp(e)<1},g.logarithm=g.log=function(e){var t,n=this,r=n.constructor,o=r.precision,s=o+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(d))throw Error(a+`NaN`);if(n.s<1)throw Error(a+(n.s?`NaN`:`-Infinity`));return n.eq(d)?new r(0):(i=!1,t=b(T(n,s),T(e,s),s),i=!0,D(t,o))},g.minus=g.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?O(t,e):_(t,(e.s=-e.s,e))},g.modulo=g.mod=function(e){var t,n=this,r=n.constructor,o=r.precision;if(e=new r(e),!e.s)throw Error(a+`NaN`);return n.s?(i=!1,t=b(n,e,0,1).times(e),i=!0,n.minus(t)):D(new r(n),o)},g.naturalExponential=g.exp=function(){return x(this)},g.naturalLogarithm=g.ln=function(){return T(this)},g.negated=g.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e},g.plus=g.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?_(t,e):O(t,(e.s=-e.s,e))},g.precision=g.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(o+e);if(t=S(i)+1,r=i.d.length-1,n=r*p+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n},g.squareRoot=g.sqrt=function(){var e,t,n,r,o,s,l,u=this,d=u.constructor;if(u.s<1){if(!u.s)return new d(0);throw Error(a+`NaN`)}for(e=S(u),i=!1,o=Math.sqrt(+u),o==0||o==1/0?(t=y(u.d),(t.length+e)%2==0&&(t+=`0`),o=Math.sqrt(t),e=c((e+1)/2)-(e<0||e%2),o==1/0?t=`5e`+e:(t=o.toExponential(),t=t.slice(0,t.indexOf(`e`)+1)+e),r=new d(t)):r=new d(o.toString()),n=d.precision,o=l=n+3;;)if(s=r,r=s.plus(b(u,s,l+2)).times(.5),y(s.d).slice(0,l)===(t=y(r.d)).slice(0,l)){if(t=t.slice(l-3,l+1),o==l&&t==`4999`){if(D(s,n+1,0),s.times(s).eq(u)){r=s;break}}else if(t!=`9999`)break;l+=4}return i=!0,D(r,n)},g.times=g.mul=function(e){var t,n,r,a,o,s,c,l,u,d=this,p=d.constructor,m=d.d,h=(e=new p(e)).d;if(!d.s||!e.s)return new p(0);for(e.s*=d.s,n=d.e+e.e,l=m.length,u=h.length,l<u&&(o=m,m=h,h=o,s=l,l=u,u=s),o=[],s=l+u,r=s;r--;)o.push(0);for(r=u;--r>=0;){for(t=0,a=l+r;a>r;)c=o[a]+h[r]*m[a-r-1]+t,o[a--]=c%f|0,t=c/f|0;o[a]=(o[a]+t)%f|0}for(;!o[--s];)o.pop();return t?++n:o.shift(),e.d=o,e.e=n,i?D(e,p.precision):e},g.toDecimalPlaces=g.todp=function(e,t){var r=this,i=r.constructor;return r=new i(r),e===void 0?r:(v(e,0,n),t===void 0?t=i.rounding:v(t,0,8),D(r,e+S(r)+1,t))},g.toExponential=function(e,t){var r,i=this,a=i.constructor;return e===void 0?r=k(i,!0):(v(e,0,n),t===void 0?t=a.rounding:v(t,0,8),i=D(new a(i),e+1,t),r=k(i,!0,e+1)),r},g.toFixed=function(e,t){var r,i,a=this,o=a.constructor;return e===void 0?k(a):(v(e,0,n),t===void 0?t=o.rounding:v(t,0,8),i=D(new o(a),e+S(a)+1,t),r=k(i.abs(),!1,e+S(i)+1),a.isneg()&&!a.isZero()?`-`+r:r)},g.toInteger=g.toint=function(){var e=this,t=e.constructor;return D(new t(e),S(e)+1,t.rounding)},g.toNumber=function(){return+this},g.toPower=g.pow=function(e){var t,n,r,o,s,l,u=this,f=u.constructor,h=12,g=+(e=new f(e));if(!e.s)return new f(d);if(u=new f(u),!u.s){if(e.s<1)throw Error(a+`Infinity`);return u}if(u.eq(d))return u;if(r=f.precision,e.eq(d))return D(u,r);if(t=e.e,n=e.d.length-1,l=t>=n,s=u.s,!l){if(s<0)throw Error(a+`NaN`)}else if((n=g<0?-g:g)<=m){for(o=new f(d),t=Math.ceil(r/p+4),i=!1;n%2&&(o=o.times(u),A(o.d,t)),n=c(n/2),n!==0;)u=u.times(u),A(u.d,t);return i=!0,e.s<0?new f(d).div(o):D(o,r)}return s=s<0&&e.d[Math.max(t,n)]&1?-1:1,u.s=1,i=!1,o=e.times(T(u,r+h)),i=!0,o=x(o),o.s=s,o},g.toPrecision=function(e,t){var r,i,a=this,o=a.constructor;return e===void 0?(r=S(a),i=k(a,r<=o.toExpNeg||r>=o.toExpPos)):(v(e,1,n),t===void 0?t=o.rounding:v(t,0,8),a=D(new o(a),e,t),r=S(a),i=k(a,e<=r||r<=o.toExpNeg,e)),i},g.toSignificantDigits=g.tosd=function(e,t){var r=this,i=r.constructor;return e===void 0?(e=i.precision,t=i.rounding):(v(e,1,n),t===void 0?t=i.rounding:v(t,0,8)),D(new i(r),e,t)},g.toString=g.valueOf=g.val=g.toJSON=function(){var e=this,t=S(e),n=e.constructor;return k(e,t<=n.toExpNeg||t>=n.toExpPos)};function _(e,t){var n,r,a,o,s,c,l,u,d=e.constructor,m=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),i?D(t,m):t;if(l=e.d,u=t.d,s=e.e,a=t.e,l=l.slice(),o=s-a,o){for(o<0?(r=l,o=-o,c=u.length):(r=u,a=s,c=l.length),s=Math.ceil(m/p),c=s>c?s+1:c+1,o>c&&(o=c,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(c=l.length,o=u.length,c-o<0&&(o=c,r=u,u=l,l=r),n=0;o;
68)n=(l[--o]=l[o]+u[o]+n)/f|0,l[o]%=f;for(n&&(l.unshift(n),++a),c=l.length;l[--c]==0;)l.pop();return t.d=l,t.e=a,i?D(t,m):t}function v(e,t,n){if(e!==~~e||e<t||e>n)throw Error(o+e)}function y(e){var t,n,r,i=e.length-1,a=``,o=e[0];if(i>0){for(a+=o,t=1;t<i;t++)r=e[t]+``,n=p-r.length,n&&(a+=w(n)),a+=r;o=e[t],r=o+``,n=p-r.length,n&&(a+=w(n))}else if(o===0)return`0`;for(;o%10==0;)o/=10;return a+o}var b=(function(){function e(e,t){var n,r=0,i=e.length;for(e=e.slice();i--;)n=e[i]*t+r,e[i]=n%f|0,r=n/f|0;return r&&e.unshift(r),e}function t(e,t,n,r){var i,a;if(n!=r)a=n>r?1:-1;else for(i=a=0;i<n;i++)if(e[i]!=t[i]){a=e[i]>t[i]?1:-1;break}return a}function n(e,t,n){for(var r=0;n--;)e[n]-=r,r=+(e[n]<t[n]),e[n]=r*f+e[n]-t[n];for(;!e[0]&&e.length>1;)e.shift()}return function(r,i,o,s){var c,l,u,d,m,h,g,_,v,y,b,x,C,w,T,E,O,k,A=r.constructor,j=r.s==i.s?1:-1,M=r.d,N=i.d;if(!r.s)return new A(r);if(!i.s)throw Error(a+`Division by zero`);for(l=r.e-i.e,O=N.length,T=M.length,g=new A(j),_=g.d=[],u=0;N[u]==(M[u]||0);)++u;if(N[u]>(M[u]||0)&&--l,x=o==null?o=A.precision:s?o+(S(r)-S(i))+1:o,x<0)return new A(0);if(x=x/p+2|0,u=0,O==1)for(d=0,N=N[0],x++;(u<T||d)&&x--;u++)C=d*f+(M[u]||0),_[u]=C/N|0,d=C%N|0;else{for(d=f/(N[0]+1)|0,d>1&&(N=e(N,d),M=e(M,d),O=N.length,T=M.length),w=O,v=M.slice(0,O),y=v.length;y<O;)v[y++]=0;k=N.slice(),k.unshift(0),E=N[0],N[1]>=f/2&&++E;do d=0,c=t(N,v,O,y),c<0?(b=v[0],O!=y&&(b=b*f+(v[1]||0)),d=b/E|0,d>1?(d>=f&&(d=f-1),m=e(N,d),h=m.length,y=v.length,c=t(m,v,h,y),c==1&&(d--,n(m,O<h?k:N,h))):(d==0&&(c=d=1),m=N.slice()),h=m.length,h<y&&m.unshift(0),n(v,m,y),c==-1&&(y=v.length,c=t(N,v,O,y),c<1&&(d++,n(v,O<y?k:N,y))),y=v.length):c===0&&(d++,v=[0]),_[u++]=d,c&&v[0]?v[y++]=M[w]||0:(v=[M[w]],y=1);while((w++<T||v[0]!==void 0)&&x--)}return _[0]||_.shift(),g.e=l,D(g,s?o+S(g)+1:o)}})();function x(e,t){var n,r,a,o,c,u,f=0,p=0,m=e.constructor,h=m.precision;if(S(e)>16)throw Error(s+S(e));if(!e.s)return new m(d);for(t==null?(i=!1,u=h):u=t,c=new m(.03125);e.abs().gte(.1);)e=e.times(c),p+=5;for(r=Math.log(l(2,p))/Math.LN10*2+5|0,u+=r,n=a=o=new m(d),m.precision=u;;){if(a=D(a.times(e),u),n=n.times(++f),c=o.plus(b(a,n,u)),y(c.d).slice(0,u)===y(o.d).slice(0,u)){for(;p--;)o=D(o.times(o),u);return m.precision=h,t==null?(i=!0,D(o,h)):o}o=c}}function S(e){for(var t=e.e*p,n=e.d[0];n>=10;n/=10)t++;return t}function C(e,t,n){if(t>e.LN10.sd())throw i=!0,n&&(e.precision=n),Error(a+`LN10 precision limit exceeded`);return D(new e(e.LN10),t)}function w(e){for(var t=``;e--;)t+=`0`;return t}function T(e,t){var n,r,o,s,c,l,u,f,p,m=1,h=10,g=e,_=g.d,v=g.constructor,x=v.precision;if(g.s<1)throw Error(a+(g.s?`NaN`:`-Infinity`));if(g.eq(d))return new v(0);if(t==null?(i=!1,f=x):f=t,g.eq(10))return t??(i=!0),C(v,f);if(f+=h,v.precision=f,n=y(_),r=n.charAt(0),s=S(g),Math.abs(s)<0x5543df729c000){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)g=g.times(e),n=y(g.d),r=n.charAt(0),m++;s=S(g),r>1?(g=new v(`0.`+n),s++):g=new v(r+`.`+n.slice(1))}else return u=C(v,f+2,x).times(s+``),g=T(new v(r+`.`+n.slice(1)),f-h).plus(u),v.precision=x,t==null?(i=!0,D(g,x)):g;for(l=c=g=b(g.minus(d),g.plus(d),f),p=D(g.times(g),f),o=3;;){if(c=D(c.times(p),f),u=l.plus(b(c,new v(o),f)),y(u.d).slice(0,f)===y(l.d).slice(0,f))return l=l.times(2),s!==0&&(l=l.plus(C(v,f+2,x).times(s+``))),l=b(l,new v(m),f),v.precision=x,t==null?(i=!0,D(l,x)):l;l=u,o+=2}}function E(e,t){var n,r,a;for((n=t.indexOf(`.`))>-1&&(t=t.replace(`.`,``)),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(r,a),t){if(a-=r,n=n-r-1,e.e=c(n/p),e.d=[],r=(n+1)%p,n<0&&(r+=p),r<a){for(r&&e.d.push(+t.slice(0,r)),a-=p;r<a;)e.d.push(+t.slice(r,r+=p));t=t.slice(r),r=p-t.length}else r-=a;for(;r--;)t+=`0`;if(e.d.push(+t),i&&(e.e>h||e.e<-h))throw Error(s+n)}else e.s=0,e.e=0,e.d=[0];return e}function D(e,t,n){var r,a,o,u,d,m,g,_,v=e.d;for(u=1,o=v[0];o>=10;o/=10)u++;if(r=t-u,r<0)r+=p,a=t,g=v[_=0];else{if(_=Math.ceil((r+1)/p),o=v.length,_>=o)return e;for(g=o=v[_],u=1;o>=10;o/=10)u++;r%=p,a=r-p+u}if(n!==void 0&&(o=l(10,u-a-1),d=g/o%10|0,m=t<0||v[_+1]!==void 0||g%o,m=n<4?(d||m)&&(n==0||n==(e.s<0?3:2)):d>5||d==5&&(n==4||m||n==6&&(r>0?a>0?g/l(10,u-a):0:v[_-1])%10&1||n==(e.s<0?8:7))),t<1||!v[0])return m?(o=S(e),v.length=1,t=t-o-1,v[0]=l(10,(p-t%p)%p),e.e=c(-t/p)||0):(v.length=1,v[0]=e.e=e.s=0),e;if(r==0?(v.length=_,o=1,_--):(v.length=_+1,o=l(10,p-r),v[_]=a>0?(g/l(10,u-a)%l(10,a)|0)*o:0),m)for(;;)if(_==0){(v[0]+=o)==f&&(v[0]=1,++e.e);break}else{if(v[_]+=o,v[_]!=f)break;v[_--]=0,o=1}for(r=v.length;v[--r]===0;)v.pop();if(i&&(e.e>h||e.e<-h))throw Error(s+S(e));return e}function O(e,t){var n,r,a,o,s,c,l,u,d,m,h=e.constructor,g=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),i?D(t,g):t;if(l=e.d,m=t.d,r=t.e,u=e.e,l=l.slice(),s=u-r,s){for(d=s<0,d?(n=l,s=-s,c=m.length):(n=m,r=u,c=l.length),a=Math.max(Math.ceil(g/p),c)+2,s>a&&(s=a,n.length=1),n.reverse(),a=s;a--;)n.push(0);n.reverse()}else{for(a=l.length,c=m.length,d=a<c,d&&(c=a),a=0;a<c;a++)if(l[a]!=m[a]){d=l[a]<m[a];break}s=0}for(d&&(n=l,l=m,m=n,t.s=-t.s),c=l.length,a=m.length-c;a>
680;--a)l[c++]=0;for(a=m.length;a>s;){if(l[--a]<m[a]){for(o=a;o&&l[--o]===0;)l[o]=f-1;--l[o],l[a]+=f}l[a]-=m[a]}for(;l[--c]===0;)l.pop();for(;l[0]===0;l.shift())--r;return l[0]?(t.d=l,t.e=r,i?D(t,g):t):new h(0)}function k(e,t,n){var r,i=S(e),a=y(e.d),o=a.length;return t?(n&&(r=n-o)>0?a=a.charAt(0)+`.`+a.slice(1)+w(r):o>1&&(a=a.charAt(0)+`.`+a.slice(1)),a=a+(i<0?`e`:`e+`)+i):i<0?(a=`0.`+w(-i-1)+a,n&&(r=n-o)>0&&(a+=w(r))):i>=o?(a+=w(i+1-o),n&&(r=n-i-1)>0&&(a=a+`.`+w(r))):((r=i+1)<o&&(a=a.slice(0,r)+`.`+a.slice(r)),n&&(r=n-o)>0&&(i+1===o&&(a+=`.`),a+=w(r))),e.s<0?`-`+a:a}function A(e,t){if(e.length>t)return e.length=t,!0}function j(e){var t,n,r;function i(e){var t=this;if(!(t instanceof i))return new i(e);if(t.constructor=i,e instanceof i){t.s=e.s,t.e=e.e,t.d=(e=e.d)?e.slice():e;return}if(typeof e==`number`){if(e*0!=0)throw Error(o+e);if(e>0)t.s=1;else if(e<0)e=-e,t.s=-1;else{t.s=0,t.e=0,t.d=[0];return}if(e===~~e&&e<1e7){t.e=0,t.d=[e];return}return E(t,e.toString())}else if(typeof e!=`string`)throw Error(o+e);if(e.charCodeAt(0)===45?(e=e.slice(1),t.s=-1):t.s=1,u.test(e))E(t,e);else throw Error(o+e)}if(i.prototype=g,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=j,i.config=i.set=M,e===void 0&&(e={}),e)for(r=[`precision`,`rounding`,`toExpNeg`,`toExpPos`,`LN10`],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return i.config(e),i}function M(e){if(!e||typeof e!=`object`)throw Error(a+`Object expected`);var t,r,i,s=[`precision`,1,n,`rounding`,0,8,`toExpNeg`,-1/0,0,`toExpPos`,0,1/0];for(t=0;t<s.length;t+=3)if((i=e[r=s[t]])!==void 0)if(c(i)===i&&i>=s[t+1]&&i<=s[t+2])this[r]=i;else throw Error(o+r+`: `+i);if((i=e[r=`LN10`])!==void 0)if(i==Math.LN10)this[r]=new this(i);else throw Error(o+r+`: `+i);return this}r=j(r),r.default=r.Decimal=r,d=new r(1),typeof define==`function`&&define.amd?define(function(){return r}):t!==void 0&&t.exports?t.exports=r:(e||=typeof self<`u`&&self&&self.self==self?self:Function(`return this`)(),e.Decimal=r)})(e)}))());function Cz(e){return e===0?1:Math.floor(new Sz.default(e).abs().log(10).toNumber())+1}function wz(e,t,n){for(var r=new Sz.default(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var Tz=e=>{var[t,n]=e,[r,i]=[t,n];return t>n&&([r,i]=[n,t]),[r,i]},Ez=(e,t,n)=>{if(e.lte(0))return new Sz.default(0);var r=Cz(e.toNumber()),i=new Sz.default(10).pow(r),a=e.div(i),o=r===1?.1:.05,s=new Sz.default(Math.ceil(a.div(o).toNumber())).add(n).mul(o).mul(i);return t?new Sz.default(s.toNumber()):new Sz.default(Math.ceil(s.toNumber()))},Dz=(e,t,n)=>{if(e.lte(0))return new Sz.default(0);var r=[1,2,2.5,5],i=e.toNumber(),a=Math.floor(new Sz.default(i).abs().log(10).toNumber()),o=new Sz.default(10).pow(a),s=e.div(o).toNumber(),c=r.findIndex(e=>e>=s-1e-10);if(c===-1&&(o=o.mul(10),c=0),c+=n,c>=r.length){var l=Math.floor(c/r.length);c%=r.length,o=o.mul(new Sz.default(10).pow(l))}var u=new Sz.default(r[c]??1).mul(o);return t?u:new Sz.default(Math.ceil(u.toNumber()))},Oz=(e,t,n)=>{var r=new Sz.default(1),i=new Sz.default(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new Sz.default(10).pow(Cz(e)-1),i=new Sz.default(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new Sz.default(Math.floor(e)))}else e===0?i=new Sz.default(Math.floor((t-1)/2)):n||(i=new Sz.default(Math.floor(e)));for(var o=Math.floor((t-1)/2),s=[],c=0;c<t;c++)s.push(i.add(new Sz.default(c-o).mul(r)).toNumber());return s},kz=function(e,t,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:Ez;if(!Number.isFinite((t-e)/(n-1)))return{step:new Sz.default(0),tickMin:new Sz.default(0),tickMax:new Sz.default(0)};var o=a(new Sz.default(t).sub(e).div(n-1),r,i),s;e<=0&&t>=0?s=new Sz.default(0):(s=new Sz.default(e).add(t).div(2),s=s.sub(new Sz.default(s).mod(o)));var c=Math.ceil(s.sub(e).div(o).toNumber()),l=Math.ceil(new Sz.default(t).sub(s).div(o).toNumber()),u=c+l+1;return u>n?kz(e,t,n,r,i+1,a):(u<n&&(l=t>0?l+(n-u):l,c=t>0?c:c+(n-u)),{step:o,tickMin:s.sub(new Sz.default(c).mul(o)),tickMax:s.add(new Sz.default(l).mul(o))})},Az=function(e){var[t,n]=e,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:`auto`,o=Math.max(r,2),[s,c]=Tz([t,n]);if(s===-1/0||c===1/0){var l=c===1/0?[s,...Array(r-1).fill(1/0)]:[...Array(r-1).fill(-1/0),c];return t>n?l.reverse():l}if(s===c)return Oz(s,r,i);var{step:u,tickMin:d,tickMax:f}=kz(s,c,o,i,0,a===`snap125`?Dz:Ez),p=wz(d,f.add(new Sz.default(.1).mul(u)),u);return t>n?p.reverse():p},jz=function(e,t){var[n,r]=e,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:`auto`,[o,s]=Tz([n,r]);if(o===-1/0||s===1/0)return[n,r];if(o===s)return[o];var c=a===`snap125`?Dz:Ez,l=Math.max(t,2),u=c(new Sz.default(s).sub(o).div(l-1),i,0
68),d=[...wz(new Sz.default(o),new Sz.default(s),u),s];return i===!1&&(d=d.map(e=>Math.round(e))),n>r?d.reverse():d},Mz=e=>e.rootProps.barCategoryGap,Nz=e=>e.rootProps.stackOffset,Pz=e=>e.rootProps.reverseStackOrder,Fz=e=>e.options.chartName,Iz=e=>e.rootProps.syncId,Lz=e=>e.rootProps.syncMethod,Rz=e=>e.options.eventEmitter,zz={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},Bz={allowDecimals:!1,allowDuplicatedCategory:!0,allowDataOverflow:!1,angle:0,angleAxisId:0,axisLine:!0,axisLineType:`polygon`,cx:0,cy:0,hide:!1,includeHidden:!1,label:!1,niceTicks:`auto`,orientation:`outer`,reversed:!1,scale:`auto`,tick:!0,tickLine:!0,tickSize:8,type:`auto`,zIndex:zz.axis},Vz={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,angle:0,axisLine:!0,includeHidden:!1,hide:!1,niceTicks:`auto`,label:!1,orientation:`right`,radiusAxisId:0,reversed:!1,scale:`auto`,stroke:`#ccc`,tick:!0,tickCount:5,tickLine:!0,type:`auto`,zIndex:zz.axis},Hz=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function Uz(e,t,n){if(n!==`auto`)return n;if(e!=null)return EP(e,t)?`category`:`number`}function Wz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Gz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Wz(Object(n),!0).forEach(function(t){Kz(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wz(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Kz(e,t,n){return(t=qz(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qz(e){var t=Jz(e,`string`);return typeof t==`symbol`?t:t+``}function Jz(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var Yz={allowDataOverflow:Bz.allowDataOverflow,allowDecimals:Bz.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:Bz.angleAxisId,includeHidden:!1,name:void 0,reversed:Bz.reversed,scale:Bz.scale,tick:Bz.tick,tickCount:void 0,ticks:void 0,type:Bz.type,unit:void 0,niceTicks:`auto`},Xz={allowDataOverflow:Vz.allowDataOverflow,allowDecimals:Vz.allowDecimals,allowDuplicatedCategory:Vz.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:Vz.radiusAxisId,includeHidden:Vz.includeHidden,name:void 0,reversed:Vz.reversed,scale:Vz.scale,tick:Vz.tick,tickCount:Vz.tickCount,ticks:void 0,type:Vz.type,unit:void 0,niceTicks:`auto`},Zz=$([(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},YF],(e,t)=>{if(e!=null)return e;var n=Uz(t,`angleAxis`,Yz.type)??`category`;return Gz(Gz({},Yz),{},{type:n})}),Qz=$([(e,t)=>e.polarAxis.radiusAxis[t],YF],(e,t)=>{if(e!=null)return e;var n=Uz(t,`radiusAxis`,Xz.type)??`category`;return Gz(Gz({},Xz),{},{type:n})}),$z=e=>e.polarOptions,eB=$([HP,UP,aF],BR),tB=$([$z,eB],(e,t)=>{if(e!=null)return mk(e.innerRadius,t,0)}),nB=$([$z,eB],(e,t)=>{if(e!=null)return mk(e.outerRadius,t,t*.8)}),rB=$([$z],e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]});$([Zz,rB],Hz);var iB=$([eB,tB,nB],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});$([Qz,iB],Hz);var aB=$([KF,$z,tB,nB,HP,UP],(e,t,n,r,i,a)=>{if(!(e!==`centric`&&e!==`radial`||t==null||n==null||r==null)){var{cx:o,cy:s,startAngle:c,endAngle:l}=t;return{cx:mk(o,i,i/2),cy:mk(s,a,a/2),innerRadius:n,outerRadius:r,startAngle:c,endAngle:l,clockWise:!1}}}),oB=(e,t)=>t,sB=(e,t,n)=>n;function cB(e){return e?.id}function lB(e,t,n){var{chartData:r=[]}=t,{allowDuplicatedCategory:i,dataKey:a}=n,o=new Map;return e.forEach(e=>{var t=e.data??r;if(!(t==null||t.length===0)){var n=cB(e);t.forEach((t,r)=>{var s=a==null||i?r:String(wP(t,a,null)),c=wP(t,e.dataKey,0),l=o.has(s)?o.get(s):{};Object.assign(l,{[n]:c}),o.set(s,l)})}}),Array.from(o.values())}function uB(e){return`stackId`in e&&e.stackId!=null&&e.dataKey!=null}var dB=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function fB(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function pB(e,t){if(e.length===t.length){for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return!1}var mB=e=>{var t=KF(e);return t===`horizontal`?`xAxis`:t===`vertical`?`yAxis`:t===`centric`?`angleAxis`:`radiu
68sAxis`},hB=e=>e.tooltip.settings.axisId;function gB(e){if(e!=null){var t=e.ticks,n=e.bandwidth,r=e.range(),i=[Math.min(...r),Math.max(...r)];return{domain:()=>e.domain(),range:function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(e){var t=i[0],n=i[1];return t<=n?e>=t&&e<=n:e>=n&&e<=t},bandwidth:n?()=>n.call(e):void 0,ticks:t?n=>t.call(e,n):void 0,map:(t,n)=>{var r=e(t);if(r!=null){if(e.bandwidth&&n!=null&&n.position){var i=e.bandwidth();switch(n.position){case`middle`:r+=i/2;break;case`end`:r+=i;break;default:break}}return r}}}}}var _B=(e,t)=>{if(t!=null)switch(e){case`linear`:if(!vz(t)){for(var n,r,i=0;i<t.length;i++){var a=t[i];_P(a)&&((n===void 0||a<n)&&(n=a),(r===void 0||a>r)&&(r=a))}return n!==void 0&&r!==void 0?[n,r]:void 0}return t;default:return t}};function vB(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function yB(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function bB(e){let t,n,r;e.length===2?(t=e===vB||e===yB?e:xB,n=e,r=e):(t=vB,n=(t,n)=>vB(e(t),n),r=(t,n)=>e(t)-n);function i(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<0?i=t+1:a=t}while(i<a)}return i}function a(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<=0?i=t+1:a=t}while(i<a)}return i}function o(e,t,n=0,a=e.length){let o=i(e,t,n,a-1);return o>n&&r(e[o-1],t)>-r(e[o],t)?o-1:o}return{left:i,center:o,right:a}}function xB(){return 0}function SB(e){return e===null?NaN:+e}function*CB(e,t){if(t===void 0)for(let t of e)t!=null&&(t=+t)>=t&&(yield t);else{let n=-1;for(let r of e)(r=t(r,++n,e))!=null&&(r=+r)>=r&&(yield r)}}var wB=bB(vB),TB=wB.right;wB.left,bB(SB).center;var EB=class extends Map{constructor(e,t=AB){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),e!=null)for(let[t,n]of e)this.set(t,n)}get(e){return super.get(DB(this,e))}has(e){return super.has(DB(this,e))}set(e,t){return super.set(OB(this,e),t)}delete(e){return super.delete(kB(this,e))}};function DB({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):n}function OB({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function kB({_intern:e,_key:t},n){let r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function AB(e){return typeof e==`object`&&e?e.valueOf():e}function jB(e=vB){if(e===vB)return MB;if(typeof e!=`function`)throw TypeError(`compare is not a function`);return(t,n)=>{let r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function MB(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:+(e>t))}var NB=Math.sqrt(50),PB=Math.sqrt(10),FB=Math.sqrt(2);function IB(e,t,n){let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/10**i,o=a>=NB?10:a>=PB?5:a>=FB?2:1,s,c,l;return i<0?(l=10**-i/o,s=Math.round(e*l),c=Math.round(t*l),s/l<e&&++s,c/l>t&&--c,l=-l):(l=10**i*o,s=Math.round(e/l),c=Math.round(t/l),s*l<e&&++s,c*l>t&&--c),c<s&&.5<=n&&n<2?IB(e,t,n*2):[s,c,l]}function LB(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];let r=t<e,[i,a,o]=r?IB(t,e,n):IB(e,t,n);if(!(a>=i))return[];let s=a-i+1,c=Array(s);if(r)if(o<0)for(let e=0;e<s;++e)c[e]=(a-e)/-o;else for(let e=0;e<s;++e)c[e]=(a-e)*o;else if(o<0)for(let e=0;e<s;++e)c[e]=(i+e)/-o;else for(let e=0;e<s;++e)c[e]=(i+e)*o;return c}function RB(e,t,n){return t=+t,e=+e,n=+n,IB(e,t,n)[2]}function zB(e,t,n){t=+t,e=+e,n=+n;let r=t<e,i=r?RB(t,e,n):RB(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function BB(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n<t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function VB(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n>t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function HB(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?MB:jB(i);r>n;){if(r-n>600){let a=r-n+1,o=t-n+1,s=Math.log(a),c=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*c*(a-c)/
68a)*(o-a/2<0?-1:1),u=Math.max(n,Math.floor(t-o*c/a+l)),d=Math.min(r,Math.floor(t+(a-o)*c/a+l));HB(e,t,u,d,i)}let a=e[t],o=n,s=r;for(UB(e,n,t),i(e[r],a)>0&&UB(e,n,r);o<s;){for(UB(e,o,s),++o,--s;i(e[o],a)<0;)++o;for(;i(e[s],a)>0;)--s}i(e[n],a)===0?UB(e,n,s):(++s,UB(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}return e}function UB(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function WB(e,t,n){if(e=Float64Array.from(CB(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return VB(e);if(t>=1)return BB(e);var r,i=(r-1)*t,a=Math.floor(i),o=BB(HB(e,a).subarray(0,a+1));return o+(VB(e.subarray(a+1))-o)*(i-a)}}function GB(e,t,n=SB){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,a=Math.floor(i),o=+n(e[a],a,e);return o+(+n(e[a+1],a+1,e)-o)*(i-a)}}function KB(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=Array(i);++r<i;)a[r]=e+r*n;return a}function qB(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function JB(e,t){switch(arguments.length){case 0:break;case 1:typeof e==`function`?this.interpolator(e):this.range(e);break;default:this.domain(e),typeof t==`function`?this.interpolator(t):this.range(t);break}return this}var YB=Symbol(`implicit`);function XB(){var e=new EB,t=[],n=[],r=YB;function i(i){let a=e.get(i);if(a===void 0){if(r!==YB)return r;e.set(i,a=t.push(i)-1)}return n[a%n.length]}return i.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new EB;for(let r of n)e.has(r)||e.set(r,t.push(r)-1);return i},i.range=function(e){return arguments.length?(n=Array.from(e),i):n.slice()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return XB(t,n).unknown(r)},qB.apply(i,arguments),i}function ZB(){var e=XB().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,s=!1,c=0,l=0,u=.5;delete e.unknown;function d(){var e=t().length,d=i<r,f=d?i:r,p=d?r:i;a=(p-f)/Math.max(1,e-c+l*2),s&&(a=Math.floor(a)),f+=(p-f-a*(e-c))*u,o=a*(1-c),s&&(f=Math.round(f),o=Math.round(o));var m=KB(e).map(function(e){return f+a*e});return n(d?m.reverse():m)}return e.domain=function(e){return arguments.length?(t(e),d()):t()}
68,e.range=function(e){return arguments.length?([r,i]=e,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(e){return[r,i]=e,r=+r,i=+i,s=!0,d()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(e){return arguments.length?(s=!!e,d()):s},e.padding=function(e){return arguments.length?(c=Math.min(1,l=+e),d()):c},e.paddingInner=function(e){return arguments.length?(c=Math.min(1,e),d()):c},e.paddingOuter=function(e){return arguments.length?(l=+e,d()):l},e.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),d()):u},e.copy=function(){return ZB(t(),[r,i]).round(s).paddingInner(c).paddingOuter(l).align(u)},qB.apply(d(),arguments)}function QB(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return QB(t())},e}function $B(){return QB(ZB.apply(null,arguments).paddingInner(1))}function eV(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function tV(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function nV(){}var rV=.7,iV=1/rV,aV=`\\s*([+-]?\\d+)\\s*`,oV=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,sV=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,cV=/^#([0-9a-f]{3,8})$/,lV=RegExp(`^rgb\\(${aV},${aV},${aV}\\)$`),uV=RegExp(`^rgb\\(${sV},${sV},${sV}\\)$`),dV=RegExp(`^rgba\\(${aV},${aV},${aV},${oV}\\)$`),fV=RegExp(`^rgba\\(${sV},${sV},${sV},${oV}\\)$`),pV=RegExp(`^hsl\\(${oV},${sV},${sV}\\)$`),mV=RegExp(`^hsla\\(${oV},${sV},${sV},${oV}\\)$`),hV={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};eV(nV,bV,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:gV,formatHex:gV,formatHex8:_V,formatHsl:vV,formatRgb:yV,toString:yV});function gV(){return this.rgb().formatHex()}function _V(){return this.rgb().formatHex8()}function vV(){return NV(this).formatHsl()}function yV(){return this.rgb().formatRgb()}function bV(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=cV.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?xV(t):n===3?new TV(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?SV(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?SV(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=lV.exec(e))?new TV(t[1],t[2],t[3],1):(t=uV.exec(e))?new TV(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=dV.exec(e))?
68SV(t[1],t[2],t[3],t[4]):(t=fV.exec(e))?SV(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=pV.exec(e))?MV(t[1],t[2]/100,t[3]/100,1):(t=mV.exec(e))?MV(t[1],t[2]/100,t[3]/100,t[4]):hV.hasOwnProperty(e)?xV(hV[e]):e===`transparent`?new TV(NaN,NaN,NaN,0):null}function xV(e){return new TV(e>>16&255,e>>8&255,e&255,1)}function SV(e,t,n,r){return r<=0&&(e=t=n=NaN),new TV(e,t,n,r)}function CV(e){return e instanceof nV||(e=bV(e)),e?(e=e.rgb(),new TV(e.r,e.g,e.b,e.opacity)):new TV}function wV(e,t,n,r){return arguments.length===1?CV(e):new TV(e,t,n,r??1)}function TV(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}eV(TV,wV,tV(nV,{brighter(e){return e=e==null?iV:iV**+e,new TV(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?rV:rV**+e,new TV(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new TV(AV(this.r),AV(this.g),AV(this.b),kV(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:EV,formatHex:EV,formatHex8:DV,formatRgb:OV,toString:OV}));function EV(){return`#${jV(this.r)}${jV(this.g)}${jV(this.b)}`}function DV(){return`#${jV(this.r)}${jV(this.g)}${jV(this.b)}${jV((isNaN(this.opacity)?1:this.opacity)*255)}`}function OV(){let e=kV(this.opacity);return`${e===1?`rgb(`:`rgba(`}${AV(this.r)}, ${AV(this.g)}, ${AV(this.b)}${e===1?`)`:`, ${e})`}`}function kV(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function AV(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function jV(e){return e=AV(e),(e<16?`0`:``)+e.toString(16)}function MV(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new FV(e,t,n,r)}function NV(e){if(e instanceof FV)return new FV(e.h,e.s,e.l,e.opacity);if(e instanceof nV||(e=bV(e)),!e)return new FV;if(e instanceof FV)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new FV(o,s,c,e.opacity)}function PV(e,t,n,r){return arguments.length===1?NV(e):new FV(e,t,n,r??1)}function FV(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}eV(FV,PV,tV(nV,{brighter(e){return e=e==null?iV:iV**+e,new FV(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?rV:rV**+e,new FV(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new TV(RV(e>=240?e-240:e+120,i,r),RV(e,i,r),RV(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new FV(IV(this.h),LV(this.s),LV(this.l),kV(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=kV(this.opacity);return`${e===1?`hsl(`:`hsla(`}${IV(this.h)}, ${LV(this.s)*100}%, ${LV(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function IV(e){return e=(e||0)%360,e<0?e+360:e}function LV(e){return Math.max(0,Math.min(1,e||0))}function RV(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var zV=e=>()=>e;function BV(e,t){return function(n){return e+n*t}}function VV(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function HV(e){return(e=+e)==1?UV:function(t,n){return n-t?VV(t,n,e):zV(isNaN(t)?n:t)}}function UV(e,t){var n=t-e;return n?BV(e,n):zV(isNaN(e)?t:e)}var WV=(function e(t){var n=HV(t);function r(e,t){var r=n((e=wV(e)).r,(t=wV(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=UV(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function GV(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function KV(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function qV(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o;for(o=0;o<r;++o)i[o]=nH(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function JV(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function YV(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function XV(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=nH(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var ZV=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,QV=new RegExp(ZV.source,`g`);function $V(e){return function(){return e}}function eH(e){return function(t){return e(t)+``}}function tH(e,t){var n=ZV.lastIndex=QV.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=ZV.exec(e))&&(i=QV.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:YV(r,i)})),n=QV.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?eH(c[0].x):$V(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function nH(e,t){var n=typeof t,r;return t==null||n===`boolean`?zV(t):(n===`number`?YV:n===`string`?(r=bV(t))?(t=r,WV):tH:t instanceof bV?WV:t instanceof Date?JV:KV(t)?GV:Array.isArray(t)?qV:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?XV:YV)(e,t)}function rH(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}
68function iH(e,t){t===void 0&&(t=e,e=nH);for(var n=0,r=t.length-1,i=t[0],a=Array(r<0?0:r);n<r;)a[n]=e(i,i=t[++n]);return function(e){var t=Math.max(0,Math.min(r-1,Math.floor(e*=r)));return a[t](e-t)}}function aH(e){return function(){return e}}function oH(e){return+e}var sH=[0,1];function cH(e){return e}function lH(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:aH(isNaN(t)?NaN:.5)}function uH(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}function dH(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=lH(i,r),a=n(o,a)):(r=lH(r,i),a=n(a,o)),function(e){return a(r(e))}}function fH(e,t,n){var r=Math.min(e.length,t.length)-1,i=Array(r),a=Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)i[o]=lH(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(t){var n=TB(e,t,1,r)-1;return a[n](i[n](t))}}function pH(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function mH(){var e=sH,t=sH,n=nH,r,i,a,o=cH,s,c,l;function u(){var n=Math.min(e.length,t.length);return o!==cH&&(o=uH(e[0],e[n-1])),s=n>2?fH:dH,c=l=null,d}function d(i){return i==null||isNaN(i=+i)?a:(c||=s(e.map(r),t,n))(r(o(i)))}return d.invert=function(n){return o(i((l||=s(t,e.map(r),YV))(n)))},d.domain=function(t){return arguments.length?(e=Array.from(t,oH),u()):e.slice()},d.range=function(e){return arguments.length?(t=Array.from(e),u()):t.slice()},d.rangeRound=function(e){return t=Array.from(e),n=rH,u()},d.clamp=function(e){return arguments.length?(o=e?!0:cH,u()):o!==cH},d.interpolate=function(e){return arguments.length?(n=e,u()):n},d.unknown=function(e){return arguments.length?(a=e,d):a},function(e,t){return r=e,i=t,u()}}function hH(){return mH()(cH,cH)}function gH(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString(`en`).replace(/,/g,``):e.toString(10)}function _H(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf(`e`),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function vH(e){return e=_H(Math.abs(e)),e?e[1]:NaN}function yH(e,t){return function(n,r){for(var i=n.length,a=[],o=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(n.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function bH(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}var xH=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function SH(e){if(!(t=xH.exec(e)))throw Error(`invalid format: `+e);var t;return new CH({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}SH.prototype=CH.prototype;function CH(e){this.fill=e.fill===void 0?` `:e.fill+``,this.align=e.align===void 0?`>`:e.align+``,this.sign=e.sign===void 0?`-`:e.sign+``,this.symbol=e.symbol===void 0?``:e.symbol+``,this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?``:e.type+``}CH.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?`0`:``)+(this.width===void 0?``:Math.max(1,this.width|0))+(this.comma?`,`:``)+(this.precision===void 0?``:`.`+Math.max(0,this.precision|0))+(this.trim?`~`:``)+this.type};function wH(e){out:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case`.`:r=i=n;break;case`0`:r===0&&(r=n),i=n;break;default:if(!+e[n])break out;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var TH;function EH(e,t){var n=_H(e,t);if(!n)return TH=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(TH=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+Array(a-o+1).join(`0`):a>0?r.slice(0,a)+`.`+r.slice(a):`0.`+Array(1-a).join(`0`)+_H(e,Math.max(0,t+a-1))[0]}function DH(e,t){var n=_H(e,t);if(!n)return e+``;var r=n[0],i=n[1];return i<0?`0.`+Array(-i).join(`0`)+r:r.length>i+1?r.slice(0,i+1)+`.`+r.slice(i+1):r+Array(i-r.length+2).join(`0`)}var OH={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+``,d:gH,e:(e,t)=>
68e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>DH(e*100,t),r:DH,s:EH,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function kH(e){return e}var AH=Array.prototype.map,jH=[`y`,`z`,`a`,`f`,`p`,`n`,`µ`,`m`,``,`k`,`M`,`G`,`T`,`P`,`E`,`Z`,`Y`];function MH(e){var t=e.grouping===void 0||e.thousands===void 0?kH:yH(AH.call(e.grouping,Number),e.thousands+``),n=e.currency===void 0?``:e.currency[0]+``,r=e.currency===void 0?``:e.currency[1]+``,i=e.decimal===void 0?`.`:e.decimal+``,a=e.numerals===void 0?kH:bH(AH.call(e.numerals,String)),o=e.percent===void 0?`%`:e.percent+``,s=e.minus===void 0?`â`:e.minus+``,c=e.nan===void 0?`NaN`:e.nan+``;function l(e,l){e=SH(e);var u=e.fill,d=e.align,f=e.sign,p=e.symbol,m=e.zero,h=e.width,g=e.comma,_=e.precision,v=e.trim,y=e.type;y===`n`?(g=!0,y=`g`):OH[y]||(_===void 0&&(_=12),v=!0,y=`g`),(m||u===`0`&&d===`=`)&&(m=!0,u=`0`,d=`=`);var b=(l&&l.prefix!==void 0?l.prefix:``)+(p===`$`?n:p===`#`&&/[boxX]/.test(y)?`0`+y.toLowerCase():``),x=(p===`$`?r:/[%p]/.test(y)?o:``)+(l&&l.suffix!==void 0?l.suffix:``),S=OH[y],C=/[defgprs%]/.test(y);_=_===void 0?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function w(e){var n=b,r=x,o,l,p;if(y===`c`)r=S(e)+r,e=``;else{e=+e;var w=e<0||1/e<0;if(e=isNaN(e)?c:S(Math.abs(e),_),v&&(e=wH(e)),w&&+e==0&&f!==`+`&&(w=!1),n=(w?f===`(`?f:s:f===`-`||f===`(`?``:f)+n,r=(y===`s`&&!isNaN(e)&&TH!==void 0?jH[8+TH/3]:``)+r+(w&&f===`(`?`)`:``),C){for(o=-1,l=e.length;++o<l;)if(p=e.charCodeAt(o),48>p||p>57){r=(p===46?i+e.slice(o+1):e.slice(o))+r,e=e.slice(0,o);break}}}g&&!m&&(e=t(e,1/0));var T=n.length+e.length+r.length,E=T<h?Array(h-T+1).join(u):``;switch(g&&m&&(e=t(E+e,E.length?h-r.length:1/0),E=``),d){case`<`:e=n+e+r+E;break;case`=`:e=n+E+e+r;break;case`^`:e=E.slice(0,T=E.length>>1)+n+e+r+E.slice(T);break;default:e=E+n+e+r;break}return a(e)}return w.toString=function(){return e+``},w}function u(e,t){var n=Math.max(-8,Math.min(8,Math.floor(vH(t)/3)))*3,r=10**-n,i=l((e=SH(e),e.type=`f`,e),{suffix:jH[8+n/3]});return function(e){return i(r*e)}}return{format:l,formatPrefix:u}}var NH,PH,FH;IH({thousands:`,`,grouping:[3],currency:[`$`,``]});function IH(e){return NH=MH(e),PH=NH.format,FH=NH.formatPrefix,NH}function LH(e){return Math.max(0,-vH(Math.abs(e)))}function RH(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(vH(t)/3)))*3-vH(Math.abs(e)))}function zH(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,vH(t)-vH(e))+1}function BH(e,t,n,r){var i=zB(e,t,n),a;switch(r=SH(r??`,f`),r.type){case`s`:var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=RH(i,o))&&(r.precision=a),FH(r,o);case``:case`e`:case`g`:case`p`:case`r`:r.precision==null&&!isNaN(a=zH(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type===`e`));break;case`f`:case`%`:r.precision==null&&!isNaN(a=LH(i))&&(r.precision=a-(r.type===`%`)*2);break}return PH(r)}function VH(e){var t=e.domain;return e.ticks=function(e){var n=t();return LB(n[0],n[n.length-1],e??10)},e.tickFormat=function(e,n){var r=t();return BH(r[0],r[r.length-1],e??10,n)},e.nice=function(n){n??=10;var r=t(),i=0,a=r.length-1,o=r[i],s=r[a],c,l,u=10;for(s<o&&(l=o,o=s,s=l,l=i,i=a,a=l);u-- >0;){if(l=RB(o,s,n),l===c)return r[i]=o,r[a]=s,t(r);if(l>0)o=Math.floor(o/l)*l,s=Math.ceil(s/l)*l;else if(l<0)o=Math.ceil(o*l)/l,s=Math.floor(s*l)/l;else break;c=l}return e},e}function HH(){var e=hH();return e.copy=function(){return pH(e,HH())},qB.apply(e,arguments),VH(e)}function UH(e){var t;function n(e){return e==null||isNaN(e=+e)?t:e}return n.invert=n,n.domain=n.range=function(t){return arguments.length?(e=Array.from(t,oH),n):e.slice()},n.unknown=function(e){return arguments.length?(t=e,n):t},n.copy=function(){return UH(e).unknown(t)},e=arguments.length?Array.from(e,oH):[0,1],VH(n)}function WH(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],o;return a<i&&(o=n,n=r,r=o,o=i,i=a,a=o),e[n]=t.floor(i),e[r]=t.ceil(a),e}function GH(e){return Math.log(e)}function KH(e){return Math.exp(e)}function qH(e){return-Math.log(-e)}function JH(e){return-Math.exp(-e)}function YH(e){return isFinite(e)?+(`1e`+e):e<0?0:e}function XH(e){return e===10?YH:e===Math.E?Math.exp:t=>e**+t}function ZH(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function QH(e){return(t,n)=>-e(-t,n)}function $H(e){let t=e(GH,KH),n=t.domain,r=10,i,a;function o(){return i=ZH(r),a=XH(r),n()[0]<0?(i=QH(i),a=QH(a),e(qH,JH)):e(GH,KH),t}return t.base=function(e){return arguments.length?(r=+e,o()):r},t.domain=function(e){return arguments.length?(n(e),o()):n()},t.ticks=e=>{let t=n(),o=t[0],s=t[t.length-1],c=s<o;c&&([o,s]=[s,o]);let l=i(o),u=i(s),d,f,p=e==null?10:+e,m=[];if(!(r%1)&&u-l<p){if(l=Math.floor(l),u=Math.ceil(u),o>0){for(;l<=u;++l)for(d=1;d<r;++d)if(f=l<0?d/a(-l):d*a(l),!(f<o)){if(f>s)break;m.push(f)}}else for(;l<=u;++l)for(d=r-1;d>=1;--d)if(f=l>0?d/a(-l):d*a(l),!(f<o)){if(f>s)break;m.push(f)}m.length*2<p&&(m=LB(o,s,p))}else m=LB(l,u,Math.min(u-l,p)).map(a);return c?m.reverse():m},t.tickFormat=(e,n)=>{if(e??=10,n??=r===10?`s`:`,`,typeof n!=`function`&&(!(r%1)&&(n=SH(n)).precision==null&&(n.trim=!0),n=PH(n)),e===1/0)return n;let o=Math.max(1,r*e/t.ticks().length);return e=>{let t=e/a(Math.round(i(e)));return t*r<r-.5&&(t*=r),t<=o?n(e):``}},t.nice=()=>n(WH(n(),{floor:e=>a(Math.floor(i(e))),ceil:e=>a(Math.ceil(i(e)))})),t}function eU(){let e=$H(mH()).domain([1,10]);return e.copy=()=>pH(e,eU()).base(e.base()),qB.apply(e,arguments),e}
68function tU(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function nU(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function rU(e){var t=1,n=e(tU(t),nU(t));return n.constant=function(n){return arguments.length?e(tU(t=+n),nU(t)):t},VH(n)}function iU(){var e=rU(mH());return e.copy=function(){return pH(e,iU()).constant(e.constant())},qB.apply(e,arguments)}function aU(e){return function(t){return t<0?-((-t)**+e):t**+e}}function oU(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function sU(e){return e<0?-e*e:e*e}function cU(e){var t=e(cH,cH),n=1;function r(){return n===1?e(cH,cH):n===.5?e(oU,sU):e(aU(n),aU(1/n))}return t.exponent=function(e){return arguments.length?(n=+e,r()):n},VH(t)}function lU(){var e=cU(mH());return e.copy=function(){return pH(e,lU()).exponent(e.exponent())},qB.apply(e,arguments),e}function uU(){return lU.apply(null,arguments).exponent(.5)}function dU(e){return Math.sign(e)*e*e}function fU(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function pU(){var e=hH(),t=[0,1],n=!1,r;function i(t){var i=fU(e(t));return isNaN(i)?r:n?Math.round(i):i}return i.invert=function(t){return e.invert(dU(t))},i.domain=function(t){return arguments.length?(e.domain(t),i):e.domain()},i.range=function(n){return arguments.length?(e.range((t=Array.from(n,oH)).map(dU)),i):t.slice()},i.rangeRound=function(e){return i.range(e).round(!0)},i.round=function(e){return arguments.length?(n=!!e,i):n},i.clamp=function(t){return arguments.length?(e.clamp(t),i):e.clamp()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return pU(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},qB.apply(i,arguments),VH(i)}function mU(){var e=[],t=[],n=[],r;function i(){var r=0,i=Math.max(1,t.length);for(n=Array(i-1);++r<i;)n[r-1]=GB(e,r/i);return a}function a(e){return e==null||isNaN(e=+e)?r:t[TB(n,e)]}return a.invertExtent=function(r){var i=t.indexOf(r);return i<0?[NaN,NaN]:[i>0?n[i-1]:e[0],i<n.length?n[i]:e[e.length-1]]},a.domain=function(t){if(!arguments.length)return e.slice();e=[];for(let n of t)n!=null&&!isNaN(n=+n)&&e.push(n);return e.sort(vB),i()},a.range=function(e){return arguments.length?(t=Array.from(e),i()):t.slice()},a.unknown=function(e){return arguments.length?(r=e,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return mU().domain(e).range(t).unknown(r)},qB.apply(a,arguments)}function hU(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function o(e){return e!=null&&e<=e?i[TB(r,e,0,n)]:a}function s(){var i=-1;for(r=Array(n);++i<n;)r[i]=((i+1)*t-(i-n)*e)/(n+1);return o}return o.domain=function(n){return arguments.length?([e,t]=n,e=+e,t=+t,s()):[e,t]},o.range=function(e){return arguments.length?(n=(i=Array.from(e)).length-1,s()):i.slice()},o.invertExtent=function(a){var o=i.indexOf(a);return o<0?[NaN,NaN]:o<1?[e,r[0]]:o>=n?[r[n-1],t]:[r[o-1],r[o]]},o.unknown=function(e){return arguments.length&&(a=e),o},o.thresholds=function(){return r.slice()},o.copy=function(){return hU().domain([e,t]).range(i).unknown(a)},qB.apply(VH(o),arguments)}function gU(){var e=[.5],t=[0,1],n,r=1;function i(i){return i!=null&&i<=i?t[TB(e,i,0,r)]:n}return i.domain=function(n){return arguments.length?(e=Array.from(n),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(n){return arguments.length?(t=Array.from(n),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(n){var r=t.indexOf(n);return[e[r-1],e[r]]},i.unknown=function(e){return arguments.length?(n=e,i):n},i.copy=function(){return gU().domain(e).range(t).unknown(n)},qB.apply(i,arguments)}var _U=new Date,vU=new Date;function yU(e,t,n,r){function i(t){return e(t=arguments.length===0?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{let t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=(e,n)=>(t(e=new Date(+e),n==null?1:Math.floor(n)),e),i.range=(n,r,a)=>{let o=[];if(n=i.ceil(n),a=a==null?1:Math.floor(a),!(n<r)||!(a>0))return o;let s;do o.push(s=new Date(+n)),t(n,a),e(n);while(s<n&&n<r);return o},i.filter=n=>yU(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,r)=>{if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}),n&&(i.count=(t,r)=>(_U.setTime(+t),vU.setTime(+r),e(_U),e(vU),Math.floor(n(_U,vU))),i.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?i.filter(r?t=>r(t)%e===0:t=>i.count(0,t)%e===0):i)),i}var bU=yU(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);bU.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?yU(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):bU),bU.range;var xU=1e3,SU=xU*60,CU=SU*60,wU=CU*24,TU=wU*7,EU=wU*30,DU=wU*365,OU=yU(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*xU)},(e,t)=>(t-e)/xU,e=>e.getUTCSeconds());OU.range;var kU=yU(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*xU)},(e,t)=>{e.setTime(+e+t*SU)},(e,t)=>(t-e)/SU,e=>e.getMinutes());kU.range;var AU=yU(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*SU)},(e,t)=>(t-e)/SU,e=>e.getUTCMinutes());AU.range;var jU=yU(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*xU-e.getMinutes()*SU)},(e,t)=>{e.setTime(+e+t*CU)},(e,t)=>(t-e)/CU,e=>e.getHours());jU.range;var MU=yU(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*CU)},(e,t)=>(t-e)/CU,e=>e.getUTCHours());MU.range;var NU=yU(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*SU)/wU,e=>e.getDate()-1);NU.range;var PU=yU(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/wU,e=>e.getUTCDate()-1);PU.range;var FU=yU(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/wU,e=>Math.floor(e/wU));FU.range;function IU(e){return yU(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+t*7)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*SU)/TU)}var LU=IU(0),RU=IU(1),zU=IU(2),BU=IU(3),VU=IU(4),HU=IU(5),UU=IU(6);LU.range,RU.range,zU.range,BU.range,VU.range,HU.range,UU.range;function WU(e){return yU(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t*7)},(e,t)=>(t-e)/TU)}var GU=WU(0),KU=WU(1),qU=WU(2),JU=WU(3),YU=WU(4),XU=WU(5),ZU=WU(6);GU.range,KU.range,qU.range,JU.range,YU.range,XU.range,ZU.range;var QU=yU(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());QU.range;var $U=yU(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());$U.range;var eW=yU(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());eW.every=e=>
68!isFinite(e=Math.floor(e))||!(e>0)?null:yU(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}),eW.range;var tW=yU(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());tW.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:yU(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}),tW.range;function nW(e,t,n,r,i,a){let o=[[OU,1,xU],[OU,5,5*xU],[OU,15,15*xU],[OU,30,30*xU],[a,1,SU],[a,5,5*SU],[a,15,15*SU],[a,30,30*SU],[i,1,CU],[i,3,3*CU],[i,6,6*CU],[i,12,12*CU],[r,1,wU],[r,2,2*wU],[n,1,TU],[t,1,EU],[t,3,3*EU],[e,1,DU]];function s(e,t,n){let r=t<e;r&&([e,t]=[t,e]);let i=n&&typeof n.range==`function`?n:c(e,t,n),a=i?i.range(e,+t+1):[];return r?a.reverse():a}function c(t,n,r){let i=Math.abs(n-t)/r,a=bB(([,,e])=>e).right(o,i);if(a===o.length)return e.every(zB(t/DU,n/DU,r));if(a===0)return bU.every(Math.max(zB(t,n,r),1));let[s,c]=o[i/o[a-1][2]<o[a][2]/i?a-1:a];return s.every(c)}return[s,c]}var[rW,iW]=nW(tW,$U,GU,FU,MU,AU),[aW,oW]=nW(eW,QU,LU,NU,jU,kU);function sW(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function cW(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function lW(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function uW(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,o=e.shortDays,s=e.months,c=e.shortMonths,l=_W(i),u=vW(i),d=_W(a),f=vW(a),p=_W(o),m=vW(o),h=_W(s),g=vW(s),_=_W(c),v=vW(c),y={a:N,A:ee,b:P,B:F,c:null,d:zW,e:zW,f:WW,g:tG,G:rG,H:BW,I:VW,j:HW,L:UW,m:GW,M:KW,p:I,q:te,Q:EG,s:DG,S:qW,u:JW,U:YW,V:ZW,w:QW,W:$W,x:null,X:null,y:eG,Y:nG,Z:iG,"%":TG},b={a:L,A:ne,b:R,B:z,c:null,d:aG,e:aG,f:uG,g:xG,G:CG,H:oG,I:sG,j:cG,L:lG,m:dG,M:fG,p:B,q:re,Q:EG,s:DG,S:pG,u:mG,U:hG,V:_G,w:vG,W:yG,x:null,X:null,y:bG,Y:SG,Z:wG,"%":TG},x={a:E,A:D,b:O,B:k,c:A,d:kW,e:kW,f:FW,g:TW,G:wW,H:jW,I:jW,j:AW,L:PW,m:OW,M:MW,p:T,q:DW,Q:LW,s:RW,S:NW,u:bW,U:xW,V:SW,w:yW,W:CW,x:j,X:M,y:TW,Y:wW,Z:EW,"%":IW};y.x=S(n,y),y.X=S(r,y),y.c=S(t,y),b.x=S(n,b),b.X=S(r,b),b.c=S(t,b);function S(e,t){return function(n){var r=[],i=-1,a=0,o=e.length,s,c,l;for(n instanceof Date||(n=new Date(+n));++i<o;)e.charCodeAt(i)===37&&(r.push(e.slice(a,i)),(c=dW[s=e.charAt(++i)])==null?c=s===`e`?` `:`0`:s=e.charAt(++i),(l=t[s])&&(s=l(n,c)),r.push(s),a=i+1);return r.push(e.slice(a,i)),r.join(``)}}function C(e,t){return function(n){var r=lW(1900,void 0,1),i=w(r,e,n+=``,0),a,o;if(i!=n.length)return null;if(`Q`in r)return new Date(r.Q);if(`s`in r)return new Date(r.s*1e3+(`L`in r?r.L:0));if(t&&!(`Z`in r)&&(r.Z=0),`p`in r&&(r.H=r.H%12+r.p*12),r.m===void 0&&(r.m=`q`in r?r.q:0),`V`in r){if(r.V<1||r.V>53)return null;`w`in r||(r.w=1),`Z`in r?(a=cW(lW(r.y,0,1)),o=a.getUTCDay(),a=o>4||o===0?KU.ceil(a):KU(a),a=PU.offset(a,(r.V-1)*7),r.y=a.getUTCFullYear(),r.m=a.getUTCMonth(),r.d=a.getUTCDate()+(r.w+6)%7):(a=sW(lW(r.y,0,1)),o=a.getDay(),a=o>4||o===0?RU.ceil(a):RU(a),a=NU.offset(a,(r.V-1)*7),r.y=a.getFullYear(),r.m=a.getMonth(),r.d=a.getDate()+(r.w+6)%7)}else (`W`in r||`U`in r)&&(`w`in r||(r.w=`u`in r?r.u%7:+(`W`in r)),o=`Z`in r?cW(lW(r.y,0,1)).getUTCDay():sW(lW(r.y,0,1)).getDay(),r.m=0,r.d=`W`in r?(r.w+6)%7+r.W*7-(o+5)%7:r.w+r.U*7-(o+6)%7);return`Z`in r?(r.H+=r.Z/100|0,r.M+=r.Z%100,cW(r)):sW(r)}}function w(e,t,n,r){for(var i=0,a=t.length,o=n.length,s,c;i<a;){if(r>=o)return-1;if(s=t.charCodeAt(i++),s===37){if(s=t.charAt(i++),c=x[s in dW?t.charAt(i++):s],!c||(r=c(e,n,r))<0)return-1}else if(s!=n.charCodeAt(r++))return-1}return r}function T(e,t,n){var r=l.exec(t.slice(n));return r?(e.p=u.get(r[0].toLowerCase()),n+r[0].length):-1}function E(e,t,n){var r=p.exec(t.slice(n));return r?(e.w=m.get(r[0].toLowerCase()),n+r[0].length):-1}function D(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=f.get(r[0].toLowerCase()),n+r[0].length):-1}function O(e,t,n){var r=_.exec(t.slice(n));return r?(e.m=v.get(r[0].toLowerCase()),n+r[0].length):-1}
68function k(e,t,n){var r=h.exec(t.slice(n));return r?(e.m=g.get(r[0].toLowerCase()),n+r[0].length):-1}function A(e,n,r){return w(e,t,n,r)}function j(e,t,r){return w(e,n,t,r)}function M(e,t,n){return w(e,r,t,n)}function N(e){return o[e.getDay()]}function ee(e){return a[e.getDay()]}function P(e){return c[e.getMonth()]}function F(e){return s[e.getMonth()]}function I(e){return i[+(e.getHours()>=12)]}function te(e){return 1+~~(e.getMonth()/3)}function L(e){return o[e.getUTCDay()]}function ne(e){return a[e.getUTCDay()]}function R(e){return c[e.getUTCMonth()]}function z(e){return s[e.getUTCMonth()]}function B(e){return i[+(e.getUTCHours()>=12)]}function re(e){return 1+~~(e.getUTCMonth()/3)}return{format:function(e){var t=S(e+=``,y);return t.toString=function(){return e},t},parse:function(e){var t=C(e+=``,!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=S(e+=``,b);return t.toString=function(){return e},t},utcParse:function(e){var t=C(e+=``,!0);return t.toString=function(){return e},t}}}var dW={"-":``,_:` `,0:`0`},fW=/^\s*\d+/,pW=/^%/,mW=/[\\^$*+?|[\]().{}]/g;function hW(e,t,n){var r=e<0?`-`:``,i=(r?-e:e)+``,a=i.length;return r+(a<n?Array(n-a+1).join(t)+i:i)}function gW(e){return e.replace(mW,`\\$&`)}function _W(e){return RegExp(`^(?:`+e.map(gW).join(`|`)+`)`,`i`)}function vW(e){return new Map(e.map((e,t)=>[e.toLowerCase(),t]))}function yW(e,t,n){var r=fW.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function bW(e,t,n){var r=fW.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function xW(e,t,n){var r=fW.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function SW(e,t,n){var r=fW.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function CW(e,t,n){var r=fW.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function wW(e,t,n){var r=fW.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function TW(e,t,n){var r=fW.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function EW(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||`00`)),n+r[0].length):-1}function DW(e,t,n){var r=fW.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function OW(e,t,n){var r=fW.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function kW(e,t,n){var r=fW.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function AW(e,t,n){var r=fW.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function jW(e,t,n){var r=fW.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function MW(e,t,n){var r=fW.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function NW(e,t,n){var r=fW.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function PW(e,t,n){var r=fW.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function FW(e,t,n){var r=fW.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function IW(e,t,n){var r=pW.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function LW(e,t,n){var r=fW.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function RW(e,t,n){var r=fW.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function zW(e,t){return hW(e.getDate(),t,2)}function BW(e,t){return hW(e.getHours(),t,2)}function VW(e,t){return hW(e.getHours()%12||12,t,2)}function HW(e,t){return hW(1+NU.count(eW(e),e),t,3)}function UW(e,t){return hW(e.getMilliseconds(),t,3)}function WW(e,t){return UW(e,t)+`000`}function GW(e,t){return hW(e.getMonth()+1,t,2)}function KW(e,t){return hW(e.getMinutes(),t,2)}function qW(e,t){return hW(e.getSeconds(),t,2)}function JW(e){var t=e.getDay();return t===0?7:t}function YW(e,t){return hW(LU.count(eW(e)-1,e),t,2)}function XW(e){var t=e.getDay();return t>=4||t===0?VU(e):VU.ceil(e)}function ZW(e,t){return e=XW(e),hW(VU.count(eW(e),e)+(eW(e).getDay()===4),t,2)}function QW(e){return e.getDay()}function $W(e,t){return hW(RU.count(eW(e)-1,e),t,2)}function eG(e,t){return hW(e.getFullYear()%100,t,2)}function tG(e,t){return e=XW(e),hW(e.getFullYear()%100,t,2)}function nG(e,t){return hW(e.getFullYear()%1e4,t,4)}function rG(e,t){var n=e.getDay();return e=n>=4||n===0?VU(e):VU.ceil(e),hW(e.getFullYear()%1e4,t,4)}function iG(e){var t=e.getTimezoneOffset();return(t>0?`-`:(t*=-1,`+`))+hW(t/60|0,`0`,2)+hW(t%60,`0`,2)}function aG(e,t){return hW(e.getUTCDate(),t,2)}function oG(e,t){return hW(e.getUTCHours(),t,2)}function sG(e,t){return hW(e.getUTCHours()%12||12,t,2)}function cG(e,t){return hW(1+PU.count(tW(e),e),t,3)}function lG(e,t){return hW(e.getUTCMilliseconds(),t,3)}function uG(e,t){return lG(e,t)+`000`}function dG(e,t){return hW(e.getUTCMonth()+1,t,2)}function fG(e,t){return hW(e.getUTCMinutes(),t,2)}function pG(e,t){return hW(e.getUTCSeconds(),t,2)}function mG(e){var t=e.getUTCDay();return t===0?7:t}function hG(e,t){return hW(GU.count(tW(e)-1,e),t,2)}function gG(e){var t=e.getUTCDay();return t>=4||t===0?YU(e):YU.ceil(e)}function _G(e,t){return e=gG(e),hW(YU.count(tW(e),e)+(tW(e).getUTCDay()===4),t,2)}function vG(e){return e.getUTCDay()}function yG(e,t){return hW(KU.count(tW(e)-1,e),t,2)}function bG(e,t){return hW(e.getUTCFullYear()%100,t,2)}function xG(e,t){return e=gG(e),hW(e.getUTCFullYear()%100,t,2)}function SG(e,t){return hW(e.getUTCFullYear()%1e4,t,4)}function CG(e,t){var n=e.getUTCDay();return e=n>=4||n===0?YU(e):YU.ceil(e),hW(e.getUTCFullYear()%1e4,t,4)}function wG(){return`+0000`}function TG(){return`%`}function EG(e){return+e}function DG(e){return Math.floor(e/1e3)}var OG,kG,AG;jG({dateTime:`%x, %X`,date:`%-m/%-d/%Y`,time:`%-I:%M:%S %p`,periods:[`AM`,`PM`],days:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],shortDays:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],months:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],shortMonths:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`]});function jG(e){return OG=uW(e),kG=OG.format,OG.parse,AG=OG.utcFormat,OG.utcParse,OG}function MG(e){return new Date(e)}function NG(e){return e instanceof Date?+e:+new Date(+e)}function PG(e,t,n,r,i,a,o,s,c,l){var u=hH(),d=u.invert,f=u.domain,p=l(`.%L`),m=l(`:%S`),h=l(`%I:%M`),g=l(`%I %p`),_=l(`%a %d`),v=l(`%b %d`),y=l(`%B`),b=l(`%Y`);function x(e){return(c(e)<e?p:s(e)<e?m:o(e)<e?h:a(e)<e?g:r(e)<e?i(e)<e?_:v:n(e)<e?y:b)(e)}return u.invert=function(e){return new Date(d(e))},u.domain=function(e){return arguments.length?f(Array.from(e,NG)):f().map(MG)},u.ticks=function(t){var n=f();return e(n[0],n[n.length-1],t??10)},u.tickFormat=function(e,t){return t==null?x:l(t)},u.nice=function(e){var n=f();return(!e||typeof e.range!=`function`)&&(e=t(n[0],n[n.length-1],e??10)),e?f(WH(n,e)):u},u.copy=function(){return pH(u,PG(e,t,n,r,i,a,o,s,c,l))},u}function FG(){return qB.apply(PG(aW,oW,eW,QU,LU,NU,jU,kU,OU,kG).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function IG(){return qB.apply(PG(rW,iW,tW,$U,GU,PU,MU,AU,OU,AG).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function LG(){var e=0,t=1,n,r,i,a,o=cH,s=!1,c;function l(e){return e==null||isNaN(e=+e)?c:o(i===0?.5:(e=(a(e)-n)*i,s?Math.max(0,Math.min(1,e)):e))}l.domain=function(o){return arguments.length?([e,t]=o,n=a(e=+e),r=a(t=+t),i=n===r?0:1/(r-n),l):[e,t]},l.clamp=function(e){return arguments.length?(s=!!e,l):s},l.interpolator=function(e){return arguments.length?(o=e,l):o};function u(e){return function(t){var n,r;return arguments.length?([n,r]=t,o=e(n,r),l):[o(0),o(1)]}}return l.range=u(nH),l.rangeRound=u(rH),l.unknown=function(e){return arguments.length?(c=e,l):c},function(o){return a=o,n=o(e),r=o(t),i=n===r?0:1/(r-n),l}}function RG(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function zG(){var e=VH(LG()(cH));return e.copy=function(){return RG(e,zG())},JB.apply(e,arguments)}
68function BG(){var e=$H(LG()).domain([1,10]);return e.copy=function(){return RG(e,BG()).base(e.base())},JB.apply(e,arguments)}function VG(){var e=rU(LG());return e.copy=function(){return RG(e,VG()).constant(e.constant())},JB.apply(e,arguments)}function HG(){var e=cU(LG());return e.copy=function(){return RG(e,HG()).exponent(e.exponent())},JB.apply(e,arguments)}function UG(){return HG.apply(null,arguments).exponent(.5)}function WG(){var e=[],t=cH;function n(n){if(n!=null&&!isNaN(n=+n))return t((TB(e,n,1)-1)/(e.length-1))}return n.domain=function(t){if(!arguments.length)return e.slice();e=[];for(let n of t)n!=null&&!isNaN(n=+n)&&e.push(n);return e.sort(vB),n},n.interpolator=function(e){return arguments.length?(t=e,n):t},n.range=function(){return e.map((n,r)=>t(r/(e.length-1)))},n.quantiles=function(t){return Array.from({length:t+1},(n,r)=>WB(e,r/t))},n.copy=function(){return WG(t).domain(e)},JB.apply(n,arguments)}function GG(){var e=0,t=.5,n=1,r=1,i,a,o,s,c,l=cH,u,d=!1,f;function p(e){return isNaN(e=+e)?f:(e=.5+((e=+u(e))-a)*(r*e<r*a?s:c),l(d?Math.max(0,Math.min(1,e)):e))}p.domain=function(l){return arguments.length?([e,t,n]=l,i=u(e=+e),a=u(t=+t),o=u(n=+n),s=i===a?0:.5/(a-i),c=a===o?0:.5/(o-a),r=a<i?-1:1,p):[e,t,n]},p.clamp=function(e){return arguments.length?(d=!!e,p):d},p.interpolator=function(e){return arguments.length?(l=e,p):l};function m(e){return function(t){var n,r,i;return arguments.length?([n,r,i]=t,l=iH(e,[n,r,i]),p):[l(0),l(.5),l(1)]}}return p.range=m(nH),p.rangeRound=m(rH),p.unknown=function(e){return arguments.length?(f=e,p):f},function(l){return u=l,i=l(e),a=l(t),o=l(n),s=i===a?0:.5/(a-i),c=a===o?0:.5/(o-a),r=a<i?-1:1,p}}function KG(){var e=VH(GG()(cH));return e.copy=function(){return RG(e,KG())},JB.apply(e,arguments)}function qG(){var e=$H(GG()).domain([.1,1,10]);return e.copy=function(){return RG(e,qG()).base(e.base())},JB.apply(e,arguments)}function JG(){var e=rU(GG());return e.copy=function(){return RG(e,JG()).constant(e.constant())},JB.apply(e,arguments)}function YG(){var e=cU(GG());return e.copy=function(){return RG(e,YG()).exponent(e.exponent())},JB.apply(e,arguments)}function XG(){return YG.apply(null,arguments).exponent(.5)}var ZG=e({scaleBand:()=>ZB,scaleDiverging:()=>KG,scaleDivergingLog:()=>qG,scaleDivergingPow:()=>YG,scaleDivergingSqrt:()=>XG,scaleDivergingSymlog:()=>JG,scaleIdentity:()=>UH,scaleImplicit:()=>YB,scaleLinear:()=>HH,scaleLog:()=>eU,scaleOrdinal:()=>XB,scalePoint:()=>$B,scalePow:()=>lU,scaleQuantile:()=>mU,scaleQuantize:()=>hU,scaleRadial:()=>pU,scaleSequential:()=>zG,scaleSequentialLog:()=>BG,scaleSequentialPow:()=>HG,scaleSequentialQuantile:()=>WG,scaleSequentialSqrt:()=>UG,scaleSequentialSymlog:()=>VG,scaleSqrt:()=>uU,scaleSymlog:()=>iU,scaleThreshold:()=>gU,scaleTime:()=>FG,scaleUtc:()=>IG,tickFormat:()=>BH});function QG(e){var t=ZG;if(e in t&&typeof t[e]==`function`)return t[e]();var n=`scale${yk(e)}`;if(n in t&&typeof t[n]==`function`)return t[n]()}function $G(e,t,n){if(typeof e==`function`)return e.copy().domain(t).range(n);if(e!=null){var r=QG(e);if(r!=null)return r.domain(t).range(n),r}}function eK(e,t,n,r){if(!(n==null||r==null))return typeof e.scale==`function`?$G(e.scale,n,r):$G(t,n,r)}function tK(e){return`scale${yk(e)}`}function nK(e){return tK(e)in ZG}var rK=(e,t,n)=>{if(e!=null){var{scale:r,type:i}=e;if(r===`auto`)return i===`category`&&n&&(n.indexOf(`LineChart`)>=0||n.indexOf(`AreaChart`)>=0||n.indexOf(`ComposedChart`)>=0&&!t)?`point`:i===`category`?`band`:`linear`;if(typeof r==`string`)return nK(r)?r:`point`}};function iK(e,t){for(var n=0,r=e.length,i=e[0]<e[e.length-1];n<r;){var a=Math.floor((n+r)/2);(i?e[a]<t:e[a]>t)?n=a+1:r=a}return n}function aK(e,t){if(e){var n=t??e.domain(),r=n.map(t=>e(t)??0),i=e.range();if(!(n.length===0||i.length<2))return e=>{var t=iK(r,e);if(t<=0)return n[0];if(t>=n.length)return n[n.length-1];var i=r[t-1]??0,a=r[t]??0;return Math.abs(e-i)<=Math.abs(e-a)?n[t-1]:n[t]}}}function oK(e){if(e!=null)return`invert`in e&&typeof e.invert==`function`?e.invert.bind(e):aK(e,void 0)}var sK=t(fz());function cK(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function lK(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];
68t%2?cK(Object(n),!0).forEach(function(t){uK(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cK(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function uK(e,t,n){return(t=dK(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dK(e){var t=fK(e,`string`);return typeof t==`symbol`?t:t+``}function fK(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var pK=[0,`auto`],mK={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:void 0,height:30,hide:!0,id:0,includeHidden:!1,interval:`preserveEnd`,minTickGap:5,mirror:!1,name:void 0,orientation:`bottom`,padding:{left:0,right:0},reversed:!1,scale:`auto`,tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:`category`,unit:void 0,niceTicks:`auto`},hK=(e,t)=>e.cartesianAxis.xAxis[t],gK=(e,t)=>hK(e,t)??mK,_K={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:pK,hide:!0,id:0,includeHidden:!1,interval:`preserveEnd`,minTickGap:5,mirror:!1,name:void 0,orientation:`left`,padding:{top:0,bottom:0},reversed:!1,scale:`auto`,tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:`number`,unit:void 0,niceTicks:`auto`,width:60},vK=(e,t)=>e.cartesianAxis.yAxis[t],yK=(e,t)=>vK(e,t)??_K,bK={domain:[0,`auto`],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:``,range:[64,64],scale:`auto`,type:`number`,unit:``},xK=(e,t)=>e.cartesianAxis.zAxis[t]??bK,SK=(e,t,n)=>{switch(t){case`xAxis`:return gK(e,n);case`yAxis`:return yK(e,n);case`zAxis`:return xK(e,n);case`angleAxis`:return Zz(e,n);case`radiusAxis`:return Qz(e,n);default:throw Error(`Unexpected axis type: ${t}`)}},CK=(e,t,n)=>{switch(t){case`xAxis`:return gK(e,n);case`yAxis`:return yK(e,n);default:throw Error(`Unexpected axis type: ${t}`)}},wK=(e,t,n)=>{switch(t){case`xAxis`:return gK(e,n);case`yAxis`:return yK(e,n);case`angleAxis`:return Zz(e,n);case`radiusAxis`:return Qz(e,n);default:throw Error(`Unexpected axis type: ${t}`)}},TK=e=>e.graphicalItems.cartesianItems.some(e=>e.type===`bar`)||e.graphicalItems.polarItems.some(e=>e.type===`radialBar`);function EK(e,t){return n=>{switch(e){case`xAxis`:return`xAxisId`in n&&n.xAxisId===t;case`yAxis`:return`yAxisId`in n&&n.yAxisId===t;case`zAxis`:return`zAxisId`in n&&n.zAxisId===t;case`angleAxis`:return`angleAxisId`in n&&n.angleAxisId===t;case`radiusAxis`:return`radiusAxisId`in n&&n.radiusAxisId===t;default:return!1}}}var DK=e=>e.graphicalItems.cartesianItems,OK=$([oB,sB],EK),kK=(e,t,n)=>e.filter(n).filter(e=>t?.includeHidden===!0?!0:!e.hide),AK=$([DK,SK,OK],kK,{memoizeOptions:{resultEqualityCheck:fB}}),jK=$([AK],e=>e.filter(e=>e.type===`area`||e.type===`bar`).filter(uB)),MK=e=>e.filter(e=>!(`stackId`in e)||e.stackId===void 0),NK=$([AK],MK),PK=e=>e.map(e=>e.data).filter(Boolean).flat(1),FK=$([AK],e=>e.some(e=>!e.data)),IK=$([AK],PK,{memoizeOptions:{resultEqualityCheck:fB}}),LK=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:i}=t;return e.length>0?e:n.slice(r,i+1)},RK=$([IK,hz],LK),zK=(e,t,n)=>t?.dataKey==null?n.length>0?n.map(e=>e.dataKey).flatMap(t=>e.map(e=>({value:wP(e,t)}))):e.map(e=>({value:e})):e.map(e=>({value:wP(e,t.dataKey)})),BK=(e,t,n,r,i,a)=>{var{chartData:o=[],dataStartIndex:s,dataEndIndex:c}=r,l=zK(e,t,n);return i&&t?.dataKey!=null&&a.length>0?[...o.slice(s,c+1).map(e=>({value:wP(e,t.dataKey)})).filter(e=>e.value!=null),...l]:l},VK=$([RK,SK,AK,hz,FK,IK],BK);function HK(e){if(dk(e)||e instanceof Date){var t=Number(e);if(_P(t))return t}}function UK(e){if(Array.isArray(e)){var t=[HK(e[0]),HK(e[1])];return vz(t)?t:void 0}var n=HK(e);if(n!=null)return[n,n]}function WK(e){return e.map(HK).filter(bk)}function GK(e,t){var n=HK(e),r=HK(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var KK=$([VK],e=>e?.map(e=>e.value).sort(GK));function qK(e,t){switch(e){case`xAxis`:return t.direction===`x`;case`yAxis`:return t.direction===`y`;default:return!1}}
68function JK(e,t,n){if(!n||!n.length)return[];var r;if(typeof t==`number`&&!ck(t))r=t;else if(Array.isArray(t)){var i=WK(t);i.length>0&&(r=Math.max(...i))}return r==null?[]:WK(n.flatMap(t=>{var n=wP(e,t.dataKey),i,a;if(Array.isArray(n)?[i,a]=n:i=a=n,!(!_P(i)||!_P(a)))return[r-i,r+a]}))}var YK=e=>wK(e,mB(e),hB(e)),XK=$([YK],e=>e?.dataKey),ZK=$([jK,hz,YK],lB),QK=(e,t,n,r)=>{var i=t.reduce((e,t)=>{if(t.stackId==null)return e;var n=e[t.stackId];return n??=[],n.push(t),e[t.stackId]=n,e},{});return Object.fromEntries(Object.entries(i).map(t=>{var[i,a]=t,o=r?[...a].reverse():a;return[i,{stackedData:AP(e,o.map(cB),n),graphicalItems:o}]}))},$K=$([ZK,jK,Nz,Pz],QK),eq=(e,t,n,r)=>{var{dataStartIndex:i,dataEndIndex:a}=t;if(r==null&&n!==`zAxis`){var o=PP(e,i,a);if(!(o!=null&&o[0]===0&&o[1]===0))return o}},tq=$([SK],e=>e.allowDataOverflow),nq=e=>{if(e==null||!(`domain`in e))return pK;if(e.domain!=null)return e.domain;if(`ticks`in e&&e.ticks!=null){if(e.type===`number`){var t=WK(e.ticks);return[Math.min(...t),Math.max(...t)]}if(e.type===`category`)return e.ticks.map(String)}return e?.domain??pK},rq=$([SK],nq),iq=$([rq,tq],bz),aq=$([$K,pz,oB,iq],eq,{memoizeOptions:{resultEqualityCheck:dB}}),oq=e=>e.errorBars,sq=(e,t,n)=>e.flatMap(e=>t[e.id]).filter(Boolean).filter(e=>qK(n,e)),cq=function(){var e=[...arguments].filter(Boolean);if(e.length!==0){var t=e.flat();return[Math.min(...t),Math.max(...t)]}},lq=function(e,t,n,r,i){var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:[],o,s;if(n.length>0&&n.forEach(e=>{var n=e.data==null?a:[...e.data],c=r[e.id]?.filter(e=>qK(i,e));n.forEach(n=>{var r=wP(n,t.dataKey??e.dataKey),i=JK(n,r,c);if(i.length>=2){var a=Math.min(...i),l=Math.max(...i);(o==null||a<o)&&(o=a),(s==null||l>s)&&(s=l)}var u=UK(r);u!=null&&(o=o==null?u[0]:Math.min(o,u[0]),s=s==null?u[1]:Math.max(s,u[1]))})}),t?.dataKey!=null&&n.length===0&&e.forEach(e=>{var n=UK(wP(e,t.dataKey));n!=null&&(o=o==null?n[0]:Math.min(o,n[0]),s=s==null?n[1]:Math.max(s,n[1]))}),_P(o)&&_P(s))return[o,s]},uq=$([RK,SK,NK,oq,oB,gz],lq,{memoizeOptions:{resultEqualityCheck:dB}});function dq(e){var{value:t}=e;if(dk(t)||t instanceof Date)return t}var fq=(e,t,n)=>{var r=e.map(dq).filter(e=>e!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&hk(r))?(0,sK.default)(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},pq=e=>e.referenceElements.dots,mq=(e,t,n)=>e.filter(e=>e.ifOverflow===`extendDomain`).filter(e=>t===`xAxis`?e.xAxisId===n:e.yAxisId===n),hq=$([pq,oB,sB],mq),gq=e=>e.referenceElements.areas,_q=$([gq,oB,sB],mq),vq=e=>e.referenceElements.lines,yq=$([vq,oB,sB],mq),bq=(e,t)=>{if(e!=null){var n=WK(e.map(e=>t===`xAxis`?e.x:e.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},xq=$(hq,oB,bq),Sq=(e,t)=>{if(e!=null){var n=WK(e.flatMap(e=>[t===`xAxis`?e.x1:e.y1,t===`xAxis`?e.x2:e.y2]));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},Cq=$([_q,oB],Sq);function wq(e){if(e.x!=null)return WK([e.x]);var t=e.segment?.map(e=>e.x);return t==null||t.length===0?[]:WK(t)}function Tq(e){if(e.y!=null)return WK([e.y]);var t=e.segment?.map(e=>e.y);return t==null||t.length===0?[]:WK(t)}var Eq=(e,t)=>{if(e!=null){var n=e.flatMap(e=>t===`xAxis`?wq(e):Tq(e));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},Dq=$(xq,$([yq,oB],Eq),Cq,(e,t,n)=>cq(e,n,t)),Oq=(e,t,n,r,i,a,o,s)=>n??xz(t,o===`vertical`&&s===`xAxis`||o===`horizontal`&&s===`yAxis`?cq(r,a,i):cq(a,i),e.allowDataOverflow),kq=$([SK,rq,iq,aq,uq,Dq,KF,oB],Oq,{memoizeOptions:{resultEqualityCheck:dB}}),Aq=[0,1],jq=(e,t,n,r,i,a,o)=>{if(!((e==null||n==null||n.length===0)&&o===void 0)){var{dataKey:s,type:c}=e,l=EP(t,a);return l&&s==null?(0,sK.default)(0,n?.length??0):c===`category`?fq(r,e,l):i===`expand`&&!l?Aq:o}},Mq=$([SK,KF,RK,VK,Nz,oB,kq],jq),Nq=$([SK,TK,Fz],rK),Pq=(e,t,n)=>{var{niceTicks:r}=t;if(r!==`none`){var i=nq(t),a=Array.isArray(i)&&(i[0]===`auto`||i[1]===`auto`);if((r===`snap125`||r===`adaptive`)&&t!=null&&t.tickCount&&vz(e)){if(a)return Az(e,t.tickCount,t.allowDecimals,r);if(t.type===`number`)return jz(e,t.tickCount,t.allowDecimals,r)}if(r===`auto`&&n===`linear`&&t!=null&&t.tickCount){if(a&&vz(e))return Az(e,t.tickCount,t.allowDecimals,`adaptive`);if(t.type===`number`&&vz(e))return jz(e,t.tickCount,t.allowDecimals,`adaptive`)}}},Fq=$([Mq,wK,Nq],Pq),Iq=(e,t,n,r)=>{if(r!==`angleAxis`&&e?.type===`number`&&vz(t)&&Array.isArray(n)&&n.length>
680){var i=t[0],a=n[0]??0,o=t[1],s=n[n.length-1]??0;return[Math.min(i,a),Math.max(o,s)]}return t},Lq=$([SK,Mq,Fq,oB],Iq),Rq=$($(VK,SK,(e,t)=>{if(!(!t||t.type!==`number`)){var n=1/0,r=Array.from(WK(e.map(e=>e.value))).sort((e,t)=>e-t),i=r[0],a=r[r.length-1];if(i==null||a==null)return 1/0;var o=a-i;if(o===0)return 1/0;for(var s=0;s<r.length-1;s++){var c=r[s],l=r[s+1];if(!(c==null||l==null)){var u=l-c;n=Math.min(n,u)}}return n/o}}),KF,Mz,aF,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!_P(e))return 0;var a=t===`vertical`?r.height:r.width;if(i===`gap`)return e*a/2;if(i===`no-gap`){var o=mk(n,e*a),s=e*a/2;return s-o-(s-o)/a*o}return 0}),zq=(e,t,n)=>{var r=gK(e,t);return r==null||typeof r.padding!=`string`?0:Rq(e,`xAxis`,t,n,r.padding)},Bq=(e,t,n)=>{var r=yK(e,t);return r==null||typeof r.padding!=`string`?0:Rq(e,`yAxis`,t,n,r.padding)},Vq=$(gK,zq,(e,t)=>{if(e==null)return{left:0,right:0};var{padding:n}=e;return typeof n==`string`?{left:t,right:t}:{left:(n.left??0)+t,right:(n.right??0)+t}}),Hq=$(yK,Bq,(e,t)=>{if(e==null)return{top:0,bottom:0};var{padding:n}=e;return typeof n==`string`?{top:t,bottom:t}:{top:(n.top??0)+t,bottom:(n.bottom??0)+t}}),Uq=$([aF,Vq,dF,uF,(e,t,n)=>n],(e,t,n,r,i)=>{var{padding:a}=r;return i?[a.left,n.width-a.right]:[e.left+t.left,e.left+e.width-t.right]}),Wq=$([aF,KF,Hq,dF,uF,(e,t,n)=>n],(e,t,n,r,i,a)=>{var{padding:o}=i;return a?[r.height-o.bottom,o.top]:t===`horizontal`?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),Gq=(e,t,n,r)=>{switch(t){case`xAxis`:return Uq(e,n,r);case`yAxis`:return Wq(e,n,r);case`zAxis`:return xK(e,n)?.range;case`angleAxis`:return rB(e);case`radiusAxis`:return iB(e,n);default:return}},Kq=$([SK,Gq],Hz),qq=$([SK,Nq,$([Nq,Lq],_B),Kq],eK),Jq=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var{type:i,scale:a}=n;if(EP(e,r)&&(i===`number`||a!==`auto`))return t.map(e=>e.value)}},Yq=$([KF,VK,wK,oB],Jq),Xq=$([qq],gB);$([qq],oK),$([qq,KK],aK),$([AK,oq,oB],sq);function Zq(e,t){return e.id<t.id?-1:+(e.id>t.id)}var Qq=(e,t)=>t,$q=(e,t,n)=>n,eJ=$(KP,Qq,$q,(e,t,n)=>e.filter(e=>e.orientation===t).filter(e=>e.mirror===n).sort(Zq)),tJ=$(qP,Qq,$q,(e,t,n)=>e.filter(e=>e.orientation===t).filter(e=>e.mirror===n).sort(Zq)),nJ=(e,t)=>({width:e.width,height:t.height}),rJ=(e,t)=>({width:typeof t.width==`number`?t.width:60,height:e.height}),iJ=$(aF,gK,nJ),aJ=(e,t,n)=>{switch(t){case`top`:return e.top;case`bottom`:return n-e.bottom;default:return 0}},oJ=(e,t,n)=>{switch(t){case`left`:return e.left;case`right`:return n-e.right;default:return 0}},sJ=$(UP,aF,eJ,Qq,$q,(e,t,n,r,i)=>{var a={},o;return n.forEach(n=>{var s=nJ(t,n);o??=aJ(t,r,e);var c=r===`top`&&!i||r===`bottom`&&i;a[n.id]=o-Number(c)*s.height,o+=(c?-1:1)*s.height}),a}),cJ=$(HP,aF,tJ,Qq,$q,(e,t,n,r,i)=>{var a={},o;return n.forEach(n=>{var s=rJ(t,n);o??=oJ(t,r,e);var c=r===`left`&&!i||r===`right`&&i;a[n.id]=o-Number(c)*s.width,o+=(c?-1:1)*s.width}),a}),lJ=$([aF,gK,(e,t)=>{var n=gK(e,t);if(n!=null)return sJ(e,n.orientation,n.mirror)},(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n?.[r];return i==null?{x:e.left,y:0}:{x:e.left,y:i}}}),uJ=$([aF,yK,(e,t)=>{var n=yK(e,t);if(n!=null)return cJ(e,n.orientation,n.mirror)},(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n?.[r];return i==null?{x:0,y:e.top}:{x:i,y:e.top}}}),dJ=$(aF,yK,(e,t)=>({width:typeof t.width==`number`?t.width:60,height:e.height})),fJ=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:i,type:a,dataKey:o}=n,s=EP(e,r),c=t.map(e=>e.value),l=c.filter(e=>e!=null);if(o&&s&&a===`category`&&i&&hk(l))return c}},pJ=$([KF,VK,SK,oB],fJ),mJ=$([KF,CK,Nq,Xq,pJ,Yq,Gq,Fq,oB],(e,t,n,r,i,a,o,s,c)=>{if(t!=null){var l=EP(e,c);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:c,categoricalDomain:a,duplicateDomain:i,isCategorical:l,niceTicks:s,range:o,realScaleType:n,scale:r}}}),hJ=$([KF,wK,Nq,Xq,Fq,Gq,pJ,Yq,oB],(e,t,n,r,i,a,o,s,c)=>{if(!(t==null||r==null)){var l=EP(e,c),{type:u,ticks:d,tickCount:f}=t,p=n===`scaleBand`&&typeof r.bandwidth==`function`?r.bandwidth()/2:2,m=u===`category`&&r.bandwidth?r.bandwidth()/p:0;m=c===`angleAxis`&&a!=null&&a.length>=2?sk(a[0]-a[1])*2*m:m;var h=d||i;return h?h.map((e,t)=>{var n=o?o.indexOf(e):e,i=r.map(n);return _P(i)?{index:t,coordinate:i+m,value:e,offset:m}:null}).filter(bk):l&&s?s.map((e,t)=>{var n=r.map(e);return _P(n)?{coordinate:n+m,value:e,index:t,offset:m}:null}).filter(bk):r.ticks?r.ticks(f).map((e,t)=>{var n=r.map(e);return _P(n)?{coordinate:n+m,value:e,index:t,offset:m}:null}).filter(bk):r.domain().map((e,t)=>{var n=r.map(e);return _P(n)?{coordinate:n+m,value:o?o[e]:e,index:t,offset:m}:null}).filter(bk)}}),gJ=$([KF,wK,Xq,Gq,pJ,Yq,oB],(e,t,n,r,i,a,o)=>
68{if(!(t==null||n==null||r==null||r[0]===r[1])){var s=EP(e,o),{tickCount:c}=t,l=0;return l=o===`angleAxis`&&r?.length>=2?sk(r[0]-r[1])*2*l:l,s&&a?a.map((e,t)=>{var r=n.map(e);return _P(r)?{coordinate:r+l,value:e,index:t,offset:l}:null}).filter(bk):n.ticks?n.ticks(c).map((e,t)=>{var r=n.map(e);return _P(r)?{coordinate:r+l,value:e,index:t,offset:l}:null}).filter(bk):n.domain().map((e,t)=>{var r=n.map(e);return _P(r)?{coordinate:r+l,value:i?i[e]:e,index:t,offset:l}:null}).filter(bk)}}),_J=$(SK,Xq,(e,t)=>{if(!(e==null||t==null))return lK(lK({},e),{},{scale:t})});$((e,t,n)=>xK(e,n),$([$([SK,Nq,Mq,Kq],eK)],gB),(e,t)=>{if(!(e==null||t==null))return lK(lK({},e),{},{scale:t})});var vJ=$([KF,KP,qP],(e,t,n)=>{switch(e){case`horizontal`:return t.some(e=>e.reversed)?`right-to-left`:`left-to-right`;case`vertical`:return n.some(e=>e.reversed)?`bottom-to-top`:`top-to-bottom`;case`centric`:case`radial`:return`left-to-right`;default:return}});$([(e,t,n)=>e.renderedTicks[t]?.[n]],e=>{if(!(!e||e.length===0))return t=>{var n=1/0,r=e[0];for(var i of e){var a=Math.abs(i.coordinate-t);a<n&&(n=a,r=i)}return r?.value}});var yJ=e=>e.options.defaultTooltipEventType,bJ=e=>e.options.validateTooltipEventTypes;function xJ(e,t,n){if(e==null)return t;var r=e?`axis`:`item`;return n==null?t:n.includes(r)?r:t}function SJ(e,t){return xJ(t,yJ(e),bJ(e))}function CJ(e){return WA(t=>SJ(t,e))}var wJ=(e,t)=>{var n,r=Number(t);if(!(ck(r)||t==null))return r>=0?e==null||(n=e[r])==null?void 0:n.value:void 0},TJ=e=>e.tooltip.settings,EJ={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},DJ=SN({name:`tooltip`,initialState:{itemInteraction:{click:EJ,hover:EJ},axisInteraction:{click:EJ,hover:EJ},keyboardInteraction:EJ,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0,graphicalItemId:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:`hover`,axisId:0,active:!1,defaultIndex:void 0}},reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(qI(t.payload))},prepare:cN()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,i=JM(e).tooltipItemPayloads.indexOf(qI(n));i>-1&&(e.tooltipItemPayloads[i]=qI(r))},prepare:cN()},removeTooltipEntrySettings:{reducer(e,t){var n=JM(e).tooltipItemPayloads.indexOf(qI(t.payload));n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:cN()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.keyboardInteraction.active=!1,e.itemInteraction.hover.active=!0,e.itemInteraction.hover.index=t.payload.activeIndex,e.itemInteraction.hover.dataKey=t.payload.activeDataKey,e.itemInteraction.hover.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.hover.coordinate=t.payload.activeCoordinate},mouseLeaveChart(e){e.itemInteraction.hover.active=!1,e.axisInteraction.hover.active=!1},mouseLeaveItem(e){e.itemInteraction.hover.active=!1},setActiveClickItemIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.itemInteraction.click.active=!0,e.keyboardInteraction.active=!1,e.itemInteraction.click.index=t.payload.activeIndex,e.itemInteraction.click.dataKey=t.payload.activeDataKey,e.itemInteraction.click.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.click.coordinate=t.payload.activeCoordinate},setMouseOverAxisIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.axisInteraction.hover.active=!0,e.keyboardInteraction.active=!1,e.axisInteraction.hover.index=t.payload.activeIndex,e.axisInteraction.hover.dataKey=t.payload.activeDataKey,e.axisInteraction.hover.coordinate=t.payload.activeCoordinate},setMouseClickAxisIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.keyboardInteraction.active=!1,e.axisInteraction.click.active=!0,e.axisInteraction.click.index=t.payload.activeIndex,e.axisInteraction.click.dataKey=t.payload.activeDataKey,e.axisInteraction.click.coordinate=t.payload.activeCoordinate},setSyncInteraction(e,t){e.syncInteraction=t.payload},setKeyboardInteraction(e,t){e.keyboardInteraction.active=t.payload.active,e.keyboardInteraction.index=t.payload.activeIndex,e.keyboardInteraction.coordinate=t.payload.activeCoordinate}}}),{addTooltipEntrySettings:OJ,replaceTooltipEntrySettings:kJ,removeTooltipEntrySettings:AJ,setTooltipSettingsState:jJ,setActiveMouseOverItemIndex:MJ,mouseLeaveItem:rne,mouseLeaveChart:NJ,setActiveClickItemIndex:ine,setMouseOverAxisIndex:PJ,
68setMouseClickAxisIndex:FJ,setSyncInteraction:IJ,setKeyboardInteraction:LJ}=DJ.actions,RJ=DJ.reducer;function zJ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function BJ(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?zJ(Object(n),!0).forEach(function(t){VJ(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zJ(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function VJ(e,t,n){return(t=HJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HJ(e){var t=UJ(e,`string`);return typeof t==`symbol`?t:t+``}function UJ(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function WJ(e,t,n){return t===`axis`?n===`click`?e.axisInteraction.click:e.axisInteraction.hover:n===`click`?e.itemInteraction.click:e.itemInteraction.hover}function GJ(e){return e.index!=null}var KJ=(e,t,n,r)=>{if(t==null)return EJ;var i=WJ(e,t,n);if(i==null)return EJ;if(i.active)return i;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var a=e.settings.active===!0;if(GJ(i)){if(a)return BJ(BJ({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return BJ(BJ({},EJ),{},{coordinate:i.coordinate})};function qJ(e){if(typeof e==`number`)return Number.isFinite(e)?e:void 0;if(e instanceof Date){var t=e.valueOf();return Number.isFinite(t)?t:void 0}var n=Number(e);return Number.isFinite(n)?n:void 0}function JJ(e,t){var n=qJ(e),r=t[0],i=t[1];return n===void 0?!1:n>=Math.min(r,i)&&n<=Math.max(r,i)}function YJ(e,t,n){if(n==null||t==null)return!0;var r=wP(e,t);return r==null||!vz(n)?!0:JJ(r,n)}var XJ=(e,t,n,r)=>{var i=e?.index;if(i==null)return null;var a=Number(i);if(!_P(a))return i;var o=0,s=1/0;t.length>0&&(s=t.length-1);var c=Math.max(o,Math.min(a,s)),l=t[c];return l==null||YJ(l,n,r)?String(c):null},ZJ=(e,t,n,r,i,a,o)=>{if(a!=null){var s=o[0]?.getPosition(a);if(s!=null)return s;var c=i?.[Number(a)];if(c)switch(n){case`horizontal`:return{x:c.coordinate,y:(r.top+t)/2};default:return{x:(r.left+e)/2,y:c.coordinate}}}},QJ=(e,t,n,r)=>{if(t===`axis`)return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var i=n===`hover`?e.itemInteraction.hover.graphicalItemId:e.itemInteraction.click.graphicalItemId;if(e.syncInteraction.active&&i==null)return e.tooltipItemPayloads;if(i==null&&(r!=null||e.keyboardInteraction.active)){var a=e.tooltipItemPayloads[0];return a==null?[]:[a]}return e.tooltipItemPayloads.filter(e=>e.settings?.graphicalItemId===i)},$J=e=>e.options.tooltipPayloadSearcher,eY=e=>e.tooltip;function tY(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function nY(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?tY(Object(n),!0).forEach(function(t){rY(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tY(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function rY(e,t,n){return(t=iY(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iY(e){var t=aY(e,`string`);return typeof t==`symbol`?t:t+``}function aY(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function oY(e){if(typeof e==`string`||typeof e==`number`)return e}function sY(e){if(typeof e==`string`||typeof e==`number`||typeof e==`boolean`)return e}function cY(e){if(typeof e==`string`||typeof e==`number`)return e;if(typeof e==`function`)return t=>e(t)}function lY(e){if(typeof e==`string`)return e}function uY(e){if(!(typeof e!=`object`||!e))return{name:`name`in e?oY(e.n
68ame):void 0,unit:`unit`in e?sY(e.unit):void 0,dataKey:`dataKey`in e?cY(e.dataKey):void 0,payload:`payload`in e?e.payload:void 0,color:`color`in e?lY(e.color):void 0,fill:`fill`in e?lY(e.fill):void 0}}function dY(e,t){return e??t}var fY=(e,t,n,r,i,a,o)=>{if(!(t==null||a==null)){var{chartData:s,computedData:c,dataStartIndex:l,dataEndIndex:u}=n;return e.reduce((e,n)=>{var{dataDefinedOnItem:d,settings:f}=n,p=dY(d,s),m=Array.isArray(p)?gP(p,l,u):p,h=f?.dataKey??r,g=f?.nameKey,_=r&&Array.isArray(m)&&!Array.isArray(m[0])&&o===`axis`?_k(m,r,i):a(m,t,c,g);return Array.isArray(_)?_.forEach(t=>{var n=uY(t),r=n?.name,i=n?.dataKey,a=n?.payload,o=nY(nY({},f),{},{name:r,unit:n?.unit,color:n?.color??f?.color,fill:n?.fill??f?.fill});e.push(RP({tooltipEntrySettings:o,dataKey:i,payload:a,value:wP(a,i),name:r==null?void 0:String(r)}))}):e.push(RP({tooltipEntrySettings:f,dataKey:h,payload:_,value:wP(_,h),name:wP(_,g)??f?.name})),e},[])}},pY=$([YK,TK,Fz],rK),mY=$([$([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),YK,$([mB,hB],EK)],kK,{memoizeOptions:{resultEqualityCheck:fB}}),hY=$([mY],e=>e.filter(uB)),gY=$([mY],PK,{memoizeOptions:{resultEqualityCheck:fB}}),_Y=$([mY],e=>e.some(e=>!e.data)),vY=$([gY,pz],LK),yY=$([hY,pz,YK],lB),bY=$([vY,YK,mY,pz,_Y,gY],BK),xY=$([YK],nq),SY=$([xY,$([YK],e=>e.allowDataOverflow)],bz),CY=$([$([yY,$([mY],e=>e.filter(uB)),Nz,Pz],QK),pz,mB,SY],eq),wY=$([vY,YK,$([mY],MK),oq,mB,_z],lq,{memoizeOptions:{resultEqualityCheck:dB}}),TY=$([$([pq,mB,hB],mq),mB],bq),EY=$([$([gq,mB,hB],mq),mB],Sq),DY=$([YK,KF,vY,bY,Nz,mB,$([YK,xY,SY,CY,wY,$([TY,$([$([vq,mB,hB],mq),mB],Eq),EY],cq),KF,mB],Oq)],jq),OY=$([YK,DY,$([DY,YK,pY],Pq),mB],Iq),kY=e=>Gq(e,mB(e),hB(e),!1),AY=$([YK,kY],Hz),jY=$([$([YK,pY,OY,AY],eK)],gB),MY=$([KF,YK,pY,jY,kY,$([KF,bY,YK,mB],fJ),$([KF,bY,YK,mB],Jq),mB],(e,t,n,r,i,a,o,s)=>{if(t){var{type:c}=t,l=EP(e,s);if(r){var u=n===`scaleBand`&&r.bandwidth?r.bandwidth()/2:2,d=c===`category`&&r.bandwidth?r.bandwidth()/u:0;return d=s===`angleAxis`&&i!=null&&i?.length>=2?sk(i[0]-i[1])*2*d:d,l&&o?o.map((e,t)=>{var n=r.map(e);return _P(n)?{coordinate:n+d,value:e,index:t,offset:d}:null}).filter(bk):r.domain().map((e,t)=>{var n=r.map(e);return _P(n)?{coordinate:n+d,value:a?a[e]:e,index:t,offset:d}:null}).filter(bk)}}}),NY=$([yJ,bJ,TJ],(e,t,n)=>xJ(n.shared,e,t)),PY=e=>e.tooltip.settings.trigger,FY=e=>e.tooltip.settings.defaultIndex,IY=$([eY,NY,PY,FY],KJ),LY=$([IY,vY,XK,DY],XJ),RY=$([MY,LY],wJ),zY=$([IY],e=>{if(e)return e.dataKey}),BY=$([IY],e=>{if(e)return e.graphicalItemId}),VY=$([eY,NY,PY,FY],QJ),HY=$([IY,$([HP,UP,KF,aF,MY,FY,VY],ZJ)],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),UY=$([IY],e=>e?.active??!1),WY=$([$([VY,LY,pz,XK,RY,$J,NY],fY)],e=>{if(e!=null){var t=e.map(e=>e.payload).filter(e=>e!=null);return Array.from(new Set(t))}});function GY(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function KY(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?GY(Object(n),!0).forEach(function(t){qY(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GY(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function qY(e,t,n){return(t=JY(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function JY(e){var t=YY(e,`string`);return typeof t==`symbol`?t:t+``}function YY(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var XY=()=>WA(YK),ZY=()=>{var e=XY(),t=WA(MY),n=WA(jY);return LP(!e||!n?void 0:KY(KY({},e),{},{scale:n}),t)};function QY(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $Y(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];
68t%2?QY(Object(n),!0).forEach(function(t){eX(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QY(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function eX(e,t,n){return(t=tX(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tX(e){var t=nX(e,`string`);return typeof t==`symbol`?t:t+``}function nX(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var rX=(e,t,n,r)=>{var i=t.find(e=>e&&e.index===n);if(i){if(e===`horizontal`)return{x:i.coordinate,y:r.relativeY};if(e===`vertical`)return{x:r.relativeX,y:i.coordinate}}return{x:0,y:0}},iX=(e,t,n,r)=>{var i=t.find(e=>e&&e.index===n);if(i){if(e===`centric`){var a=i.coordinate,{radius:o}=r;return $Y($Y($Y({},r),zR(r.cx,r.cy,o,a)),{},{angle:a,radius:o})}var s=i.coordinate,{angle:c}=r;return $Y($Y($Y({},r),zR(r.cx,r.cy,s,c)),{},{angle:c,radius:s})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function aX(e,t){var{relativeX:n,relativeY:r}=e;return n>=t.left&&n<=t.left+t.width&&r>=t.top&&r<=t.top+t.height}var oX=(e,t,n,r,i)=>{var a=t?.length??0;if(a<=1||e==null)return 0;if(r===`angleAxis`&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var o=0;o<a;o++){var s=o>0?n[o-1]?.coordinate:n[a-1]?.coordinate,c=n[o]?.coordinate,l=o>=a-1?n[0]?.coordinate:n[o+1]?.coordinate,u=void 0;if(!(s==null||c==null||l==null))if(sk(c-s)!==sk(l-c)){var d=[];if(sk(l-c)===sk(i[1]-i[0])){u=l;var f=c+i[1]-i[0];d[0]=Math.min(f,(f+s)/2),d[1]=Math.max(f,(f+s)/2)}else{u=s;var p=l+i[1]-i[0];d[0]=Math.min(c,(p+c)/2),d[1]=Math.max(c,(p+c)/2)}var m=[Math.min(c,(u+c)/2),Math.max(c,(u+c)/2)];if(e>m[0]&&e<=m[1]||e>=d[0]&&e<=d[1])return n[o]?.index}else{var h=Math.min(s,l),g=Math.max(s,l);if(e>(h+c)/2&&e<=(g+c)/2)return n[o]?.index}}else if(t)for(var _=0;_<a;_++){var v=t[_];if(v!=null){var y=t[_+1],b=t[_-1];if(_===0&&y!=null&&e<=(v.coordinate+y.coordinate)/2||_===a-1&&b!=null&&e>(v.coordinate+b.coordinate)/2||_>0&&_<a-1&&b!=null&&y!=null&&e>(v.coordinate+b.coordinate)/2&&e<=(v.coordinate+y.coordinate)/2)return v.index}}return-1},sX=()=>WA(Fz),cX=(e,t)=>t,lX=(e,t,n)=>n,uX=(e,t,n,r)=>r,dX=$(MY,e=>(0,fj.default)(e,e=>e.coordinate)),fX=$([eY,cX,lX,uX],KJ),pX=$([fX,vY,XK,DY],XJ),mX=(e,t,n)=>{if(t!=null){var r=eY(e);return t===`axis`?n===`hover`?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n===`hover`?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},hX=$([eY,cX,lX,uX],QJ),gX=$([HP,UP,KF,aF,MY,uX,hX],ZJ),_X=$([fX,gX],(e,t)=>e.coordinate??t),vX=$([MY,pX],wJ),yX=$([hX,pX,pz,XK,vX,$J,cX],fY),bX=$([fX,pX],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),xX=(e,t,n,r,i,a,o)=>{if(!(!e||!n||!r||!i)&&aX(e,o)){var s=oX(BP(e,t),a,i,n,r),c=rX(t,i,s,e);return{activeIndex:String(s),activeCoordinate:c}}},SX=(e,t,n,r,i,a,o)=>{if(!(!e||!r||!i||!a||!n)){var s=GR(e,n);if(s){var c=oX(VP(s,t),o,a,r,i),l=iX(t,a,c,s);return{activeIndex:String(c),activeCoordinate:l}}}},CX=(e,t,n,r,i,a,o,s)=>{if(!(!e||!t||!r||!i||!a))return t===`horizontal`||t===`vertical`?xX(e,t,r,i,a,o,s):SX(e,t,n,r,i,a,o)},wX=$(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,n)=>n,(e,t,n)=>{if(t!=null){var r=e[t];if(r!=null)return n?r.panoramaElement:r.element}}),TX=$(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(e=>parseInt(e,10)).concat(Object.values(zz));return Array.from(new Set(t)).sort((e,t)=>e-t)},{memoizeOptions:{resultEqualityCheck:pB}});function EX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function DX(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?EX(Object(n),!0).forEach(function(t){OX(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EX(Object(n)).forEac
68h(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function OX(e,t,n){return(t=kX(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kX(e){var t=AX(e,`string`);return typeof t==`symbol`?t:t+``}function AX(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var jX={zIndexMap:Object.values(zz).reduce((e,t)=>DX(DX({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),{})},MX=new Set(Object.values(zz));function NX(e){return MX.has(e)}var PX=SN({name:`zIndex`,initialState:jX,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]?e.zIndexMap[n].consumers+=1:e.zIndexMap[n]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:cN()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(--e.zIndexMap[n].consumers,e.zIndexMap[n].consumers<=0&&!NX(n)&&delete e.zIndexMap[n])},prepare:cN()},registerZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n,element:r,isPanorama:i}=t.payload;e.zIndexMap[n]?i?e.zIndexMap[n].panoramaElement=qI(r):e.zIndexMap[n].element=qI(r):e.zIndexMap[n]={consumers:0,element:i?void 0:qI(r),panoramaElement:i?qI(r):void 0}},prepare:cN()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(t.payload.isPanorama?e.zIndexMap[n].panoramaElement=void 0:e.zIndexMap[n].element=void 0)},prepare:cN()}}}),{registerZIndexPortal:FX,unregisterZIndexPortal:IX,registerZIndexPortalElement:LX,unregisterZIndexPortalElement:RX}=PX.actions,zX=PX.reducer;function BX(e){var{zIndex:t,children:n}=e,r=XF()&&t!==void 0&&t!==0,i=lF(),a=(0,f.useRef)(void 0),o=(0,f.useRef)(new Set),s=BA(),c=WA(e=>wX(e,t,i));if((0,f.useLayoutEffect)(()=>{if(!r){var e=o.current;e.forEach(e=>{s(IX({zIndex:e}))}),e.clear(),a.current=void 0;return}if(o.current.has(t)||(s(FX({zIndex:t})),o.current.add(t)),c){a.current=c;var n=o.current;n.forEach(e=>{e!==t&&(s(IX({zIndex:e})),n.delete(e))})}},[s,t,r,c]),(0,f.useLayoutEffect)(()=>{var e=o.current;return()=>{e.forEach(e=>{s(IX({zIndex:e}))}),e.clear()}},[s]),!r)return n;var l=c??a.current;return l?(0,fs.createPortal)(n,l):null}function VX(){return VX=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},VX.apply(null,arguments)}function HX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function UX(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?HX(Object(n),!0).forEach(function(t){WX(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HX(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function WX(e,t,n){return(t=GX(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function GX(e){var t=KX(e,`string`);return typeof t==`symbol`?t:t+``}function KX(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function qX(e){var{cursor:t,cursorComp:n,cursorProps:r}=e;return(0,f.isValidElement)(t)?(0,f.cloneElement)(t,r):(0,f.createElement)(n,r)}function JX(e){var{coordinate:t,payload:n,index:r,offset:i,tooltipAxisBandSize:a,layout:o,cursor:s,tooltipEventType:c,chartName:l}=e,u=t,d=n,p=r;if(!s||!u||l!==`ScatterChart`&&c!==`axis`)return null;var m,h,g;if(l===`ScatterChart`)m=u,h=Cte,g=zz.cursorLine;else if(l===`BarChart`)m=wte(o,u,i,a),h=jR,g=zz.cursorRectangle;
68else if(o===`radial`&&Lk(u)){var{cx:_,cy:v,radius:y,startAngle:b,endAngle:x}=KR(u);m={cx:_,cy:v,startAngle:b,endAngle:x,innerRadius:y,outerRadius:y},h=sz,g=zz.cursorLine}else m={points:cz(o,u,i)},h=ZL,g=zz.cursorLine;var S=typeof s==`object`&&`className`in s?s.className:void 0,C=UX(UX(UX(UX({stroke:`#ccc`,pointerEvents:`none`},i),m),dD(s)),{},{payload:d,payloadIndex:p,className:zc(`recharts-tooltip-cursor`,S)});return f.createElement(BX,{zIndex:e.zIndex??g},f.createElement(qX,{cursor:s,cursorComp:h,cursorProps:C}))}function YX(e){var t=ZY(),n=HF(),r=qF(),i=sX();return t==null||n==null||r==null||i==null?null:f.createElement(JX,VX({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var XX=(0,f.createContext)(null),ZX=()=>(0,f.useContext)(XX),QX=t(n(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=`~`;function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if(typeof n!=`function`)throw TypeError(`The listener must be a function`);var s=new a(n,i||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function s(e,t){--e._eventsCount===0?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i<a;i++)o[i]=n[i].fn;return o},c.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},c.prototype.emit=function(e,t,n,i,a,o){var s=r?r+e:e;if(!this._events[s])return!1;var c=this._events[s],l=arguments.length,u,d;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,a),!0;case 6:return c.fn.call(c.context,t,n,i,a,o),!0}for(d=1,u=Array(l-1);d<l;d++)u[d-1]=arguments[d];c.fn.apply(c.context,u)}else{var f=c.length,p;for(d=0;d<f;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),l){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,n);break;case 4:c[d].fn.call(c[d].context,t,n,i);break;default:if(!u)for(p=1,u=Array(l-1);p<l;p++)u[p-1]=arguments[p];c[d].fn.apply(c[d].context,u)}}return!0},c.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,n,i){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return s(this,a),this;var o=this._events[a];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&s(this,a);else{for(var c=0,l=[],u=o.length;c<u;c++)(o[c].fn!==t||i&&!o[c].once||n&&o[c].context!==n)&&l.push(o[c]);l.length?this._events[a]=l.length===1?l[0]:l:s(this,a)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,t!==void 0&&(t.exports=c)}))(),1).default,$X=new QX,eZ=`recharts.syncEvent.tooltip`,tZ=`recharts.syncEvent.brush`,nZ=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!ck(n))return e[n]}},rZ=SN({name:`options`,initialState:{chartName:``,tooltipPayloadSearcher:()=>void 0,eventEmitter:void 0,defaultTooltipEventType:`axis`},reducers:{createEventEmitter:e=>{e.eventEmitter??=Symbol(`rechartsEventEmitter`)}}}),iZ=rZ.reducer,{createEventEmitter:aZ}=rZ.actions;function oZ(e){return e.tooltip.syncInteraction}var sZ=SN({name:`chartData`,initialState:{chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},reducers:{setChartData(e,t){if(e.chartData=qI(t.payload),t.payload==null){e.dataStartIndex=0,e.dataEndIndex=0;return}t.payload.length>0&&e.dataEndIndex!==t.payload.length-1&&(e.dataEndIndex=t.payload.length-1)},setComputedData(e,t){e.computedData=t.payload},setDataStartEndIndexes(e,t){var{startIndex:n,endIndex:r}=t.payload;n!=null&&(e.dataStartIndex=n),r!=null&&(e.dataEndIndex=r)}}}),{setChartData:cZ,setDataStartEndIndexes:lZ,setComputedData:ane}=sZ.actions,uZ=sZ.reducer,dZ=[`x`,`y`];function fZ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function pZ(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];
68t%2?fZ(Object(n),!0).forEach(function(t){mZ(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fZ(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function mZ(e,t,n){return(t=hZ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hZ(e){var t=gZ(e,`string`);return typeof t==`symbol`?t:t+``}function gZ(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function _Z(e,t){if(e==null)return{};var n,r,i=vZ(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function vZ(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function yZ(){var e=WA(Iz),t=WA(Rz),n=BA(),r=WA(Lz),i=WA(MY),a=qF(),o=BF();(0,f.useEffect)(()=>{if(e==null)return xk;var s=(s,c,l)=>{if(t!==l&&e===s){if(c.payload.active===!1){n(IJ({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(r===`index`){var u;if(o&&c!=null&&(u=c.payload)!=null&&u.coordinate&&c.payload.sourceViewBox){var d=c.payload.coordinate,{x:f,y:p}=d,m=_Z(d,dZ),{x:h,y:g,width:_,height:v}=c.payload.sourceViewBox,y=pZ(pZ({},m),{},{x:o.x+(_?(f-h)/_:0)*o.width,y:o.y+(v?(p-g)/v:0)*o.height});n(pZ(pZ({},c),{},{payload:pZ(pZ({},c.payload),{},{coordinate:y})}))}else n(c);return}if(i!=null){var b;typeof r==`function`?b=i[r(i,{activeTooltipIndex:c.payload.index==null?void 0:Number(c.payload.index),isTooltipActive:c.payload.active,activeIndex:c.payload.index==null?void 0:Number(c.payload.index),activeLabel:c.payload.label,activeDataKey:c.payload.dataKey,activeCoordinate:c.payload.coordinate})]:r===`value`&&(b=i.find(e=>String(e.value)===c.payload.label));var{coordinate:x}=c.payload;if(x==null||o==null){n(IJ({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(b==null){n(IJ({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:c.payload.sourceViewBox,graphicalItemId:void 0}));return}var{x:S,y:C}=x,w=Math.min(S,o.x+o.width),T=Math.min(C,o.y+o.height),E={x:a===`horizontal`?b.coordinate:w,y:a===`horizontal`?T:b.coordinate};n(IJ({active:c.payload.active,coordinate:E,dataKey:c.payload.dataKey,index:String(b.index),label:c.payload.label,sourceViewBox:c.payload.sourceViewBox,graphicalItemId:c.payload.graphicalItemId}))}}};return $X.on(eZ,s),()=>{$X.off(eZ,s)}},[WA(e=>e.rootProps.className),n,t,e,r,i,a,o])}function bZ(){var e=WA(Iz),t=WA(Rz),n=BA();(0,f.useEffect)(()=>{if(e==null)return xk;var r=(r,i,a)=>{t!==a&&e===r&&n(lZ(i))};return $X.on(tZ,r),()=>{$X.off(tZ,r)}},[n,t,e])}function xZ(){var e=BA();(0,f.useEffect)(()=>{e(aZ())},[e]),yZ(),bZ()}function SZ(e,t,n,r,i,a){var o=WA(n=>mX(n,e,t)),s=WA(BY),c=WA(Rz),l=WA(Iz),u=WA(Lz),d=WA(oZ)?.sourceViewBox!=null,p=BF();(0,f.useEffect)(()=>{if(!d&&l!=null&&c!=null){var e=IJ({active:a,coordinate:n,dataKey:o,index:i,label:typeof r==`number`?String(r):r,sourceViewBox:p,graphicalItemId:s});$X.emit(eZ,l,e,c)}},[d,n,o,s,i,r,c,l,u,a,p])}function CZ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function wZ(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?CZ(Object(n),!0).forEach(function(t){TZ(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CZ(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function TZ(e,t,n){return(t=EZ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function EZ(e){var t=DZ(e,`string`);return typeof t==`symbol`?t:t+``}function DZ(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function OZ(e){return e.dataKey}function kZ(e,t){return f.isValidElement(e)?f.cloneElement(e,t):typeof e==`function`?f.createElement(e,t):f.createElement($ee,t)}var AZ=[],jZ={allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:`ease`,axisId:0,contentStyle:{},cursor:!0,filterNull:!0,includeHidden:!1,isAnimationActive:`auto`,itemSorter:`name`,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:` : `,trigger:`hover`,useTranslate3d:!1,wrapperStyle:{}};function MZ(e){var t=Kk(e,jZ),{active:n,allowEscapeViewBox:r,animationDuration:i,animationEasing:a,content:o,filterNull:s,isAnimationActive:c,offset:l,payloadUniqBy:u,position:d,reverseDirection:p,useTranslate3d:m,wrapperStyle:h,cursor:g,shared:_,trigger:v,defaultIndex:y,portal:b,axisId:x}=t,S=BA(),C=typeof y==`number`?String(y):y;(0,f.useEffect)(()=>{S(jJ({shared:_,trigger:v,axisId:x,active:n,defaultIndex:C}))},[S,_,v,x,n,C]);var w=BF(),T=VL(),E=CJ(_),{activeIndex:D,isActive:O}=WA(e=>bX(e,E,v,C))??{},k=WA(e=>yX(e,E,v,C)),A=WA(e=>vX(e,E,v,C)),j=WA(e=>_X(e,E,v,C)),M=k,N=ZX(),ee=n??O??!1,[P,F]=vj([M,ee]),I=E===`axis`?A:void 0;SZ(E,v,j,I,D,ee);var te=b??N;if(te==null||w==null||E==null)return null;var L=M??AZ;ee||(L=AZ),s&&L.length&&(L=PA(L.filter(e=>e.value!=null&&(e.hide!==!0||t.includeHidden)),u,OZ));var ne=L.length>0,R=wZ(wZ({},t),{},{payload:L,label:I,active:ee,activeIndex:D,coordinate:j,accessibilityLayer:T}),z=f.createElement(lte,{allowEscapeViewBox:r,animationDuration:i,animationEasing:a,isAnimationActive:c,active:ee,coordinate:j,hasPayload:ne,offset:l,position:d,reverseDirection:p,useTranslate3d:m,viewBox:w,wrapperStyle:h,lastBoundingBox:P,innerRef:F,hasPortalFromProps:!!b},kZ(o,R));return f.createElement(f.Fragment,null,(0,fs.createPortal)(z,te),ee&&f.createElement(YX,{cursor:g,tooltipEventType:E,coordinate:j,payload:L,index:D}))}
68function NZ(e,t,n){return(t=PZ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PZ(e){var t=FZ(e,`string`);return typeof t==`symbol`?t:t+``}function FZ(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var IZ=class{constructor(e){NZ(this,`cache`,new Map),this.maxSize=e}get(e){var t=this.cache.get(e);return t!==void 0&&(this.cache.delete(e),this.cache.set(e,t)),t}set(e,t){if(this.cache.has(e))this.cache.delete(e);else if(this.cache.size>=this.maxSize){var n=this.cache.keys().next().value;n!=null&&this.cache.delete(n)}this.cache.set(e,t)}clear(){this.cache.clear()}size(){return this.cache.size}};function LZ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function RZ(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?LZ(Object(n),!0).forEach(function(t){zZ(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LZ(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function zZ(e,t,n){return(t=BZ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function BZ(e){var t=VZ(e,`string`);return typeof t==`symbol`?t:t+``}function VZ(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var HZ=RZ({},{cacheSize:2e3,enableCache:!0}),UZ=new IZ(HZ.cacheSize),WZ={position:`absolute`,top:`-20000px`,left:0,padding:0,margin:0,border:`none`,whiteSpace:`pre`},GZ=`recharts_measurement_span`;function KZ(e,t){return`${e}|${t.fontSize||``}|${t.fontFamily||``}|${t.fontWeight||``}|${t.fontStyle||``}|${t.letterSpacing||``}|${t.textTransform||``}`}var qZ=(e,t)=>{try{var n=document.getElementById(GZ);n||(n=document.createElement(`span`),n.setAttribute(`id`,GZ),n.setAttribute(`aria-hidden`,`true`),document.body.appendChild(n)),Object.assign(n.style,WZ,t),n.textContent=`${e}`;var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},JZ=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||LL.isSsr)return{width:0,height:0};if(!HZ.enableCache)return qZ(e,t);var n=KZ(e,t),r=UZ.get(n);if(r)return r;var i=qZ(e,t);return UZ.set(n,i),i},YZ;function XZ(e,t,n){return(t=ZZ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ZZ(e){var t=QZ(e,`string`);return typeof t==`symbol`?t:t+``}function QZ(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var $Z=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,eQ=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,tQ=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,nQ=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,rQ={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},iQ=[`cm`,`mm`,`pt`,`pc`,`in`,`Q`,`px`];function aQ(e){return iQ.includes(e)}var oQ=`NaN`;function sQ(e,t){return e*rQ[t]}var cQ=class e{static parse(t){var[,n,r]=nQ.exec(t)??[];return n==null?e.NaN:new e(parseFloat(n),r??``)}constructor(e,t){this.num=e,this.unit=t,this.num=e,this.unit=t,ck(e)&&(this.unit=``),t!==``&&!tQ.test(t)&&(this.num=NaN,this.unit=``),aQ(t)&&(this.num=sQ(e,t),this.unit=`px`)}add(t){return this.unit===t.unit?new e(this.num+t.num,this.unit):new e(NaN,``)}subtract(t){return this.unit===t.unit?new e(this.num-t.num,this.unit):new e(NaN,``)}multiply(t){return this.unit!==``&&t.unit!==``&&this.unit!==t.unit?new e(NaN,``):new e(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==``&&t.unit!==``&&this.unit!==t.unit?new e(NaN,``):new e(this.num/t.num,this.unit||t.unit)}toString(){return`${this.num}${this.unit}`}isNaN(){return ck(this.num)}};YZ=cQ,XZ(cQ,`NaN`,new YZ(NaN,``));function lQ(e){if(e==null||e.includes(oQ))return oQ;for(var t=e;t.includes(`*`)||t.includes(`/`);){var[,n,r,i]=$Z.exec(t)??[],a=cQ.parse(n??``),o=cQ.parse(i??``),s=r===`*`?a.multiply(o):a.divide(o);if(s.isNaN())return oQ;t=t.replace($Z,s.toString())}for(;t.includes(`+`)||/.-\d+(?:\.\d+)?/.test(t);){var[,c,l,u]=eQ.exec(t)??[],d=cQ.parse(c??``),f=cQ.parse(u??``),p=l===`+`?d.add(f):d.subtract(f);if(p.isNaN())return oQ;t=t.replace(eQ,p.toString())}return t}var uQ=/\(([^()]*)\)/;function dQ(e){for(var t=e,n;(n=uQ.exec(t))!=null;){var[,r]=n;t=t.replace(uQ,lQ(r))}return t}function fQ(e){var t=e.replace(/\s+/g,``);return t=dQ(t),t=lQ(t),t}function pQ(e){try{return fQ(e)}catch{return oQ}}function mQ(e){var t=pQ(e.slice(5,-1));return t===oQ?``:t}var hQ=[`x`,`y`,`lineHeight`,`capHeight`,`fill`,`scaleToFit`,`textAnchor`,`verticalAnchor`],gQ=[`dx`,`dy`,`angle`,`className`,`breakAll`];function _Q(){return _Q=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_Q.apply(null,arguments)}function vQ(e,t){if(e==null)return{};var n,r,i=yQ(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function yQ(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var bQ=/[ \f\n\r\t\v\u2028\u2029]+/,xQ=e=>{var{children:t,breakAll:n,style:r}=e;try{var i=[];return vk(t)||(i=n?t.toString().split(``):t.toString().split(bQ)),{wordsWithComputedWidth:i.map(e=>({word:e,width:JZ(e,r).width})),spaceWidth:n?0:JZ(`\xA0`,r).width}}catch{return null}};function SQ(e){return e===`start`||e===`middle`||e===`end`||e===`inherit`}
68function CQ(e){return vk(e)||typeof e==`string`||typeof e==`number`||typeof e==`boolean`}var wQ=(e,t,n,r)=>e.reduce((e,i)=>{var{word:a,width:o}=i,s=e[e.length-1];if(s&&o!=null&&(t==null||r||s.width+o+n<Number(t)))s.words.push(a),s.width+=o+n;else{var c={words:[a],width:o};e.push(c)}return e},[]),TQ=e=>e.reduce((e,t)=>e.width>t.width?e:t),EQ=`â¦`,DQ=(e,t,n,r,i,a,o,s)=>{var c=xQ({breakAll:n,style:r,children:e.slice(0,t)+EQ});if(!c)return[!1,[]];var l=wQ(c.wordsWithComputedWidth,a,o,s);return[l.length>i||TQ(l).width>Number(a),l]},OQ=(e,t,n,r,i)=>{var{maxLines:a,children:o,style:s,breakAll:c}=e,l=uk(a),u=String(o),d=wQ(t,r,n,i);if(!l||i||!(d.length>a||TQ(d).width>Number(r)))return d;for(var f=0,p=u.length-1,m=0,h;f<=p&&m<=u.length-1;){var g=Math.floor((f+p)/2),[_,v]=DQ(u,g-1,c,s,a,r,n,i),[y]=DQ(u,g,c,s,a,r,n,i);if(!_&&!y&&(f=g+1),_&&y&&(p=g-1),!_&&y){h=v;break}m++}return h||d},kQ=e=>[{words:vk(e)?[]:e.toString().split(bQ),width:void 0}],AQ=e=>{var{width:t,scaleToFit:n,children:r,style:i,breakAll:a,maxLines:o}=e;if((t||n)&&!LL.isSsr){var s,c,l=xQ({breakAll:a,children:r,style:i});if(l){var{wordsWithComputedWidth:u,spaceWidth:d}=l;s=u,c=d}else return kQ(r);return OQ({breakAll:a,children:r,maxLines:o,style:i},s,c,t,!!n)}return kQ(r)},jQ=`#808080`,MQ={angle:0,breakAll:!1,capHeight:`0.71em`,fill:jQ,lineHeight:`1em`,scaleToFit:!1,textAnchor:`start`,verticalAnchor:`end`,x:0,y:0},NQ=(0,f.forwardRef)((e,t)=>{var n=Kk(e,MQ),{x:r,y:i,lineHeight:a,capHeight:o,fill:s,scaleToFit:c,textAnchor:l,verticalAnchor:u}=n,d=vQ(n,hQ),p=(0,f.useMemo)(()=>AQ({breakAll:d.breakAll,children:d.children,maxLines:d.maxLines,scaleToFit:c,style:d.style,width:d.width}),[d.breakAll,d.children,d.maxLines,c,d.style,d.width]),{dx:m,dy:h,angle:g,className:_,breakAll:v}=d,y=vQ(d,gQ);if(!dk(r)||!dk(i)||p.length===0)return null;var b=Number(r)+(uk(m)?m:0),x=Number(i)+(uk(h)?h:0);if(!_P(b)||!_P(x))return null;var S;switch(u){case`start`:S=mQ(`calc(${o})`);break;case`middle`:S=mQ(`calc(${(p.length-1)/2} * -${a} + (${o} / 2))`);break;default:S=mQ(`calc(${p.length-1} * -${a})`);break}var C=[],w=p[0];if(c&&w!=null){var T=w.width,{width:E}=d;C.push(`scale(${uk(E)&&uk(T)?E/T:1})`)}return g&&C.push(`rotate(${g}, ${b}, ${x})`),C.length&&(y.transform=C.join(` `)),f.createElement(`text`,_Q({},fD(y),{ref:t,x:b,y:x,className:zc(`recharts-text`,_),textAnchor:l,fill:s.includes(`url`)?jQ:s}),p.map((e,t)=>{var n=e.words.join(v?``:` `);return f.createElement(`tspan`,{x:b,dy:t===0?S:a,key:`${n}-${t}`},n)}))});NQ.displayName=`Text`;function PQ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function FQ(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?PQ(Object(n),!0).forEach(function(t){IQ(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PQ(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function IQ(e,t,n){return(t=LQ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function LQ(e){var t=RQ(e,`string`);return typeof t==`symbol`?t:t+``}function RQ(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var zQ=e=>{var{viewBox:t,position:n,offset:r=0,parentViewBox:i,clamp:a}=e,{x:o,y:s,height:c,upperWidth:l,lowerWidth:u}=zF(t),d=o,f=o+(l-u)/2,p=(d+f)/2,m=(l+u)/2,h=d+l/2,g=c>=0?1:-1,_=g*r,v=g>0?`end`:`start`,y=g>0?`start`:`end`,b=l>=0?1:-1,x=b*r,S=b>0?`end`:`start`,C=b>0?`start`:`end`,w=i;if(n===`top`){var T={x:d+l/2,y:s-_,horizontalAnchor:`middle`,verticalAnchor:v};return a&&w&&(T.height=Math.max(s-w.y,0),T.width=l),T}if(n===`bottom`){var E={x:f+u/2,y:s+c+_,horizontalAnchor:`middle`,verticalAnchor:y};return a&&w&&(E.height=Math.max(w.y+w.height-(s+c),0),E.width=u),E}if(n===`left`){var D={x:p-x,y:s+c/2,horizontalAnchor:S,verticalAnchor:`middle`};return a&&w&&(D.width=Math.max(D.x-w.x,0),D.height=c),D}if(n===`right`){var O={x:p+m+x,y:s+c/2,horizontalAnchor:C,verticalAnchor:`middle`};return a&&w&&(O.width=Math.max(w.x+w.width-O.x,0),O.height=c),O}var k=a&&w?{width:m,height:c}:{};return n===`insideLeft`?FQ({x:p+x,y:s+c/2,horizontalAnchor:C,verticalAnchor:`middle`},k):n===`insideRight`?FQ({x:p+m-x,y:s+c/2,horizontalAnchor:S,verticalAnchor:`middle`},k):n===`insideTop`?FQ({x:d+l/2,y:s+_,horizontalAnchor:`middle`,verticalAnchor:y},k):n===`insideBottom`?FQ({x:f+u/2,y:s+c-_,horizontalAnchor:`middle`,verticalAnchor:v},k):n===`insideTopLeft`?FQ({x:d+x,y:s+_,horizontalAnchor:C,verticalAnchor:y},k):n===`insideTopRight`?FQ({x:d+l-x,y:s+_,horizontalAnchor:S,verticalAnchor:y},k):n===`insideBottomLeft`?FQ({x:f+x,y:s+c-_,horizontalAnchor:C,verticalAnchor:v},k):n===`insideBottomRight`?FQ({x:f+u-x,y:s+c-_,horizontalAnchor:S,verticalAnchor:v}
68,k):n&&typeof n==`object`&&(uk(n.x)||lk(n.x))&&(uk(n.y)||lk(n.y))?FQ({x:o+mk(n.x,m),y:s+mk(n.y,c),horizontalAnchor:`end`,verticalAnchor:`end`},k):FQ({x:h,y:s+c/2,horizontalAnchor:`middle`,verticalAnchor:`middle`},k)},BQ=[`labelRef`],VQ=[`content`];function HQ(e,t){if(e==null)return{};var n,r,i=UQ(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function UQ(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function WQ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function GQ(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?WQ(Object(n),!0).forEach(function(t){KQ(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WQ(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function KQ(e,t,n){return(t=qQ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qQ(e){var t=JQ(e,`string`);return typeof t==`symbol`?t:t+``}function JQ(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function YQ(){return YQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},YQ.apply(null,arguments)}var XQ=(0,f.createContext)(null),ZQ=e=>{var{x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:o,children:s}=e,c=(0,f.useMemo)(()=>({x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:o}),[t,n,r,i,a,o]);return f.createElement(XQ.Provider,{value:c},s)},QQ=()=>{var e=(0,f.useContext)(XQ),t=BF();return e||(t?zF(t):void 0)},$Q=(0,f.createContext)(null),e$=()=>{var e=(0,f.useContext)($Q),t=WA(aB);return e||t},t$=e=>{var{value:t,formatter:n}=e,r=vk(e.children)?t:e.children;return typeof n==`function`?n(r):r},n$=e=>e!=null&&typeof e==`function`,r$=(e,t)=>sk(t-e)*Math.min(Math.abs(t-e),360),i$=(e,t,n,r,i)=>{var{offset:a,className:o}=e,{cx:s,cy:c,innerRadius:l,outerRadius:u,startAngle:d,endAngle:p,clockWise:m}=i,h=(l+u)/2,g=r$(d,p),_=g>=0?1:-1,v,y;switch(t){case`insideStart`:v=d+_*a,y=m;break;case`insideEnd`:v=p-_*a,y=!m;break;case`end`:v=p+_*a,y=m;break;default:throw Error(`Unsupported position ${t}`)}y=g<=0?y:!y;var b=zR(s,c,h,v),x=zR(s,c,h,v+(y?1:-1)*359),S=`M${b.x},${b.y} 69 A${h},${h},0,1,${+!y}, 70 ${x.x},${x.y}`,C=vk(e.id)?pk(`recharts-radial-line-`):e.id;return f.createElement(`text`,YQ({},r,{dominantBaseline:`central`,className:zc(`recharts-radial-bar-label`,o)}),f.createElement(`defs`,null,f.createElement(`path`,{id:C,d:S})),f.createElement(`textPath`,{xlinkHref:`#${C}`},n))},a$=(e,t,n)=>{var{cx:r,cy:i,innerRadius:a,outerRadius:o,startAngle:s,endAngle:c}=e,l=(s+c)/2;if(n===`outside`){var{x:u,y:d}=zR(r,i,o+t,l);return{x:u,y:d,textAnchor:u>=r?`start`:`end`,verticalAnchor:`middle`}}if(n===`center`)return{x:r,y:i,textAnchor:`middle`,verticalAnchor:`middle`};if(n===`centerTop`)return{x:r,y:i,textAnchor:`middle`,verticalAnchor:`start`};if(n===`centerBottom`)return{x:r,y:i,textAnchor:`middle`,verticalAnchor:`end`};var{x:f,y:p}=zR(r,i,(a+o)/2,l);return{x:f,y:p,textAnchor:`middle`,verticalAnchor:`middle`}},o$=e=>e!=null&&`cx`in e&&uk(e.cx),s$={angle:0,offset:5,zIndex:zz.label,position:`middle`,textBreakAll:!1};function c$(e){if(!o$(e))return e;var{cx:t,cy:n,outerRadius:r}=e,i=r*2;return{x:t-r,y:n-r,width:i,upperWidth:i,lowerWidth:i,height:i}}function l$(e){var t=Kk(e,s$),{viewBox:n,parentViewBox:r,position:i,value:a,children:o,content:s,className:c=``,textBreakAll:l,labelRef:u}=t,d=e$(),p=QQ(),m=n==null?i===`center`?p:d??p:o$(n)?n:zF(n),h,g,_=c$(m);if(!m||vk(a)&&vk(o)&&!(0,f.isValidElement)(s)&&typeof s!=`function`)return null;var v=GQ(GQ({},t),{},{viewBox:m});if((0,f.isValidElement)(s)){var{labelRef:y}=v;return(0,f.cloneElement)(s,HQ(v,BQ))}if(typeof s==`function`){var{content:b}=v;if(h=(0,f.createElement)(s,HQ(v,VQ)),(0,f.isValidElement)(h))return h}else h=t$(t);var x=fD(t);
70if(o$(m)){if(i===`insideStart`||i===`insideEnd`||i===`end`)return i$(t,i,h,x,m);g=a$(m,t.offset,t.position)}else{if(!_)return null;var S=zQ({viewBox:_,position:i,offset:t.offset,parentViewBox:o$(r)?void 0:r,clamp:!0});g=GQ(GQ({x:S.x,y:S.y,textAnchor:S.horizontalAnchor,verticalAnchor:S.verticalAnchor},S.width===void 0?{}:{width:S.width}),S.height===void 0?{}:{height:S.height})}return f.createElement(BX,{zIndex:t.zIndex},f.createElement(NQ,YQ({ref:u,className:zc(`recharts-label`,c)},x,g,{textAnchor:SQ(x.textAnchor)?x.textAnchor:g.textAnchor,breakAll:l}),h))}l$.displayName=`Label`;var u$=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?f.createElement(l$,YQ({key:`label-implicit`},r)):dk(e)?f.createElement(l$,YQ({key:`label-implicit`,value:e},r)):(0,f.isValidElement)(e)?e.type===l$?(0,f.cloneElement)(e,GQ({key:`label-implicit`},r)):f.createElement(l$,YQ({key:`label-implicit`,content:e},r)):n$(e)?f.createElement(l$,YQ({key:`label-implicit`,content:e},r)):e&&typeof e==`object`?f.createElement(l$,YQ({},e,{key:`label-implicit`},r)):null};function d$(e){var{label:t,labelRef:n}=e;return u$(t,QQ(),n)||null}var f$=[`valueAccessor`],p$=[`dataKey`,`clockWise`,`id`,`textBreakAll`,`zIndex`];function m$(){return m$=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},m$.apply(null,arguments)}function h$(e,t){if(e==null)return{};var n,r,i=g$(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function g$(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var _$=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(CQ(t))return t},v$=(0,f.createContext)(void 0),y$=v$.Provider,b$=(0,f.createContext)(void 0);b$.Provider;function x$(){return(0,f.useContext)(v$)}function S$(){return(0,f.useContext)(b$)}function C$(e){var{valueAccessor:t=_$}=e,n=h$(e,f$),{dataKey:r,clockWise:i,id:a,textBreakAll:o,zIndex:s}=n,c=h$(n,p$),l=x$(),u=S$(),d=l||u;return!d||!d.length?null:f.createElement(BX,{zIndex:s??zz.label},f.createElement(CD,{className:`recharts-label-list`},d.map((e,i)=>{var s=vk(r)?t(e,i):wP(e.payload,r),l=vk(a)?{}:{id:`${a}-${i}`};return f.createElement(l$,m$({key:`label-${i}`},fD(e),c,l,{fill:n.fill??e.fill,parentViewBox:e.parentViewBox,value:s,textBreakAll:o,viewBox:e.viewBox,index:i,zIndex:0}))})))}C$.displayName=`LabelList`;function w$(e){var{label:t}=e;return t?t===!0?f.createElement(C$,{key:`labelList-implicit`}):f.isValidElement(t)||n$(t)?f.createElement(C$,{key:`labelList-implicit`,content:t}):typeof t==`object`?f.createElement(C$,m$({key:`labelList-implicit`},t,{type:String(t.type)})):null:null}function T$(){return T$=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},T$.apply(null,arguments)}var E$=e=>{var{cx:t,cy:n,r,className:i}=e,a=zc(`recharts-dot`,i);return uk(t)&&uk(n)&&uk(r)?f.createElement(`circle`,T$({},uD(e),Rk(e),{className:a,cx:t,cy:n,r})):null},D$=SN({name:`polarAxis`,initialState:{radiusAxis:{},angleAxis:{}},reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=qI(t.payload)},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=qI(t.payload)},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),{addRadiusAxis:one,removeRadiusAxis:sne,addAngleAxis:cne,removeAngleAxis:lne}=D$.actions,O$=D$.reducer;function k$(e){return e&&typeof e==`object`&&`className`in e&&typeof e.className==`string`?e.className:``}var A$=e=>e&&typeof e==`object`&&`clipDot`in e?!!e.clipDot:!0,j$=n((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){if(typeof e!=`object`||!e)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(Object.prototype.toString.call(e)!==`[object Object]`){let t=e[Symbol.toStringTag];return t==null||!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable?!1:e.toString()===`[object ${t}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}e.isPlainObject=t})),M$=n(((e,t)=>{t.exports=j$().isPlainObject})),N$,P$,F$,I$,L$;function R$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function z$(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];
70t%2?R$(Object(n),!0).forEach(function(t){B$(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):R$(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function B$(e,t,n){return(t=V$(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function V$(e){var t=H$(e,`string`);return typeof t==`symbol`?t:t+``}function H$(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function U$(){return U$=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},U$.apply(null,arguments)}function W$(e,t){return t||=e.slice(0),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var G$=(e,t,n,r,i)=>{var a=n-r,o=ak(N$||=W$([`M `,`,`,``]),e,t);return o+=ak(P$||=W$([`L `,`,`,``]),e+n,t),o+=ak(F$||=W$([`L `,`,`,``]),e+n-a/2,t+i),o+=ak(I$||=W$([`L `,`,`,``]),e+n-a/2-r,t+i),o+=ak(L$||=W$([`L `,`,`,` Z`]),e,t),o},K$={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:`ease`},q$=e=>{var t=Kk(e,K$),{x:n,y:r,upperWidth:i,lowerWidth:a,height:o,className:s}=t,{animationEasing:c,animationDuration:l,animationBegin:u,isUpdateAnimationActive:d}=t,p=(0,f.useRef)(null),[m,h]=(0,f.useState)(-1),g=(0,f.useRef)(i),_=(0,f.useRef)(a),v=(0,f.useRef)(o),y=(0,f.useRef)(n),b=(0,f.useRef)(r),x=gR(e,`trapezoid-`);if((0,f.useEffect)(()=>{if(p.current&&p.current.getTotalLength)try{var e=p.current.getTotalLength();e&&h(e)}catch{}},[]),n!==+n||r!==+r||i!==+i||a!==+a||o!==+o||i===0&&a===0||o===0)return null;var S=zc(`recharts-trapezoid`,s);if(!d)return f.createElement(`g`,null,f.createElement(`path`,U$({},fD(t),{className:S,d:G$(n,r,i,a,o)})));var C=g.current,w=_.current,T=v.current,E=y.current,D=b.current,O=`0px ${m===-1?1:m}px`,k=`${m}px ${m}px`,A=nR([`strokeDasharray`],l,c);return f.createElement(hR,{animationId:x,key:x,canBegin:m>0,duration:l,easing:c,isActive:d,begin:u},e=>{var s=gk(C,i,e),c=gk(w,a,e),l=gk(T,o,e),u=gk(E,n,e),d=gk(D,r,e);p.current&&(g.current=s,_.current=c,v.current=l,y.current=u,b.current=d);var m=e>0?{transition:A,strokeDasharray:k}:{strokeDasharray:O};return f.createElement(`path`,U$({},fD(t),{className:S,d:G$(u,d,s,c,l),ref:p,style:z$(z$({},m),t.style)}))})},J$=t(M$()),Y$=[`option`,`shapeType`,`activeClassName`,`inActiveClassName`];function X$(e,t){if(e==null)return{};var n,r,i=Z$(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Z$(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Q$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $$(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Q$(Object(n),!0).forEach(function(t){e1(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Q$(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function e1(e,t,n){return(t=t1(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function t1(e){var t=n1(e,`string`);return typeof t==`symbol`?t:t+``}function n1(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function r1(e,t){return $$($$({},t),e)}function i1(e,t){return e===`symbols`}function a1(e){var{shapeType:t,elementProps:n}=e;switch(t){case`rectangle`:return f.createElement(jR,n);case`trapezoid`:return f.createElement(q$,n);case`sector`:return f.createElement(sz,n);case`symbols`:if(i1(t,n))return f.createElement(Ik,n);break;case`curve`:return f.createElement(ZL,n);default:return null}}function o1(e){return(0,f.isValidElement)(e)?e.props:e}function s1(e){var{option:t,shapeType:n,activeClassName:r=`recharts-active-shape`,inActiveClassName:i=`recharts-shape`}=e,a=X$(e,Y$),o;if((0,f.isValidElement)(t))o=(0,f.cloneElement)(t,$$($$({},a),o1(t)));else if(typeof t==`function`)o=t(a,a.index);else if((0,J$.default)(t)&&typeof t!=`boolean`){var s=r1(t,a);o=f.createElement(a1,{shapeType:n,elementProps:s})}else{var c=a;o=f.createElement(a1,{shapeType:n,elementProps:c})}return a.isActive?f.createElement(CD,{className:r},o):f.createElement(CD,{className:i},o)}function c1(e){var{tooltipEntrySettings:t}=e,n=BA(),r=lF(),i=(0,f.useRef)(null);return(0,f.useLayoutEffect)(()=>{r||(i.current===null?n(OJ(t)):i.current!==t&&n(kJ({prev:i.current,next:t})),i.current=t)},[t,n,r]),(0,f.useLayoutEffect)(()=>()=>{i.current&&=(n(AJ(i.current)),null)},[n]),null}function l1(e){var{legendPayload:t}=e,n=BA(),r=lF(),i=(0,f.useRef)(null);return(0,f.useLayoutEffect)(()=>{r||(i.current===null?n(ZI(t)):i.current!==t&&n(QI({prev:i.current,next:t})),i.current=t)},[n,r,t]),(0,f.useLayoutEffect)(()=>()=>{i.current&&=(n($I(i.current)),null)},[n]),null}var u1=f.useId??(()=>{var[e]=f.useState(()=>pk(`uid-`));return e});function d1(e,t){var n=u1();return t||(e?`${e}-${n}`:n)}var f1=(0,f.createContext)(void 0),p1=e=>{var{id:t,type:n,children:r}=e,i=d1(`recharts-${n}`,t);return f.createElement(f1.Provider,{value:i},r(i))},m1=SN({name:`graphicalItems`,initialState:{cartesianItems:[],polarItems:[]},reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(qI(t.payload))},prepare:cN()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=JM(e).cartesianItems.indexOf(qI(n));i>-1&&(e.cartesianItems[i]=qI(r))},prepare:cN()},removeCartesianGraphicalItem:{reducer(e,t){var n=JM(e).cartesianItems.indexOf(qI(t.payload));n>-1&&e.cartesianItems.splice(n,1)},prepare:cN()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(qI(t.payload))},prepare:cN()},removePolarGraphicalItem:{reducer(e,t){var n=JM(e).polarItems.indexOf(qI(t.payload));n>-1&&e.polarItems.splice(n,1)},prepare:cN()},replacePolarGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=JM(e).polarItems.indexOf(qI(n));i>-1&&(e.polarItems[i]=qI(r))},prepare:cN()}}}),{addCartesianGraphicalItem:h1,replaceCartesianGraphicalItem:g1,removeCartesianGraphicalItem:_1,addPolarGraphicalItem:une,removePolarGraphicalItem:dne,replacePolarGraphicalItem:fne}=m1.actions,v1=m1.reducer,y1=(0,f.memo)(e=>{var t=BA(),n=(0,f.useRef)(null);return(0,f.useLayoutEffect)(()=>{n.current===null?t(h1(e)):n.current!==e&&t(g1({prev:n.current,next:e})),n.current=e},[t,e]),(0,f.useLayoutEffect)(()=>()=>{n.current&&=(t(_1(n.current)),null)},[t]),null}),b1=[`points`];function x1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function S1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];
70t%2?x1(Object(n),!0).forEach(function(t){C1(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x1(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function C1(e,t,n){return(t=w1(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function w1(e){var t=T1(e,`string`);return typeof t==`symbol`?t:t+``}function T1(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function E1(){return E1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},E1.apply(null,arguments)}function D1(e,t){if(e==null)return{};var n,r,i=O1(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function O1(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function k1(e){var{option:t,dotProps:n,className:r}=e;if((0,f.isValidElement)(t))return(0,f.cloneElement)(t,n);if(typeof t==`function`)return t(n);var i=zc(r,typeof t==`boolean`?``:t.className),a=n??{},{points:o}=a,s=D1(a,b1);return f.createElement(E$,E1({},s,{className:i}))}function A1(e,t){return e==null?!1:t?!0:e.length===1}function pne(e){var{points:t,dot:n,className:r,dotClassName:i,dataKey:a,baseProps:o,needClip:s,clipPathId:c,zIndex:l=zz.scatter}=e;if(!A1(t,n))return null;var u=A$(n),d=pD(n),p=t.map((e,r)=>{var s=S1(S1(S1({r:3},o),d),{},{index:r,cx:e.x??void 0,cy:e.y??void 0,dataKey:a,value:e.value,payload:e.payload,points:t});return f.createElement(k1,{key:`dot-${r}`,option:n,dotProps:s,className:i})}),m={};return s&&c!=null&&(m.clipPath=`url(#clipPath-${u?``:`dots-`}${c})`),f.createElement(BX,{zIndex:l},f.createElement(CD,E1({className:r},m),p))}function j1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function M1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?j1(Object(n),!0).forEach(function(t){N1(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j1(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function N1(e,t,n){return(t=P1(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P1(e){var t=F1(e,`string`);return typeof t==`symbol`?t:t+``}function F1(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var I1=SN({name:`cartesianAxis`,initialState:{xAxis:{},yAxis:{},zAxis:{}},reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=qI(t.payload)},prepare:cN()},replaceXAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.xAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.xAxis[n.id],e.xAxis[r.id]=qI(r))},prepare:cN()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:cN()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=qI(t.payload)},prepare:cN()},replaceYAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.yAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.yAxis[n.id],e.yAxis[r.id]=qI(r))},prepare:cN()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:cN()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=qI(t.payload)},prepare:cN()},replaceZAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.zAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.zAxis[n.id],e.zAxis[r.id]=qI(r))},prepare:cN()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:cN()},updateYAxisWidth(e,t){var{id:n,width:r}=t.payload,i=e.yAxis[n];if(i){var a=i.widthHistory||[];if(a.length===3&&a[0]===a[2]&&r===a[1]&&r!==i.width&&Math.abs(r-(a[0]??0))<=1)return;var o=[...a,r].slice(-3);e.yAxis[n]=M1(M1({},i),{}
70,{width:r,widthHistory:o})}}}}),{addXAxis:L1,replaceXAxis:R1,removeXAxis:z1,addYAxis:B1,replaceYAxis:V1,removeYAxis:H1,addZAxis:mne,replaceZAxis:hne,removeZAxis:gne,updateYAxisWidth:U1}=I1.actions,W1=I1.reducer,G1=$([$([aF],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),HP,UP],(e,t,n)=>{if(!(!e||t==null||n==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,n-e.top-e.bottom)}}),K1=()=>WA(G1),q1=()=>WA(WY);function J1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Y1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?J1(Object(n),!0).forEach(function(t){X1(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):J1(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function X1(e,t,n){return(t=Z1(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Z1(e){var t=Q1(e,`string`);return typeof t==`symbol`?t:t+``}function Q1(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var $1=e=>{var{point:t,childIndex:n,mainColor:r,activeDot:i,dataKey:a,clipPath:o}=e;if(i===!1||t.x==null||t.y==null)return null;var s=Y1(Y1(Y1({},{index:n,dataKey:a,cx:t.x,cy:t.y,r:4,fill:r??`none`,strokeWidth:2,stroke:`#fff`,payload:t.payload,value:t.value}),dD(i)),Rk(i)),c=(0,f.isValidElement)(i)?(0,f.cloneElement)(i,s):typeof i==`function`?i(s):f.createElement(E$,s);return f.createElement(CD,{className:`recharts-active-dot`,clipPath:o},c)};function e0(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:i,clipPath:a,zIndex:o=zz.activeDot}=e,s=WA(LY),c=q1();if(t==null||c==null)return null;var l=t.find(e=>c.includes(e.payload));return vk(l)?null:f.createElement(BX,{zIndex:o},f.createElement($1,{point:l,childIndex:Number(s),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}var t0=e=>{var{chartData:t}=e,n=BA(),r=lF();return(0,f.useEffect)(()=>r?()=>{}:(n(cZ(t)),()=>{n(cZ(void 0))}),[t,n,r]),null},n0={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},r0=SN({name:`brush`,initialState:n0,reducers:{setBrushSettings(e,t){return t.payload==null?n0:t.payload}}}),{setBrushSettings:_ne}=r0.actions,i0=r0.reducer;function a0(e){return(e%180+180)%180}var o0=function(e){var{width:t,height:n}=e,r=a0(arguments.length>1&&arguments[1]!==void 0?arguments[1]:0)*Math.PI/180,i=Math.atan(n/t),a=r>i&&r<Math.PI-i?n/Math.sin(r):t/Math.cos(r);return Math.abs(a)},s0=SN({name:`referenceElements`,initialState:{dots:[],areas:[],lines:[]},reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=JM(e).dots.findIndex(e=>e===t.payload);n!==-1&&e.dots.splice(n,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var n=JM(e).areas.findIndex(e=>e===t.payload);n!==-1&&e.areas.splice(n,1)},addLine:(e,t)=>{e.lines.push(qI(t.payload))},removeLine:(e,t)=>{var n=JM(e).lines.findIndex(e=>e===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:vne,removeDot:yne,addArea:bne,removeArea:xne,addLine:Sne,removeLine:Cne}=s0.actions,c0=s0.reducer,l0=(0,f.createContext)(void 0),u0=e=>{var{children:t}=e,[n]=(0,f.useState)(`${pk(`recharts`)}-clip`),r=K1();if(r==null)return null;var{x:i,y:a,width:o,height:s}=r;return f.createElement(l0.Provider,{value:n},f.createElement(`defs`,null,f.createElement(`clipPath`,{id:n},f.createElement(`rect`,{x:i,y:a,height:s,width:o}))),t)};function d0(e,t){if(t<1)return[];if(t===1)return e;for(var n=[],r=0;r<e.length;r+=t){var i=e[r];i!==void 0&&n.push(i)}return n}function f0(e,t,n){return o0({width:e.width+t.width,height:e.height+t.height},n)}function p0(e,t,n){var r=n===`width`,{x:i,y:a,width:o,height:s}=e;return t===1?{start:r?i:a,end:r?i+o:a+s}:{start:r?i+o:a+s,end:r?i:a}}function m0(e,t,n,r,i){if(e*t<e*r||e*t>e*i)return!1;var a=n();return e*(t-e*a/2-r)>=0&&e*(t+e*a/2-i)<=0}function h0(e,t){return d0(e,t+1)}function g0(e,t,n,r,i){for(var a=(r||[]).slice(),{start:o,end:s}=t,c=0,l=1,u=o,d=function(){var t=r?.[c];if(t===void 0)return{v:d0(r,l)};var a=c,d,f=()=>(d===void 0&&(d=n(t,a)),d),p=t.coordinate,m=c===0||m0(e,p,f,u,s);
70m||(c=0,u=o,l+=1),m&&(u=p+e*(f()/2+i),c+=l)},f;l<=a.length;)if(f=d(),f)return f.v;return[]}function _0(e,t,n,r,i){var a=(r||[]).slice().length;if(a===0)return[];for(var{start:o,end:s}=t,c=1;c<=a;c++){for(var l=(a-1)%c,u=o,d=!0,f=function(){var t=r[m];if(t==null)return 0;var a=m,o,c=()=>(o===void 0&&(o=n(t,a)),o),f=t.coordinate,p=m===l||m0(e,f,c,u,s);if(!p)return d=!1,1;p&&(u=f+e*(c()/2+i))},p,m=l;m<a&&(p=f(),!(p!==0&&p===1));m+=c);if(d){for(var h=[],g=l;g<a;g+=c){var _=r[g];_!=null&&h.push(_)}return h}}return[]}function v0(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function y0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?v0(Object(n),!0).forEach(function(t){b0(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v0(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function b0(e,t,n){return(t=x0(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function x0(e){var t=S0(e,`string`);return typeof t==`symbol`?t:t+``}function S0(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function C0(e,t,n,r,i){for(var a=(r||[]).slice(),o=a.length,{start:s}=t,{end:c}=t,l=function(t){var r=a[t];if(r==null)return 1;var l=r,u,d=()=>(u===void 0&&(u=n(r,t)),u);if(t===o-1){var f=e*(l.coordinate+e*d()/2-c);a[t]=l=y0(y0({},l),{},{tickCoord:f>0?l.coordinate-f*e:l.coordinate})}else a[t]=l=y0(y0({},l),{},{tickCoord:l.coordinate});l.tickCoord!=null&&m0(e,l.tickCoord,d,s,c)&&(c=l.tickCoord-e*(d()/2+i),a[t]=y0(y0({},l),{},{isShow:!0}))},u=o-1;u>=0;u--)if(l(u))continue;return a}function w0(e,t,n,r,i,a){var o=(r||[]).slice(),s=o.length,{start:c,end:l}=t;if(a){var u=r[s-1];if(u!=null){var d=n(u,s-1),f=e*(u.coordinate+e*d/2-l);o[s-1]=u=y0(y0({},u),{},{tickCoord:f>0?u.coordinate-f*e:u.coordinate}),u.tickCoord!=null&&m0(e,u.tickCoord,()=>d,c,l)&&(l=u.tickCoord-e*(d/2+i),o[s-1]=y0(y0({},u),{},{isShow:!0}))}}for(var p=a?s-1:s,m=function(t){var r=o[t];if(r==null)return 1;var a=r,s,u=()=>(s===void 0&&(s=n(r,t)),s);if(t===0){var d=e*(a.coordinate-e*u()/2-c);o[t]=a=y0(y0({},a),{},{tickCoord:d<0?a.coordinate-d*e:a.coordinate})}else o[t]=a=y0(y0({},a),{},{tickCoord:a.coordinate});a.tickCoord!=null&&m0(e,a.tickCoord,u,c,l)&&(c=a.tickCoord+e*(u()/2+i),o[t]=y0(y0({},a),{},{isShow:!0}))},h=0;h<p;h++)if(m(h))continue;return o}function T0(e,t,n){var{tick:r,ticks:i,viewBox:a,minTickGap:o,orientation:s,interval:c,tickFormatter:l,unit:u,angle:d}=e;if(!i||!i.length||!r)return[];if(uk(c)||LL.isSsr)return h0(i,uk(c)?c:0)??[];var f=[],p=s===`top`||s===`bottom`?`width`:`height`,m=u&&p===`width`?JZ(u,{fontSize:t,letterSpacing:n}):{width:0,height:0},h=(e,r)=>{var i=typeof l==`function`?l(e.value,r):e.value;return p===`width`?f0(JZ(i,{fontSize:t,letterSpacing:n}),m,d):JZ(i,{fontSize:t,letterSpacing:n})[p]},g=i[0],_=i[1],v=i.length>=2&&g!=null&&_!=null?sk(_.coordinate-g.coordinate):1,y=p0(a,v,p);return c===`equidistantPreserveStart`?g0(v,y,h,i,o):c===`equidistantPreserveEnd`?_0(v,y,h,i,o):(f=c===`preserveStart`||c===`preserveStartEnd`?w0(v,y,h,i,o,c===`preserveStartEnd`):C0(v,y,h,i,o),f.filter(e=>e.isShow))}var E0=e=>{var{ticks:t,label:n,labelGapWithTick:r=5,tickSize:i=0,tickMargin:a=0}=e,o=0;if(t){Array.from(t).forEach(e=>{if(e){var t=e.getBoundingClientRect();t.width>
70o&&(o=t.width)}});var s=n?n.getBoundingClientRect().width:0,c=i+a,l=o+c+s+(n?r:0);return Math.round(l)}return 0},D0=SN({name:`renderedTicks`,initialState:{xAxis:{},yAxis:{}},reducers:{setRenderedTicks:(e,t)=>{var{axisType:n,axisId:r,ticks:i}=t.payload;e[n][r]=qI(i)},removeRenderedTicks:(e,t)=>{var{axisType:n,axisId:r}=t.payload;delete e[n][r]}}}),{setRenderedTicks:O0,removeRenderedTicks:k0}=D0.actions,A0=D0.reducer,j0=[`axisLine`,`width`,`height`,`className`,`hide`,`ticks`,`axisType`,`axisId`];function M0(e,t){if(e==null)return{};var n,r,i=N0(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function N0(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function P0(){return P0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},P0.apply(null,arguments)}function F0(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function I0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?F0(Object(n),!0).forEach(function(t){L0(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):F0(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function L0(e,t,n){return(t=R0(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function R0(e){var t=z0(e,`string`);return typeof t==`symbol`?t:t+``}function z0(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var B0={x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:`bottom`,ticks:[],stroke:`#666`,tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:`preserveEnd`,zIndex:zz.axis};function V0(e){var{x:t,y:n,width:r,height:i,orientation:a,mirror:o,axisLine:s,otherSvgProps:c}=e;if(!s)return null;var l=I0(I0(I0({},c),uD(s)),{},{fill:`none`});if(a===`top`||a===`bottom`){var u=+(a===`top`&&!o||a===`bottom`&&o);l=I0(I0({},l),{},{x1:t,y1:n+u*i,x2:t+r,y2:n+u*i})}else{var d=+(a===`left`&&!o||a===`right`&&o);l=I0(I0({},l),{},{x1:t+d*r,y1:n,x2:t+d*r,y2:n+i})}return f.createElement(`line`,P0({},l,{className:zc(`recharts-cartesian-axis-line`,(0,ok.default)(s,`className`))}))}function H0(e,t,n,r,i,a,o,s,c){var l,u,d,f,p,m,h=s?-1:1,g=e.tickSize||o,_=uk(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case`top`:l=u=e.coordinate,f=n+ +!s*i,d=f-h*g,m=d-h*c,p=_;break;case`left`:d=f=e.coordinate,u=t+ +!s*r,l=u-h*g,p=l-h*c,m=_;break;case`right`:d=f=e.coordinate,u=t+ +s*r,l=u+h*g,p=l+h*c,m=_;break;default:l=u=e.coordinate,f=n+ +s*i,d=f+h*g,m=d+h*c,p=_;break}return{line:{x1:l,y1:d,x2:u,y2:f},tick:{x:p,y:m}}}function U0(e,t){switch(e){case`left`:return t?`start`:`end`;case`right`:return t?`end`:`start`;default:return`middle`}}function W0(e,t){switch(e){case`left`:case`right`:return`middle`;case`top`:return t?`start`:`end`;default:return t?`end`:`start`}}function G0(e){var{option:t,tickProps:n,value:r}=e,i,a=zc(n.className,`recharts-cartesian-axis-tick-value`);if(f.isValidElement(t))i=f.cloneElement(t,I0(I0({},n),{},{className:a}));else if(typeof t==`function`)i=t(I0(I0({},n),{},{className:a}));else{var o=`recharts-cartesian-axis-tick-value`;typeof t!=`boolean`&&(o=zc(o,k$(t))),i=f.createElement(NQ,P0({},n,{className:o}),r)}return i}function K0(e){var{ticks:t,axisType:n,axisId:r}=e,i=BA();return(0,f.useEffect)(()=>r==null||n==null?xk:(i(O0({ticks:t.map(e=>({value:e.value,coordinate:e.coordinate,offset:e.offset,index:e.index})),axisId:r,axisType:n})),()=>{i(k0({axisId:r,axisType:n}))}),[i,t,r,n]),null}var q0=(0,f.forwardRef)((e,t)=>
70{var{ticks:n=[],tick:r,tickLine:i,stroke:a,tickFormatter:o,unit:s,padding:c,tickTextProps:l,orientation:u,mirror:d,x:p,y:m,width:h,height:g,tickSize:_,tickMargin:v,fontSize:y,letterSpacing:b,getTicksConfig:x,events:S,axisType:C,axisId:w}=e,T=T0(I0(I0({},x),{},{ticks:n}),y,b),E=uD(x),D=dD(r),O=SQ(E.textAnchor)?E.textAnchor:U0(u,d),k=W0(u,d),A={};typeof i==`object`&&(A=i);var j=I0(I0({},E),{},{fill:`none`},A),M=T.map(e=>I0({entry:e},H0(e,p,m,h,g,u,_,d,v))),N=M.map(e=>{var{entry:t,line:n}=e;return f.createElement(CD,{className:`recharts-cartesian-axis-tick`,key:`tick-${t.value}-${t.coordinate}-${t.tickCoord}`},i&&f.createElement(`line`,P0({},j,n,{className:zc(`recharts-cartesian-axis-tick-line`,(0,ok.default)(i,`className`))})))}),ee=M.map((e,t)=>{var{entry:n,tick:i}=e,u=I0(I0({},I0(I0(I0(I0({verticalAnchor:k},E),{},{textAnchor:O,stroke:`none`,fill:a},i),{},{index:t,payload:n,visibleTicksCount:T.length,tickFormatter:o,padding:c},l),{},{angle:l?.angle??E.angle??0})),D);return f.createElement(CD,P0({className:`recharts-cartesian-axis-tick-label`,key:`tick-label-${n.value}-${n.coordinate}-${n.tickCoord}`},Bk(S,n,t)),r&&f.createElement(G0,{option:r,tickProps:u,value:`${typeof o==`function`?o(n.value,t):n.value}${s||``}`}))});return f.createElement(`g`,{className:`recharts-cartesian-axis-ticks recharts-${C}-ticks`},f.createElement(K0,{ticks:T,axisId:w,axisType:C}),ee.length>0&&f.createElement(BX,{zIndex:zz.label},f.createElement(`g`,{className:`recharts-cartesian-axis-tick-labels recharts-${C}-tick-labels`,ref:t},ee)),N.length>0&&f.createElement(`g`,{className:`recharts-cartesian-axis-tick-lines recharts-${C}-tick-lines`},N))}),J0=(0,f.forwardRef)((e,t)=>{var{axisLine:n,width:r,height:i,className:a,hide:o,ticks:s,axisType:c,axisId:l}=e,u=M0(e,j0),[d,p]=(0,f.useState)(``),[m,h]=(0,f.useState)(``),g=(0,f.useRef)(null);(0,f.useImperativeHandle)(t,()=>({getCalculatedWidth:()=>E0({ticks:g.current,label:e.labelRef?.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}));var _=(0,f.useCallback)(e=>{if(e){var t=e.getElementsByClassName(`recharts-cartesian-axis-tick-value`);g.current=t;var n=t[0];if(n){var r=window.getComputedStyle(n),i=r.fontSize,a=r.letterSpacing;(i!==d||a!==m)&&(p(i),h(a))}}},[d,m]);return o||r!=null&&r<=0||i!=null&&i<=0?null:f.createElement(BX,{zIndex:e.zIndex},f.createElement(CD,{className:zc(`recharts-cartesian-axis`,a)},f.createElement(V0,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:uD(e)}),f.createElement(q0,{ref:_,axisType:c,events:u,fontSize:d,getTicksConfig:e,height:e.height,letterSpacing:m,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:s,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:l}),f.createElement(ZQ,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},f.createElement(d$,{label:e.label,labelRef:e.labelRef}),e.children)))}),Y0=f.forwardRef((e,t)=>{var n=Kk(e,B0);return f.createElement(J0,P0({},n,{ref:t}))});Y0.displayName=`CartesianAxis`;var X0=[`x1`,`y1`,`x2`,`y2`,`key`],Z0=[`offset`],Q0=[`xAxisId`,`yAxisId`],$0=[`xAxisId`,`yAxisId`];function e2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function t2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?e2(Object(n),!0).forEach(function(t){n2(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):e2(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function n2(e,t,n){return(t=r2(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r2(e){var t=i2(e,`string`);return typeof t==`symbol`?t:t+``}function i2(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function a2(){return a2=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a2.apply(null,arguments)}function o2(e,t){if(e==null)return{};var n,r,i=s2(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function s2(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var c2=e=>{var{fill:t}=e;if(!t||t===`none`)return null;var{fillOpacity:n,x:r,y:i,width:a,height:o,ry:s}=e;return f.createElement(`rect`,{x:r,y:i,ry:s,width:a,height:o,stroke:`none`,fill:t,fillOpacity:n,className:`recharts-cartesian-grid-bg`})};function l2(e){var{option:t,lineItemProps:n}=e,r;if(f.isValidElement(t))r=f.cloneElement(t,n);else if(typeof t==`function`)r=t(n);else{var{x1:i,y1:a,x2:o,y2:s,key:c}=n,l=uD(o2(n,X0))??{},{offset:u}=l,d=o2(l,Z0);r=f.createElement(`line`,a2({},d,{x1:i,y1:a,x2:o,y2:s,fill:`none`,key:c}))}return r}function u2(e){var{x:t,width:n,horizontal:r=!0,horizontalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:a,yAxisId:o}=e,s=o2(e,Q0),c=i.map((e,i)=>{var a=t2(t2({},s),{},{x1:t,y1:e,x2:t+n,y2:e,key:`line-${i}`,index:i});return f.createElement(l2,{key:`line-${i}`,option:r,lineItemProps:a})});return f.createElement(`g`,{className:`recharts-cartesian-grid-horizontal`},c)}function d2(e){var{y:t,height:n,vertical:r=!0,verticalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:a,yAxisId:o}=e,s=o2(e,$0),c=i.map((e,i)=>{var a=t2(t2({},s),{},{x1:e,y1:t,x2:e,y2:t+n,key:`line-${i}`,index:i});return f.createElement(l2,{option:r,lineItemProps:a,key:`line-${i}`})});return f.createElement(`g`,{className:`recharts-cartesian-grid-vertical`},c)}function f2(e){var{horizontalFill:t,fillOpacity:n,x:r,y:i,width:a,height:o,horizontalPoints:s,horizontal:c=!0}=e;if(!c||!t||!t.length||s==null)return null;var l=s.map(e=>Math.round(e+i-i)).sort((e,t)=>
70e-t);i!==l[0]&&l.unshift(0);var u=l.map((e,s)=>{var c=l[s+1],u=c==null?i+o-e:c-e;if(u<=0)return null;var d=s%t.length;return f.createElement(`rect`,{key:`react-${s}`,y:e,x:r,height:u,width:a,stroke:`none`,fill:t[d],fillOpacity:n,className:`recharts-cartesian-grid-bg`})});return f.createElement(`g`,{className:`recharts-cartesian-gridstripes-horizontal`},u)}function p2(e){var{vertical:t=!0,verticalFill:n,fillOpacity:r,x:i,y:a,width:o,height:s,verticalPoints:c}=e;if(!t||!n||!n.length)return null;var l=c.map(e=>Math.round(e+i-i)).sort((e,t)=>e-t);i!==l[0]&&l.unshift(0);var u=l.map((e,t)=>{var c=l[t+1],u=c==null?i+o-e:c-e;if(u<=0)return null;var d=t%n.length;return f.createElement(`rect`,{key:`react-${t}`,x:e,y:a,width:u,height:s,stroke:`none`,fill:n[d],fillOpacity:r,className:`recharts-cartesian-grid-bg`})});return f.createElement(`g`,{className:`recharts-cartesian-gridstripes-vertical`},u)}var m2=(e,t)=>{var{xAxis:n,width:r,height:i,offset:a}=e;return DP(T0(t2(t2(t2({},B0),n),{},{ticks:OP(n,!0),viewBox:{x:0,y:0,width:r,height:i}})),a.left,a.left+a.width,t)},h2=(e,t)=>{var{yAxis:n,width:r,height:i,offset:a}=e;return DP(T0(t2(t2(t2({},B0),n),{},{ticks:OP(n,!0),viewBox:{x:0,y:0,width:r,height:i}})),a.top,a.top+a.height,t)},g2={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:`#ccc`,fill:`none`,verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:zz.grid};function _2(e){var t=UF(),n=WF(),r=HF(),i=t2(t2({},Kk(e,g2)),{},{x:uk(e.x)?e.x:r.left,y:uk(e.y)?e.y:r.top,width:uk(e.width)?e.width:r.width,height:uk(e.height)?e.height:r.height}),{xAxisId:a,yAxisId:o,x:s,y:c,width:l,height:u,syncWithTicks:d,horizontalValues:p,verticalValues:m}=i,h=lF(),g=WA(e=>mJ(e,`xAxis`,a,h)),_=WA(e=>mJ(e,`yAxis`,o,h));if(!vP(l)||!vP(u)||!uk(s)||!uk(c))return null;var v=i.verticalCoordinatesGenerator||m2,y=i.horizontalCoordinatesGenerator||h2,{horizontalPoints:b,verticalPoints:x}=i;if((!b||!b.length)&&typeof y==`function`){var S=p&&p.length,C=y({yAxis:_?t2(t2({},_),{},{ticks:S?p:_.ticks}):void 0,width:t??l,height:n??u,offset:r},S?!0:d);_F(Array.isArray(C),`horizontalCoordinatesGenerator should return Array but instead it returned [${typeof C}]`),Array.isArray(C)&&(b=C)}if((!x||!x.length)&&typeof v==`function`){var w=m&&m.length,T=v({xAxis:g?t2(t2({},g),{},{ticks:w?m:g.ticks}):void 0,width:t??l,height:n??u,offset:r},w?!0:d);_F(Array.isArray(T),`verticalCoordinatesGenerator should return Array but instead it returned [${typeof T}]`),Array.isArray(T)&&(x=T)}return f.createElement(BX,{zIndex:i.zIndex},f.createElement(`g`,{className:`recharts-cartesian-grid`},f.createElement(c2,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),f.createElement(f2,a2({},i,{horizontalPoints:b})),f.createElement(p2,a2({},i,{verticalPoints:x})),f.createElement(u2,a2({},i,{offset:r,horizontalPoints:b,xAxis:g,yAxis:_})),f.createElement(d2,a2({},i,{offset:r,verticalPoints:x,xAxis:g,yAxis:_}))))}_2.displayName=`CartesianGrid`;var v2=SN({name:`errorBars`,initialState:{},reducers:{addErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]||(e[n]=[]),e[n].push(r)},replaceErrorBar:(e,t)=>{var{itemId:n,prev:r,next:i}=t.payload;e[n]&&(e[n]=e[n].map(e=>e.dataKey===r.dataKey&&e.direction===r.direction?i:e))},removeErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]&&(e[n]=e[n].filter(e=>e.dataKey!==r.dataKey||e.direction!==r.direction))}}}),{addErrorBar:wne,replaceErrorBar:Tne,removeErrorBar:Ene}=v2.actions,y2=v2.reducer,b2=[`children`];function x2(e,t){if(e==null)return{};var n,r,i=S2(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function S2(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var C2=(0,f.createContext)({data:[],xAxisId:`xAxis-0`,yAxisId:`yAxis-0`,dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0});function w2(e){var{children:t}=e,n=x2(e,b2);return f.createElement(C2.Provider,{value:n},t)}function T2(e,t){var n=WA(t=>gK(t,e)),r=WA(e=>yK(e,t)),i=n?.allowDataOverflow??mK.allowDataOverflow,a=r?.allowDataOverflow??_K.allowDataOverflow;return{needClip:i||a,needClipX:i,needClipY:a}}function E2(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,i=K1(),{needClipX:a,needClipY:o,needClip:s}=T2(t,n);if(!s||!i)return null;var{x:c,y:l,width:u,height:d}=i;return f.createElement(`clipPath`,{id:`clipPath-${r}`},f.createElement(`rect`,{x:a?c:c-u/2,y:o?l:l-d/2,width:a?u:u*2,height:o?d:d*2}))}var D2=(e,t,n,r)=>_J(e,`xAxis`,t,r),O2=(e,t,n,r)=>gJ(e,`xAxis`,t,r),k2=(e,t,n,r)=>_J(e,`yAxis`,n,r),A2=(e,t,n,r)=>gJ(e,`yAxis`,n,r),j2=$([KF,D2,k2,O2,A2],(e,t,n,r,i)=>EP(e,`xAxis`)?LP(t,r,!1):LP(n,i,!1)),M2=(e,t,n,r,i)=>i;function N2(e){return e.type===`line`}var P2=$([KF,D2,k2,O2,A2,$([DK,M2],(e,t)=>e.filter(N2).find(e=>e.id===t)),j2,hz],(e,t,n,r,i,a,o,s)=>{var{chartData:c,dataStartIndex:l,dataEndIndex:u}=s;if(!(a==null||t==null||n==null||r==null||i==null||r.length===0||i.length===0||o==null||e!==`horizontal`&&e!==`vertical`)){var{dataKey:d,data:f}=a,p=f!=null&&f.length>0?f:c?.slice(l,u+1);if(p!=null)return c4({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataKey:d,bandSize:o,displayedData:p})}});function F2(e){var t=dD(e),n=3,r=2;if(t!=null){var{r:i,strokeWidth:a}=t,o=Number(i),s=Number(a);return(Number.isNaN(o)||o<0)&&(o=n),(Number.isNaN(s)||s<0)&&(s=r),{r:o,strokeWidth:s}}return{r:n,strokeWidth:r}}var I2=[`id`],L2=[`type`,`layout`,`connectNulls`,`needClip`,`shape`],R2=[`activeDot`,`animateNewValues`,`animationBegin`,`animationDuration`,`animationEasing`,`connectNulls`,`dot`,`hide`,`isAnimationActive`,`label`,`legendT
70ype`,`xAxisId`,`yAxisId`,`id`];function z2(){return z2=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},z2.apply(null,arguments)}function B2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function V2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?B2(Object(n),!0).forEach(function(t){H2(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):B2(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function H2(e,t,n){return(t=U2(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function U2(e){var t=W2(e,`string`);return typeof t==`symbol`?t:t+``}function W2(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function G2(e,t){if(e==null)return{};var n,r,i=K2(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function K2(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var q2=e=>{var{dataKey:t,name:n,stroke:r,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:r,value:zP(n,t),payload:e}]},J2=f.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:a,name:o,hide:s,unit:c,tooltipType:l,id:u}=e,d={dataDefinedOnItem:n,getPosition:xk,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:zP(o,t),hide:s,type:l,color:r,unit:c,graphicalItemId:u}};return f.createElement(c1,{tooltipEntrySettings:d})}),Y2=(e,t)=>`${t}px ${e}px`;function X2(e,t){for(var n=e.length%2==0?e:[...e,0],r=[],i=0;i<t;++i)r.push(...n);return r}var Z2=(e,t,n)=>{var r=n.reduce((e,t)=>e+t,0);if(!r)return Y2(t,e);for(var i=Math.floor(e/r),a=e%r,o=[],s=0,c=0;s<n.length;c+=(l=n[s])??0,++s){var l,u=n[s];if(u!=null&&c+u>a){o=[...n.slice(0,s),a-c];break}}var d=o.length%2==0?[0,t]:[t];return[...X2(n,i),...o,...d].map(e=>`${e}px`).join(`, `)};function Q2(e){var{clipPathId:t,points:n,props:r}=e,{dot:i,dataKey:a,needClip:o}=r,{id:s}=r,c=uD(G2(r,I2));return f.createElement(pne,{points:n,dot:i,className:`recharts-line-dots`,dotClassName:`recharts-line-dot`,dataKey:a,baseProps:c,needClip:o,clipPathId:t})}function $2(e){var{showLabels:t,children:n,points:r}=e,i=(0,f.useMemo)(()=>r?.map(e=>{var t={x:e.x??0,y:e.y??0,width:0,lowerWidth:0,upperWidth:0,height:0};return V2(V2({},t),{},{value:e.value,payload:e.payload,viewBox:t,parentViewBox:void 0,fill:void 0})}),[r]);return f.createElement(y$,{value:t?i:void 0},n)}function e4(e){var{clipPathId:t,pathRef:n,points:r,strokeDasharray:i,props:a}=e,{type:o,layout:s,connectNulls:c,needClip:l,shape:u}=a,d=V2(V2({},fD(G2(a,L2))),{},{fill:`none`,className:`recharts-line-curve`,clipPath:l?`url(#clipPath-${t})`:void 0,points:r,type:o,layout:s,connectNulls:c,strokeDasharray:i??a.strokeDasharray});return f.createElement(f.Fragment,null,r?.length>1&&f.createElement(s1,z2({shapeType:`curve`,option:u},d,{pathRef:n})),f.createElement(Q2,{points:r,clipPathId:t,props:a}))}function t4(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function n4(e){var{clipPathId:t,props:n,pathRef:r,previousPointsRef:i,longestAnimatedLengthRef:a}=e,{points:o,strokeDasharray:s,isAnimationActive:c,animationBegin:l,animationDuration:u,animationEasing:d,animateNewValues:p,width:m,height:h,onAnimationEnd:g,onAnimationStart:_}=n,v=i.current,y=gR(o,`recharts-line-`),b=(0,f.useRef)(y),[x,S]=(0,f.useState)(!1),C=!x,w=(0,f.useCallback)(()=>{typeof g==`function`&&g(),S(!1)},[g]),T=(0,f.useCallback)(()=>{typeof _==`function`&&_(),S(!0)},[_]),E=t4(r.current),D=(0,f.useRef)(0);b.current!==y&&(D.current=a.current,b.current=y);var O=D.current;return f.createElement($2,{points:o,showLabels:C},n.children,f.createElement(hR,{animationId:y,begin:l,duration:u,isActive:c,easing:d,onAnimationEnd:w,onAnimationStart:T,key:y},e=>{var l=gk(O,E+O,e),u=Math.min(l,E),d=c?s?Z2(u,E,`${s}`.split(/[,\s]+/gim).map(e=>parseFloat(e))):Y2(E,u):s==null?void 0:String(s);if(e>0&&E>0&&(i.current=o,a.current=Math.max(a.current,u)),v){var g=v.length/o.length,_=e===1?o:o.map((t,n)=>{var r=Math.floor(n*g);if(v[r]){var i=v[r];return V2(V2({},t),{},{x:gk(i.x,t.x,e),y:gk(i.y,t.y,e)})}return p?V2(V2({},t),{},{x:gk(m*2,t.x,e),y:gk(h/2,t.y,e)}):V2(V2({},t),{},{x:t.x,y:t.y})});return i.current=_,f.createElement(e4,{props:n,points:_,clipPathId:t,pathRef:r,strokeDasharray:d})}return f.createElement(e4,{props:n,points:o,clipPathId:t,pathRef:r,strokeDasharray:d})}),f.createElement(w$,{label:n.label}))}function r4(e){var{clipPathId:t,props:n}=e,r=(0,f.useRef)(null),i=(0,f.useRef)(0),a=(0,f.useRef)(null);return f.createElement(n4,{props:n,clipPathId:t,previousPointsRef:r,longestAnimatedLengthRef:i,pathRef:a})}var i4=(e,t)=>
70({x:e.x??void 0,y:e.y??void 0,value:e.value,errorVal:wP(e.payload,t)}),a4=class extends f.Component{render(){var{hide:e,dot:t,points:n,className:r,xAxisId:i,yAxisId:a,top:o,left:s,width:c,height:l,id:u,needClip:d,zIndex:p}=this.props;if(e)return null;var m=zc(`recharts-line`,r),h=u,{r:g,strokeWidth:_}=F2(t),v=A$(t),y=g*2+_,b=d?`url(#clipPath-${v?``:`dots-`}${h})`:void 0;return f.createElement(BX,{zIndex:p},f.createElement(CD,{className:m},d&&f.createElement(`defs`,null,f.createElement(E2,{clipPathId:h,xAxisId:i,yAxisId:a}),!v&&f.createElement(`clipPath`,{id:`clipPath-dots-${h}`},f.createElement(`rect`,{x:s-y/2,y:o-y/2,width:c+y,height:l+y}))),f.createElement(w2,{xAxisId:i,yAxisId:a,data:n,dataPointFormatter:i4,errorBarOffset:0},f.createElement(r4,{props:this.props,clipPathId:h}))),f.createElement(e0,{activeDot:this.props.activeDot,points:n,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:b}))}},o4={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:`ease`,connectNulls:!1,dot:!0,fill:`#fff`,hide:!1,isAnimationActive:`auto`,label:!1,legendType:`line`,stroke:`#3182bd`,strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:zz.line,type:`linear`};function s4(e){var t=Kk(e,o4),{activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:a,animationEasing:o,connectNulls:s,dot:c,hide:l,isAnimationActive:u,label:d,legendType:p,xAxisId:m,yAxisId:h,id:g}=t,_=G2(t,R2),{needClip:v}=T2(m,h),y=K1(),b=qF(),x=lF(),S=WA(e=>P2(e,m,h,x,g));if(b!==`horizontal`&&b!==`vertical`||S==null||y==null)return null;var{height:C,width:w,x:T,y:E}=y;return f.createElement(a4,z2({},_,{id:g,connectNulls:s,dot:c,activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:a,animationEasing:o,isAnimationActive:u,hide:l,label:d,legendType:p,xAxisId:m,yAxisId:h,points:S,layout:b,height:C,width:w,left:T,top:E,needClip:v}))}function c4(e){var{layout:t,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,dataKey:o,bandSize:s,displayedData:c}=e;return c.map((e,c)=>{var l=wP(e,o);if(t===`horizontal`)return{x:jP({axis:n,ticks:i,bandSize:s,entry:e,index:c}),y:(vk(l)?null:r.scale.map(l))??null,value:l,payload:e};var u=vk(l)?null:n.scale.map(l),d=jP({axis:r,ticks:a,bandSize:s,entry:e,index:c});return u==null||d==null?null:{x:u,y:d,value:l,payload:e}}).filter(Boolean)}function l4(e){var t=Kk(e,o4),n=lF();return f.createElement(p1,{id:t.id,type:`line`},e=>f.createElement(f.Fragment,null,f.createElement(l1,{legendPayload:q2(t)}),f.createElement(J2,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:e}),f.createElement(y1,{type:`line`,id:e,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:n}),f.createElement(s4,z2({},t,{id:e}))))}var u4=f.memo(l4,yL);u4.displayName=`Line`;var d4=[`domain`,`range`],f4=[`domain`,`range`];function p4(e,t){if(e==null)return{};var n,r,i=m4(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function m4(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function h4(e,t){return e===t?!0:Array.isArray(e)&&e.length===2&&Array.isArray(t)&&t.length===2?e[0]===t[0]&&e[1]===t[1]:!1}function g4(e,t){if(e===t)return!0;var{domain:n,range:r}=e,i=p4(e,d4),{domain:a,range:o}=t,s=p4(t,f4);return!h4(n,a)||!h4(r,o)?!1:yL(i,s)}var _4=[`type`],v4=[`dangerouslySetInnerHTML`,`ticks`,`scale`],y4=[`id`,`scale`];function b4(){return b4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},b4.apply(null,arguments)}function x4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function S4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];
70t%2?x4(Object(n),!0).forEach(function(t){C4(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x4(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function C4(e,t,n){return(t=w4(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function w4(e){var t=T4(e,`string`);return typeof t==`symbol`?t:t+``}function T4(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function E4(e,t){if(e==null)return{};var n,r,i=D4(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function D4(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function O4(e){var t=BA(),n=(0,f.useRef)(null),r=JF(),{type:i}=e,a=E4(e,_4),o=Uz(r,`xAxis`,i),s=(0,f.useMemo)(()=>{if(o!=null)return S4(S4({},a),{},{type:o})},[a,o]);return(0,f.useLayoutEffect)(()=>{s!=null&&(n.current===null?t(L1(s)):n.current!==s&&t(R1({prev:n.current,next:s})),n.current=s)},[s,t]),(0,f.useLayoutEffect)(()=>()=>{n.current&&=(t(z1(n.current)),null)},[t]),null}var k4=e=>{var{xAxisId:t,className:n}=e,r=WA(sF),i=lF(),a=`xAxis`,o=WA(e=>hJ(e,a,t,i)),s=WA(e=>iJ(e,t)),c=WA(e=>lJ(e,t)),l=WA(e=>hK(e,t));if(s==null||c==null||l==null)return null;var{dangerouslySetInnerHTML:u,ticks:d,scale:p}=e,m=E4(e,v4),{id:h,scale:g}=l,_=E4(l,y4);return f.createElement(Y0,b4({},m,_,{x:c.x,y:c.y,width:s.width,height:s.height,className:zc(`recharts-${a} ${a}`,n),viewBox:r,ticks:o,axisType:a,axisId:t}))},A4={allowDataOverflow:mK.allowDataOverflow,allowDecimals:mK.allowDecimals,allowDuplicatedCategory:mK.allowDuplicatedCategory,angle:mK.angle,axisLine:B0.axisLine,height:mK.height,hide:!1,includeHidden:mK.includeHidden,interval:mK.interval,label:!1,minTickGap:mK.minTickGap,mirror:mK.mirror,orientation:mK.orientation,padding:mK.padding,reversed:mK.reversed,scale:mK.scale,tick:mK.tick,tickCount:mK.tickCount,tickLine:B0.tickLine,tickSize:B0.tickSize,type:mK.type,niceTicks:mK.niceTicks,xAxisId:0},j4=f.memo(e=>{var t=Kk(e,A4);return f.createElement(f.Fragment,null,f.createElement(O4,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,niceTicks:t.niceTicks}),f.createElement(k4,t))},g4);j4.displayName=`XAxis`;var M4=[`type`],N4=[`dangerouslySetInnerHTML`,`ticks`,`scale`],P4=[`id`,`scale`];function F4(){return F4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},F4.apply(null,arguments)}function I4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function L4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?I4(Object(n),!0).forEach(function(t){R4(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I4(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function R4(e,t,n){return(t=z4(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function z4(e){var t=B4(e,`string`);return typeof t==`symbol`?t:t+``}function B4(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function V4(e,t){if(e==null)return{};var n,r,i=H4(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function H4(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function U4(e){var t=BA(),n=(0,f.useRef)(null),r=JF(),{type:i}=e,a=V4(e,M4),o=Uz(r,`yAxis`,i),s=(0,f.useMemo)(()=>
70{if(o!=null)return L4(L4({},a),{},{type:o})},[o,a]);return(0,f.useLayoutEffect)(()=>{s!=null&&(n.current===null?t(B1(s)):n.current!==s&&t(V1({prev:n.current,next:s})),n.current=s)},[s,t]),(0,f.useLayoutEffect)(()=>()=>{n.current&&=(t(H1(n.current)),null)},[t]),null}function W4(e){var{yAxisId:t,className:n,width:r,label:i}=e,a=(0,f.useRef)(null),o=(0,f.useRef)(null),s=WA(sF),c=lF(),l=BA(),u=`yAxis`,d=WA(e=>dJ(e,t)),p=WA(e=>uJ(e,t)),m=WA(e=>hJ(e,u,t,c)),h=WA(e=>vK(e,t));if((0,f.useLayoutEffect)(()=>{if(!(r!==`auto`||!d||n$(i)||(0,f.isValidElement)(i)||h==null)){var e=a.current;if(e){var n=e.getCalculatedWidth();Math.round(d.width)!==Math.round(n)&&l(U1({id:t,width:n}))}}},[m,d,l,i,t,r,h]),d==null||p==null||h==null)return null;var{dangerouslySetInnerHTML:g,ticks:_,scale:v}=e,y=V4(e,N4),{id:b,scale:x}=h,S=V4(h,P4);return f.createElement(Y0,F4({},y,S,{ref:a,labelRef:o,x:p.x,y:p.y,tickTextProps:r===`auto`?{width:void 0}:{width:r},width:d.width,height:d.height,className:zc(`recharts-${u} ${u}`,n),viewBox:s,ticks:m,axisType:u,axisId:t}))}var G4={allowDataOverflow:_K.allowDataOverflow,allowDecimals:_K.allowDecimals,allowDuplicatedCategory:_K.allowDuplicatedCategory,angle:_K.angle,axisLine:B0.axisLine,hide:!1,includeHidden:_K.includeHidden,interval:_K.interval,label:!1,minTickGap:_K.minTickGap,mirror:_K.mirror,orientation:_K.orientation,padding:_K.padding,reversed:_K.reversed,scale:_K.scale,tick:_K.tick,tickCount:_K.tickCount,tickLine:B0.tickLine,tickSize:B0.tickSize,type:_K.type,niceTicks:_K.niceTicks,width:_K.width,yAxisId:0},K4=f.memo(e=>{var t=Kk(e,G4);return f.createElement(f.Fragment,null,f.createElement(U4,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter,niceTicks:t.niceTicks}),f.createElement(W4,t))},g4);K4.displayName=`YAxis`;var q4=$([(e,t)=>t,KF,aB,mB,AY,MY,dX,aF],CX);function J4(e){return`getBBox`in e.currentTarget&&typeof e.currentTarget.getBBox==`function`}function Y4(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(J4(e)){var i=e.currentTarget.getBBox();n=i.width>0?t.width/i.width:1,r=i.height>0?t.height/i.height:1}else{var a=e.currentTarget;n=a.offsetWidth>0?t.width/a.offsetWidth:1,r=a.offsetHeight>0?t.height/a.offsetHeight:1}var o=(e,i)=>({relativeX:Math.round((e-t.left)/n),relativeY:Math.round((i-t.top)/r)});return`touches`in e?Array.from(e.touches).map(e=>o(e.clientX,e.clientY)):o(e.clientX,e.clientY)}var X4=tN(`mouseClick`),Z4=cP();Z4.startListening({actionCreator:X4,effect:(e,t)=>{var n=e.payload,r=q4(t.getState(),Y4(n));r?.activeIndex!=null&&t.dispatch(FJ({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var Q4=tN(`mouseMove`),$4=cP(),e3=null,t3=null,n3=null;$4.startListening({actionCreator:Q4,effect:(e,t)=>{var n=e.payload,{throttleDelay:r,throttledEvents:i}=t.getState().eventSettings,a=i===`all`||i?.includes(`mousemove`);e3!==null&&(cancelAnimationFrame(e3),e3=null),t3!==null&&(typeof r!=`number`||!a)&&(clearTimeout(t3),t3=null),n3=Y4(n);var o=()=>{var e=t.getState(),n=SJ(e,e.tooltip.settings.shared);if(!n3){e3=null,t3=null;return}if(n===`axis`){var r=q4(e,n3);r?.activeIndex==null?t.dispatch(NJ()):t.dispatch(PJ({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}e3=null,t3=null};if(!a){o();return}r===`raf`?e3=requestAnimationFrame(o):typeof r==`number`&&t3===null&&(t3=setTimeout(o,r))}});function r3(e,t){return t instanceof HTMLElement?`HTMLElement <${t.tagName} class="${t.className}">`:t===window?`global.window`:e===`children`&&typeof t==`object`&&t?`<<CHILDREN>>`:t}var i3={accessibilityLayer:!0,barCategoryGap:`10%`,barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:`none`,syncId:void 0,syncMethod:`index`,baseValue:void 0,reverseStackOrder:!1},a3=SN({name:`rootProps`,initialState:i3,reducers:{updateOptions:(e,t)=>{e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=t.payload.barGap??i3.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className,e.baseValue=t.payload.baseValue,e.reverseStackOrder=t.payload.reverseStackOrder}}}),o3=a3.reducer,{updateOptions:s3}=a3.actions,c3=SN({name:`polarOptions`,initialState:null,reducers:{updatePolarOptions:(e,t)=>e===null?t.payload:(e.startAngle=t.payload.startAngle,e.endAngle=t.payload.endAngle,e.cx=t.payload.cx,e.cy=t.payload.cy,e.innerRadius=t.payload.innerRadius,e.outerRadius=t.payload.outerRadius,e)}}),{updatePolarOptions:Dne}=c3.actions,l3=c3.reducer,u3=tN(`keyDown`),d3=tN(`focus`),f3=tN(`blur`),p3=cP(),m3=null,h3=null,g3=null;p3.startListening({actionCreator:u3,effect:(e,t)=>
70{g3=e.payload,m3!==null&&(cancelAnimationFrame(m3),m3=null);var{throttleDelay:n,throttledEvents:r}=t.getState().eventSettings,i=r===`all`||r.includes(`keydown`);h3!==null&&(typeof n!=`number`||!i)&&(clearTimeout(h3),h3=null);var a=()=>{try{var e=t.getState();if(e.rootProps.accessibilityLayer===!1)return;var{keyboardInteraction:n}=e.tooltip,r=g3;if(r!==`ArrowRight`&&r!==`ArrowLeft`&&r!==`Enter`)return;var i=XJ(n,vY(e),XK(e),DY(e)),a=i==null?-1:Number(i),o=!Number.isFinite(a)||a<0,s=MY(e),c=vY(e),l=SJ(e,e.tooltip.settings.shared);if(r===`Enter`){if(o)return;var u=gX(e,l,`hover`,String(n.index));t.dispatch(LJ({active:!n.active,activeIndex:n.index,activeCoordinate:u}));return}var d=vJ(e)===`left-to-right`?1:-1,f=r===`ArrowRight`?1:-1,p;if(o){var m=XK(e),h=DY(e),g=f*d,_=e=>({active:!1,index:String(e),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(p=-1,g>0){for(var v=0;v<c.length;v++)if(XJ(_(v),c,m,h)!=null){p=v;break}}else for(var y=c.length-1;y>=0;y--)if(XJ(_(y),c,m,h)!=null){p=y;break}if(p<0)return}else{p=a+f*d;var b=s?.length||c.length;if(b===0||p>=b||p<0)return}var x=gX(e,l,`hover`,String(p));t.dispatch(LJ({active:!0,activeIndex:p.toString(),activeCoordinate:x}))}finally{m3=null,h3=null}};if(!i){a();return}n===`raf`?m3=requestAnimationFrame(a):typeof n==`number`&&h3===null&&(a(),g3=null,h3=setTimeout(()=>{g3?a():(h3=null,m3=null)},n))}}),p3.startListening({actionCreator:d3,effect:(e,t)=>{var n=t.getState();if(n.rootProps.accessibilityLayer!==!1){var{keyboardInteraction:r}=n.tooltip;if(!r.active&&r.index==null){var i=`0`,a=gX(n,SJ(n,n.tooltip.settings.shared),`hover`,String(i));t.dispatch(LJ({active:!0,activeIndex:i,activeCoordinate:a}))}}}}),p3.startListening({actionCreator:f3,effect:(e,t)=>{var n=t.getState();if(n.rootProps.accessibilityLayer!==!1){var{keyboardInteraction:r}=n.tooltip;r.active&&t.dispatch(LJ({active:!1,activeIndex:r.index,activeCoordinate:r.coordinate}))}}});function _3(e){e.persist();var{currentTarget:t}=e;return new Proxy(e,{get:(e,n)=>{if(n===`currentTarget`)return t;var r=Reflect.get(e,n);return typeof r==`function`?r.bind(e):r}})}var v3=tN(`externalEvent`),y3=cP(),b3=new Map,x3=new Map,S3=new Map;y3.startListening({actionCreator:v3,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){var i=r.type,a=_3(r);S3.set(i,{handler:n,reactEvent:a});var o=b3.get(i);o!==void 0&&(cancelAnimationFrame(o),b3.delete(i));var{throttleDelay:s,throttledEvents:c}=t.getState().eventSettings,l=c,u=l===`all`||l?.includes(i),d=x3.get(i);d!==void 0&&(typeof s!=`number`||!u)&&(clearTimeout(d),x3.delete(i));var f=()=>{var e=S3.get(i);try{if(!e)return;var{handler:n,reactEvent:r}=e,a=t.getState(),o={activeCoordinate:HY(a),activeDataKey:zY(a),activeIndex:LY(a),activeLabel:RY(a),activeTooltipIndex:LY(a),isTooltipActive:UY(a)};n&&n(o,r)}finally{b3.delete(i),x3.delete(i),S3.delete(i)}};if(!u){f();return}if(s===`raf`){var p=requestAnimationFrame(f);b3.set(i,p)}else if(typeof s==`number`){if(!x3.has(i)){f();var m=setTimeout(f,s);x3.set(i,m)}}else f()}}});var C3=$([$([eY],e=>e.tooltipItemPayloads),(e,t)=>t,(e,t,n)=>n],(e,t,n)=>{if(t!=null){var r=e.find(e=>e.settings.graphicalItemId===n);if(r!=null){var{getPosition:i}=r;if(i!=null)return i(t)}}}),w3=tN(`touchMove`),T3=cP(),E3=null,D3=null,O3=null,k3=null;T3.startListening({actionCreator:w3,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){k3=_3(n);var{throttleDelay:r,throttledEvents:i}=t.getState().eventSettings,a=i===`all`||i.includes(`touchmove`);E3!==null&&(cancelAnimationFrame(E3),E3=null),D3!==null&&(typeof r!=`number`||!a)&&(clearTimeout(D3),D3=null),O3=Array.from(n.touches).map(e=>Y4({clientX:e.clientX,clientY:e.clientY,currentTarget:n.currentTarget}));var o=()=>{if(k3!=null){var e=t.getState(),n=SJ(e,e.tooltip.settings.shared);if(n===`axis`){var r=O3?.[0];if(r==null){E3=null,D3=null;return}var i=q4(e,r);i?.activeIndex!=null&&t.dispatch(PJ({activeIndex:i.activeIndex,activeDataKey:void 0,activeCoordinate:i.activeCoordinate}))}else if(n===`item`){var a=k3.touches[0];if(document.elementFromPoint==null||a==null)return;var o=document.elementFromPoint(a.clientX,a.clientY);if(!o||!o.getAttribute)return;var s=o.getAttribute(JP),c=o.getAttribute(`data-recharts-item-id`)??void 0,l=mY(e).find(e=>e.id===c);if(s==null||l==null||c==null)return;var{dataKey:u}=l,d=C3(e,s,c);t.dispatch(MJ({activeDataKey:u,activeIndex:s,activeCoordinate:d,activeGraphicalItemId:c}))}E3=null,D3=null}};if(!a){o();return}r===`raf`?E3=requestAnimationFrame(o):typeof r==`number`&&D3===null&&(o(),
70k3=null,D3=setTimeout(()=>{k3?o():(D3=null,E3=null)},r))}}});var A3={throttleDelay:`raf`,throttledEvents:[`mousemove`,`touchmove`,`pointermove`,`scroll`,`wheel`]},j3=SN({name:`eventSettings`,initialState:A3,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=qI(t.payload.throttledEvents))}}}),{setEventSettings:M3}=j3.actions,N3=j3.reducer,P3=Ej({brush:i0,cartesianAxis:W1,chartData:uZ,errorBars:y2,eventSettings:N3,graphicalItems:v1,layout:hP,legend:eL,options:iZ,polarAxis:O$,polarOptions:l3,referenceElements:c0,renderedTicks:A0,rootProps:o3,tooltip:RJ,zIndex:zX}),F3=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`Chart`;return fN({reducer:P3,preloadedState:e,middleware:e=>e({serializableCheck:!1,immutableCheck:![`commonjs`,`es6`,`production`].includes(`es6`)}).concat([Z4.middleware,$4.middleware,p3.middleware,y3.middleware,T3.middleware]),enhancers:e=>{var t=e;return typeof e==`function`&&(t=e()),t.concat(uN({type:`raf`}))},devTools:LL.devToolsEnabled&&{serialize:{replacer:r3},name:`recharts-${t}`}})};function I3(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,i=lF(),a=(0,f.useRef)(null);if(i)return n;a.current??=F3(t,r);var o=LA;return f.createElement(gL,{context:o,store:a.current},n)}function L3(e){var{layout:t,margin:n}=e,r=BA(),i=lF();return(0,f.useEffect)(()=>{i||(r(fP(t)),r(dP(n)))},[r,i,t,n]),null}var R3=(0,f.memo)(L3,yL);function z3(e){var t=BA();return(0,f.useEffect)(()=>{t(s3(e))},[t,e]),null}var B3=(0,f.memo)(e=>{var t=BA();return(0,f.useEffect)(()=>{t(M3(e))},[t,e]),null},yL);function V3(e){var{zIndex:t,isPanorama:n}=e,r=(0,f.useRef)(null),i=BA();return(0,f.useLayoutEffect)(()=>(r.current&&i(LX({zIndex:t,element:r.current,isPanorama:n})),()=>{i(RX({zIndex:t,isPanorama:n}))}),[i,t,n]),f.createElement(`g`,{tabIndex:-1,ref:r,className:`recharts-zIndex-layer_${t}`})}function H3(e){var{children:t,isPanorama:n}=e,r=WA(TX);if(!r||r.length===0)return t;var i=r.filter(e=>e<0),a=r.filter(e=>e>0);return f.createElement(f.Fragment,null,i.map(e=>f.createElement(V3,{key:e,zIndex:e,isPanorama:n})),t,a.map(e=>f.createElement(V3,{key:e,zIndex:e,isPanorama:n})))}var U3=[`children`];function W3(e,t){if(e==null)return{};var n,r,i=G3(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function G3(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function K3(){return K3=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},K3.apply(null,arguments)}var q3={width:`100%`,height:`100%`,display:`block`},J3=(0,f.forwardRef)((e,t)=>{var n=UF(),r=WF(),i=VL();if(!vP(n)||!vP(r))return null;var{children:a,otherAttributes:o,title:s,desc:c}=e,l,u;return o!=null&&(l=typeof o.tabIndex==`number`?o.tabIndex:i?0:void 0,u=typeof o.role==`string`?o.role:i?`application`:void 0),f.createElement(vD,K3({},o,{title:s,desc:c,role:u,tabIndex:l,width:n,height:r,style:q3,ref:t}),a)}),Y3=e=>{var{children:t}=e,n=WA(dF);if(!n)return null;var{width:r,height:i,y:a,x:o}=n;return f.createElement(vD,{width:r,height:i,x:o,y:a},t)},X3=(0,f.forwardRef)((e,t)=>{var{children:n}=e,r=W3(e,U3);return lF()?f.createElement(Y3,null,f.createElement(H3,{isPanorama:!0},n)):f.createElement(J3,K3({ref:t},r),f.createElement(H3,{isPanorama:!1},n))});function Z3(){var e=BA(),[t,n]=(0,f.useState)(null),r=WA(WP);return(0,f.useEffect)(()=>{if(t!=null){var n=t.getBoundingClientRect().width/t.offsetWidth;_P(n)&&n!==r&&e(mP(n))}},[t,e,r]),n}function Q3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];
70t%2?Q3(Object(n),!0).forEach(function(t){e6(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Q3(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function e6(e,t,n){return(t=t6(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function t6(e){var t=n6(e,`string`);return typeof t==`symbol`?t:t+``}function n6(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function r6(){return r6=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r6.apply(null,arguments)}var i6=()=>(xZ(),null);function a6(e){if(typeof e==`number`)return e;if(typeof e==`string`){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var o6=(0,f.forwardRef)((e,t)=>{var n=(0,f.useRef)(null),[r,i]=(0,f.useState)({containerWidth:a6(e.style?.width),containerHeight:a6(e.style?.height)}),a=(0,f.useCallback)((e,t)=>{i(n=>{var r=Math.round(e),i=Math.round(t);return n.containerWidth===r&&n.containerHeight===i?n:{containerWidth:r,containerHeight:i}})},[]),o=(0,f.useCallback)(e=>{if(typeof t==`function`&&t(e),n.current!=null&&(n.current.disconnect(),n.current=null),e!=null&&typeof ResizeObserver<`u`){var{width:r,height:i}=e.getBoundingClientRect();a(r,i);var o=new ResizeObserver(e=>{var t=e[0];if(t!=null){var{width:n,height:r}=t.contentRect;a(n,r)}});o.observe(e),n.current=o}},[t,a]);return(0,f.useEffect)(()=>()=>{n.current?.disconnect()},[a]),f.createElement(f.Fragment,null,f.createElement(ZF,{width:r.containerWidth,height:r.containerHeight}),f.createElement(`div`,r6({ref:o},e)))}),s6=(0,f.forwardRef)((e,t)=>{var{width:n,height:r}=e,[i,a]=(0,f.useState)({containerWidth:a6(n),containerHeight:a6(r)}),o=(0,f.useCallback)((e,t)=>{a(n=>{var r=Math.round(e),i=Math.round(t);return n.containerWidth===r&&n.containerHeight===i?n:{containerWidth:r,containerHeight:i}})},[]),s=(0,f.useCallback)(e=>{if(typeof t==`function`&&t(e),e!=null){var{width:n,height:r}=e.getBoundingClientRect();o(n,r)}},[t,o]);return f.createElement(f.Fragment,null,f.createElement(ZF,{width:i.containerWidth,height:i.containerHeight}),f.createElement(`div`,r6({ref:s},e)))}),c6=(0,f.forwardRef)((e,t)=>{var{width:n,height:r}=e;return f.createElement(f.Fragment,null,f.createElement(ZF,{width:n,height:r}),f.createElement(`div`,r6({ref:t},e)))}),l6=(0,f.forwardRef)((e,t)=>{var{width:n,height:r}=e;return typeof n==`string`||typeof r==`string`?f.createElement(s6,r6({},e,{ref:t})):typeof n==`number`&&typeof r==`number`?f.createElement(c6,r6({},e,{width:n,height:r,ref:t})):f.createElement(f.Fragment,null,f.createElement(ZF,{width:n,height:r}),f.createElement(`div`,r6({ref:t},e)))});function u6(e){return e?o6:l6}var d6=(0,f.forwardRef)((e,t)=>{var{children:n,className:r,height:i,onClick:a,onContextMenu:o,onDoubleClick:s,onMouseDown:c,onMouseEnter:l,onMouseLeave:u,onMouseMove:d,onMouseUp:p,onTouchEnd:m,onTouchMove:h,onTouchStart:g,style:_,width:v,responsive:y,dispatchTouchEvents:b=!0}=e,x=(0,f.useRef)(null),S=BA(),[C,w]=(0,f.useState)(null),[T,E]=(0,f.useState)(null),D=Z3(),O=IF(),k=O?.width>0?O.width:v,A=O?.height>0?O.height:i,j=(0,f.useCallback)(e=>{D(e),typeof t==`function`&&t(e),w(e),E(e),e!=null&&(x.current=e)},[D,t,w,E]),M=(0,f.useCallback)(e=>{S(X4(e)),S(v3({handler:a,reactEvent:e}))},[S,a]),N=(0,f.useCallback)(e=>{S(Q4(e)),S(v3({handler:l,reactEvent:e}))},[S,l]),ee=(0,f.useCallback)(e=>{S(NJ()),S(v3({handler:u,reactEvent:e}))},[S,u]),P=(0,f.useCallback)(e=>{S(Q4(e)),S(v3({handler:d,reactEvent:e}))},[S,d]),F=(0,f.useCallback)(()=>{S(d3())},[S]),I=(0,f.useCallback)(()=>{S(f3())},[S]),te=(0,f.useCallback)(e=>{S(u3(e.key))},[S]),L=(0,f.useCallback)(e=>{S(v3({handler:o,reactEvent:e}))},[S,o]),ne=(0,f.useCallback)(e=>{S(v3({handler:s,reactEvent:e}))},[S,s]),R=(0,f.useCallback)(e=>{S(v3({handler:c,reactEvent:e}))},[S,c]),z=(0,f.useCallback)(e=>{S(v3({handler:p,reactEvent:e}))},[S,p]),B=(0,f.useCallback)(e=>{S(v3({handler:g,reactEvent:e}))},[S,g]),re=(0,f.useCallback)(e=>{b&&S(w3(e)),S(v3({handler:h,reactEvent:e}))},[S,b,h]),ie=(0,f.useCallback)(e=>{S(v3({handler:m,reactEvent:e}))},[S,m]),ae=u6(y);return f.createElement(XX.Provider,{value:C},f.createElement(wD.Provider,{value:T},f.createElement(ae,{width:k??_?.width,height:A??_?.height,className:zc(`recharts-wrapper`,r),style:$3({position:`relative`,cursor:`default`,width:k,height:A}
70,_),onClick:M,onContextMenu:L,onDoubleClick:ne,onFocus:F,onBlur:I,onKeyDown:te,onMouseDown:R,onMouseEnter:N,onMouseLeave:ee,onMouseMove:P,onMouseUp:z,onTouchEnd:ie,onTouchMove:re,onTouchStart:B,ref:j},f.createElement(i6,null),n)))}),f6=[`width`,`height`,`responsive`,`children`,`className`,`style`,`compact`,`title`,`desc`];function p6(e,t){if(e==null)return{};var n,r,i=m6(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function m6(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var h6=(0,f.forwardRef)((e,t)=>{var{width:n,height:r,responsive:i,children:a,className:o,style:s,compact:c,title:l,desc:u}=e,d=uD(p6(e,f6));return c?f.createElement(f.Fragment,null,f.createElement(ZF,{width:n,height:r}),f.createElement(X3,{otherAttributes:d,title:l,desc:u},a)):f.createElement(d6,{className:o,style:s,width:n,height:r,responsive:i??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},f.createElement(X3,{otherAttributes:d,title:l,desc:u,ref:t},f.createElement(u0,null,a)))});function g6(){return g6=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},g6.apply(null,arguments)}function _6(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function v6(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?_6(Object(n),!0).forEach(function(t){y6(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_6(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function y6(e,t,n){return(t=b6(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b6(e){var t=x6(e,`string`);return typeof t==`symbol`?t:t+``}function x6(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var S6=v6({accessibilityLayer:!0,barCategoryGap:`10%`,barGap:4,layout:`horizontal`,margin:{top:5,right:5,bottom:5,left:5},responsive:!1,reverseStackOrder:!1,stackOffset:`none`,syncMethod:`index`},A3),C6=(0,f.forwardRef)(function(e,t){var n=Kk(e.categoricalChartProps,S6),{chartName:r,defaultTooltipEventType:i,validateTooltipEventTypes:a,tooltipPayloadSearcher:o,categoricalChartProps:s}=e,c={chartName:r,defaultTooltipEventType:i,validateTooltipEventTypes:a,tooltipPayloadSearcher:o,eventEmitter:void 0};return f.createElement(I3,{preloadedState:{options:c},reduxStoreName:s.id??r},f.createElement(t0,{chartData:s.data}),f.createElement(R3,{layout:n.layout,margin:n.margin}),f.createElement(B3,{throttleDelay:n.throttleDelay,throttledEvents:n.throttledEvents}),f.createElement(z3,{baseValue:n.baseValue,accessibilityLayer:n.accessibilityLayer,barCategoryGap:n.barCategoryGap,maxBarSize:n.maxBarSize,stackOffset:n.stackOffset,barGap:n.barGap,barSize:n.barSize,syncId:n.syncId,syncMethod:n.syncMethod,className:n.className,reverseStackOrder:n.reverseStackOrder}),f.createElement(h6,g6({},n,{ref:t})))}),w6=[`axis`],T6=(0,f.forwardRef)((e,t)=>f.createElement(C6,{chartName:`LineChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:w6,tooltipPayloadSearcher:nZ,categoricalChartProps:e,ref:t}));function E6(e){let t=e.split(`-`);return t.length===3?`${Number(t[1])}/${Number(t[2])}`:e}function D6({rows:e,loading:t,error:n,refetch:r,metrics:i,hasData:a}){let{t:o}=V(`common`),s=a??e.length>0,[c,l]=(0,f.useState)(0),u=(0,f.useRef)(null),d=(0,f.useRef)(null),p=(0,f.useCallback)(e=>{if(u.current?.disconnect(),u.current=null,d.current&&clearTimeout(d.current),!e)return;l(e.offsetWidth);let t=new ResizeObserver(()=>{d.current&&clearTimeout(d.current),d.current=setTimeout(()=>l(e.offsetWidth),100)});t.observe(e),u.current=t},[]);(0,f.useEffect)(()=>()=>{u.current?.disconnect(),d.current&&clearTimeout(d.current)},[]);let m=c||768,h=Math.max(1.5,Math.min(3,1.5+(m-480)/288*1.5)),g=m>=600?2:1.5,_=m>=640?320:240;return n?(0,X.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-16 text-center`,children:[(0,X.jsx)(jc,{className:`w-8 h-8 text-danger opacity-60 mb-3`}),(0,X.jsx)(`p`,{className:`text-[14px] text-text-primary mb-3`,children:o(`loadFailed`)}),(0,X.jsx)(Z,{variant:`secondary`,size:`sm`,onClick:()=>void r(),children:o(`retry`)}
70)]}):t&&!s?(0,X.jsx)(`div`,{className:`flex items-center justify-center py-20 text-[14px] text-text-secondary`,children:o(`loading`)}):(0,X.jsx)(`div`,{ref:p,className:`relative transition-opacity duration-200 ${t&&s?`opacity-50 pointer-events-none`:``}`,children:(0,X.jsx)(RF,{width:`100%`,height:_,children:(0,X.jsxs)(T6,{data:e,margin:{top:5,right:10,left:-20,bottom:5},children:[(0,X.jsx)(_2,{strokeDasharray:`3 3`,stroke:`rgba(0,0,0,0.06)`}),(0,X.jsx)(j4,{dataKey:`date`,tick:{fontSize:11,fill:`var(--text-secondary)`},tickLine:!1,axisLine:!1,interval:`preserveStartEnd`,tickFormatter:E6,minTickGap:80}),(0,X.jsx)(K4,{tick:{fontSize:11,fill:`var(--text-secondary)`},tickLine:!1,axisLine:!1,allowDecimals:!1}),(0,X.jsx)(MZ,{content:({active:e,payload:t,label:n})=>!e||!t?.length?null:(0,X.jsxs)(`div`,{className:`bg-bg-card border border-border rounded-[8px] px-3 py-2 text-[13px]`,style:{boxShadow:`var(--shadow-2)`},children:[(0,X.jsx)(`p`,{className:`text-text-primary font-medium mb-1`,children:n}),i.map(e=>{let n=t.find(t=>t.dataKey===e.key);return n?(0,X.jsxs)(`p`,{className:`tabular-nums`,style:{color:e.color},children:[e.label,`ï¼`,n.value]},e.key):null})]})}),(0,X.jsx)(AL,{wrapperStyle:{paddingTop:`16px`},content:()=>(0,X.jsx)(`div`,{className:`flex flex-wrap justify-center gap-x-4 gap-y-1.5 text-[13px]`,children:i.map(e=>(0,X.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,X.jsx)(`span`,{className:`w-3 h-[2px] rounded-full`,style:{backgroundColor:e.color}}),(0,X.jsx)(`span`,{style:{color:e.color},children:e.label})]},e.key))})}),[...i].reverse().map(({key:e,label:t,color:n})=>(0,X.jsx)(u4,{type:`monotone`,dataKey:e,name:t,stroke:n,strokeWidth:g,dot:{r:h,fill:n},activeDot:{r:5},animationDuration:1500},e))]})})})}function O6(e){return e?e.chatRoomCount.map(e=>e.date).map((t,n)=>({date:t,chatRoom:Number(e.chatRoomCount[n]?.count??0),uniqueUser:Number(e.userCount[n]?.count??0),message:Number(e.messageCount[n]?.count??0),pageView:Number(e.landingUserCount[n]?.count??0),effectiveInteraction:Number(e.effectiveUserCount[n]?.count??0)})):[]}function k6(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`}function A6(){let e=new Date;return{startDate:k6(new Date(e.getFullYear(),e.getMonth(),1)),endDate:k6(e)}}function j6(e,t){return e.reduce((e,n)=>e+Number(n[t]??0),0)}function M6(){let[e,t]=(0,f.useState)(!1),{logAnalyticsEvent:n}=BS();return{isExporting:e,handleExport:(0,f.useCallback)(async(e,r,i,a,o,s)=>{n(`analytics_export_click`,{export_type:`csv`}),t(!0),await new Promise(e=>setTimeout(e,0)),N6(e,r,i,a,o),t(!1),Q.success(s)},[n])}}function N6(e,t,n,r,i){let a=e=>`"${String(e).replace(/"/g,`""`)}"`,o=[`Date`,...t.map(e=>e.label)].map(a).join(`,`),s=e.map(e=>[e.date,...t.map(t=>e[t.key]??0)].map(a).join(`,`)),c=new Blob([``+[o,...s].join(` 71`)],{type:`text/csv;charset=utf-8;`}),l=URL.createObjectURL(c),u=document.createElement(`a`);u.href=l,u.download=`${n.replace(/[^\w\s-]/g,`_`)}_${r}_${i}.csv`,document.body.appendChild(u),u.click(),document.body.removeChild(u),URL.revokeObjectURL(l)}function P6(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`}function F6(e){let t=e===`7d`?7:e===`30d`?30:90,n=new Date,r=new Date;return r.setDate(n.getDate()-(t-1)),{startDate:P6(r),endDate:P6(n)}}function I6(e){for(let t of[`7d`,`30d`,`90d`]){let n=F6(t);if(n.startDate===e.startDate&&n.endDate===e.endDate)return t}return`custom`}function L6({value:e,onChange:t}){let{t:n}=V(`analytics`),[r,i]=(0,f.useState)(()=>I6(e)),[a,o]=(0,f.useState)(e.startDate),[s,c]=(0,f.useState)(e.endDate),[l,u]=(0,f.useState)(!1),d=(0,f.useRef)(null),p=(0,f.useRef)(null),[m,h]=(0,f.useState)(null);(0,f.useLayoutEffect)(()=>{if(!l)return;let e=()=>{let e=d.current;if(!e)return;let t=e.getBoundingClientRect(),n=Math.min(288,window.innerWidth-16),r=t.right-n,i=Math.max(8,Math.min(r,window.innerWidth-n-8));h({top:t.bottom+4,left:i,width:n})};return e(),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[l]),(0,f.useEffect)(()=>
71{if(!l)return;let e=e=>{let t=e.target;d.current?.contains(t)||p.current?.contains(t)||u(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[l]);let g=e=>n(e===`7d`?`rangeLast7Days`:e===`30d`?`rangeLast30Days`:e===`90d`?`rangeLast90Days`:`rangeCustom`),_=r===`custom`?`${e.startDate.replace(/-/g,`/`)} â ${e.endDate.replace(/-/g,`/`)}`:g(r),v=n=>{if(n===`custom`){i(`custom`),o(e.startDate),c(e.endDate);return}i(n),t(F6(n)),u(!1)},y=!!a&&!!s&&a<=s&&(a!==e.startDate||s!==e.endDate),b=()=>{y&&(t({startDate:a,endDate:s}),u(!1))};return(0,X.jsxs)(`div`,{className:`shrink-0`,children:[(0,X.jsxs)(`button`,{ref:d,type:`button`,onClick:()=>u(e=>!e),className:`flex items-center gap-2 h-10 pl-3 pr-2.5 min-w-[200px] rounded-[8px] border border-border bg-bg-card text-[15px] text-text-primary outline-none focus:border-border-strong cursor-pointer`,children:[(0,X.jsx)(Ms,{className:`w-3.5 h-3.5 text-text-secondary shrink-0`}),(0,X.jsx)(`span`,{className:`flex-1 text-left tabular-nums`,children:_}),(0,X.jsx)(Is,{className:K(`w-3.5 h-3.5 text-text-secondary shrink-0 transition-transform duration-200`,l&&`rotate-180`)})]}),l&&m&&(0,fs.createPortal)((0,X.jsxs)(`div`,{ref:p,className:`fixed z-40 bg-bg-card border border-border rounded-[12px] overflow-hidden`,style:{top:m.top,left:m.left,width:m.width,boxShadow:`var(--shadow-3)`},children:[(0,X.jsx)(`div`,{className:`p-1`,children:[`7d`,`30d`,`90d`,`custom`].map(e=>{let t=r===e;return(0,X.jsxs)(`button`,{type:`button`,onClick:()=>v(e),className:K(`w-full flex items-center justify-between px-3 h-9 rounded-[8px] text-[14px] transition-colors duration-100 text-left cursor-pointer`,t?`bg-brand-tint text-brand font-medium`:`text-text-primary hover:bg-bg-subtle`),children:[(0,X.jsx)(`span`,{children:g(e)}),t&&(0,X.jsx)(Fs,{className:`w-4 h-4`})]},e)})}),r===`custom`&&(0,X.jsxs)(`div`,{className:`border-t border-border p-3 space-y-3`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(`input`,{type:`date`,value:a,max:s||void 0,onChange:e=>o(e.target.value),onKeyDown:e=>{e.key===`Enter`&&b()},className:`flex-1 min-w-0 h-9 px-2 rounded-[8px] border border-border bg-bg-card text-[14px] text-text-primary outline-none focus:border-border-strong`}),(0,X.jsx)(`span`,{className:`text-text-secondary text-[13px]`,children:`â`}),(0,X.jsx)(`input`,{type:`date`,value:s,min:a||void 0,onChange:e=>c(e.target.value),onKeyDown:e=>{e.key===`Enter`&&b()},className:`flex-1 min-w-0 h-9 px-2 rounded-[8px] border border-border bg-bg-card text-[14px] text-text-primary outline-none focus:border-border-strong`})]}),(0,X.jsx)(Z,{size:`md`,onClick:b,disabled:!y,className:`w-full`,children:n(`rangeApply`)})]})]}),document.body)]})}var R6=200;function z6({value:e,options:t,onChange:n}){let[r,i]=(0,f.useState)(!1),a=(0,f.useRef)(null),o=(0,f.useRef)(null),[s,c]=(0,f.useState)(null);return(0,f.useLayoutEffect)(()=>{if(!r)return;let e=()=>{let e=a.current;if(!e)return;let n=e.getBoundingClientRect(),r=Math.max(n.width,Math.min(R6,window.innerWidth-16)),i=n.left,o=Math.max(8,Math.min(i,window.innerWidth-r-8)),s=t.length*36+8,l=window.innerHeight-n.bottom-8,u=n.top-8;c({top:l<s&&u>=s?n.top-s-4:n.bottom+4,left:o,width:r})};return e(),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[r,t.length]),(0,f.useEffect)(()=>{if(!r)return;let e=e=>{let t=e.target;a.current?.contains(t)||o.current?.contains(t)||i(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[r]),(0,X.jsxs)(`div`,{className:`shrink-0`,children:[(0,X.jsxs)(`button`,{ref:a,type:`button`,onClick:()=>i(e=>!e),className:`flex items-center gap-2 h-10 pl-3 pr-2.5 min-w-[120px] rounded-[8px] border border-border bg-bg-card text-[15px] text-text-primary outline-none focus:border-border-strong cursor-pointer`,children:[(0,X.jsx)(`span`,{className:`flex-1 text-left`,children:t.find(t=>t.value===e)?.label??t[0]?.label}),(0,X.jsx)(Is,{className:K(`w-3.5 h-3.5 text-text-secondary shrink-0 transition-transform duration-200`,r&&`rotate-180`)})]}),r&&s&&(0,fs.createPortal)((0,X.jsx)(`div`,{ref:o,className:`fixed z-40 bg-bg-card border border-border rounded-[12px] overflow-hidden p-1`,style:{to
71p:s.top,left:s.left,width:s.width,boxShadow:`var(--shadow-3)`},children:t.map(t=>{let r=t.value===e;return(0,X.jsxs)(`button`,{type:`button`,onClick:()=>{n(t.value),i(!1)},className:K(`w-full flex items-center justify-between px-3 h-9 rounded-[8px] text-[14px] transition-colors duration-100 text-left cursor-pointer`,r?`bg-brand-tint text-brand font-medium`:`text-text-primary hover:bg-bg-subtle`),children:[(0,X.jsx)(`span`,{children:t.label}),r&&(0,X.jsx)(Fs,{className:`w-4 h-4`})]},t.value)})}),document.body)]})}function B6({rows:e,headers:t,emptyMessage:n}){return e.reduce((e,t)=>e+t.count,0)===0?(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary py-4`,children:n}):(0,X.jsx)(`div`,{className:`overflow-x-auto`,children:(0,X.jsxs)(`table`,{className:`w-full min-w-[420px] table-fixed`,children:[(0,X.jsxs)(`colgroup`,{children:[(0,X.jsx)(`col`,{}),(0,X.jsx)(`col`,{className:`w-[80px]`})]}),(0,X.jsx)(`thead`,{children:(0,X.jsxs)(`tr`,{className:`border-b border-border`,children:[(0,X.jsx)(`th`,{className:`text-left px-3 py-2.5 text-[12px] font-medium text-text-secondary uppercase tracking-[0.6px]`,children:t.label??``}),(0,X.jsx)(`th`,{className:`text-right px-3 py-2.5 text-[12px] font-medium text-text-secondary uppercase tracking-[0.6px]`,children:t.count})]})}),(0,X.jsx)(`tbody`,{children:e.map((e,t)=>(0,X.jsxs)(`tr`,{className:`border-b border-border last:border-0`,children:[(0,X.jsx)(`td`,{className:`px-3 py-3`,children:(0,X.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,X.jsx)(`span`,{className:`text-[14px] text-text-primary truncate w-[140px] shrink-0`,children:e.label}),(0,X.jsx)(`div`,{className:`flex-1 max-w-[280px] h-2 bg-bg-subtle rounded-full overflow-hidden`,children:(0,X.jsx)(`div`,{className:`h-full rounded-full transition-all duration-300`,style:{width:`${e.percent}%`,backgroundColor:e.color}})}),(0,X.jsxs)(`span`,{className:`text-[14px] text-text-primary tabular-nums w-[56px] shrink-0 text-right`,children:[e.percent.toFixed(1),`%`]})]})}),(0,X.jsx)(`td`,{className:`px-3 py-3 text-right text-[14px] text-text-primary tabular-nums`,children:du(e.count)})]},t))})]})})}var V6=[`#3B82F6`,`#06B6D4`,`#10B981`,`#F59E0B`,`#8B5CF6`,`#EF4444`,`#EC4899`,`#14B8A6`,`#84CC16`,`#F97316`],H6=[`browser`,`os`,`device`,`language`,`city`];function U6(e){if(e.reduce((e,t)=>e+t.count,0)===0)return[];let t=[],n=0;return e.forEach((e,r)=>{let i=(e.key??``).trim(),a=!i||i===`null`?`Unidentified`:i;r<5?t.push({name:a,count:e.count}):n+=e.count}),n>0&&t.push({name:`Other`,count:n}),t}function W6({token:e}={}){let{t}=V(`analytics`),{t:n}=V(`common`),[r,i]=(0,f.useState)(`browser`),{data:a,loading:o,error:s,refetch:c}=Ld(e),l=(0,f.useMemo)(()=>{let e=U6(a?.[r]??[]),t=e.reduce((e,t)=>e+t.count,0);return e.map((e,n)=>({label:(0,X.jsx)(`span`,{className:`break-words`,children:e.name}),count:e.count,percent:t===0?0:e.count/t*100,color:V6[n%V6.length]}))},[a,r]),u=H6.map(e=>({value:e,label:t(`attr_${e}`)}));return(0,X.jsxs)(`div`,{className:`card p-6 space-y-5`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-3 flex-wrap`,children:[(0,X.jsx)(`h3`,{className:`text-[17px] font-semibold text-text-primary`,children:t(`userAttributesTitle`)}),(0,X.jsx)(z6,{value:r,options:u,onChange:e=>i(e)})]}),s?(0,X.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-10 text-center`,children:[(0,X.jsx)(jc,{className:`w-8 h-8 text-danger opacity-60 mb-3`}),(0,X.jsx)(`p`,{className:`text-[14px] text-text-primary mb-3`,children:n(`loadFailed`)}),(0,X.jsx)(Z,{variant:`secondary`,size:`sm`,onClick:()=>void c(),children:n(`retry`)})]}):o?(0,X.jsx)(`div`,{className:`flex items-center justify-center py-10 text-[14px] text-text-secondary`,children:n(`loading`)}):(0,X.jsx)(B6,{rows:l,headers:{count:t(`attrColCount`)},emptyMessage:t(`attrNoData`)})]})}function G6(){let e=new Date,t=new Date;t.setDate(e.getDate()-29);let n=e=>`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`;return{startDate:n(t),endDate:n(e)}}function K6(){let{t:e}=V(`analytics`);cE(e(`overviewTitle`));let t=zf(e=>e.userSetting),n=t===null?localStorage.getItem(Pu)===`1`:!!t.subAccount,[r,i]=(0,f.useState)(`all`),[a,o]=(0,f.useState)(G6),{isExporting:s,handleExport:c}=M6(),{startDate:l,endDate:u}=a,d=Fd(A6()),{data:p,loading:m,error:h,refetch:g}=Fd({startDate:l,endDate:u}),_=[{key:`chatRoom`,label:e(`metrics.chatRoom`),color:`#3B82F6`},{key:`message`,label:e(`metrics.message`),color:`var(--brand)`},{key:`uniqueUser`,label:e(`metrics.uniqueUser`),color:`#06B6D4`},{key:`pageView`,label:e(`metrics.pageView`),color:`#F59E0B`},{key:`effectiveInteraction`,label:e(`metrics.effectiveInteraction`),color:`#EF4444`}],v=(0,f.useMemo)(()=>[{key:`chatRoom`,label:e(`metrics.chatRoom`),tooltip:e(`metrics.chatRoomDesc`),value:
71Id(d.data?.chatRoomCount),icon:fc,color:`#3B82F6`},{key:`message`,label:e(`metrics.message`),tooltip:e(`metrics.messageDesc`),value:Id(d.data?.messageCount),icon:dc,color:`var(--brand)`},{key:`uniqueUser`,label:e(`metrics.uniqueUser`),tooltip:e(`metrics.uniqueUserDesc`),value:Id(d.data?.userCount),icon:Fc,color:`#06B6D4`},{key:`pageView`,label:e(`metrics.pageView`),tooltip:e(`metrics.pageViewDesc`),value:Id(d.data?.landingUserCount),icon:Zs,color:`#F59E0B`},{key:`effectiveInteraction`,label:e(`metrics.effectiveInteraction`),tooltip:e(`metrics.effectiveInteractionDesc`),value:Id(d.data?.effectiveUserCount),icon:Lc,color:`#EF4444`}],[d.data,e]),y=d.loading&&!d.data,b=A6(),x=`${b.startDate.replace(/-/g,`/`)} â ${b.endDate.replace(/-/g,`/`)}`,S=[{value:`all`,label:e(`filterAll`)},..._.map(e=>({value:e.key,label:e.label}))],C=r===`all`?_:_.filter(e=>e.key===r),w=O6(p);return n?(0,X.jsx)(Ya,{to:`/dashboard/analytics/link`,replace:!0}):(0,X.jsxs)(`div`,{className:`space-y-6`,children:[(0,X.jsx)(`h1`,{className:`text-[28px] font-semibold text-text-primary`,children:e(`overviewTitle`)}),(0,X.jsxs)(`section`,{children:[(0,X.jsxs)(`h2`,{className:`text-[15px] font-semibold text-text-primary mb-3`,children:[e(`currentMonth`),(0,X.jsxs)(`span`,{className:`text-text-secondary font-normal ml-2 tabular-nums`,children:[`(`,x,`)`]})]}),(0,X.jsx)(`div`,{className:`grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-4`,children:y?v.map(({key:e})=>(0,X.jsx)(iD,{},e)):v.map(({key:e,label:t,tooltip:n,value:r,icon:i,color:a})=>(0,X.jsxs)(`div`,{className:`card p-5`,children:[(0,X.jsx)(`div`,{className:`w-8 h-8 rounded-[8px] flex items-center justify-center mb-3`,style:{backgroundColor:hu(a)},children:(0,X.jsx)(i,{className:`w-4 h-4`,style:{color:a}})}),(0,X.jsxs)(`div`,{className:`flex items-center gap-1 mb-1 min-h-[30px]`,children:[(0,X.jsx)(`p`,{className:`text-[12px] text-text-secondary leading-tight`,children:t}),(0,X.jsx)(tE,{content:n})]}),(0,X.jsx)(`p`,{className:`text-[28px] font-bold text-text-primary tabular-nums leading-none`,children:du(r)})]},e))})]}),(0,X.jsxs)(`div`,{className:`card p-6`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between mb-5 gap-3 flex-wrap`,children:[(0,X.jsx)(`h2`,{className:`text-[17px] font-semibold text-text-primary`,children:e(`dataReport`)}),(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,X.jsx)(z6,{value:r,options:S,onChange:i}),(0,X.jsx)(L6,{value:a,onChange:o}),(0,X.jsxs)(Z,{size:`sm`,className:`gap-1.5 whitespace-nowrap shrink-0`,disabled:!p||m,loading:s,onClick:()=>c(w,C,`overview`,l,u,e(`exportSuccess`)),children:[(0,X.jsx)(qs,{className:`w-3.5 h-3.5`}),e(`export`)]})]})]}),(0,X.jsx)(`div`,{className:`flex flex-wrap gap-x-6 gap-y-2 mb-5 pb-5 border-b border-border`,children:C.map(e=>(0,X.jsxs)(`div`,{className:`flex items-baseline gap-2`,children:[(0,X.jsx)(`span`,{className:`w-2 h-2 rounded-full shrink-0`,style:{backgroundColor:e.color}}),(0,X.jsx)(`span`,{className:`text-[13px] text-text-secondary`,children:e.label}),(0,X.jsx)(`span`,{className:`text-[15px] font-semibold text-text-primary tabular-nums`,children:m&&!p?`â`:du(j6(w,e.key))})]},e.key))}),(0,X.jsx)(D6,{rows:w,hasData:!!p,loading:m,error:h,refetch:g,metrics:C})]}),(0,X.jsx)(W6,{})]})}function q6({buttons:e,totalClicks:t}){let{t:n}=V(`analytics`);return e.length===0?null:(0,X.jsxs)(`div`,{className:`card overflow-hidden`,children:[(0,X.jsxs)(`div`,{className:`px-5 py-4 border-b border-border flex items-baseline gap-2`,children:[(0,X.jsx)(`h3`,{className:`text-[15px] font-semibold text-text-primary`,children:n(`welcomeButtonTotal`)}),(0,X.jsx)(`span`,{className:`text-[20px] font-bold text-text-primary tabular-nums`,children:du(t)})]}),(0,X.jsx)(`div`,{className:`overflow-x-auto`,children:(0,X.jsxs)(`table`,{className:`w-full min-w-[560px] table-fixed`,children:[(0,X.jsxs)(`colgroup`,{children:[(0,X.jsx)(`col`,{className:`w-[200px]`}),(0,X.jsx)(`col`,{}),(0,X.jsx)(`col`,{className:`w-[100px]`}),(0,X.jsx)(`col`,{className:`w-[100px]`})]}),(0,X.jsx)(`thead`,{children:(0,X.jsxs)(`tr`,{className:`bg-bg-muted border-b border-border`,children:[(0,X.jsx)(`th`,{className:`text-left px-4 py-3 text-[12px] font-medium text-text-secondary uppercase tracking-[0.6px]`,children:n(`welcomeColTitle`)}),(0,X.jsx)(`th`,{className:`text-left px-4 py-3 text-[12px] font-medium text-text-secondary uppercase tracking-[0.6px]`,children:n(`welcomeColLink`)}),(0,X.jsx)(`th`,{className:`text-right px-4 py-3 text-[12px] font-medium text-text-secondary uppercase tracking-[0.6px]`,children:n(`welcomeClick`)}),(0,X.jsx)(`th`,{className:`text-right px-4 py-3 text-[12px] font-medium text-text-secondary uppercase tracking-[0.6px]`,children:n(`welcomeCtr`)})]})}),(0,X.jsx)(`tbody`,{children:e.map((e,t)=>(0,X.jsxs)(`tr`,{className:`border-b border-border last:border-0`,children:[(0,X.jsx)(`td`,{className:`px-4 py-3 text-[15px] text-text-primary truncate`,children:e.title}),(0,X.jsx)(`td`,{className:`px-4 py-3`,children:(0,X.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-1.5 text-[14px] text-text-secondary hover:text-brand transition-colors`,title:e.url,children:[(0,X.jsx)(`span`,{className:`truncate min-w-0`,children:e.url}),(0,X.jsx)(Ys,{className:`w-3 h-3 shrink-0`})]})}),(0,X.jsx)(`td`,{className:`px-4 py-3 text-right text-[15px] text-text-primary tabular-nums`,children:du(e.click)}),(0,X.jsxs)(`td`,{className:`px-4 py-3 text-right text-[15px] text-text-primary tabular-nums`,children:[e.ctr.toFixed(1),`%`]})]},`${e.title}-${t}`))})]})})]})}function J6(e,t,n,r){let i=e=>`"${String(e).replace(/"/g,`""`)}"`,a=[[r(`exportColQuestion`),r(`exportColType`),r(`exportColAnswer`),r(`exportColCount`),r(`exportColPercent`),r(`exportColRespondent`),r(`exportColDate`)].map(i).join(`,`)];for(let t of e.flow)if(t.type===`rating`){let e=[0,0,0,0,0];for(let n of t.result){let t=n.ans.match(/([1-5])/),r=t?parseInt(t[1],10):0;r>=1&&r<=5&&(e[r-1]+=n.count)}let n=e.reduce((e,t)=>
71e+t,0);for(let o=4;o>=0;o--){let s=n===0?0:e[o]/n*100;a.push([i(t.question),i(r(`exportTypeRating`)),i(`${o+1} â `),i(e[o]),i(`${s.toFixed(1)}%`),i(``),i(``)].join(`,`))}}else if(t.type===`choice`){let e=t.result.reduce((e,t)=>e+t.count,0);for(let n of t.result){let o=e===0?0:n.count/e*100;a.push([i(t.question),i(r(`exportTypeChoice`)),i(n.ans),i(n.count),i(`${o.toFixed(1)}%`),i(``),i(``)].join(`,`))}}else for(let e of t.result){let o=e.createdAt?new Date(e.createdAt).toLocaleString(n,{year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`}):``;a.push([i(t.question),i(r(`exportTypeCommand`)),i(e.ans),i(``),i(``),i(e.nickname??``),i(o)].join(`,`))}let o=new Blob([``+a.join(` 72`)],{type:`text/csv;charset=utf-8;`}),s=URL.createObjectURL(o),c=document.createElement(`a`);c.href=s,c.download=`${t.replace(/[^\w\s-]/g,`_`)}_${r(`exportFilenameSuffix`)}.csv`,c.click(),URL.revokeObjectURL(s)}function Y6({token:e}){let{t,i18n:n}=V(`analytics`),r=ef(e),[i,a]=(0,f.useState)(),o=r.data??[],s=i??o[0]?.survey.id,c=zd(e,s),l=c.data,u=o.map(e=>({value:String(e.survey.id),label:e.survey.name})),d=o.find(e=>e.survey.id===s)?.survey.name??``;return!e||!r.loading&&o.length===0?(0,X.jsxs)(`div`,{className:`card p-12 flex flex-col items-center gap-3`,children:[(0,X.jsx)(Qs,{className:`w-10 h-10 text-text-secondary opacity-40`}),(0,X.jsx)(`p`,{className:`text-[15px] text-text-secondary`,children:t(`surveyEmpty`)})]}):r.loading&&!r.data?(0,X.jsx)(`div`,{className:`flex justify-center py-16`,children:(0,X.jsxs)(`svg`,{className:`w-6 h-6 text-brand animate-spin`,viewBox:`0 0 24 24`,fill:`none`,children:[(0,X.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`3`}),(0,X.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z`})]})}):(0,X.jsxs)(`div`,{className:`space-y-6`,children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,X.jsx)(`p`,{className:`text-[15px] text-text-secondary shrink-0`,children:t(`selectSurveyLabel`)}),(0,X.jsx)(z6,{value:String(s??``),options:u,onChange:e=>a(Number(e))})]}),(0,X.jsxs)(`div`,{className:`flex items-center gap-5 flex-wrap`,children:[(0,X.jsxs)(`div`,{className:`flex items-baseline gap-2`,children:[(0,X.jsx)(`span`,{className:`text-[14px] text-text-secondary`,children:t(`surveySent`)}),(0,X.jsx)(`span`,{className:`text-[20px] font-semibold text-text-primary tabular-nums`,children:c.loading?`â`:du(l?.startedCount??0)})]}),(0,X.jsxs)(`div`,{className:`flex items-baseline gap-2`,children:[(0,X.jsx)(`span`,{className:`text-[14px] text-text-secondary`,children:t(`surveyCompleted`)}),(0,X.jsx)(`span`,{className:`text-[20px] font-semibold text-text-primary tabular-nums`,children:c.loading?`â`:du(l?.completedCount??0)})]}),(0,X.jsxs)(Z,{size:`sm`,variant:`secondary`,className:`gap-1.5 whitespace-nowrap shrink-0`,disabled:!l||c.loading,onClick:()=>l&&J6(l,d,n.language,t),children:[(0,X.jsx)(qs,{className:`w-3.5 h-3.5`}),t(`export`)]})]})]}),!c.loading&&(!l||l.flow.length===0)?(0,X.jsxs)(`div`,{className:`card p-12 flex flex-col items-center gap-3`,children:[(0,X.jsx)(Qs,{className:`w-10 h-10 text-text-secondary opacity-40`}),(0,X.jsx)(`p`,{className:`text-[15px] text-text-secondary`,children:t(`surveyNoResponses`)})]}):(l?.flow??[]).map((e,t)=>(0,X.jsx)(X6,{flow:e,index:t+1,locale:n.language},e.id))]})}function X6({flow:e,index:t,locale:n}){return(0,X.jsxs)(`div`,{className:`card p-6 space-y-5`,children:[(0,X.jsxs)(`h4`,{className:`text-[15px] font-semibold text-text-primary break-words`,children:[(0,X.jsxs)(`span`,{className:`text-text-secondary tabular-nums mr-2`,children:[t,`.`]}),e.question]}),e.type===`choice`&&(0,X.jsx)(Z6,{result:e.result}),e.type===`rating`&&(0,X.jsx)(Q6,{result:e.result}),e.type===`command`&&(0,X.jsx)($6,{result:e.result,locale:n})]})}function Z6({result:e}){let{t}=V(`analytics`),n=e.reduce((e,t)=>e+t.count,0);return(0,X.jsx)(B6,{rows:e.map((e,t)=>({label:(0,X.jsx)(`span`,{className:`break-words`,children:e.ans}),count:e.count,percent:n===0?0:e.count/n*100,color:V6[t%V6.length]})),headers:{label:t(`surveyColOption`),count:t(`surveyColCount`)},emptyMessage:t(`surveyNoResponses`)}
72)}function Q6({result:e}){let{t}=V(`analytics`),n=[0,0,0,0,0];for(let t of e){let e=t.ans.match(/([1-5])/),r=e?parseInt(e[1],10):NaN;r>=1&&r<=5&&(n[r-1]+=t.count)}let r=n.reduce((e,t)=>e+t,0),i=n.reduce((e,t,n)=>e+t*(n+1),0),a=r===0?0:i/r,o=Math.floor(a),s=[4,3,2,1,0].map((e,t)=>({label:(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,X.jsx)(`span`,{className:`tabular-nums`,children:e+1}),(0,X.jsx)(Dc,{className:`w-3.5 h-3.5 text-[#F59E0B] fill-[#F59E0B]`})]}),count:n[e],percent:r===0?0:n[e]/r*100,color:V6[t%V6.length]}));return(0,X.jsxs)(`div`,{className:`space-y-5`,children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-3`,children:[(0,X.jsxs)(`div`,{className:`flex items-baseline gap-1`,children:[(0,X.jsx)(`span`,{className:`text-[36px] font-bold text-text-primary tabular-nums leading-none`,children:a.toFixed(1)}),(0,X.jsx)(`span`,{className:`text-[14px] text-text-secondary`,children:`/ 5`})]}),(0,X.jsx)(`div`,{className:`flex items-center gap-0.5`,children:[1,2,3,4,5].map(e=>(0,X.jsx)(Dc,{className:K(`w-4 h-4`,e<=o?`text-[#F59E0B] fill-[#F59E0B]`:`text-text-secondary opacity-25`)},e))}),(0,X.jsx)(`span`,{className:`text-[13px] text-text-secondary`,children:t(`surveyTotalResponses`,{count:r})})]}),(0,X.jsx)(B6,{rows:s,headers:{label:t(`surveyColOption`),count:t(`surveyColCount`)},emptyMessage:t(`surveyNoResponses`)})]})}function $6({result:e,locale:t}){let{t:n}=V(`analytics`);return e.length===0?(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary py-4`,children:n(`surveyNoResponses`)}):(0,X.jsx)(`div`,{className:`space-y-3`,children:e.map((e,n)=>(0,X.jsxs)(`div`,{className:`border-l-2 border-border pl-4 py-1`,children:[(0,X.jsxs)(`div`,{className:`flex items-baseline gap-2 mb-1 flex-wrap`,children:[(0,X.jsx)(`span`,{className:`text-[14px] font-medium text-text-primary`,children:e.nickname??`â`}),(0,X.jsx)(`span`,{className:`text-[12px] text-text-secondary tabular-nums`,children:new Date(e.createdAt).toLocaleString(t,{year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})})]}),(0,X.jsx)(`p`,{className:`text-[14px] text-text-primary break-words leading-relaxed`,children:e.ans})]},n))})}function e8(){let e=new Date,t=new Date;t.setDate(e.getDate()-29);let n=e=>`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`;return{startDate:n(t),endDate:n(e)}}function t8(){let{t:e}=V(`analytics`);cE(e(`linkAnalyticsTitle`));let[t,n]=(0,f.useState)(``),[r,i]=(0,f.useState)(),[a,o]=(0,f.useState)(!1),[s,c]=(0,f.useState)(0),[l,u]=(0,f.useState)(e8),{isExporting:d,handleExport:p}=M6(),{startDate:m,endDate:h}=l,g=dd({pageSize:100,keyword:ZE(t,300)}),_=zf(e=>e.userSetting),v=!!_?.subAccount,y=(0,f.useMemo)(()=>{let e=g.data?.data??[];if(!v)return e;let t=_?.subAccount_rules??[],n=new Set(t.filter(e=>e.rule===`admin`||e.rule===`analyst`).map(e=>e.token));return e.filter(e=>n.has(e.token))},[g.data?.data,v,_?.subAccount_rules]);(0,f.useEffect)(()=>{if(r)return;let e=y[0];e&&i(e.token)},[y,r]);let b=(0,f.useMemo)(()=>y.find(e=>e.token===r),[y,r]),x=Fd({...A6(),token:r}),S=Fd({startDate:m,endDate:h,token:r}),C=Rd(r,m,h),w=[{label:e(`tabLinkData`)},{label:e(`tabWelcomePage`)},{label:e(`tabSurvey`)}],T=[{key:`chatRoom`,label:e(`metrics.chatRoom`),color:`#3B82F6`},{key:`message`,label:e(`metrics.message`),color:`var(--brand)`},{key:`uniqueUser`,label:e(`metrics.uniqueUser`),color:`#06B6D4`},{key:`pageView`,label:e(`metrics.pageView`),color:`#F59E0B`},{key:`effectiveInteraction`,label:e(`metrics.effectiveInteraction`),color:`#EF4444`}],E=(0,f.useMemo)(()=>[{key:`chatRoom`,label:e(`metrics.chatRoom`),tooltip:e(`metrics.chatRoomDesc`),value:Id(x.data?.chatRoomCount),icon:fc,color:`#3B82F6`},{key:`message`,label:e(`metrics.message`),tooltip:e(`metrics.messageDesc`),value:Id(x.data?.messageCount),icon:dc,color:`var(--brand)`},{key:`uniqueUser`,label:e(`metrics.uniqueUser`),tooltip:e(`metrics.uniqueUserDesc`),value:Id(x.data?.userCount),icon:Fc,color:`#06B6D4`},{key:`pageView`,label:e(`metrics.pageView`),tooltip:e(`metrics.pageViewDesc`),value:
72Id(x.data?.landingUserCount),icon:Zs,color:`#F59E0B`},{key:`effectiveInteraction`,label:e(`metrics.effectiveInteraction`),tooltip:e(`metrics.effectiveInteractionDesc`),value:Id(x.data?.effectiveUserCount),icon:Lc,color:`#EF4444`}],[x.data,e]),D=x.loading,O=O6(S.data),k=A6(),A=`${k.startDate.replace(/-/g,`/`)} â ${k.endDate.replace(/-/g,`/`)}`,j=C.data,M=(0,f.useMemo)(()=>[{key:`view`,label:e(`welcomeView`),display:du(j?.view??0),icon:Zs,color:`#6366F1`},{key:`click`,label:e(`welcomeClick`),display:du(j?.click??0),icon:hc,color:`#F59E0B`},{key:`ctr`,label:e(`welcomeCtr`),display:`${(j?.ctr??0).toFixed(1)}%`,icon:yc,color:`#06B6D4`},{key:`stay`,label:e(`welcomeStay`),display:fu(j?.stay??0),icon:Ws,color:`#8B5CF6`}],[e,j]);return(0,X.jsxs)(`div`,{className:`space-y-6`,children:[(0,X.jsx)(`h1`,{className:`text-[28px] font-semibold text-text-primary`,children:e(`linkAnalyticsTitle`)}),(0,X.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,X.jsx)(`p`,{className:`text-[15px] text-text-secondary shrink-0`,children:e(`viewLinkLabel`)}),(0,X.jsxs)(`div`,{className:`relative w-72`,children:[(0,X.jsxs)(`button`,{onClick:()=>o(e=>!e),className:`w-full flex items-center justify-between h-10 px-3 rounded-[8px] border border-border bg-bg-card text-[15px] text-text-primary outline-none focus:border-border-strong cursor-pointer`,children:[(0,X.jsx)(`span`,{children:b?b.title||b.name:e(`selectLink`)}),(0,X.jsx)(Is,{className:K(`w-3.5 h-3.5 text-text-secondary shrink-0 transition-transform duration-200`,a&&`rotate-180`)})]}),a&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{className:`fixed inset-0 z-30`,onClick:()=>o(!1)}),(0,X.jsxs)(`div`,{className:`absolute top-10 left-0 w-full card z-40 overflow-hidden`,style:{boxShadow:`var(--shadow-3)`},children:[(0,X.jsx)(`div`,{className:`p-2 border-b border-border`,children:(0,X.jsxs)(`div`,{className:`flex items-center gap-2 px-2`,children:[(0,X.jsx)(Cc,{className:`w-3.5 h-3.5 text-text-secondary shrink-0`}),(0,X.jsx)(`input`,{autoFocus:!0,value:t,onChange:e=>n(e.target.value),placeholder:e(`searchLink`),className:`flex-1 text-[15px] bg-transparent outline-none text-text-primary placeholder:text-text-secondary`}),t&&(0,X.jsx)(`button`,{onClick:()=>n(``),className:`shrink-0 text-text-secondary hover:text-text-primary transition-colors cursor-pointer`,children:(0,X.jsx)(Ic,{className:`w-3.5 h-3.5`})})]})}),(0,X.jsxs)(`div`,{className:`max-h-48 overflow-y-auto py-1`,children:[y.map(e=>(0,X.jsx)(`button`,{onClick:()=>{i(e.token),o(!1),n(``)},className:K(`w-full text-left px-3 h-9 text-[15px] transition-colors hover:bg-bg-subtle cursor-pointer`,e.token===r?`text-brand font-medium`:`text-text-primary`),children:e.title||e.name},e.token)),y.length===0&&(0,X.jsx)(`p`,{className:`px-3 py-2 text-[15px] text-text-secondary`,children:e(`noLinkFound`)})]})]})]})]})]}),(0,X.jsx)(`div`,{className:`flex gap-1 border-b border-border`,children:w.map(({label:e},t)=>(0,X.jsx)(`button`,{onClick:()=>c(t),className:K(`px-4 py-2 text-[15px] border-b-2 -mb-px transition-all duration-200 cursor-pointer`,s===t?`border-brand text-brand font-medium`:`border-transparent text-text-secondary hover:text-text-primary`),children:e},e))}),s===0?(0,X.jsxs)(`div`,{className:`space-y-6`,children:[(0,X.jsxs)(`section`,{children:[(0,X.jsxs)(`h2`,{className:`text-[15px] font-semibold text-text-primary mb-3`,children:[e(`currentMonth`),(0,X.jsxs)(`span`,{className:`text-text-secondary font-normal ml-2 tabular-nums`,children:[`(`,A,`)`]})]}),(0,X.jsx)(`div`,{className:`grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-4`,children:D?E.map(({key:e})=>(0,X.jsx)(iD,{},e)):E.map(({key:e,label:t,tooltip:n,value:r,icon:i,color:a})=>(0,X.jsxs)(`div`,{className:`card p-5`,children:[(0,X.jsx)(`div`,{className:`w-8 h-8 rounded-[8px] flex items-center justify-center mb-3`,style:{backgroundColor:hu(a)},children:(0,X.jsx)(i,{className:`w-4 h-4`,style:{color:a}})}),(0,X.jsxs)(`div`,{className:`flex items-center gap-1 mb-1 min-h-[30px]`,children:[(0,X.jsx)(`p`,{className:`text-[12px] text-text-secondary leading-tight`,children:t}),(0,X.jsx)(tE,{content:n})]}),(0,X.jsx)(`p`,{className:`text-[28px] font-bold text-text-primary tabular-nums leading-none`,children:du(r)})]},e))})]}),(0,X.jsxs)(`div`,{className:`card p-6`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between mb-5 gap-3 flex-wrap`,children:[(0,X.jsx)(`h2`,{className:`text-[17px] font-semibold text-text-primary`,children:e(`dataReport`)}),(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(L6,{value:l,onCh
72ange:u}),(0,X.jsxs)(Z,{size:`sm`,variant:`secondary`,className:`gap-1.5 whitespace-nowrap shrink-0`,disabled:!S.data||S.loading,loading:d,onClick:()=>p(O,T,b?.title||b?.name||``,m,h,e(`exportSuccess`)),children:[(0,X.jsx)(qs,{className:`w-3.5 h-3.5`}),e(`export`)]})]})]}),(0,X.jsx)(`div`,{className:`flex flex-wrap gap-x-6 gap-y-2 mb-5 pb-5 border-b border-border`,children:T.map(e=>(0,X.jsxs)(`div`,{className:`flex items-baseline gap-2`,children:[(0,X.jsx)(`span`,{className:`w-2 h-2 rounded-full shrink-0`,style:{backgroundColor:e.color}}),(0,X.jsx)(`span`,{className:`text-[13px] text-text-secondary`,children:e.label}),(0,X.jsx)(`span`,{className:`text-[15px] font-semibold text-text-primary tabular-nums`,children:S.loading&&!S.data?`â`:du(j6(O,e.key))})]},e.key))}),(0,X.jsx)(D6,{rows:O,hasData:!!S.data,loading:S.loading,error:S.error,refetch:S.refetch,metrics:T})]}),(0,X.jsx)(W6,{token:r})]}):s===1?(0,X.jsxs)(`div`,{className:`space-y-6`,children:[(0,X.jsx)(`div`,{className:`flex items-center justify-end`,children:(0,X.jsx)(L6,{value:l,onChange:u})}),(0,X.jsx)(`div`,{className:`grid grid-cols-2 lg:grid-cols-4 gap-4`,children:M.map(({key:e,label:t,display:n,icon:r,color:i})=>(0,X.jsxs)(`div`,{className:`card p-5`,children:[(0,X.jsx)(`div`,{className:`w-8 h-8 rounded-[8px] flex items-center justify-center mb-3`,style:{backgroundColor:hu(i)},children:(0,X.jsx)(r,{className:`w-4 h-4`,style:{color:i}})}),(0,X.jsx)(`p`,{className:`text-[12px] text-text-secondary mb-1 leading-tight`,children:t}),(0,X.jsx)(`p`,{className:`text-[28px] font-bold text-text-primary tabular-nums leading-none`,children:n})]},e))}),(0,X.jsx)(q6,{buttons:(j?.clickGroup??[]).map(e=>({title:e.data.detail.title,url:e.data.detail.link,click:e.count,ctr:j?.view?e.count/j.view*100:0})),totalClicks:j?.click??0})]}):(0,X.jsx)(Y6,{token:r})]})}function n8(){return(0,X.jsx)(`div`,{children:(0,X.jsx)(Xa,{})})}function r8(){let{t:e,i18n:t}=V(`settings`),{t:n}=V(`common`);cE(e(`generalTitle`));let{logAnalyticsEvent:r}=BS(),i=t.language,a=e=>{e!==i&&(r(`save_changes_click`,{feature_name:`general_settings`}),t.changeLanguage(e),Q.success(n(`languageChanged`)))};return(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h1`,{className:`text-[28px] font-semibold text-text-primary mb-6`,children:e(`generalTitle`)}),(0,X.jsxs)(`div`,{className:`card p-6`,children:[(0,X.jsx)(`h2`,{className:`text-[17px] font-semibold text-text-primary mb-1`,children:e(`languageSection`)}),(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary mb-5`,children:i}),(0,X.jsx)(`div`,{className:`grid grid-cols-2 sm:grid-cols-3 gap-2`,children:qt.map(({code:e,label:t})=>{let n=i===e;return(0,X.jsxs)(`button`,{onClick:()=>a(e),className:K(`flex items-center gap-2.5 px-3 h-10 rounded-[8px] border text-left text-[15px] transition-all duration-150 cursor-pointer`,n?`border-brand bg-brand-tint text-brand font-medium`:`border-border bg-bg-card text-text-primary hover:border-brand/40 hover:bg-bg-subtle`),children:[(0,X.jsx)(`span`,{className:`flex-1 truncate`,children:t}),n&&(0,X.jsx)(Fs,{className:`w-3.5 h-3.5 shrink-0`})]},e)})})]})]})}var i8={success:`bg-[#E6F8EC] text-[#029935]`,warning:`bg-[#FEF3E2] text-[#B76E00]`,danger:`bg-[#FDEAEA] text-[#C0392B]`,neutral:`bg-bg-subtle text-text-secondary`,brand:`bg-brand-tint text-brand`};function a8({variant:e=`neutral`,children:t,className:n}){return(0,X.jsx)(`span`,{className:K(`inline-flex items-center px-2 py-0.5 rounded-[6px] text-[13px] font-medium`,i8[e],n),children:t})}var o8=[20,0];function s8(){let{t:e}=V(`settings`),{t}=V(`common`);cE(e(`subAccountsTitle`));let n=zf(e=>e.userSetting),{logAnalyticsEvent:r}=BS(),i=Yd(),a=dd({pageSize:100}),o=Xd(),s=Zd(),c=Qd(),l=$d(),[u,d]=(0,f.useState)(!1),[p,m]=(0,f.useState)(!1),[h,g]=(0,f.useState)(null),[_,v]=(0,f.useState)(null),[y,b]=(0,f.useState)(null),[x,S]=(0,f.useState)(null),C=i.data?.data??[],w=()=>{r(`subaccount_add_click`);let e=n?.sub_accounts_limit??0,t=i.data?.count??C.length;if(e>0&&t>=e){m(!0);return}g(null),d(!0)};return(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h1`,{className:`text-[28px] font-semibold text-text-primary mb-6`,children:e(`subAccountsTitle`)}),(0,X.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center justify-between gap-3 mb-5`,children:[(0,X.jsx)(`p`,{className:`text-[15px] text-text-secondary`,children:e(`subAccountsDescription`)}),(0,X.jsxs)(Z,{size:`sm`,onClick:w,className:`gap-1.5`,children:[(0,X.jsx)(xc,{className:`w-4 h-4`}),e(`addSubAccount`)]})]}),(0,X.jsx)(`div`,{className:`card overflow-x-auto`,children:(0,X.jsxs)(`table`,{className:`w-full`,children:[(0,X.jsx)(`thead`,{children:(0,X.jsxs)(`tr`,{className:`bg-bg-muted border-b border-border`,children:[(0,X.jsx)(`th`,{className:`text-left px-4 py-3 text-[13px] font-medium text-text-secondary uppercase tracking-wide`,children:t(`name`)}),(0,X.jsx)(`th`,{className:`text-left px-4 py-3 text-[13px] font-medium text-text-secondary uppercase tracking-wide`,children:e(`accountLabel`)}),(0,X.jsx)(`th`,{className:`text-left px-4 py-3 text-[13px] font-medium text-text-secondary uppercase tracking-wide`,children:e(`tableAssignedLinks`)}),(0,X.jsx)(`th`,{className:`px-4 py-3`})]})}),(0,X.jsx)(`tbody`,{children:i.loading&&!i.data?(0,X.jsx)(`tr`,{children:(0,X.jsx)(`td`,{colSpan:4,className:`px-4 py-12 text-center text-[14px] text-text-secondary`,children:t(`loading`)})}):i.error?(0,X.jsx)(`tr`,{children:(0,X.jsxs)(`td`,{colSpan:4,className:`px-4 py-12 text-center`,children:[(0,X.jsx)(`p`,{className:`text-[14px] text-danger mb-2`,children:t(`loadFailed`)}),(0,X.jsx)(Z,{size:`sm`,variant:`secondary`,onClick:()=>void i.refetch(),children:t(`retry`)}
72)]})}):C.length===0?(0,X.jsx)(`tr`,{children:(0,X.jsx)(`td`,{colSpan:4,className:`px-4 py-12 text-center`,children:(0,X.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[(0,X.jsx)(Nc,{className:`w-8 h-8 text-text-secondary opacity-30`}),(0,X.jsx)(`p`,{className:`text-[15px] text-text-secondary`,children:e(`noSubAccounts`)}),(0,X.jsxs)(Z,{size:`sm`,onClick:w,className:`gap-1.5 mt-1`,children:[(0,X.jsx)(xc,{className:`w-4 h-4`}),e(`addSubAccount`)]})]})})}):C.map(t=>(0,X.jsxs)(`tr`,{className:`border-b border-border last:border-0`,children:[(0,X.jsx)(`td`,{className:`px-4 h-12 text-[15px] font-medium text-text-primary`,children:t.name}),(0,X.jsx)(`td`,{className:`px-4 h-12 text-[15px] text-text-secondary`,children:t.account}),(0,X.jsx)(`td`,{className:`px-4 h-12`,children:t.enterpoints.length>0?(0,X.jsx)(`button`,{type:`button`,onClick:()=>S(t),className:`cursor-pointer`,children:(0,X.jsx)(a8,{variant:`brand`,children:e(`assignedLinks_other`,{count:t.enterpoints.length})})}):(0,X.jsx)(a8,{variant:`neutral`,children:e(`unassigned`)})}),(0,X.jsx)(`td`,{className:`px-4 h-12 text-right`,children:(0,X.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,X.jsx)(`button`,{onClick:()=>{r(`subaccount_edit_click`),g(t),d(!0)},"aria-label":e(`editSubAccount`),className:`w-8 h-8 flex items-center justify-center rounded-[8px] text-text-secondary hover:text-text-primary hover:bg-bg-subtle transition-colors cursor-pointer`,children:(0,X.jsx)(vc,{className:`w-4 h-4`})}),(0,X.jsx)(`button`,{onClick:()=>{r(`subaccount_delete_click`),v(t)},"aria-label":e(`deleteSubAccount`),className:`w-8 h-8 flex items-center justify-center rounded-[8px] text-text-secondary hover:text-danger hover:bg-bg-subtle transition-colors cursor-pointer`,children:(0,X.jsx)(kc,{className:`w-4 h-4`})})]})})]},t.id))})]})}),(0,X.jsx)(c8,{open:u,editing:h,onClose:()=>{d(!1),g(null)},onSaved:e=>{d(!1),g(null),i.refetch(),e&&b(e)},createMutation:o,updateMutation:s}),(0,X.jsxs)(GS,{open:!!_,onClose:()=>v(null),title:e(`deleteConfirmTitle`),children:[(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary mb-5`,children:e(`deleteConfirmMessage`,{name:_?.name??``})}),(0,X.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,X.jsx)(Z,{variant:`secondary`,onClick:()=>v(null),disabled:c.loading,children:t(`cancel`)}),(0,X.jsx)(Z,{onClick:async()=>{if(_)try{await c.mutate(_.id),Q.success(e(`subAccountDeleted`)),v(null),i.refetch()}catch(t){let n=t instanceof Du&&t.message?t.message:e(`subAccountDeleteFailed`);Q.error(n)}},disabled:c.loading,className:`!bg-danger !text-white hover:!bg-danger/90 disabled:opacity-40`,children:c.loading?t(`loading`):t(`delete`)})]})]}),(0,X.jsxs)(GS,{open:p,onClose:()=>m(!1),title:e(`subAccountLimitTitle`),children:[(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary mb-5`,children:e(`subAccountLimitBody`,{limit:n?.sub_accounts_limit??0})}),(0,X.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,X.jsx)(Z,{variant:`secondary`,onClick:()=>m(!1),children:t(`cancel`)}),(0,X.jsx)(qo,{to:`/dashboard/billing`,children:(0,X.jsx)(Z,{onClick:()=>m(!1),children:e(`subAccountLimitUpgrade`)})})]})]}),(0,X.jsx)(f8,{account:x,onClose:()=>S(null)}),(0,X.jsx)(l8,{account:y,allLinks:a.data?.data??[],loading:a.loading&&!a.data,onClose:()=>b(null),onSaved:()=>{b(null),i.refetch()},rulesMutation:l})]})}function c8({open:e,editing:t,onClose:n,onSaved:r,createMutation:i,updateMutation:a}){let{t:o}=V(`settings`),{t:s}=V(`common`),[c,l]=(0,f.useState)(``),[u,d]=(0,f.useState)(``),[p,m]=(0,f.useState)(``),[h,g]=(0,f.useState)(20),[_,v]=(0,f.useState)(``),[y,b]=(0,f.useState)({});(0,f.useEffect)(()=>{e&&(b({}),m(``),t?(l(t.name??``),d(t.account??``),g(t.notifyType===0?0:20),v(t.notifyEmail??t.account??``)):(l(``),d(``),g(20),v(``)))},[e,t]);let x=!!t,S=i.loading||a.loading;return(0,X.jsx)(GS,{open:e,onClose:n,title:o(x?`editSubAccountModal`:`addSubAccountModal`),children:(0,X.jsxs)(`div`,{className:`space-y-3`,children:[(0,X.jsx)(iE,{label:s(`name`),placeholder:o(`namePlaceholder`),value:c,onChange:e=>l(e.target.value),error:y.name}),(0,X.jsx)(iE,{label:o(`accountLabel`),type:`email`,placeholder:o(`accountPlaceholder`),value:u,onChange:e=>d(e.target.value),error:y.account,disabled:x}),(0,X.jsx)(iE,{label:o(`passwordLabel`),type:`password`,placeholder:o(x?`passwordEditPlaceholder`:`passwordPlaceholder`),value:p,onChange:e=>m(e.target.value),error:y.password,autoComplete:`new-password`}),x&&(0,X.jsx)(`p`,{className:`text-[13px] text-text-secondary -mt-2`,children:o(`passwordEditHint`)}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,X.jsx)(`label`,{className:`text-[14px] font-medium text-text-primary`,children:o(`notifyTypeLabel`)}),(0,X.jsx)(`select`,{value:h,onChange:e=>g(Number(e.target.value)),className:`h-10 w-full rounded-[8px] border border-border bg-bg-card px-3 text-[15px] text-text-primary outline-none focus:border-border-strong cursor-pointer`,children:o8.map(e=>(0,X.jsx)(`option`,{value:e,children:o(e===20?`notifyEmail`:`notifyNone`)},e))})]}),h===20&&(0,X.jsx)(iE,{label:o(`notifyEmailLabel`),type:`email`,placeholder:o(`emailPlaceholder`),value:_,onCh
72ange:e=>v(e.target.value),error:y.notifyEmail}),(0,X.jsxs)(`div`,{className:`flex justify-end gap-2 pt-2`,children:[(0,X.jsx)(Z,{variant:`secondary`,onClick:n,disabled:S,children:s(`cancel`)}),(0,X.jsx)(Z,{onClick:async()=>{let e={};if(c.trim()||(e.name=o(`fieldRequired`)),u.trim()||(e.account=o(`fieldRequired`)),!x&&!p&&(e.password=o(`fieldRequired`)),h===20&&!_.trim()&&(e.notifyEmail=o(`fieldRequired`)),b(e),!(Object.keys(e).length>0))try{let e={name:c.trim(),account:u.trim(),notifyType:h,notifyEmail:h===20?_.trim():``};x&&t?(await a.mutate({id:t.id,payload:{...e,...p?{password:p}:{}}}),Q.success(o(`subAccountUpdated`)),r(null)):(await i.mutate({...e,password:p}),Q.success(o(`subAccountAdded`,{name:c.trim()})),r(null))}catch(e){let t=e instanceof Du&&e.message?e.message:o(`subAccountSaveFailed`);Q.error(t)}},disabled:S,className:`disabled:opacity-40`,children:s(S?x?`saving`:`loading`:x?`save`:`create`)})]})]})})}function l8({account:e,allLinks:t,loading:n,onClose:r,onSaved:i,rulesMutation:a}){let{t:o}=V(`settings`),{t:s}=V(`common`),c=(0,f.useMemo)(()=>{let t=new Map;return e?.enterpoints.forEach(e=>t.set(e.token,e.role)),t},[e]),[l,u]=(0,f.useState)(new Set);if((0,f.useEffect)(()=>{e&&u(new Set(e.enterpoints.map(e=>e.token)))},[e]),!e)return null;let d=e=>{u(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};return(0,X.jsxs)(GS,{open:!!e,onClose:r,title:o(`assignModal`),children:[(0,X.jsx)(`div`,{className:`space-y-1 mb-4 max-h-80 overflow-y-auto`,children:n?(0,X.jsx)(`p`,{className:`text-center py-8 text-[14px] text-text-secondary`,children:s(`loading`)}):t.length===0?(0,X.jsx)(`p`,{className:`text-center py-8 text-[14px] text-text-secondary`,children:o(`noLinksToAssign`)}):t.map(e=>(0,X.jsxs)(`div`,{onClick:()=>d(e.token),className:`flex items-center gap-3 px-3 py-2.5 rounded-[8px] hover:bg-bg-subtle cursor-pointer transition-colors`,children:[(0,X.jsx)(`button`,{type:`button`,role:`checkbox`,"aria-checked":l.has(e.token),"aria-label":e.name,onClick:t=>{t.stopPropagation(),d(e.token)},className:`w-4 h-4 shrink-0 rounded-[4px] border flex items-center justify-center cursor-pointer transition-colors ${l.has(e.token)?`bg-brand border-brand`:`border-border bg-bg-card hover:border-border-strong`}`,children:l.has(e.token)&&(0,X.jsx)(Fs,{className:`w-[10px] h-[10px] text-white`,strokeWidth:3})}),(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsx)(`p`,{className:`text-[15px] text-text-primary truncate`,children:e.name}),(0,X.jsx)(`p`,{className:`text-[13px] text-text-secondary font-mono truncate`,children:Sd(e.token,e.custom_domain)})]})]},e.token))}),(0,X.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,X.jsx)(Z,{variant:`secondary`,onClick:r,disabled:a.loading,children:s(`cancel`)}),(0,X.jsx)(Z,{onClick:async()=>{try{let t=Array.from(l).map(e=>({token:e,rule:c.get(e)??`admin`}));await a.mutate({id:e.id,payload:{rules:t,shareAvatars:e.shareAvatars}}),Q.success(o(`assignmentUpdated`)),i()}catch(e){let t=e instanceof Du&&e.message?e.message:o(`assignmentSaveFailed`);Q.error(t)}},disabled:a.loading,className:`disabled:opacity-40`,children:a.loading?s(`saving`):s(`save`)})]})]})}var u8=10,d8={admin:`roleAdmin`,editor:`roleEditor`,analyst:`roleAnalyst`,cs:`roleCs`};function f8({account:e,onClose:t}){let{t:n}=V(`settings`),r=la(),[i,a]=(0,f.useState)(1);if((0,f.useEffect)(()=>{e&&a(1)},[e]),!e)return null;let o=e.enterpoints,s=Math.ceil(o.length/u8),c=o.slice((i-1)*u8,i*u8);return(0,X.jsx)(GS,{open:!!e,onClose:t,title:n(`viewAssignedLinks`),className:`max-w-2xl`,children:o.length===0?(0,X.jsx)(`p`,{className:`text-center py-12 text-[14px] text-text-secondary`,children:n(`noAssignedLinks`)}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{className:`overflow-x-auto -mx-6`,children:(0,X.jsxs)(`table`,{className:`w-full min-w-[480px]`,children:[(0,X.jsx)(`thead`,{children:(0,X.jsxs)(`tr`,{className:`bg-bg-muted border-b border-border`,children:[(0,X.jsx)(`th`,{className:`text-left px-6 py-2.5 text-[13px] font-medium text-text-secondary`,children:n(`colLinkName`)}),(0,X.jsx)(`th`,{className:`text-left px-3 py-2.5 text-[13px] font-medium text-text-secondary`,children:n(`colLinkUrl`)}),(0,X.jsx)(`th`,{className:`text-left px-3 py-2.5 text-[13px] font-medium text-text-secondary`,children:n(`colLinkRole`)}),(0,X.jsx)(`th`,{className:`px-6 py-2.5 w-10`})]})}),(0,X.jsx)(`tbody`,{children:c.map(e=>(0,X.jsxs)(`tr`,{className:`border-b border-border last:border-0`,children:[(0,X.jsx)(`td`,{className:`px-6 py-3 text-[14px] text-text-primary font-medium max-w-[140px] truncate`,children:e.title??e.token}),(0,X.jsx)(`td`,{className:`px-3 py-3 text-[13px] text-text-secondary font-mono max-w-[200px] truncate`,children:Sd(e.token,e.custom_domain)}),(0,X.jsx)(`td`,{className:`px-3 py-3 text-[14px] text-text-secondary whitespace-nowrap`,children:n(d8[e.role]??`roleAdmin`)}),(0,X.jsx)(`td`,{className:`px-6 py-3 text-right`,children:(0,X.jsx)(`button`,{type:`button`,onClick:()=>r(`/dashboard/workspace/${e.token}
72/settings/sub-accounts`),className:`text-text-secondary hover:text-text-primary transition-colors cursor-pointer`,"aria-label":n(`manageAssignment`),children:(0,X.jsx)(Ys,{className:`w-4 h-4`})})})]},e.token))})]})}),s>1&&(0,X.jsxs)(`div`,{className:`flex items-center justify-end gap-1 pt-3`,children:[(0,X.jsx)(`button`,{type:`button`,disabled:i===1,onClick:()=>a(e=>Math.max(1,e-1)),className:`px-2 py-1 text-[13px] text-text-secondary disabled:opacity-30 hover:text-text-primary cursor-pointer disabled:cursor-default`,children:`â¹`}),Array.from({length:s},(e,t)=>t+1).map(e=>(0,X.jsx)(`button`,{type:`button`,onClick:()=>a(e),className:`px-2.5 py-1 text-[13px] rounded-[8px] cursor-pointer transition-colors ${e===i?`bg-bg-muted font-semibold text-text-primary`:`text-text-secondary hover:text-text-primary`}`,children:e},e)),(0,X.jsx)(`button`,{type:`button`,disabled:i===s,onClick:()=>a(e=>Math.min(s,e+1)),className:`px-2 py-1 text-[13px] text-text-secondary disabled:opacity-30 hover:text-text-primary cursor-pointer disabled:cursor-default`,children:`âº`})]})]})})}function p8(){return J(e=>q.put(`/user/stripe`,e))}function m8(){return J(e=>q.put(`/user/paypal`,e))}function h8(){return J(e=>q.put(`/user/linepay`,e))}function g8(){let{t:e,i18n:t}=V(`settings`),{t:n}=V(`common`);cE(e(`paymentTitle`));let{logAnalyticsEvent:r}=BS(),i=zf(e=>e.user),a=zf(e=>e.userSetting),o=Tu(`/api/stripe/webhook/${i?.id??``}`),s=p8(),c=m8(),l=h8(),[u,d]=(0,f.useState)({linepay:!1,stripe:!1,paypal:!1}),[p,m]=(0,f.useState)({linepay:!1,stripe:!1,paypal:!1}),[h,g]=(0,f.useState)({stripe:{secretKey:``,webhookSecret:``},paypal:{clientId:``,clientSecret:``},linepay:{channelId:``,secretKey:``}}),[_,v]=(0,f.useState)({}),[y,b]=(0,f.useState)(null);(0,f.useEffect)(()=>{a&&(d({stripe:a.stripe_api_secret!=null,paypal:a.paypal_client_id!=null,linepay:a.linepay_channel_id!=null}),m({stripe:a.stripe_open===!0,paypal:a.paypal_open===!0,linepay:a.linepay_open===!0}),g(e=>({...e,paypal:{...e.paypal,clientId:String(a.paypal_client_id??``)},linepay:{...e.linepay,channelId:String(a.linepay_channel_id??``)}})))},[a]);let x=t.language===`zh-TW`?`https://funtek.notion.site/LINE-Pay-57c9b67a4a2046acb2331ac06655154b`:`https://funtek.notion.site/LINE-Pay-Dashboard-Setup-Tutorial-10a54015e2cf4987b3e0076a16e9d517`,S=[{id:`linepay`,name:`LINE Pay`,color:`#06C755`,abbr:`L`,description:e(`linepay.description`),docsUrl:x,fields:[{label:e(`linepay.channelId`),placeholder:e(`linepay.channelIdPlaceholder`),key:`channelId`,tooltip:e(`linepay.channelIdTooltip`),prefillKey:`linepay_channel_id`},{label:e(`linepay.secretKey`),placeholder:e(`linepay.secretKeyPlaceholder`),key:`secretKey`,tooltip:e(`linepay.secretKeyTooltip`)}]},{id:`stripe`,name:`Stripe`,color:`#635BFF`,abbr:`S`,description:e(`stripe.description`),webhookUrl:!0,setupNote:e(`stripe.setupNote`),docsUrl:`https://funtek.notion.site/In-Chat-Payment-7ab08c91d7d74e3b94d88b31f170c692#48c967fb3aeb4a7b958f968c405815c8`,fields:[{label:e(`stripe.secretKey`),placeholder:e(`stripe.secretKeyPlaceholder`),key:`secretKey`,tooltip:e(`stripe.secretKeyTooltip`)},{label:e(`stripe.webhookSecret`),placeholder:e(`stripe.webhookSecretPlaceholder`),key:`webhookSecret`,tooltip:e(`stripe.webhookSecretTooltip`)}]},{id:`paypal`,name:`PayPal`,color:`#003087`,abbr:`P`,description:e(`paypal.description`),fields:[{label:e(`paypal.clientId`),placeholder:e(`paypal.clientIdPlaceholder`),key:`clientId`,tooltip:e(`paypal.clientIdTooltip`),prefillKey:`paypal_client_id`},{label:e(`paypal.clientSecret`),placeholder:e(`paypal.clientSecretPlaceholder`),key:`clientSecret`,tooltip:e(`paypal.clientSecretTooltip`)}]}],C=e=>b(t=>t===e?null:e),w=(e,t,n)=>{g(r=>({...r,[e]:{...r[e],[t]:n}}))},T=async(t,n)=>{m(e=>({...e,[t]:n}));try{t===`stripe`?await s.mutate({stripe_open:n}):t===`paypal`?await c.mutate({paypal_open:n}):t===`linepay`&&await l.mutate({linepay_open:n})}catch(r){m(e=>({...e,[t]:!n}));let i=r instanceof Du&&r.message?r.message:e(`paymentSaveFailed`);Q.error(i)}},E=async t=>{r(`save_changes_click`,{feature_name:`payment_settings`,element_id:t}),v(e=>({...e,[t]:!0}));try{let n=h[t]??{};t===`stripe`?await s.mutate({stripe_open:!!p.stripe,...n.secretKey?{secret_key:n.secretKey}:{},...n.webhookSecret?{webhook_secret:n.webhookSecret}:{}}):t===`paypal`?await c.mutate({paypal_open:!!p.paypal,...n.clientId?{paypal_client_id:n.clientId}:{},...n.clientSecret?{paypal_secret:n.clientSecret}:{}}):t===`linepay`&&await l.mutate({linepay_open:!!p.linepay,...n.channelId?{linepay_channel_id:n.channelId}:{},...n.secretKey?{linepay_channel_secret_key:n.secretKey}:{}}),d(e=>({...e,[t]:!0})),Q.success(e(`paymentSaved`))}catch(t){let n=t instanceof Du&&t.message?t.message:e(`paymentSaveFailed`);Q.error(n)}finally{v(e=>({...e,[t]:!1}))}},D=async e=>{await uu(e),Q.success(n(`copiedWebhookUrl`))};return(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h1`,{className:`text-[28px] font-semibold text-text-primary mb-6`,children:e(`paymentTitle`)}),(0,X.jsx)(`p`,{className:`text-[15px] text-text-secondary mb-5`,children:e(`paymentDescription`)}),(0,X.jsx)(`div`,{className:`space-y-4`,children:S.map(t=>{let r=!!u[t.id],i=r&&!!p[t.id];return(0,X.jsxs)(`div`,{className:`card overflow-hidden`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between px-5 py-4 cursor-pointer hover:bg-bg-page transition-colors duration-150`,onClick:()=>C(t.id),children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,X.jsx)(`div`,{className:`w-10 h-10 rounded-[8px] flex items-center justify-center text-white text-[15px] font-bold shrink-0`,style:{backgroundColor:t.color},children:t.abbr}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h3`,{className:`text-[17px] font-semibold text-text-primary`,children:t.name}),(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary mt-0.5`,children:t.description})]})]}),(0,X.jsxs)(`div`,{className:`flex items-center gap-3`,children:[!r&&(0,X.jsx)(`span`,{className:`text-[13px] text-text-secondary`,children:e(`paymentNotConfigured`)}),(0,X.jsx)(`span`,{className:`inline-flex`,onClick:e=>e.stopPropagation(),children:r?(0,X.jsx)(_8,{checked:i,onChange:e=>T(t.id,e)}):(0,X.jsx)(tE,{content:e(`paymentToggleDisabledHint`),children:(0,X.jsx)(_8,{checked:!1,onChange:()=>{},disabled:!0})})}),(0,X.jsx)(Is,{className:`w-4 h-4 text-text-secondary transition-transform duration-200 ${y===t.id?`rotate-180`:``}`})]})]}),y===t.id&&(0,X.jsxs)(`div`,{className:`border-t border-border px-5 py-4 space-y-4 bg-bg-card`,children:[t.setupNote&&(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary leading-relaxed`,children:t.setupNote}),t.webhookUrl&&(0,X.jsxs)(`div`,{className:`flex items-center gap-2 h-10 px-3 rounded-[8px] border border-border bg-bg-muted font-mono text-[14px] text-text-secondary`,children:[(0,X.jsx)(`span`,{className:`flex-1 truncate`,children:o}),(0,X.jsx)(`button`,{onClick:()=>D(o),className:`shrink-0 text-text-secondary hover:text-brand transition-colors cursor-pointer`,"aria-label":n(`copyWebhookUrl`),children:(0,X.jsx)(Gs,{className:`w-4 h-4`})})]}),t.fields.map(e=>{let n=!e.prefillKey,i=h[t.id]?.[e.key]??``;return(0,X.jsxs)(`div`,{children:[(0,X.jsxs)(`label`,{className:`flex items-center gap-1.5 text-[14px] font-medium text-text-primary mb-1.5`,children:[e.label,(0,X.jsx)(tE,{content:e.tooltip})]}),(0,X.jsx)(iE,{placeholder:n&&r?`â¢â¢â¢â¢â¢â¢â¢â¢`:e.placeholder,type:`password`,value:i,onChange:n=>w(t.id,e.key,n.target.value)})]},e.key)}),(0,X.jsxs)(`div`,{className:`flex items-center justify-between pt-1`,children:[t.docsUrl?(0,X.jsxs)(`a`,{href:t.docsUrl,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-1.5 text-[14px] text-brand hover:underline`,children:[n(`viewDocs`),(0,X.jsx)(Ys,{className:`w-3 h-3`})]}):(0,X.jsx)(`span`,{}),(0,X.jsx)(Z,{size:`sm`,className:`ml-auto`,loading:!!_[t.id],disabled:!!_[t.id],onClick:()=>
72E(t.id),children:n(`saveChanges`)})]})]})]},t.id)})})]})}function _8({checked:e,onChange:t,disabled:n}){return(0,X.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":e,disabled:n,onClick:()=>t(!e),className:K(`relative w-10 h-[22px] rounded-full transition-colors duration-200 shrink-0 overflow-hidden`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1`,n?`cursor-not-allowed opacity-50`:`cursor-pointer`,e?`bg-brand`:`bg-border-strong`),children:(0,X.jsx)(`span`,{className:K(`absolute top-[3px] w-4 h-4 rounded-full bg-white shadow-sm transition-[left] duration-200`,e?`left-[21px]`:`left-[3px]`)})})}function v8(){let e=new Date,t=new Date;t.setDate(e.getDate()-29);let n=e=>`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`;return{startDate:n(t),endDate:n(e)}}function y8(){let{t:e}=V(`workspace`),{t}=V(`analytics`),{linkName:n}=$T();cE(n?`${n} â ${e(`nav.dataOverview`)}`:e(`nav.dataOverview`));let{linkId:r}=pa(),[i,a]=(0,f.useState)(0),[o,s]=(0,f.useState)(`all`),[c,l]=(0,f.useState)(v8),u=Fd({...A6(),token:r}),d=Fd({startDate:c.startDate,endDate:c.endDate,token:r}),p=Rd(r,c.startDate,c.endDate),m=O6(d.data),h=u.loading,g=[{label:e(`data.tabLinkData`)},{label:e(`data.tabWelcomePage`)},{label:e(`data.tabSurvey`)}],_={cards:[{key:`chatRoom`,label:e(`data.chatRoom`),tooltip:e(`data.chatRoomDesc`),value:Id(u.data?.chatRoomCount),icon:fc,color:`#3B82F6`},{key:`messageCount`,label:e(`data.messageCount`),tooltip:e(`data.messageCountDesc`),value:Id(u.data?.messageCount),icon:dc,color:`var(--brand)`},{key:`uniqueUser`,label:e(`data.uniqueUser`),tooltip:e(`data.uniqueUserDesc`),value:Id(u.data?.userCount),icon:Fc,color:`#06B6D4`},{key:`pageView`,label:e(`data.pageView`),tooltip:e(`data.pageViewDesc`),value:Id(u.data?.landingUserCount),icon:Zs,color:`#F59E0B`},{key:`effectiveInteraction`,label:e(`data.effectiveInteraction`),tooltip:e(`data.effectiveInteractionDesc`),value:Id(u.data?.effectiveUserCount),icon:Lc,color:`#EF4444`}],metrics:[{key:`chatRoom`,label:e(`data.chatRoom`),color:`#3B82F6`},{key:`message`,label:e(`data.messageCount`),color:`var(--brand)`},{key:`uniqueUser`,label:e(`data.uniqueUser`),color:`#06B6D4`},{key:`pageView`,label:e(`data.pageView`),color:`#F59E0B`},{key:`effectiveInteraction`,label:e(`data.effectiveInteraction`),color:`#EF4444`}],chartData:m},v=p.data,y=[{key:`view`,label:t(`welcomeView`),display:du(v?.view??0),icon:Zs,color:`#6366F1`},{key:`click`,label:t(`welcomeClick`),display:du(v?.click??0),icon:hc,color:`#F59E0B`},{key:`ctr`,label:t(`welcomeCtr`),display:`${(v?.ctr??0).toFixed(1)}%`,icon:yc,color:`#06B6D4`},{key:`stay`,label:t(`welcomeStay`),display:fu(v?.stay??0),icon:Ws,color:`#8B5CF6`}],b=i===0,x=i===1,S=i===2,C=A6(),w=`${C.startDate.replace(/-/g,`/`)} â ${C.endDate.replace(/-/g,`/`)}`,T=e=>{a(e),s(`all`)};return(0,X.jsxs)(`div`,{className:`space-y-6`,children:[(0,X.jsx)(`h2`,{className:`text-[28px] font-semibold text-text-primary`,children:e(`data.title`)}),(0,X.jsx)(`div`,{className:`flex gap-1 border-b border-border`,children:g.map(({label:e},t)=>(0,X.jsx)(`button`,{onClick:()=>T(t),className:K(`px-4 py-2 text-[15px] border-b-2 -mb-px transition-all duration-200 cursor-pointer`,i===t?`border-brand text-brand font-medium`:`border-transparent text-text-secondary hover:text-text-primary`),children:e},e))}),x?(0,X.jsx)(b8,{welcomeCards:y,range:c,setRange:l,welcomeData:v}):S?(0,X.jsx)(Y6,{token:r}):(0,X.jsx)(x8,{config:_,isLinkTab:b,loading:b&&h,monthRangeLabel:w,currentMonthLabel:t(`currentMonth`),filter:o,setFilter:s,range:c,setRange:l,report:d,rangeRows:m,filterAllLabel:e(`data.filterAll`),dataReportLabel:e(`data.dataReport`),exportLabel:e(`data.export`),linkId:r,linkName:n})]})}function b8({welcomeCards:e,range:t,setRange:n,welcomeData:r}){return(0,X.jsxs)(`div`,{className:`space-y-6`,children:[(0,X.jsx)(`div`,{className:`flex items-center justify-end`,children:(0,X.jsx)(L6,{value:t,onChange:n})}),(0,X.jsx)(`div`,{className:`grid grid-cols-2 lg:grid-cols-4 gap-4`,children:e.map(({key:e,label:t,display:n,icon:r,color:i})=>(0,X.jsxs)(`div`,{className:`card p-5`,children:[(0,X.jsx)(`div`,{className:`w-8 h-8 rounded-[8px] flex items-center justify-center mb-3`,style:{backgroundColor:hu(i)},children:(0,X.jsx)(r,{className:`w-4 h-4`,style:{color:i}})}),(0,X.jsx)(`p`,{className:`text-[12px] text-text-secondary mb-1 leading-tight`,children:t}),(0,X.jsx)(`p`,{className:`text-[28px] font-bold text-text-primary tabular-nums leading-none`,children:n})]},e))}),(0,X.jsx)(q6,{buttons:(r?.clickGroup??[]).map(e=>({title:e.data.detail.title,url:e.data.detail.link,click:e.count,ctr:r?.view?e.count/r.view*100:0})),totalClicks:r?.click??0})]})}function x8({config:e,isLinkTab:t,loading:n,monthRangeLabel:r,currentMonthLabel:i,filter:a,setFilter:o,range:s,setRange:c,report:l,rangeRows:u,filterAllLabel:d,dataReportLabel:f,exportLabel:p,linkId:m,linkName:h}){let{t:g}=V(`analytics`),{isExporting:_,handleExport:v}=M6(),y=[{value:`all`,label:d},...e.metrics.map(e=>({value:e.key,label:e.label}))],b=a===`all`?e.metrics:e.metrics.filter(e=>e.key===a);return(0,X.jsxs)(`div`,{className:`space-y-6`,children:[(0,X.jsxs)(`section`,{children:[t&&(0,X.jsxs)(`h3`,{className:`text-[15px] font-semibold text-text-primary mb-3`,children:[i,(0,X.jsxs)(`span`,{className:`text-text-secondary font-normal ml-2 tabular-nums`,children:[`(`,r,`)`]})]}),(0,X.jsx)(`div`,{className:K(`grid grid-cols-2 sm:grid-cols-3 gap-4`,e.cards.length===5?`lg:grid-cols-5`:e.cards.length===4?`lg:grid-cols-4`:`lg:grid-cols-3`),children:n?e.cards.map(({key:e})=>(0,X.jsx)(iD,{},e)):e.cards.map(({key:e,label:t,value:n,icon:r,color:i,suffix:a,tooltip:o})=>(0,X.jsxs)(`div`,{className:`card p-5`,children:[(0,X.jsx)(`div`,{className:`w-8 h-8 rounded-[8px] flex items-center justify-center mb-3`,style:{backgroundColor:hu(i)},children:(0,X.jsx)(r,{className:`w-4 h-4`,style:{color:i}})}),(0,X.jsxs)(`div`,{className:`flex items-center gap-1 mb-1 min-h-[30px]`,children:[(0,X.jsx)(`p`,{className:`text-[12px] text-text-secondary leading-tight`,children:t}),o&&(0,X.jsx)(tE,{content:o})]}),(0,X.jsx)(`p`,{className:`text-[28px] font-bold text-text-primary tabular-nums leading-none`,children:`${du(n)}${a??``}`})]},e))})]}),(0,X.jsxs)(`div`,{className:`card p-6`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between mb-5 gap-3 flex-wrap`,children:[(0,X.jsx)(`h3`,{className:`text-[17px] font-semibold text-text-primary`,children:f}),(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,X.jsx)(z6,{value:a,options:y,onChange:o}),(0,X.jsx)(L6,{value:s,onChange:c}),(0,X.jsxs)(Z,{size:`sm`,className:`gap-1.5 whitespace-nowrap shrink-0`,disabled:!l.data||l.loading,loading:_,onClick:()=>
72v(u,b,h||m||`export`,s.startDate,s.endDate,g(`exportSuccess`)),children:[(0,X.jsx)(qs,{className:`w-3.5 h-3.5`}),p]})]})]}),t&&(0,X.jsx)(`div`,{className:`flex flex-wrap gap-x-6 gap-y-2 mb-5 pb-5 border-b border-border`,children:b.map(e=>(0,X.jsxs)(`div`,{className:`flex items-baseline gap-2`,children:[(0,X.jsx)(`span`,{className:`w-2 h-2 rounded-full shrink-0`,style:{backgroundColor:e.color}}),(0,X.jsx)(`span`,{className:`text-[13px] text-text-secondary`,children:e.label}),(0,X.jsx)(`span`,{className:`text-[15px] font-semibold text-text-primary tabular-nums`,children:l.loading&&!l.data?`â`:du(j6(u,e.key))})]},e.key))}),(0,X.jsx)(D6,{rows:e.chartData,hasData:t?!!l.data:!0,loading:t?l.loading:!1,error:t?l.error:void 0,refetch:t?l.refetch:()=>{},metrics:b})]}),t&&(0,X.jsx)(W6,{token:m})]})}var S8=[`#02B13F`,`#3B82F6`,`#8B5CF6`,`#EF4444`,`#F97316`,`#0EA5E9`];function C8(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)>>>0;return S8[t%S8.length]}function w8(e){let t=e.nickname||e.email||e.chat_room_id;return{id:e.chat_room_id,name:t,email:e.email??``,info:e.other??``,notes:e.memo??``,joinedAt:e.joined_at,lastMessage:e.sent_at??``,tags:e.tags??[],avatarColor:C8(t)}}var T8=10,E8=`h-10 w-full rounded-[8px] border border-border bg-bg-card px-3 text-[15px] text-text-primary placeholder:text-text-secondary placeholder:opacity-50 outline-none focus:border-border-strong transition-colors`;function D8(){let{t:e,i18n:t}=V(`workspace`),{t:n}=V(`common`),{linkName:r}=$T();cE(r?`${r} â ${e(`nav.customers`)}`:e(`nav.customers`));let{linkId:i}=pa(),{logAnalyticsEvent:a}=BS(),o=e=>{if(!e)return``;let n=new Date(e);return Number.isNaN(n.getTime())?e:n.toLocaleString(t.language,{dateStyle:`short`,timeStyle:`short`})},[s,c]=(0,f.useState)(``),l=ZE(s,300),[u,d]=(0,f.useState)(1),[p,m]=(0,f.useState)(null),[h,g]=(0,f.useState)(!1),[_,v]=(0,f.useState)(``),{data:y,loading:b,error:x,refetch:S}=Dd({token:i,keyword:l}),C=Od(i),w=kd(i),T=Ad(),E=(y??[]).map(w8).sort((e,t)=>new Date(t.joinedAt).getTime()-new Date(e.joinedAt).getTime()),D=Math.max(1,Math.ceil(E.length/T8)),O
72=E.slice((u-1)*T8,u*T8),k=u<D,A=u>1,j=e=>{c(e),u!==1&&d(1)};return(0,X.jsxs)(`div`,{children:[(0,X.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center justify-between gap-3 mb-5`,children:[(0,X.jsx)(`h2`,{className:`text-[28px] font-semibold text-text-primary`,children:e(`customers.title`)}),(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsx)(Cc,{className:`absolute left-3 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-text-secondary`}),(0,X.jsx)(`input`,{value:s,onChange:e=>j(e.target.value),placeholder:e(`customers.searchPlaceholder`),className:`h-10 w-56 pl-9 pr-3 rounded-[8px] border border-border bg-bg-card text-[15px] text-text-primary placeholder:text-text-secondary outline-none focus:border-border-strong`})]}),(0,X.jsxs)(`div`,{className:`relative group`,children:[(0,X.jsxs)(Z,{variant:`secondary`,size:`md`,className:`gap-2`,children:[(0,X.jsx)(qs,{className:`w-4 h-4`}),e(`customers.export`)]}),(0,X.jsxs)(`div`,{className:`absolute right-0 top-11 w-52 bg-bg-card border border-border rounded-[12px] py-1 z-20 hidden group-hover:block`,style:{boxShadow:`var(--shadow-2)`},children:[(0,X.jsxs)(`button`,{onClick:async()=>{if(i){a(`client_list_export_click`,{element_id:i,type:`csv`});try{let e=await C.mutate();window.open(e,`_blank`,`noopener,noreferrer`)}catch{Q.error(e(`customers.exportFailed`))}}},disabled:C.loading,className:`w-full flex items-center gap-2.5 px-3 h-9 text-[14px] text-text-primary hover:bg-bg-subtle cursor-pointer disabled:opacity-50 disabled:cursor-wait`,children:[(0,X.jsx)(qs,{className:`w-4 h-4 text-text-secondary`}),e(`customers.exportCsvBtn`)]}),(0,X.jsxs)(`button`,{onClick:()=>{v(``),g(!0)},className:`w-full flex items-center gap-2.5 px-3 h-9 text-[14px] text-text-primary hover:bg-bg-subtle cursor-pointer`,children:[(0,X.jsx)(lc,{className:`w-4 h-4 text-text-secondary`}),e(`customers.exportEmailBtn`)]})]})]})]})]}),(0,X.jsx)(`div`,{className:`card overflow-x-auto`,children:(0,X.jsxs)(`table`,{className:`w-full min-w-[700px] table-fixed`,children:[(0,X.jsx)(`thead`,{children:(0,X.jsxs)(`tr`,{className:`bg-bg-muted border-b border-border`,children:[(0,X.jsx)(`th`,{className:`text-left px-4 py-3 text-[12px] font-medium text-text-secondary uppercase tracking-[0.6px] w-[30%]`,children:e(`customers.colUser`)}),(0,X.jsx)(`th`,{className:`text-left px-4 py-3 text-[12px] font-medium text-text-secondary uppercase tracking-[0.6px] w-[18%]`,children:e(`customers.colCreatedAt`)}),(0,X.jsx)(`th`,{className:`text-left px-4 py-3 text-[12px] font-medium text-text-secondary uppercase tracking-[0.6px] w-[18%]`,children:e(`customers.colLastMessage`)}),(0,X.jsx)(`th`,{className:`text-left px-4 py-3 text-[12px] font-medium text-text-secondary uppercase tracking-[0.6px]`,children:e(`customers.colTags`)}),(0,X.jsx)(`th`,{className:`px-4 py-3 w-[72px]`})]})}),(0,X.jsx)(`tbody`,{children:b&&O.length===0?Array.from({length:4}).map((e,t)=>(0,X.jsx)(A8,{},t)):x&&O.length===0?(0,X.jsx)(`tr`,{children:(0,X.jsx)(`td`,{colSpan:5,className:`px-4 py-16 text-center`,children:(0,X.jsxs)(`div`,{className:`flex flex-col items-center gap-3`,children:[(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary`,children:n(`loadFailed`)}),(0,X.jsx)(Z,{variant:`secondary`,size:`md`,onClick:()=>void S(),children:n(`retry`)})]})})}):O.length===0?(0,X.jsx)(`tr`,{children:(0,X.jsx)(`td`,{colSpan:5,className:`px-4 py-16 text-center`,children:(0,X.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[(0,X.jsx)(Fc,{className:`w-10 h-10 text-text-secondary opacity-25`}),(0,X.jsx)(`p`,{className:`text-[15px] font-medium text-text-primary`,children:e(s?`customers.noResults`:`customers.noCustomersTitle`)}),!s&&(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary`,children:e(`customers.noCustomersDesc`)})]})})}):O.map(t=>(0,X.jsxs)(`tr`,{className:`border-b border-border last:border-0 hover:bg-bg-subtle transition-colors duration-150`,children:[(0,X.jsx)(`td`,{className:`px-4 py-3`,children:(0,X.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,X.jsx)(`div`,{className:`w-8 h-8 rounded-full flex items-center justify-center text-white text-[13px] font-bold shrink-0`,style:{backgroundColor:t.avatarColor},children:t.name[0]}),(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsx)(`p`,{className:`text-[15px] font-medium text-text-primary truncate`,children:t.name}),t.email&&(0,X.jsx)(`p`,{className:`text-[13px] text-text-secondary truncate`,children:t.email})]})]})}),(0,X.jsx)(`td`,{className:`px-4 py-3 text-[14px] text-text-secondary whitespace-nowrap`,children:o(t.joinedAt)}),(0,X.jsx)(`td`,{className:`px-4 py-3 text-[14px] text-text-secondary whitespace-nowrap`,children:t.lastMessage?o(t.lastMessage):`â`}),(0,X.jsx)(`td`,{className:`px-4 py-3`,children:(0,X.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:t.tags.map((e,t)=>(0,X.jsx)(`span`,{className:`inline-flex items-center px-2 h-5 rounded-full text-[12px] font-medium`,style:{backgroundColor:e.color?`${e.color}1A`:void 0,color:e.color||void 0},children:e.text},`${e.text}-${t}`))})}),(0,X.jsx)(`td`,{className:`px-4 py-3`,children:(0,X.jsxs)(`div`,{className:`flex items-center gap-1 justify-end`,children:[(0,X.jsx)(`button`,{onClick:()=>{a(`client_list_chat_click`,{element_id:t.id}),window.open(`#`,`_blank`)},title:e(`customers.goToChatroom`),className:`w-8 h-8 flex items-center justify-center rounded-[8px] text-text-secondary hover:bg-bg-subtle hover:text-text-primary transition-colors cursor-pointer`,children:(0,X.jsx)(dc,{className:`w-4 h-4`})}),(0,X.jsx)(`button`,{onClick:()=>{a(`client_list_edit_click`,{element_id:t.id}),m({...t})},title:e(`customers.editCustomer`),className:`w-8 h-8 flex items-center justify-center rounded-[8px] text-text-secondary hover:bg-bg-subtle hover:text-text-primary transition-colors cursor-pointer`,children:(0,X.jsx)(vc,{className:`w-4 h-4`})})]})})]},t.id))})]})}
72),(A||k)&&(0,X.jsxs)(`div`,{className:`flex items-center justify-end gap-2 mt-4`,children:[(0,X.jsx)(Z,{variant:`secondary`,size:`md`,disabled:!A||b,onClick:()=>d(e=>Math.max(1,e-1)),children:n(`previousPage`)}),(0,X.jsxs)(`span`,{className:`text-[14px] text-text-secondary tabular-nums px-2`,children:[u,` / `,D]}),(0,X.jsx)(Z,{variant:`secondary`,size:`md`,disabled:!k||b,onClick:()=>d(e=>e+1),children:n(`nextPage`)})]}),p&&(0,X.jsx)(O8,{customer:p,loading:T.loading,onClose:()=>m(null),onSave:async t=>{if(!i)return;let n=[{type:`email`,data:t.email},{type:`text`,data:t.info},{type:`memo`,data:t.notes}].filter(e=>e.data.trim()!==``);if(n.length===0){m(null);return}let r=(await Promise.allSettled(n.map(({type:e,data:n})=>T.mutate({type:e,data:n,roomId:t.id,token:i})))).filter(e=>e.status===`rejected`).length;await S(),r===0?(Q.success(e(`customers.editSaved`)),m(null)):r===n.length?Q.error(e(`customers.editFailed`)):Q.error(e(`customers.editPartialFailed`,{failed:r,total:n.length}))}}),(0,X.jsx)(GS,{open:h,onClose:()=>g(!1),title:e(`customers.exportEmailBtn`),children:(0,X.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,X.jsx)(`input`,{type:`email`,value:_,onChange:e=>v(e.target.value),placeholder:e(`customers.exportEmailPlaceholder`),className:E8,autoFocus:!0}),(0,X.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,X.jsx)(Z,{variant:`secondary`,onClick:()=>g(!1),children:n(`cancel`)}),(0,X.jsxs)(Z,{disabled:!_||w.loading,className:`disabled:opacity-40`,onClick:async()=>{if(_){a(`client_list_export_click`,{element_id:i,type:`email`});try{await w.mutate(_),Q.success(e(`customers.exportEmailSent`)),g(!1)}catch{Q.error(e(`customers.exportFailed`))}}},children:[(0,X.jsx)(lc,{className:`w-4 h-4`}),w.loading?n(`loading`):e(`customers.exportEmailBtn`)]})]})]})})]})}function O8({customer:e,loading:t,onClose:n,onSave:r}){let{t:i}=V(`workspace`),{t:a}=V(`common`),[o,s]=(0,f.useState)(e),c=e=>t=>s(n=>({...n,[e]:t.target.value})),l=`h-10 w-full rounded-[8px] border border-border bg-bg-card px-3 text-[15px] text-text-primary placeholder:text-text-secondary placeholder:opacity-50 outline-none focus:border-border-strong transition-colors`;return(0,X.jsx)(GS,{open:!0,onClose:n,title:i(`customers.editTitle`),children:(0,X.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,X.jsx)(k8,{label:i(`customers.labelEmail`),children:(0,X.jsx)(`input`,{type:`email`,value:o.email,onChange:c(`email`),placeholder:i(`customers.labelEmailPlaceholder`),className:l})}),(0,X.jsx)(k8,{label:i(`customers.labelAdditionalInfo`),children:(0,X.jsx)(`input`,{value:o.info,onChange:c(`info`),placeholder:i(`customers.labelAdditionalInfoPlaceholder`),className:l})}),(0,X.jsx)(k8,{label:i(`customers.labelNotes`),children:(0,X.jsx)(`textarea`,{value:o.notes,onChange:c(`notes`),rows:3,placeholder:i(`customers.labelNotesPlaceholder`),className:K(l,`h-auto py-2 resize-none`)})}),(0,X.jsxs)(`div`,{className:`flex justify-end gap-2 pt-1`,children:[(0,X.jsx)(Z,{variant:`secondary`,onClick:n,disabled:t,children:a(`cancel`)}),(0,X.jsx)(Z,{onClick:()=>r(o),disabled:t,children:a(t?`saving`:`save`)})]})]})})}function k8({label:e,children:t}){return(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsx)(`label`,{className:`text-[14px] font-medium text-text-primary`,children:e}),t]})}function A8(){return(0,X.jsxs)(`tr`,{className:`border-b border-border`,children:[(0,X.jsx)(`td`,{className:`px-4 py-3`,children:(0,X.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,X.jsx)(rD,{className:`w-8 h-8 rounded-full shrink-0`}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsx)(rD,{className:`h-3.5 w-24 rounded`}),(0,X.jsx)(rD,{className:`h-3 w-36 rounded`})]})]})}),(0,X.jsx)(`td`,{className:`px-4 py-3`,children:(0,X.jsx)(rD,{className:`h-3.5 w-28 rounded`})}),(0,X.jsx)(`td`,{className:`px-4 py-3`,children:(0,X.jsx)(rD,{className:`h-3.5 w-28 rounded`})}),(0,X.jsx)(`td`,{className:`px-4 py-3`,children:(0,X.jsx)(rD,{className:`h-5 w-16 rounded-full`})}),(0,X.jsx)(`td`,{className:`px-4 py-3`})]})}function j8({allowed:e,children:t,inline:n}){let r=cC(e=>e.currentPlan),{t:i}=V(`common`);return e.includes(r)?(0,X.jsx)(X.Fragment,{children:t}):n?(0,X.jsx)(`div`,{className:`pointer-events-none select-none opacity-40`,children:t}):(0,X.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 rounded-[8px] border border-border bg-bg-subtle px-3 py-2.5`,children:[(0,X.jsx)(nc,{className:`w-4 h-4 text-text-secondary shrink-0`}),(0,X.jsxs)(`p`,{className:`text-[14px] text-text-secondary`,children:[i(`planGate.message`),` `,(0,X.jsx)(qo,{to:`/dashboard/billing`,className:`text-brand hover:underline font-medium`,children:i(`planGate.cta`)})]})]}),(0,X.jsx)(`div`,{className:`pointer-events-none select-none opacity-40`,children:t})]})}function M8(){return(M8=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function N8(e,t){if(e==null)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||(i[n]=e[n]);return i}function P8(e){var t=(0,f.useRef)(e),n=(0,f.useRef)(function(e){t.current&&t.current(e)});return t.current=e,n.current}var F8=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e<t?t:e},I8=function(e){return`touches`in e},L8=function(e){return e&&e.ownerDocument.defaultView||self},R8=function(e,t,n){var r=e.getBoundingClientRect(),i=I8(t)?function(e,t){for(var n=0;n<e.length;n++)if(e[n].identifier===t)return e[n];return e[0]}(t.touches,n):t;return{left:F8((i.pageX-(r.left+L8(e).pageXOffset))/r.width),top:F8((i.pageY-(r.top+L8(e).pageYOffset))/r.height)}},z8=function(e){!I8(e)&&e.preventDefault()},B8=f.memo(function(e){var t=e.onMove,n=e.onKey,r=e.onEnd,i=N8(e,[`onMove`,`onKey`,`onEnd`]),a=(0,f.useRef)(null),o=P8(t),s=P8(n),c=P8(r),l=(0,f.useRef)(null),u=(0,f.useRef)(!1),d=(0,f.useMemo)(function(){var e=function(e){z8(e),(I8(e)?e.touches.length>0:e.buttons>0)&&a.current?o(R8(a.current,e,l.current)):(n(!1),c())},t=function(){n(!1),c()};function n(n){var r=u.current,i=L8(a.current),o=n?i.addEventListener:i.removeEventListener;o(r?`touchmove`:`mousemove`,e),o(r?`touchend`:`mouseup`,t)}return[function(e){var t=e.nativeEvent,r=a.current;if(r&&(z8(t),!function(e,t){return t&&!I8(e)}(t,u.current)&&r)){if(I8(t)){u.current=!0;var i=t.changedTouches||[];i.length&&(l.current=i[0].identifier)}r.focus(),o(R8(r,t,l.current)),n(!0)}},function(e){var t=e.which||e.keyCode;t<37||t>40||(e.preventDefault(),s({left:t===39?.05:t===37?-.05:0,top:t===40?.05:t===38?-.05:0}))},function(e){var t=e.which||e.keyCode;t>=37&&t<=40&&c()},n]},[s,o,c]),p=d[0],m=d[1],h=d[2],g=d[3];return(0,f.useEffect)(function(){return g},[g]),f.createElement(`div`,M8({},i,{onTouchStart:p,onMouseDown:p,className:`react-colorful__interactive`,ref:a,onKeyDown:m,onKeyUp:h,tabIndex:0,role:`slider`}))}),V8=function(e){return e.filter(Boolean).join(` `)},H8=function(e){var t=e.color,n=e.left,r=e.top,i=r===void 0?.5:r,a=V8([`react-colorful__pointer`,e.className]);
72return f.createElement(`div`,{className:a,style:{top:100*i+`%`,left:100*n+`%`}},f.createElement(`div`,{className:`react-colorful__pointer-fill`,style:{backgroundColor:t}}))},U8=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=10**t),Math.round(n*e)/n};360/(2*Math.PI);var W8=function(e){return Q8(G8(e))},G8=function(e){return e[0]===`#`&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?U8(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:e.length===8?U8(parseInt(e.substring(6,8),16)/255,2):1}},K8=function(e){return Z8(Y8(e))},q8=function(e){var t=e.s,n=e.v,r=e.a,i=(200-t)*n/100;return{h:U8(e.h),s:U8(i>0&&i<200?t*n/100/(i<=100?i:200-i)*100:0),l:U8(i/2),a:U8(r,2)}},J8=function(e){var t=q8(e);return`hsl(`+t.h+`, `+t.s+`%, `+t.l+`%)`},Y8=function(e){var t=e.h,n=e.s,r=e.v,i=e.a;t=t/360*6,n/=100,r/=100;var a=Math.floor(t),o=r*(1-n),s=r*(1-(t-a)*n),c=r*(1-(1-t+a)*n),l=a%6;return{r:U8(255*[r,s,o,o,c,r][l]),g:U8(255*[c,r,r,s,o,o][l]),b:U8(255*[o,o,c,r,r,s][l]),a:U8(i,2)}},X8=function(e){var t=e.toString(16);return t.length<2?`0`+t:t},Z8=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,a=i<1?X8(U8(255*i)):``;return`#`+X8(t)+X8(n)+X8(r)+a},Q8=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,a=Math.max(t,n,r),o=a-Math.min(t,n,r),s=o?a===t?(n-r)/o:a===n?2+(r-t)/o:4+(t-n)/o:0;return{h:U8(60*(s<0?s+6:s)),s:U8(a?o/a*100:0),v:U8(a/255*100),a:i}},$8=f.memo(function(e){var t=e.hue,n=e.onChange,r=e.onChangeEnd,i=V8([`react-colorful__hue`,e.className]);return f.createElement(`div`,{className:i},f.createElement(B8,{onMove:function(e){n({h:360*e.left})},onKey:function(e){n({h:F8(t+360*e.left,0,360)})},onEnd:r,"aria-label":`Hue`,"aria-valuenow":U8(t),"aria-valuemax":`360`,"aria-valuemin":`0`},f.createElement(H8,{className:`react-colorful__hue-pointer`,left:t/360,color:J8({h:t,s:100,v:100,a:1})})))}),e5=f.memo(function(e){var t=e.hsva,n=e.onChange,r=e.onChangeEnd,i={backgroundColor:J8({h:t.h,s:100,v:100,a:1})};return f.createElement(`div`,{className:`react-colorful__saturation`,style:i},f.createElement(B8,{onMove:function(e){n({s:100*e.left,v:100-100*e.top})},onKey:function(e){n({s:F8(t.s+100*e.left,0,100),v:F8(t.v-100*e.top,0,100)})},onEnd:r,"aria-label":`Color`,"aria-valuetext":`Saturation `+U8(t.s)+`%, Brightness `+U8(t.v)+`%`},f.createElement(H8,{className:`react-colorful__saturation-pointer`,top:1-t.v/100,left:t.s/100,color:J8(t)})))}),t5=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0},n5=function(e,t){return e.toLowerCase()===t.toLowerCase()||t5(G8(e),G8(t))};function r5(e,t,n,r){var i=P8(n),a=P8(r),o=(0,f.useState)(function(){return e.toHsva(t)}),s=o[0],c=o[1],l=(0,f.useRef)({color:t,hsva:s}),u=(0,f.useRef)(!1);return(0,f.useEffect)(function(){if(!e.equal(t,l.current.color)){var n=e.toHsva(t);l.current={hsva:n,color:t},c(n),u.current=!1}},[t,e]),(0,f.useEffect)(function(){var t;t5(s,l.current.hsva)||e.equal(t=e.fromHsva(s),l.current.color)||(l.current={hsva:s,color:t},i(t),u.current=!0)},[s,e,i]),[s,(0,f.useCallback)(function(e){c(function(t){return Object.assign({},t,e)})},[]),(0,f.useCallback)(function(){u.current&&(u.current=!1,a(l.current.color))},[a])]}var i5,a5=typeof window<`u`?f.useLayoutEffect:f.useEffect,o5=function(){return i5||(typeof __webpack_nonce__<`u`?__webpack_nonce__:void 0)},s5=new WeakMap,c5=function(e){a5(function(){var t=e.current;if(typeof document<`u`&&t){var n=t.getRootNode?t.getRootNode():t.ownerDocument,r=n&&(`head`in n||`host`in n)?n:t.ownerDocument;if(!s5.has(r)){var i=`head`in r?r.head:r,a=(i.ownerDocument||document).createElement(`style`);a.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;
72left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`;var o=o5();o&&a.setAttribute(`nonce`,o),s5.set(r,a),i.appendChild(a)}}},[])},l5=function(e){var t=e.className,n=e.colorModel,r=e.color,i=r===void 0?n.defaultColor:r,a=e.onChange,o=e.onChangeEnd,s=N8(e,[`className`,`colorModel`,`color`,`onChange`,`onChangeEnd`]),c=(0,f.useRef)(null);c5(c);var l=r5(n,i,a,o),u=l[0],d=l[1],p=l[2],m=V8([`react-colorful`,t]);return f.createElement(`div`,M8({},s,{ref:c,className:m}),f.createElement(e5,{hsva:u,onChange:d,onChangeEnd:p}),f.createElement($8,{hue:u.h,onChange:d,onChangeEnd:p,className:`react-colorful__last-control`}))},u5={defaultColor:`000`,toHsva:W8,fromHsva:function(e){return K8({h:e.h,s:e.s,v:e.v,a:1})},equal:n5},d5=function(e){return f.createElement(l5,M8({},e,{colorModel:u5}))},f5=/^#?([0-9A-F]{3,8})$/i,p5=function(e){var t=e.color,n=t===void 0?``:t,r=e.onChange,i=e.onBlur,a=e.escape,o=e.validate,s=e.format,c=e.process,l=N8(e,[`color`,`onChange`,`onBlur`,`escape`,`validate`,`format`,`process`]),u=(0,f.useState)(function(){return a(n)}),d=u[0],p=u[1],m=P8(r),h=P8(i),g=(0,f.useCallback)(function(e){var t=a(e.target.value);p(t),o(t)&&m(c?c(t):t)},[a,c,o,m]),_=(0,f.useCallback)(function(e){o(e.target.value)||p(a(n)),h(e)},[n,a,o,h]);return(0,f.useEffect)(function(){p(a(n))},[n,a]),f.createElement(`input`,M8({},l,{value:s?s(d):d,spellCheck:`false`,onChange:g,onBlur:_}))},m5=function(e){return`#`+e},h5=function(e){var t=e.prefixed,n=e.alpha,r=N8(e,[`prefixed`,`alpha`]),i=(0,f.useCallback)(function(e){return e.replace(/([^0-9A-F]+)/gi,``).substring(0,n?8:6)},[n]),a=(0,f.useCallback)(function(e){return function(e,t){var n=f5.exec(e),r=n?n[1].length:0;return r===3||r===6||!!t&&r===4||!!t&&r===8}(e,n)},[n]);return f.createElement(p5,M8({},r,{escape:i,format:t?m5:void 0,process:m5,validate:a}))};function g5({value:e,onChange:t,className:n,trigger:r}){let[i,a]=(0,f.useState)(!1),[o,s]=(0,f.useState)(null),c=(0,f.useRef)(null),l=(0,f.useRef)(null),u=()=>a(e=>!e);return(0,f.useLayoutEffect)(()=>{if(!i)return;let e=()=>{let e=c.current,t=l.current;if(!e||!t)return;let n=e.getBoundingClientRect(),r=t.offsetWidth,i=t.offsetHeight,a=n.bottom+8;a+i>window.innerHeight-8&&n.top-8-i>8&&(a=n.top-8-i);let o=Math.max(8,Math.min(n.right-r,window.innerWidth-r-8));s({top:a,left:o})};return e(),window.addEventListener(`scroll`,e,!0),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`scroll`,e,!0),window.removeEventListener(`resize`,e)}},[i]),(0,f.useEffect)(()=>{if(!i)return;let e=e=>{let t=e.target;c.current?.contains(t)||l.current?.contains(t)||a(!1)},t=e=>{e.key===`Escape`&&a(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[i]),(0,X.jsxs)(`div`,{className:K(`relative shrink-0`,n),ref:c,children:[r?r({open:i,toggle:u}):(0,X.jsxs)(`button`,{type:`button`,onClick:u,className:`flex items-center gap-2 cursor-pointer`,children:[(0,X.jsx)(`span`,{className:`w-7 h-7 rounded-[6px] border border-border shrink-0`,style:{backgroundColor:e}}),(0,X.jsx)(`span`,{className:`text-[14px] font-mono text-text-secondary uppercase`,children:e})]}),i&&(0,fs.createPortal)((0,X.jsxs)(`div`,{ref:l,className:`pinchat-color-popover fixed z-50 p-3 rounded-[12px] border border-border bg-bg-card flex flex-col gap-2.5`,style:{to
72p:o?.top??-9999,left:o?.left??-9999,visibility:o?`visible`:`hidden`,boxShadow:`var(--shadow-3)`},children:[(0,X.jsx)(d5,{color:e,onChange:t}),(0,X.jsxs)(`div`,{className:`flex items-center gap-1.5 rounded-[8px] border border-border px-2 h-8`,children:[(0,X.jsx)(`span`,{className:`text-[14px] font-mono text-text-secondary`,children:`#`}),(0,X.jsx)(h5,{color:e,onChange:t,prefixed:!1,className:`w-full bg-transparent text-[14px] font-mono text-text-primary uppercase outline-none`})]})]}),document.body)]})}var _5=/^https?:\/\/(www\.)?[-\p{L}\p{N}@:%._+~#=\uFF00-\uFFEF]{2,256}\.[a-z]{2,63}\b([-\p{L}\p{N}@:%_+.~#?&//=\uFF00-\uFFEF]*)?$/u;function v5(e){return e===``||_5.test(e)}var y5=[{id:`green`,color:`#02b13f`,welcome:{textColor:`#7d8a97`,btnColor:`#02b13f`,btnTextColor:`#ffffff`},btn:{dividerColor:`#7d8a97`,btnColor:`#02b13f`,btnTextColor:`#ffffff`},chat:{headerBg:`#006b25`,headerText:`#ffffff`,bubbleBg:`#ddefe0`,bubbleBorder:`#ddefe0`,bubbleText:`#000000`}},{id:`blue`,color:`#007abf`,welcome:{textColor:`#7d8a97`,btnColor:`#007abf`,btnTextColor:`#ffffff`},btn:{dividerColor:`#7d8a97`,btnColor:`#007abf`,btnTextColor:`#ffffff`},chat:{headerBg:`#007abf`,headerText:`#ffffff`,bubbleBg:`#b4cedc`,bubbleBorder:`#b4cedc`,bubbleText:`#000000`}},{id:`orange`,color:`#ffa01a`,welcome:{textColor:`#7d8a97`,btnColor:`#ffa01a`,btnTextColor:`#ffffff`},btn:{dividerColor:`#7d8a97`,btnColor:`#ffa01a`,btnTextColor:`#ffffff`},chat:{headerBg:`#ffa01a`,headerText:`#000000`,bubbleBg:`#ffe4bc`,bubbleBorder:`#ffe4bc`,bubbleText:`#3c3c3c`}},{id:`pink`,color:`#ff85b0`,welcome:{textColor:`#7d8a97`,btnColor:`#ff85b0`,btnTextColor:`#ffffff`},btn:{dividerColor:`#7d8a97`,btnColor:`#ff85b0`,btnTextColor:`#ffffff`},chat:{headerBg:`#ff85b0`,headerText:`#ffffff`,bubbleBg:`#ffe9f1`,bubbleBorder:`#ffe9f1`,bubbleText:`#7b7b7b`}},{id:`purple`,color:`#cf93e6`,welcome:{textColor:`#7d8a97`,btnColor:`#cf93e6`,btnTextColor:`#ffffff`},btn:{dividerColor:`#7d8a97`,btnColor:`#cf93e6`,btnTextColor:`#ffffff`},chat:{headerBg:`#cf93e6`,headerText:`#ffffff`,bubbleBg:`#e7d0f0`,bubbleBorder:`#e7d0f0`,bubbleText:`#616081`}},{id:`lime`,color:`#e0eb76`,welcome:{textColor:`#7d8a97`,btnColor:`#e0eb76`,btnTextColor:`#39701f`},btn:{dividerColor:`#7d8a97`,btnColor:`#e0eb76`,btnTextColor:`#39701f`},chat:{headerBg:`#e0eb76`,headerText:`#1d3d0e`,bubbleBg:`#39701e`,bubbleBorder:`#39701e`,bubbleText:`#ffffff`}}],b5=[{id:`p1`,url:`https://pinchat-prod.s3.ap-northeast-1.amazonaws.com/enterpoint/1f77b4ff50d6279648b27a42ed999826.png`},{id:`p2`,url:`https://pinchat-prod.s3.ap-northeast-1.amazonaws.com/enterpoint/dae136ba5563fa48cd4472c9867167e4.png`},{id:`p3`,url:`https://pinchat-prod.s3.ap-northeast-1.amazonaws.com/enterpoint/0b0a4793be55b1ca27e265e132e65773.png`},{id:`p4`,url:`https://pinchat-prod.s3.ap-northeast-1.amazonaws.com/enterpoint/ad545b6fc6f11bb451d944d5a8a02957.png`},{id:`p5`,url:`https://pinchat-prod.s3.ap-northeast-1.amazonaws.com/enterpoint/355bc6cb11e8ccb6904c88f00cdf8959.png`},{id:`p6`,url:`https://pinchat-prod.s3.ap-northeast-1.amazonaws.com/enterpoint/d30cb76255415d8e13f8563c05851354.png`}],x5=typeof Intl.supportedValuesOf==`function`?Array.from(new Set([`UTC`,...Intl.supportedValuesOf(`timeZone`)])):[`UTC`,`America/New_York`,`America/Chicago`,`America/Denver`,`America/Los_Angeles`,`Europe/London`,`Europe/Paris`,`Europe/Berlin`,`Asia/Tokyo`,`Asia/Shanghai`,`Asia/Taipei`,`Asia/Seoul`,`Asia/Kuala_Lumpur`,`Asia/Bangkok`,`Australia/Sydney`],S5=new Set(x5);function C5(e){try{return new Intl.DateTimeFormat(`en-US`,{timeZone:e,timeZoneName:`shortOffset`}).formatToParts(new Date).find(e=>e.type===`timeZoneName`)?.value??``}catch{return``}}var w5=(()=>{let e=new Map;for(let t of x5){if(t===`UTC`)continue;let n=t.indexOf(`/`),r=n===-1?`Other`:t.slice(0,n),i=(n===-1?t:t.slice(n+1)).replaceAll(`_`,` `),a=C5(t),o={value:t,label:a?`${i} (${a})`:i},s=e.get(r);s?s.push(o):e.set(r,[o])}return Array.from(e,([e,t])=>({region:e,options:t})).sort((e,t)=>e.region.localeCompare(t.region))})(),T5=[`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`,`Sun`],E5=[`image/png`,`image/jpeg`],D5=2*1024*1024,O5=`h-10 w-full rounded-[8px] border border-border bg-bg-card px-3 text-[15px] text-text-primary placeholder:text-text-secondary placeholder:opacity-50 outline-none focus:border-border-strong transition-colors`,k5=`h-10 w-full rounded-[8px] border border-border bg-bg-card pl-3 pr-8 text-[15px] text-text-primary outline-none focus:border-border-strong transition-colors appearance-none cursor-pointer`,A5=`w-full px-3 py-2 rounded-[8px] border border-border bg-bg-card text-[15px] text-text-primary placeholder:text-text-secondary placeholder:opacity-50 outline-none focus:border-border-strong transition-colors resize-none`;function j5(){let{t:e,i18n:t}=V(`workspace`),{t:n}=V(`common`),{linkName:r}=$T();cE(r?`${r} â ${e(`nav.linkInfo`)}`:e(`nav.linkInfo`));let{linkId:i}=pa(),a=la(),{data:o,loading:s,error:c,refetch:l}=pd(i),u=o?wd(o):void 0,d=md(),p=!!zf(e=>e.userSetting)?.subAccount,[m,h]=(0,f.useState)(`info`),[g,_]=(0,f.useState)(``),[v,y]=(0,f.useState)(!1),[b,x]=(0,f.useState)(!1),S=()=>{u?.url&&(uu(u.url),x(!0),setTimeout(()=>x(!1),1500))},C=[{id:`info`,label:e(`linkInfo.tabBasic`)},{id:`welcome`,label:e(`linkInfo.tabWelcome`)},{id:`chat`,label:e(`linkInfo.tabChat`)},{id:`domain`,label:e(`linkInfo.tabDomain`)}],w=async()=>
72{if(o)try{await d.mutate({id:o.id,token:o.token,is_valid:!1}),Q.success(e(`linkInfo.deleteSuccess`)),a(`/dashboard`)}catch{Q.error(e(`linkInfo.deleteFailed`))}},T=u?.createdAt?new Date(u.createdAt).toLocaleString(t.language,{year:`numeric`,month:`long`,day:`numeric`,hour:`2-digit`,minute:`2-digit`}):`â`;return s&&!o?(0,X.jsx)(`div`,{className:`card p-6 text-center text-text-secondary text-[14px]`,children:n(`loading`)}):c&&!o?(0,X.jsxs)(`div`,{className:`card p-6 flex flex-col items-center gap-3`,children:[(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary`,children:n(`loadFailed`)}),(0,X.jsx)(Z,{variant:`secondary`,size:`md`,onClick:()=>void l(),children:n(`retry`)})]}):(0,X.jsxs)(`div`,{className:`flex flex-col md:flex-row gap-6`,children:[(0,X.jsx)(`div`,{className:`w-full md:w-44 shrink-0`,children:(0,X.jsx)(`nav`,{className:`card p-2 space-y-0.5`,children:C.map(({id:e,label:t})=>(0,X.jsx)(`button`,{onClick:()=>h(e),className:K(`w-full text-left px-3 h-9 rounded-[8px] text-[15px] transition-all duration-150 cursor-pointer`,m===e?`bg-brand-tint text-brand font-medium`:`text-text-secondary hover:bg-bg-subtle hover:text-text-primary`),children:t},e))})}),(0,X.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[m===`info`&&(0,X.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,X.jsxs)(`div`,{className:`card p-6 flex flex-col gap-5`,children:[(0,X.jsx)(`h3`,{className:`text-[17px] font-semibold text-text-primary`,children:e(`linkInfo.tabBasic`)}),(0,X.jsx)(G5,{label:e(`linkInfo.labelType`),children:(0,X.jsx)(`span`,{className:`inline-flex items-center px-2.5 h-6 rounded-full text-[13px] font-medium bg-bg-subtle text-text-primary`,children:u?.type===`group`?e(`linkInfo.typeGroup`):e(`linkInfo.typeDirect`)})}),(0,X.jsx)(G5,{label:e(`linkInfo.labelUrl`),children:(0,X.jsxs)(`button`,{onClick:S,className:`flex items-center gap-2 group cursor-pointer text-left`,"aria-label":e(b?`linkInfo.copied`:`linkInfo.copyUrl`),children:[(0,X.jsx)(`span`,{className:`text-[14px] font-mono text-text-secondary break-all`,children:u?.url??`â`}),b?(0,X.jsx)(Fs,{className:`w-4 h-4 text-brand shrink-0`}):(0,X.jsx)(Gs,{className:`w-4 h-4 shrink-0 text-transparent group-hover:text-text-secondary transition-colors duration-150`})]})}),(0,X.jsx)(G5,{label:e(`linkInfo.labelCreatedAt`),children:(0,X.jsx)(`span`,{className:`text-[14px] text-text-secondary`,children:T})})]}),!p&&(0,X.jsxs)(`div`,{className:`card p-6`,style:{borderColor:`rgba(235,87,87,0.25)`},children:[(0,X.jsx)(`h3`,{className:`text-[17px] font-semibold text-danger mb-1`,children:e(`linkInfo.sectionDanger`)}),(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary mb-4`,children:e(`linkInfo.deleteDesc`)}),v?(0,X.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,X.jsxs)(`div`,{className:`flex items-start gap-2 p-3 rounded-[8px] border`,style:{backgroundColor:`rgba(235,87,87,0.05)`,borderColor:`rgba(235,87,87,0.2)`},children:[(0,X.jsx)(jc,{className:`w-4 h-4 text-danger shrink-0 mt-0.5`}),(0,X.jsxs)(`p`,{className:`text-[14px] text-danger`,children:[e(`linkInfo.deleteConfirmPrompt`),`ï¼`,(0,X.jsx)(`strong`,{children:u?.title??u?.name})]})]}),(0,X.jsx)(iE,{value:g,onChange:e=>_(e.target.value),placeholder:u?.title??u?.name}),(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(Z,{size:`md`,onClick:w,disabled:g!==(u?.title??u?.name)||d.loading,className:`disabled:opacity-40`,style:{backgroundColor:g===(u?.title??u?.name)?`#EB5757`:void 0},children:e(`linkInfo.deleteConfirmButton`)}),(0,X.jsx)(Z,{variant:`secondary`,size:`md`,onClick:()=>{y(!1),_(``)},children:e(`linkInfo.deleteCancel`)})]})]}):(0,X.jsx)(Z,{variant:`secondary`,size:`md`,onClick:()=>y(!0),style:{borderColor:`rgba(235,87,87,0.35)`,color:`#EB5757`},children:e(`linkInfo.deleteButton`)})]})]}),m===`welcome`&&o&&(0,X.jsx)(M5,{config:o,refetch:l},o.updatedAt),m===`chat`&&o&&(0,X.jsx)(F5,{config:o,refetch:l},o.updatedAt),m===`domain`&&o&&(0,X.jsx)(I5,{config:o,link:u,refetch:l},o.updatedAt)]})]})}function M5({config:e,refetch:t}){let{t:n}=V(`workspace`),{t:r}=V(`common`),{logAnalyticsEvent:i}=BS(),a=md(),[o,s]=(0,f.useState)(e.show_landing??!0),[c,l]=(0,f.useState)(e.welcome??``),[u,d]=(0,f.useState)(e.start_btn_text??``),[p,m]=(0,f.useState)(e.nickname_required??!1),[h,g]=(0,f.useState)(e.nickname_type??`none`),[_,v]=(0,f.useState)(e.nickname_input_placeholder??``),[y,b]=(0,f.useState)(e.chat_logo_size??50),[x,S]=(0,f.useState)(e.chat_logo||null),[C,w]=(0,f.useState)(()=>y5.find(t=>t.welcome.textColor===e.welcome_text_color&&t.welcome.btnColor===e.start_btn_color&&t.welcome.btnTextColor===e.start_btn_text_color)?.id??``),[T,E]=(0,f.useState)(!1),[D,O]=(0,f.useState)(e.welcome_text_color??`#7d8a97`),[k,A]=(0,f.useState)(e.start_btn_color??`#02b13f`),[j,M]=(0,f.useState)(e.start_btn_text_color??`#ffffff`),[N,ee]=(0,f.useState)(e.welcome_bg_type??`color`),[P,F]=(0,f.useState)(()=>b5.find(t=>t.url===e.welcome_bg_image)?.id??``),[I,te]=(0,f.useState)(e.background_color??`#f7f8f9`),[L,ne]=(0,f.useState)(e.welcome_bg_image??null),[R,z]=(0,f.useState)(e.without_seo_no_index??!1),[B,re]=(0,f.useState)(e.remove_pinboard_footer??!1),[ie,ae]=(0,f.useState)(e.hr_text??``),[oe,se]=(0,f.useState)(()=>y5.find(t=>t.btn.dividerColor===e.hr_color&&t.btn.btnColor===e.welcome_link_prime_color&&t.btn.btnTextColor===e.welcome_link_second_color)?.id??``),[ce,le]=(0,f.useState)(!1),[ue,de]=(0,f.useState)(e.hr_color??`#7d8a97`),[fe,pe]=(0,f.useState)(e.welcome_link_prime_color??`#02b13f`),[me,he]=(0,f.useState)(e.welcome_link_second_color??`#ffffff`),[ge,_e]=(0,f.useState)(()=>(e.welcome_link_setting??[]).filter(e=>e.title?.trim()).map((e,t)=>({id:`btn-${t}-${Math.random().toString(36).slice(2,8)}`,title:e.title,type:e.type,url:e.link??``,subButtons:(e.links??[]).filter(e=>e.title?.trim()).map((e,n)=>({id:`sub-${t}-${n}-${Math.random().toString(36).slice(2,8)}`,title:e.title,url:e.link}))}))),ve=ge.some(e=>e.type===`link`?!v5(e.url):e.subButtons.some(e=>!v5(e.url))),ye=async()=>
72{if(!ve){i(`save_changes_click`,{element_id:e.token,feature_name:`chatroom_setting`});try{await a.mutate({id:e.id,token:e.token,show_landing:o,welcome:c,start_btn_text:u,nickname_required:p,nickname_type:h,nickname_input_placeholder:_,chat_logo:x??``,chat_logo_size:y,welcome_text_color:D,start_btn_color:k,start_btn_text_color:j,welcome_bg_type:N,background_color:I,welcome_bg_image:L??``,without_seo_no_index:R,remove_pinboard_footer:B,hr_text:ie,hr_color:ue,welcome_link_prime_color:fe,welcome_link_second_color:me,welcome_link_setting:ge.filter(e=>e.title.trim()!==``).map(e=>({open:!0,title:e.title,type:e.type,link:e.url,links:e.subButtons.filter(e=>e.title.trim()!==``).map(e=>({title:e.title,link:e.url}))}))}),await t(),Q.success(n(`welcome.saved`))}catch{Q.error(n(`welcome.saveFailed`))}}},be=c||n(`welcome.welcomeMessagePlaceholder`),xe=u||n(`welcome.startChatBtnPlaceholder`),Se=()=>{_e(e=>[...e,{id:Math.random().toString(36).slice(2),title:``,type:`link`,url:``,subButtons:[]}])},Ce=e=>_e(t=>t.filter(t=>t.id!==e)),we=(e,t)=>_e(n=>n.map(n=>n.id===e?{...n,...t}:n)),Te=e=>_e(t=>t.map(t=>t.id===e?{...t,subButtons:[...t.subButtons,{id:Math.random().toString(36).slice(2),title:``,url:``}]}:t)),Ee=(e,t)=>_e(n=>n.map(n=>n.id===e?{...n,subButtons:n.subButtons.filter(e=>e.id!==t)}:n)),De=(e,t,n)=>_e(r=>r.map(r=>r.id===e?{...r,subButtons:r.subButtons.map(e=>e.id===t?{...e,...n}:e)}:r)),Oe=N===`color`?{backgroundColor:I}:L?{backgroundImage:`url(${L})`,backgroundSize:`cover`,backgroundPosition:`center`}:{backgroundColor:`#ffffff`};return(0,X.jsxs)(`div`,{className:`flex gap-8 items-start`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-5 flex-1 min-w-0`,children:[(0,X.jsxs)(`div`,{className:`card p-6 flex flex-col gap-5`,children:[(0,X.jsx)(`h3`,{className:`text-[17px] font-semibold text-text-primary`,children:n(`welcome.sectionContent`)}),(0,X.jsx)(W5,{label:n(`welcome.labelShowWelcomePage`),tooltip:n(`welcome.tipShowWelcomePage`),checked:o,onChange:s}),(0,X.jsx)(L5,{}),(0,X.jsxs)(R5,{label:n(`welcome.labelWelcomeMessage`),tooltip:n(`welcome.tipWelcomeMessage`),children:[(0,X.jsx)(`textarea`,{value:c,onChange:e=>l(e.target.value),placeholder:n(`welcome.welcomeMessagePlaceholder`),maxLength:200,rows:3,className:A5}),(0,X.jsxs)(`p`,{className:`text-[13px] text-text-secondary text-right`,children:[c.length,`/200`]})]}),(0,X.jsx)(L5,{}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,X.jsx)(`p`,{className:`text-[13px] text-text-secondary`,children:n(`welcome.sectionNickname`)}),(0,X.jsx)(W5,{label:n(`welcome.labelNicknameRequired`),tooltip:n(`welcome.tipNicknameRequired`),checked:p,onChange:m}),p&&(0,X.jsx)(R5,{label:n(`welcome.labelNicknameFormat`),tooltip:n(`welcome.tipNicknameFormat`),children:(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsx)(`select`,{value:h,onChange:e=>{let t=e.target.value;g(t);let r={none:`welcome.nicknameDefaultDescNone`,email:`welcome.nicknameDefaultDescEmail`,id:`welcome.nicknameDefaultDescId`,alphanumeric:`welcome.nicknameDefaultDescAlphanumeric`,phone:`welcome.nicknameDefaultDescPhone`};r[t]&&v(n(r[t]))},className:k5,children:[`none`,`email`,`id`,`alphanumeric`,`phone`].map(e=>(0,X.jsx)(`option`,{value:e,children:n(`welcome.nicknameFormat${e.charAt(0).toUpperCase()+e.slice(1)}`)},e))}),(0,X.jsx)(Is,{className:`absolute right-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-text-secondary pointer-events-none`})]})}),(0,X.jsx)(R5,{label:n(`welcome.labelNicknameDesc`),tooltip:n(`welcome.tipNicknameDesc`),children:(0,X.jsx)(`input`,{value:_,onChange:e=>v(e.target.value),placeholder:n(`welcome.nicknameDescPlaceholder`),maxLength:60,className:O5})})]}),(0,X.jsx)(L5,{}),(0,X.jsx)(R5,{label:n(`welcome.labelStartChatBtn`),tooltip:n(`welcome.tipStartChatBtn`),children:(0,X.jsx)(`input`,{value:u,onChange:e=>d(e.target.value),placeholder:n(`welcome.startChatBtnPlaceholder`),maxLength:30,className:O5})})]}),(0,X.jsxs)(`div`,{className:`card p-6 flex flex-col gap-5`,children:[(0,X.jsx)(`h3`,{className:`text-[17px] font-semibold text-text-primary`,children:n(`welcome.sectionAppearance`)}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,X.jsx)(`p`,{className:`text-[13px] text-text-secondary`,children:n(`welcome.sectionLogo`)}),(0,X.jsx)(tE,{content:n(`welcome.tipLogo`)})]}),(0,X.jsx)(B5,{label:n(`welcome.labelLogoUpload`),hint:n(`welcome.logoUploadHint`),defaultSrc:x??`/images/pinchat-logo-default.png`,onUrlChange:S,uploadKind:`logo`}),(0,X.jsx)(R5,{label:n(`welcome.labelLogoRatio`),tooltip:n(`welcome.tipLogoRatio`),children:(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(`input`,{type:`number`,value:y,onChange:e=>b(Math.min(100,Math.max(10,Number(e.target.value)))),min:10,max:100,className:K(O5,`w-24`)}),(0,X.jsx)(`span`,{className:`text-[14px] text-text-secondary`,children:`%`})]})})]}),(0,X.jsx)(L5,{}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-2.5`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,X.jsx)(`p`,{className:`text-[14px] font-medium text-text-primary`,children:n(`welcome.labelThemeColor`)}),(0,X.jsx)(tE,{content:n(`welcome.tipThemeColor`)})]}),(0,X.jsx)(z5,{presetId:C,onPresetChange:e=>
72{let t=y5.find(t=>t.id===e);w(e),O(t.welcome.textColor),A(t.welcome.btnColor),M(t.welcome.btnTextColor)},fields:[{label:n(`welcome.labelWelcomeTextColor`),value:D,onChange:O},{label:n(`welcome.labelOpenChatBtnColor`),value:k,onChange:A},{label:n(`welcome.labelOpenChatBtnTextColor`),value:j,onChange:M}],open:T,onToggle:()=>E(e=>!e)})]}),(0,X.jsx)(L5,{}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,X.jsx)(`p`,{className:`text-[14px] font-medium text-text-primary`,children:n(`welcome.sectionBackground`)}),(0,X.jsx)(tE,{content:n(`welcome.tipBackground`)})]}),(0,X.jsx)(`div`,{className:`flex gap-2`,children:[{id:`image`,icon:tc,label:n(`welcome.bgModeImage`)},{id:`color`,icon:gc,label:n(`welcome.bgModeColor`)}].map(({id:e,icon:t,label:n})=>(0,X.jsxs)(`button`,{type:`button`,onClick:()=>ee(e),className:K(`flex flex-col items-center justify-center gap-1.5 w-20 h-20 rounded-[8px] border-2 transition-colors cursor-pointer`,N===e?`border-brand bg-brand-tint text-brand`:`border-border bg-bg-card text-text-secondary hover:border-border-strong hover:text-text-primary`),children:[(0,X.jsx)(t,{className:`w-5 h-5`}),(0,X.jsx)(`span`,{className:`text-[12px] font-medium`,children:n})]},e))}),N===`image`?(0,X.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,X.jsx)(`div`,{className:`flex gap-2 flex-wrap`,children:b5.map(e=>(0,X.jsx)(`button`,{type:`button`,onClick:()=>{F(e.id),ne(e.url)},className:K(`w-12 h-12 rounded-[8px] border-2 transition-all cursor-pointer shrink-0 bg-cover bg-center`,P===e.id?`border-brand`:`border-transparent hover:border-border-strong`),style:{backgroundImage:`url(${e.url})`}},e.id))}),(0,X.jsx)(B5,{label:n(`welcome.bgUploadCustom`),hint:n(`welcome.bgUploadHint`),defaultSrc:L??void 0,onUrlChange:e=>{ne(e),F(``)}})]}):(0,X.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,X.jsx)(`label`,{className:`text-[14px] text-text-secondary`,children:n(`welcome.labelBgColor`)}),(0,X.jsx)(g5,{value:I,onChange:te})]})]})]}),(0,X.jsxs)(`div`,{className:`card p-6 flex flex-col gap-4`,children:[(0,X.jsx)(`h3`,{className:`text-[17px] font-semibold text-text-primary`,children:n(`welcome.sectionOptions`)}),(0,X.jsx)(W5,{label:n(`welcome.labelDisplayInSearch`),tooltip:n(`welcome.tipDisplayInSearch`),checked:R,onChange:z}),(0,X.jsx)(L5,{}),(0,X.jsx)(j8,{allowed:[`standard`,`enterprise`,`appsumo`],inline:!0,children:(0,X.jsx)(W5,{label:n(`welcome.labelRemovePoweredBy`),tooltip:n(`welcome.tipRemovePoweredBy`),checked:B,onChange:re})})]}),(0,X.jsxs)(`div`,{className:`card p-6 flex flex-col gap-5`,children:[(0,X.jsx)(`h3`,{className:`text-[17px] font-semibold text-text-primary`,children:n(`welcome.sectionInteractiveBtn`)}),(0,X.jsx)(R5,{label:n(`welcome.labelDividerText`),tooltip:n(`welcome.tipDividerText`),children:(0,X.jsx)(`input`,{value:ie,onChange:e=>ae(e.target.value),placeholder:n(`welcome.dividerPlaceholder`),maxLength:50,className:O5})}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-2.5`,children:[(0,X.jsx)(`p`,{className:`text-[14px] font-medium text-text-primary`,children:n(`welcome.labelBtnThemeColor`)}),(0,X.jsx)(z5,{presetId:oe,onPresetChange:e=>{let t=y5.find(t=>t.id===e);se(e),de(t.btn.dividerColor),pe(t.btn.btnColor),he(t.btn.btnTextColor)},fields:[{label:n(`welcome.labelBtnDividerColor`),value:ue,onChange:de},{label:n(`welcome.labelBtnBgColor`),value:fe,onChange:pe},{label:n(`welcome.labelBtnTextColor`),value:me,onChange:he}],open:ce,onToggle:()=>le(e=>!e)})]}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,X.jsx)(`p`,{className:`text-[14px] font-medium text-text-primary`,children:n(`welcome.labelBtnSettings`)}),(0,X.jsx)(tE,{content:n(`welcome.tipButtons`)})]}),ge.map((e,t)=>(0,X.jsxs)(`div`,{className:`border border-border rounded-[8px] p-4 flex flex-col gap-3`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,X.jsxs)(`span`,{className:`text-[13px] font-medium text-text-secondary`,children:[`#`,t+1]}),(0,X.jsx)(`button`,{type:`button`,onClick:()=>Ce(e.id),className:`text-text-secondary hover:text-danger transition-colors cursor-pointer`,children:(0,X.jsx)(Ic,{className:`w-4 h-4`})})]}),(0,X.jsx)(R5,{label:n(`welcome.btnTitle`),children:(0,X.jsx)(`input`,{value:e.title,onChange:t=>we(e.id,{title:t.target.value}),placeholder:n(`welcome.btnTitle`),maxLength:30,className:O5})}),(0,X.jsx)(R5,{label:n(`welcome.btnType`),children:(0,X.jsx)(`div`,{className:`flex rounded-[8px] border border-border overflow-hidden self-start`,children:[`link`,`select`].map(t=>(0,X.jsx)(`button`,{type:`button`,onClick:()=>we(e.id,{type:t}),className:K(`px-3 h-8 text-[14px] transition-colors cursor-pointer`,e.type===t?`bg-brand text-white`:`bg-bg-card text-text-secondary hover:text-text-primary`),children:n(t===`link`?`welcome.btnTypeLink`:`welcome.btnTypeMenu`)},t))})}),e.type===`link`?(0,X.jsxs)(R5,{label:n(`welcome.btnUrl`),children:[(0,X.jsx)(`input`,{value:e.url,onChange:t=>we(e.id,{url:t.target.value}),placeholder:`https://`,className:K(O5,e.url&&!v5(e.url)&&`border-danger focus:border-danger`)}),e.url&&!v5(e.url)&&(0,X.jsx)(`p`,{className:`text-[13px] text-danger mt-1`,children:n(`welcome.urlInvalid`)})]}):(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[e.subButtons.map((t,r)=>(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsxs)(`span`,{className:`text-[13px] text-text-secondary w-5 shrink-0`,children:[r+1,`.`]}
72),(0,X.jsx)(`input`,{value:t.title,onChange:n=>De(e.id,t.id,{title:n.target.value}),placeholder:n(`welcome.btnTitle`),maxLength:30,className:K(O5,`flex-1`)}),(0,X.jsx)(`input`,{value:t.url,onChange:n=>De(e.id,t.id,{url:n.target.value}),placeholder:`https://`,className:K(O5,`flex-1`,t.url&&!v5(t.url)&&`border-danger focus:border-danger`)}),(0,X.jsx)(`button`,{type:`button`,onClick:()=>Ee(e.id,t.id),className:`text-text-secondary hover:text-danger cursor-pointer shrink-0`,children:(0,X.jsx)(Ic,{className:`w-3.5 h-3.5`})})]},t.id)),(0,X.jsxs)(`button`,{type:`button`,onClick:()=>Te(e.id),className:`flex items-center gap-1.5 text-[13px] text-brand hover:text-brand/80 cursor-pointer self-start`,children:[(0,X.jsx)(xc,{className:`w-3.5 h-3.5`}),n(`welcome.addSubButton`)]})]})]},e.id)),(0,X.jsxs)(`button`,{type:`button`,onClick:Se,className:`flex items-center gap-1.5 text-[14px] text-brand hover:text-brand/80 cursor-pointer self-start`,children:[(0,X.jsx)(xc,{className:`w-4 h-4`}),n(`welcome.addButton`)]})]})]}),(0,X.jsx)(Z,{onClick:ye,disabled:a.loading||ve,className:`self-start`,children:a.loading?r(`saving`):r(`saveChanges`)})]}),(0,X.jsxs)(`div`,{className:`hidden xl:flex flex-col items-center shrink-0 pt-0.5 sticky top-6`,children:[(0,X.jsx)(`p`,{className:`text-[13px] font-medium text-text-secondary uppercase tracking-wide mb-3`,children:n(`welcome.previewTitle`)}),(0,X.jsxs)(`div`,{className:`w-[240px] rounded-[14px] border border-border overflow-hidden`,style:{boxShadow:`var(--shadow-2)`},children:[(0,X.jsxs)(`div`,{className:`h-6 flex items-center gap-1.5 px-3 bg-bg-muted border-b border-border`,children:[(0,X.jsx)(`span`,{className:`w-2 h-2 rounded-full`,style:{backgroundColor:`#FF5F57`}}),(0,X.jsx)(`span`,{className:`w-2 h-2 rounded-full`,style:{backgroundColor:`#FFBD2E`}}),(0,X.jsx)(`span`,{className:`w-2 h-2 rounded-full`,style:{backgroundColor:`#28C840`}})]}),(0,X.jsxs)(`div`,{className:`p-5 flex flex-col items-center text-center gap-3`,style:Oe,children:[(0,X.jsx)(`img`,{src:x??`/images/pinchat-logo-default.png`,alt:`logo`,className:`max-w-full`,style:{width:`${y}%`}}),(0,X.jsx)(`p`,{className:`text-[12px] font-semibold leading-snug line-clamp-3 w-full`,style:{color:D},children:be}),(0,X.jsx)(`input`,{readOnly:!0,placeholder:_||n(`welcome.nicknameDescPlaceholder`),className:`w-full h-7 px-2 rounded-[6px] border border-border bg-white text-[11px] text-neutral-900 placeholder:text-neutral-400`}),(0,X.jsx)(`button`,{className:`w-full h-8 rounded-[8px] text-[12px] font-medium text-white truncate px-2`,style:{backgroundColor:k},children:xe}),ge.some(e=>e.title.trim())&&(0,X.jsxs)(X.Fragment,{children:[ie&&(0,X.jsxs)(`div`,{className:`flex items-center gap-1.5 w-full`,children:[(0,X.jsx)(`div`,{className:`flex-1 h-px`,style:{backgroundColor:ue}}),(0,X.jsx)(`span`,{className:`text-[10px] whitespace-nowrap`,style:{color:ue},children:ie}),(0,X.jsx)(`div`,{className:`flex-1 h-px`,style:{backgroundColor:ue}})]}),(0,X.jsx)(`div`,{className:`flex flex-col gap-1.5 w-full`,children:ge.filter(e=>e.title.trim()).slice(0,3).map(e=>(0,X.jsx)(`button`,{className:`w-full h-7 rounded-[6px] text-[11px] font-medium truncate px-2`,style:{backgroundColor:fe,color:me},children:e.title},e.id))})]}),!B&&(0,X.jsxs)(`p`,{className:`text-[9px] mt-1`,style:{color:D},children:[`Powered by `,(0,X.jsx)(`strong`,{children:`PinChat`})]})]})]})]})]})}var N5={Sun:0,Mon:1,Tue:2,Wed:3,Thu:4,Fri:5,Sat:6},P5=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`];function F5({config:e,refetch:t}){let{t:n}=V(`workspace`),{t:r}=V(`common`),{logAnalyticsEvent:i}=BS(),a=md(),o=Md(),{data:s}=jd(e.token),c=e.online_schedules??null,l=c?.schedule.length?c.schedule.map(e=>P5[e.day]).filter(Boolean):[`Mon`,`Tue`,`Wed`,`Thu`,`Fri`],u=c?.schedule[0]?.workHours.length?c.schedule[0].workHours.map((e,t)=>({id:`slot-${t}`,start:e.start,end:e.end})):[{id:`1`,start:`09:00`,end:`18:00`}],[d,p]=(0,f.useState)(()=>y5.find(t=>t.chat.headerBg===e.chat_header_color&&t.chat.headerText===e.chat_header_text_color&&t.chat.bubbleBg===e.chat_bubble_color&&t.chat.bubbleBorder===e.chat_bubble_border_color&&t.chat.bubbleText===e.chat_bubble_text_color)?.id??``),[m,h]=(0,f.useState)(!1),[g,_]=(0,f.useState)(e.chat_header_color??`#006b25`),[v,y]=(0,f.useState)(e.chat_header_text_color??`#ffffff`),[b,x]=(0,f.useState)(e.chat_bubble_color??`#ddefe0`),[S,C]=(0,f.useState)(e.chat_bubble_border_color??`#ddefe0`),[w,T]=(0,f.useState)(e.chat_bubble_text_color??`#000000`),[E,D]=(0,f.useState)(e.title??e.name??``),[O,k]=(0,f.useState)(e.name??``),[A,j]=(0,f.useState)(e.avatar??null),[M,N]=(0,f.useState)(e.image_id??null),[ee,P]=(0,f.useState)(e.welcome_message??``),[F,I]=(0,f.useState)(e.welcome_get_customer_info_type??`none`),[te,L]=(0,f.useState)(()=>n(`chat.emailTitleDefault`)),[ne,R]=(0,f.useState)(()=>n(`chat.emailTextDefault`)),[z,B]=(0,f.useState)(()=>n(`chat.otherTitleDefault`)),[re,ie]=(0,f.useState)(()=>n(`chat.otherTextDefault`));(0,f.useEffect)(()=>{s&&(s.email_title!=null&&L(s.email_title),s.email_text!=null&&R(s.email_text),s.other_title!=null&&B(s.other_title),s.other_text!=null&&ie(s.other_text))},[s]);let[ae,oe]=(0,f.useState)(e.show_online_status??!0),[se,ce]=(0,f.useState)(e.is_online??!1),[le,ue]=(0,f.useState)(!(e.is_online??!1)&&c!=null),[de,fe]=(0,f.useState)(l),[pe,me]=(0,f.useState)(c?.timeZone||`UTC`),[he,ge]=(0,f.useState)(u),[_e,ve]=(0,f.useState)(e.offline_send_msg??``),[ye,be]=(0,f.useState)(e.open_notify_setting??!0),[xe,Se]=(0,f.useState)(e.show_guest_setting??!0),[Ce,we]=(0,f.useState)(e.show_is_read??!0),[Te,Ee]=(0,f.useState)(e.chatroom_action_setting?.file??!0),[De,Oe]=(0,f.useState)(e.chatroom_action_setting?.location??!0),[ke,Ae]=(0,f.useState)(e.chatroom_action_setting?.voice??!0),je=async()=>{i(`save_changes_click`,{element_id:e.token,feature_name:`chatroom_setting`});let r=[...de].map(e=>N5[e]).filter(e=>e!==void 0).sort((e,t)=>
72e-t),s=he.map(e=>({start:e.start,end:e.end})).sort((e,t)=>e.start.localeCompare(t.start)).reduce((e,t)=>{let n=e[e.length-1];return n&&t.start<=n.end?n.end=n.end>t.end?n.end:t.end:e.push({...t}),e},[]),c=le?{timeZone:pe,schedule:r.map(e=>({day:e,workHours:s}))}:null;try{await a.mutate({id:e.id,token:e.token,name:O,title:E,avatar:A??``,...M==null?{}:{image_id:M},welcome_message:ee,welcome_get_customer_info_type:F,show_online_status:ae,is_online:se,online_schedules:c,offline_send_msg:_e,open_notify_setting:ye,chat_header_color:g,chat_header_text_color:v,chat_bubble_color:b,chat_bubble_border_color:S,chat_bubble_text_color:w,show_guest_setting:xe,show_is_read:Ce,chatroom_action_setting:{file:Te,location:De,voice:ke}}),F!==`none`&&await o.mutate({token:e.token,title:F===`email`?te:z,text:F===`email`?ne:re,type:F}),await t(),Q.success(n(`chat.saved`))}catch{Q.error(n(`chat.saveFailed`))}},Me=e=>fe(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]),Ne=()=>ge(e=>[...e,{id:Math.random().toString(36).slice(2),start:`09:00`,end:`18:00`}]),Pe=e=>ge(t=>t.filter(t=>t.id!==e)),Fe=(e,t)=>ge(n=>n.map(n=>n.id===e?{...n,...t}:n)),Ie=(E||O||`P`).charAt(0).toUpperCase(),Le=ee||n(`chat.defaultMsgPlaceholder`),Re=O||n(`chat.chatroomNicknamePlaceholder`),ze=E||n(`chat.chatroomNamePlaceholder`);return(0,X.jsxs)(`div`,{className:`flex gap-8 items-start`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-5 flex-1 min-w-0`,children:[(0,X.jsxs)(`div`,{className:`card p-6 flex flex-col gap-4`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,X.jsx)(`h3`,{className:`text-[17px] font-semibold text-text-primary`,children:n(`chat.labelThemeColor`)}),(0,X.jsx)(tE,{content:n(`chat.tipThemeColor`)})]}),(0,X.jsx)(z5,{presetId:d,onPresetChange:e=>{let t=y5.find(t=>t.id===e);p(e),_(t.chat.headerBg),y(t.chat.headerText),x(t.chat.bubbleBg),C(t.chat.bubbleBorder),T(t.chat.bubbleText)},fields:[{label:n(`chat.labelHeaderBgColor`),value:g,onChange:_},{label:n(`chat.labelHeaderTextColor`),value:v,onChange:y},{label:n(`chat.labelBubbleBgColor`),value:b,onChange:x},{label:n(`chat.labelBubbleBorderColor`),value:S,onChange:C},{label:n(`chat.labelBubbleTextColor`),value:w,onChange:T}],open:m,onToggle:()=>h(e=>!e)})]}),(0,X.jsxs)(`div`,{className:`card p-6 flex flex-col gap-5`,children:[(0,X.jsx)(`h3`,{className:`text-[17px] font-semibold text-text-primary`,children:n(`chat.sectionBasic`)}),(0,X.jsx)(R5,{label:n(`chat.labelChatroomName`),tooltip:n(`chat.tipChatroomName`),children:(0,X.jsx)(`input`,{value:E,onChange:e=>D(e.target.value),placeholder:n(`chat.chatroomNamePlaceholder`),maxLength:30,className:O5})}),(0,X.jsx)(R5,{label:n(`chat.labelChatroomNickname`),tooltip:n(`chat.tipChatroomNickname`),children:(0,X.jsx)(`input`,{value:O,onChange:e=>k(e.target.value),placeholder:n(`chat.chatroomNicknamePlaceholder`),maxLength:25,className:O5})}),(0,X.jsx)(V5,{label:n(`chat.labelChatroomAvatar`),hint:n(`chat.avatarUploadHint`),defaultSrc:A??void 0,onUpload:e=>{j(e?.url??null),N(e?.id??null)}})]}),(0,X.jsxs)(`div`,{className:`card p-6 flex flex-col gap-5`,children:[(0,X.jsx)(`h3`,{className:`text-[17px] font-semibold text-text-primary`,children:n(`chat.sectionWelcomeMsg`)}),(0,X.jsxs)(R5,{label:n(`chat.labelDefaultMsg`),tooltip:n(`chat.tipDefaultMsg`),children:[(0,X.jsx)(`textarea`,{value:ee,onChange:e=>P(e.target.value),placeholder:n(`chat.defaultMsgPlaceholder`),maxLength:200,rows:3,className:A5}),(0,X.jsxs)(`p`,{className:`text-[13px] text-text-secondary text-right`,children:[ee.length,`/200`]})]}),(0,X.jsx)(R5,{label:n(`chat.labelCustomerInputBox`),tooltip:n(`chat.tipCustomerInputBox`),children:(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsxs)(`select`,{value:F,onChange:e=>I(e.target.value),className:k5,children:[(0,X.jsx)(`option`,{value:`none`,children:n(`chat.customerInputNone`)}),(0,X.jsx)(`option`,{value:`email`,children:n(`chat.customerInputEmail`)}),(0,X.jsx)(`option`,{value:`text`,children:n(`chat.customerInputText`)})]}),(0,X.jsx)(Is,{className:`absolute right-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-text-secondary pointer-events-none`})]})}),F!==`none`&&(0,X.jsx)(`div`,{className:`pt-1 pl-3 border-l-2 ml-1`,style:{borderColor:`var(--brand-tint-strong)`},children:(0,X.jsx)(R5,{label:n(`chat.labelTypeText`),tooltip:n(`chat.tipTypeText`),children:(0,X.jsx)(`textarea`,{value:F===`email`?ne:re,onChange:e=>F===`email`?R(e.target.value):ie(e.target.value),placeholder:n(`chat.typeTextPlaceholder`),rows:3,className:A5})})})]}),(0,X.jsxs)(`div`,{className:`card p-6 flex flex-col gap-4`,children:[(0,X.jsx)(`h3`,{className:`text-[17px] font-semibold text-text-primary`,children:n(`chat.sectionOnlineStatus`)}),(0,X.jsx)(W5,{label:n(`chat.labelShowStatus`),tooltip:n(`chat.tipShowStatus`),checked:ae,onCh
72ange:oe}),(0,X.jsx)(L5,{}),(0,X.jsx)(W5,{label:n(`chat.labelAlwaysOnline`),tooltip:n(`chat.tipAlwaysOnline`),checked:se,onChange:e=>{ce(e),e&&ue(!1)}}),(0,X.jsx)(L5,{}),(0,X.jsx)(W5,{label:n(`chat.labelCustomAvailability`),tooltip:n(`chat.tipCustomAvailability`),checked:le,onChange:e=>{ue(e),e&&ce(!1)}}),le&&(0,X.jsxs)(`div`,{className:`flex flex-col gap-4 pt-1 pl-3 border-l-2 ml-1`,style:{borderColor:`var(--brand-tint-strong)`},children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,X.jsx)(`p`,{className:`text-[13px] font-medium text-text-secondary uppercase tracking-wide`,children:n(`chat.labelAvailableDays`)}),(0,X.jsx)(`div`,{className:`flex gap-1.5 flex-wrap`,children:T5.map(e=>(0,X.jsx)(`button`,{type:`button`,onClick:()=>Me(e),className:K(`px-2.5 h-7 rounded-full text-[13px] font-medium transition-colors cursor-pointer border`,de.includes(e)?`bg-brand text-white border-brand`:`bg-bg-card text-text-secondary border-border hover:border-brand hover:text-brand`),children:n(`chat.day${e}`)},e))})]}),(0,X.jsx)(R5,{label:n(`chat.labelTimezone`),children:(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsxs)(`select`,{value:pe,onChange:e=>me(e.target.value),className:k5,children:[(0,X.jsx)(`option`,{value:`UTC`,children:`UTC`}),pe&&pe!==`UTC`&&!S5.has(pe)&&(0,X.jsx)(`option`,{value:pe,children:pe}),w5.map(e=>(0,X.jsx)(`optgroup`,{label:e.region,children:e.options.map(e=>(0,X.jsx)(`option`,{value:e.value,children:e.label},e.value))},e.region))]}),(0,X.jsx)(Is,{className:`absolute right-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-text-secondary pointer-events-none`})]})}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,X.jsx)(`p`,{className:`text-[13px] font-medium text-text-secondary uppercase tracking-wide`,children:n(`chat.labelOnlineHours`)}),he.map(e=>(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(`input`,{type:`time`,value:e.start,onChange:t=>Fe(e.id,{start:t.target.value}),className:K(O5,`flex-1`)}),(0,X.jsx)(`span`,{className:`text-text-secondary text-[14px]`,children:`â`}),(0,X.jsx)(`input`,{type:`time`,value:e.end,onChange:t=>Fe(e.id,{end:t.target.value}),className:K(O5,`flex-1`)}),he.length>1&&(0,X.jsx)(`button`,{type:`button`,onClick:()=>Pe(e.id),className:`text-text-secondary hover:text-danger cursor-pointer shrink-0`,children:(0,X.jsx)(Ic,{className:`w-4 h-4`})})]},e.id)),(0,X.jsxs)(`button`,{type:`button`,onClick:Ne,className:`flex items-center gap-1.5 text-[13px] text-brand hover:text-brand/80 cursor-pointer self-start`,children:[(0,X.jsx)(xc,{className:`w-3.5 h-3.5`}),n(`chat.addTimeSlot`)]})]}),(0,X.jsx)(R5,{label:n(`chat.labelOfflineMsg`),tooltip:n(`chat.tipOfflineMsg`),children:(0,X.jsx)(`textarea`,{value:_e,onChange:e=>ve(e.target.value),placeholder:n(`chat.offlineMsgPlaceholder`),maxLength:200,rows:2,className:A5})})]})]}),(0,X.jsxs)(`div`,{className:`card p-6 flex flex-col gap-4`,children:[(0,X.jsx)(`h3`,{className:`text-[17px] font-semibold text-text-primary`,children:n(`chat.sectionMsgFeatures`)}),(0,X.jsx)(W5,{label:n(`chat.labelNotificationPrompt`),tooltip:n(`chat.tipNotificationPrompt`),checked:ye,onChange:be}),(0,X.jsx)(L5,{}),(0,X.jsx)(W5,{label:n(`chat.labelShowMoreSettings`),tooltip:n(`chat.tipShowMoreSettings`),checked:xe,onChange:Se}),(0,X.jsx)(L5,{}),(0,X.jsx)(W5,{label:n(`chat.labelReadReceipts`),tooltip:n(`chat.tipReadReceipts`),checked:Ce,onChange:we})]}),(0,X.jsxs)(`div`,{className:`card p-6 flex flex-col gap-4`,children:[(0,X.jsx)(`h3`,{className:`text-[17px] font-semibold text-text-primary`,children:n(`chat.sectionVisitorMsg`)}),(0,X.jsx)(W5,{label:n(`chat.labelSendMedia`),checked:Te,onChange:Ee}),(0,X.jsx)(L5,{}),(0,X.jsx)(W5,{label:n(`chat.labelSendLocation`),checked:De,onChange:Oe}),(0,X.jsx)(L5,{}),(0,X.jsx)(W5,{label:n(`chat.labelSendVoice`),checked:ke,onChange:Ae})]}),(0,X.jsx)(Z,{onClick:je,disabled:a.loading,className:`self-start`,children:a.loading?r(`saving`):r(`saveChanges`)})]}),(0,X.jsxs)(`div`,{className:`hidden xl:flex flex-col items-center shrink-0 pt-0.5 sticky top-6`,children:[(0,X.jsx)(`p`,{className:`text-[13px] font-medium text-text-secondary uppercase tracking-wide mb-3`,children:n(`chat.previewTitle`)}),(0,X.jsxs)(`div`,{className:`w-[240px] rounded-[14px] border border-border overflow-hidden`,style:{boxShadow:`var(--shadow-2)`},children:[(0,X.jsxs)(`div`,{className:`h-6 flex items-center gap-1.5 px-3 bg-bg-muted border-b border-border shrink-0`,children:[(0,X.jsx)(`span`,{className:`w-2 h-2 rounded-full`,style:{backgroundColor:`#FF5F57`}}),(0,X.jsx)(`span`,{className:`w-2 h-2 rounded-full`,style:{backgroundColor:`#FFBD2E`}}),(0,X.jsx)(`span`,{className:`w-2 h-2 rounded-full`,style:{backgroundColor:`#28C840`}})]}),(0,X.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2 shrink-0`,style:{backgroundColor:g},children:[(0,X.jsx)(`div`,{className:`w-7 h-7 rounded-full overflow-hidden shrink-0 flex items-center justify-center text-[11px] font-bold`,style:{backgroundColor:`rgba(255,255,255,0.25)`,color:v},children:A?(0,X.jsx)(`img`,{src:A,alt:``,className:`w-full h-full object-cover`}):Ie}),(0,X.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,X.jsx)(`p`,{className:`text-[11px] font-semibold truncate leading-tight`,style:{color:v},children:ze}),ae&&(0,X.jsxs)(`div`,{className:`flex items-center gap-1 mt-0.5`,children:[(0,X.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full shrink-0`,style:{backgroundColor:se?`#28C840`:`#9CA3AF`}}),(0,X.jsx)(`span`,{className:`text-[9px]`,style:{color:`${v}AA`},children:n(se?`chat.previewOnline`:`chat.previewOffline`)})]})]})]}),(0,X.jsxs)(`div`,{className:`bg-bg-muted flex flex-col gap-2 px-2 py-2.5`,style:{minHeight:220},children:[(0,X.jsxs)(`div`,{className:`flex items-start gap-1.5`,children:[(0,X.jsx)(`div`,{className:`w-5 h-5 rounded-full overflow-hidden shrink-0 flex items-center justify-center text-[8px] font-bold`,style:{backgroundColor:g,color:v},children:A?(0,X.jsx)(`img`,{src:A,alt:``,className:`w-full h-full object-cover`}):Ie}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-0.5 min-w-0`,style:{maxWidth:`80%`},children:[(0,X.jsx)(`span`,{className:`text-[9px] text-text-secondary ml-1`,children:Re}),(0,X.jsx)(`div`,{"data-testid":`preview-agent-bubble`,className:`rounded-[8px] rounded-bl-[3px] px-2 py-1.5 text-[10px] leading-snug break-words bg-bg-card border border-border text-text-primary`,children:Le})]})]}),F!==`none`&&(0,X.jsxs)(`div`,{className:`flex items-start gap-1.5`,children:[(0,X.jsx)(`div`,{className:`w-5 h-5 rounded-full overflow-hidden shrink-0 flex items-center justify-center text-[8px] font-bold`,style:{backgroundColor:g,color:v},children:A?(0,X.jsx)(`img`,{src:A,alt:``,className:`w-full h-full object-cover`}):Ie}),(0,X.jsxs)(`div`,{"data-testid":`preview-agent-bubble`,className:`rounded-[8px] rounded-bl-[3px] px-2 py-1.5 text-[10px] leading-snug bg-bg-card border border-border text-text-primary`,style:{maxWidth:`80%`},children:[(0,X.jsx)(`p`,{className:`mb-1 text-[9px]`,children:(F===`email`?ne:re)||n(F===`email`?`chat.customerInputEmail`:`chat.customerInputText`)}),(0,X.jsx)(`div`,{className:`flex items-center gap-1 bg-bg-muted rounded px-1.5 py-0.5`,children:(0,X.jsx)(`span`,{className:`flex-1 text-[9px] text-text-secondary truncate`,children:F===`email`?`[email protected]`:`...`})})]})]}),(0,X.jsx)(`div`,{className:`flex justify-end`,children:(0,X.jsx)(`div`,{"data-testid":`preview-visitor-bubble`,className:`rounded-[8px] rounded-br-[3px] px-2 py-1.5 text-[10px]`,style:{backgroundColor:b,border:`1px solid ${S}`,color:w},children:`Hello ð`})})]}),(0,X.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2 py-1.5 bg-bg-card border-t border-border shrink-0`,children:[(0,X.jsx)(`div`,{className:`flex-1 flex items-center bg-bg-muted rounded-[6px] px-2 h-6`,children:(0,X.jsx)(`span`,{className:`text-[9px] text-text-secondary truncate`,children:n(`chat.previewInputPlaceholder`)})}),(0,X.jsx)(`div`,{className:`w-5 h-5 rounded-full flex items-center justify-center shrink-0`,style:{backgroundColor:g},children:(0,X.jsx)(`svg`,{width:`9`,height:`9`,viewBox:`0 0 24 24`,fill:v,children:(0,X.jsx)(`path`,{d:`M2.01 21L23 12 2.01 3 2 10l15 2-15 2z`})})})]})]})]})]})}function I5({config:e,link:t,refetch:n}){let{t:r,i18n:i}=V(`workspace`),{t:a}=V(`common`),o=Sd(e.token),s=e.custom_domain??``,c=!!e.custom_domain,[l,u]=(0,f.useState)(s),[d,p]=(0,f.useState)(``),[m,h]=(0,f.useState)(c?`success`:`none`),[g,_]=(0,f.useState)(``),[v,y]=(0,f.useState)(!1),[b,x]=(0,f.useState)(``),[S,C]=(0,f.useState)(e.page_title??``),[w,T]=(0,f.useState)(e.page_desc??``),[E,D]=(0,f.useState)(e.page_keywords??``),[O,k]=(0,f.useState)(e.page_og_image??null),[A,j]=(0,f.useState)(!1),M=vd(),N=bd(e.token),ee=xd(e.token),P=M.loading,F=N.loading,I=ee.loading,te=N.loading,L=c,ne=/^(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,R=e=>
72{u(e),p(e&&!ne.test(e)?r(`domain.domainFormatError`):``),m!==`none`&&e!==s&&(h(`none`),_(``))},z=async()=>{if(!(!l||d)){_(``);try{(await M.mutate(l)).valid?h(`success`):(h(`failed`),_(r(`domain.verifyFailed`)))}catch{h(`failed`),_(r(`domain.verifyFailed`))}}},B=async()=>{x(``);try{await N.mutate({domain:l,page_title:S,page_desc:w,page_keywords:E,page_og_image:O??``}),await n(),Q.success(r(`domain.saved`))}catch{x(r(`domain.activateFailed`)),Q.error(r(`domain.activateFailed`))}},re=async()=>{try{await ee.mutate(),await n(),j(!1),Q.success(r(`domain.removed`))}catch{Q.error(r(`domain.removeFailed`))}},ie=async()=>{try{await N.mutate({domain:e.custom_domain??l,page_title:S,page_desc:w,page_keywords:E,page_og_image:O??``}),await n(),Q.success(r(`domain.saved`))}catch{Q.error(r(`domain.saveFailed`)||a(`loadFailed`))}},ae=L?new Date(e.updatedAt).toLocaleString(i.language,{year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`}):null,oe=l.split(`.`).slice(0,-2).join(`.`)||`@`,se=`Type: CNAME\nHost: ${oe}\nValue: landing.pinchat.me\nTTL: Auto`,ce=!l||!!d,le=m!==`success`;return(0,X.jsx)(j8,{allowed:[`standard`,`enterprise`,`appsumo`],children:(0,X.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[L?(0,X.jsxs)(`div`,{className:`card p-6 flex flex-col gap-4`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,X.jsx)(`p`,{className:`text-[13px] font-medium text-text-secondary uppercase tracking-wide`,children:r(`domain.currentUrl`)}),(0,X.jsxs)(`div`,{className:`flex items-center gap-2 px-3 h-10 rounded-[8px] bg-bg-muted border border-border`,children:[(0,X.jsx)($s,{className:`w-4 h-4 text-text-secondary shrink-0`}),(0,X.jsx)(`span`,{className:`text-[14px] font-mono text-text-secondary truncate`,children:o??`â`})]})]}),(0,X.jsx)(L5,{}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,X.jsx)(`p`,{className:`text-[13px] font-medium text-text-secondary uppercase tracking-wide`,children:r(`domain.customDomain`)}),(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2 h-5 rounded-full text-[11px] font-medium bg-brand/10 text-brand`,children:[(0,X.jsx)(Vs,{className:`w-3 h-3`}),r(`domain.statusActive`)]})]}),(0,X.jsxs)(`div`,{className:`flex items-center gap-2 px-3 h-10 rounded-[8px] border border-brand/30 bg-brand/5`,children:[(0,X.jsx)($s,{className:`w-4 h-4 text-brand shrink-0`}),(0,X.jsx)(`span`,{className:`text-[14px] font-mono text-text-primary truncate flex-1`,children:l})]}),(0,X.jsxs)(`p`,{className:`text-[13px] text-text-secondary`,children:[r(`domain.activatedAtLabel`),`ï¼`,ae]})]})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`card p-6 flex flex-col gap-3`,children:[(0,X.jsx)(`h3`,{className:`text-[17px] font-semibold text-text-primary`,children:r(`domain.currentUrl`)}),(0,X.jsxs)(`div`,{className:`flex items-center gap-2 px-3 h-10 rounded-[8px] bg-bg-muted border border-border`,children:[(0,X.jsx)($s,{className:`w-4 h-4 text-text-secondary shrink-0`}),(0,X.jsx)(`span`,{className:`text-[14px] font-mono text-text-secondary truncate`,children:t?.url??`â`})]})]}),(0,X.jsxs)(`div`,{className:`card p-6 flex flex-col gap-4`,children:[(0,X.jsx)(H5,{number:1,title:r(`domain.step1Title`)}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsx)(`input`,{value:l,onChange:e=>R(e.target.value),placeholder:r(`domain.domainPlaceholder`),className:K(O5,d?`border-danger focus:border-danger`:``,l&&!d?`pr-9`:``)}),l&&!d&&(0,X.jsx)(Vs,{className:`absolute right-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-brand pointer-events-none`})]}),d&&(0,X.jsx)(`p`,{className:`text-[13px] text-danger`,children:d})]}),(0,X.jsxs)(`a`,{href:`#`,onClick:e=>e.preventDefault(),className:`inline-flex items-center gap-1.5 text-[13px] text-brand hover:underline self-start`,children:[(0,X.jsx)(Ys,{className:`w-3.5 h-3.5`}),r(`domain.learnMore`)]})]}),(0,X.jsxs)(`div`,{className:K(`card p-6 flex flex-col gap-4`,ce&&`opacity-50 pointer-events-none`),children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-3 flex-wrap`,children:[(0,X.jsx)(H5,{number:2,title:r(`domain.step2Title`)}),m===`success`&&(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-[13px] text-brand font-medium`,children:[(0,X.jsx)(Vs,{className:`w-4 h-4`}),r(`domain.verifySuccess`)]})]}),(0,X.jsx)(`div`,{className:`rounded-[8px] border border-border overflow-hidden`,children:(0,X.jsxs)(`table`,{className:`w-full text-left`,children:[(0,X.jsx)(`thead`,{children:(0,X.jsx)(`tr`,{className:`bg-bg-muted border-b border-border`,children:[`dnsType`,`dnsName`,`dnsValue`,`dnsTtl`].map(e=>(0,X.jsx)(`th`,{className:`px-3 py-2 text-[12px] font-medium text-text-secondary uppercase tracking-wide whitespace-nowrap`,children:r(`domain.${e}`)},e))})}),(0,X.jsx)(`tbody`,{children:(0,X.jsxs)(`tr`,{children:[(0,X.jsx)(`td`,{className:`px-3 py-2.5 text-[14px] font-mono text-text-primary`,children:`CNAME`}),(0,X.jsx)(`td`,{className:`px-3 py-2.5 text-[14px] font-mono text-text-primary break-all`,children:l?oe:`â`}),(0,X.jsx)(`td`,{className:`px-3 py-2.5 text-[14px] font-mono text-text-primary`,children:`landing.pinchat.me`}),(0,X.jsx)(`td`,{className:`px-3 py-2.5 text-[14px] font-mono text-text-secondary`,children:`Auto`})]})})]})}),(0,X.jsxs)(`div`,{className:`flex items-center gap-3 flex-wrap`,children:[(0,X.jsx)(Z,{variant:`secondary`,size:`md`,onClick:()=>y(!0),children:r(`domain.seeInstructions`)}),(0,X.jsx)(Z,{size:`md`,onClick:z,loading:P,disabled:ce,children:r(`domain.verifyDomainBtn`)})]}),m===`failed`&&(0,X.jsx)(`p`,{className:`text-[13px] text-danger`,children:g||r(`domain.verifyFailed`)})]}),(0,X.jsxs)(`div`,{className:K(`card p-6 flex flex-col gap-4`,le&&`opacity-50 pointer-events-none`),children:[(0,X.jsx)(H5,{number:3,title:r(`domain.step3Title`)}),(0,X.jsxs)(`div`,{className:`flex items-center gap-4 flex-wrap`,children:[(0,X.jsx)(Z,{size:`md`,onClick:B,loading:F,disabled:L,children:r(`domain.activateBtn`)}),ae&&(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-[13px] text-brand font-medium`,children:[(0,X.jsx)(Vs,{className:`w-4 h-4`}),ae,` `,r(`domain.statusActive`)]})]}),b&&(0,X.jsx)(`p`,{className:`text-[13px] text-danger`,children:b})]})]}),L&&(0,X.jsxs)(`div`,{className:`card p-6 flex flex-col gap-5`,children:[(0,X.jsx)(`h3`,{className:`text-[17px] font-semibold text-text-primary`,children:r(`domain.sectionMeta`)}),(0,X.jsx)(R5,{label:r(`domain.labelMetaTitle`),children:(0,X.jsx)(`input`,{value:S,onChange:e=>C(e.target.value),placeholder:r(`domain.metaTitlePlaceholder`),maxLength:60,className:O5})}),(0,X.jsx)(R5,{label:r(`domain.labelMetaDesc`),children:(0,X.jsx)(`textarea`,{value:w,onChange:e=>T(e.target.value),placeholder:r(`domain.metaDescPlaceholder`),maxLength:160,rows:2,className:A5})}),(0,X.jsx)(R5,{label:r(`domain.labelMetaKeywords`),children:(0,X.jsx)(`input`,{value:E,onChange:e=>D(e.target.value),placeholder:r(`domain.metaKeywordsPlaceholder`),className:O5})}),(0,X.jsx)(B5,{label:r(`domain.labelMetaImage`),hint:r(`domain.metaImageHint`),defaultSrc:O??void 0,onUrlChange:k}),(0,X.jsx)(Z,{onClick:ie,disabled:te,className:`self-start`,children:a(te?`saving`:`saveChanges`)})]}),L&&(0,X.jsxs)(`div`,{className:`card p-6`,style:{borderColor:`rgba(235,87,87,0.25)`},children:[(0,X.jsx)(`h3`,{className:`text-[17px] font-semibold text-danger mb-1`,children:r(`linkInfo.sectionDanger`)}),(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary mb-4`,children:r(`domain.deleteDomainDesc`)}),A?(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(Z,{size:`md`,onClick:re,disabled:I,style:{backgroundColor:`#EB5757`},children:I?a(`loading`):r(`domain.deleteDomainConfirm`)}),(0,X.jsx)(Z,{variant:`secondary`,size:`md`,onClick:()=>j(!1),children:r(`domain.deleteDomainCancel`)})]}):(0,X.jsx)(Z,{variant:`secondary`,size:`md`,onClick:()=>j(!0),style:{borderColor:`rgba(235,87,87,0.35)`,color:`#EB5757`},children:r(`domain.deleteDomainBtn`)})]}),v&&(0,X.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center`,style:{backgroundColor:`rgba(0,0,0,0.45)`},onClick:()=>y(!1),children:(0,X.jsxs)(`div`,{className:`card p-6 w-full max-w-md mx-4 flex flex-col gap-4`,onClick:e=>e.stopPropagation(),children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,X.jsx)(`h3`,{className:`text-[17px] font-semibold text-text-primary`,children:r(`domain.seeInstructions`)}),(0,X.jsx)(`button`,{type:`button`,onClick:()=>y(!1),className:`text-text-secondary hover:text-text-primary curs
72or-pointer`,children:(0,X.jsx)(Ic,{className:`w-4 h-4`})})]}),(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary`,children:r(`domain.instructionsDialogTitle`)}),(0,X.jsx)(`pre`,{className:`bg-bg-muted rounded-[8px] p-3 text-[13px] font-mono text-text-primary whitespace-pre-wrap border border-border`,children:se}),(0,X.jsxs)(Z,{variant:`secondary`,size:`md`,onClick:()=>{uu(se),Q.success(r(`domain.instructionsCopied`)),y(!1)},children:[(0,X.jsx)(Gs,{className:`w-4 h-4 mr-1.5`}),r(`domain.instructionsCopy`)]})]})})]})})}function L5(){return(0,X.jsx)(`div`,{className:`border-t border-border`})}function R5({label:e,tooltip:t,children:n}){return(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,X.jsx)(`label`,{className:`text-[14px] font-medium text-text-primary`,children:e}),t&&(0,X.jsx)(tE,{content:t})]}),n]})}function z5({presetId:e,onPresetChange:t,fields:n,open:r,onToggle:i}){let{t:a}=V(`workspace`);return(0,X.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-3`,children:[y5.map(n=>(0,X.jsx)(`button`,{type:`button`,onClick:()=>t(n.id),className:`w-7 h-7 rounded-full transition-transform duration-150 cursor-pointer hover:scale-110 shrink-0`,style:{backgroundColor:n.color,boxShadow:e===n.id?`0 0 0 2px var(--bg-card), 0 0 0 4px ${n.color}`:void 0,transform:e===n.id?`scale(1.15)`:void 0}},n.id)),(0,X.jsxs)(`button`,{type:`button`,onClick:i,className:`ml-auto flex items-center gap-1 text-[13px] text-text-secondary hover:text-text-primary cursor-pointer transition-colors`,children:[a(`linkInfo.customColor`),(0,X.jsx)(Is,{className:K(`w-3.5 h-3.5 transition-transform duration-200`,r&&`rotate-180`)})]})]}),r&&(0,X.jsx)(`div`,{className:`flex flex-col gap-2.5 pl-3 border-l-2 ml-1`,style:{borderColor:`var(--brand-tint-strong)`},children:n.map(e=>(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,X.jsx)(`span`,{className:`text-[14px] text-text-secondary shrink-0`,children:e.label}),(0,X.jsx)(g5,{value:e.value,onChange:e.onChange})]},e.label))})]})}function B5({label:e,hint:t,defaultSrc:n,onUrlChange:r,uploadKind:i=`image`}){let{t:a}=V(`common`),[o,s]=(0,f.useState)(n??null),[c,l]=(0,f.useState)(null),u=Ed(i);return(0,f.useEffect)(()=>{s(n??null)},[n]),(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsx)(`label`,{className:`text-[14px] font-medium text-text-primary`,children:e}),(0,X.jsxs)(`label`,{className:K(`relative flex flex-col items-center justify-center gap-2 h-20 rounded-[8px] border-2 border-dashed border-border bg-bg-muted transition-colors overflow-hidden`,u.loading?`cursor-wait opacity-60`:`cursor-pointer`),children:[(0,X.jsx)(`input`,{type:`file`,accept:E5.join(`,`),className:`sr-only`,onChange:async e=>{let t=e.target.files?.[0];if(!t)return;if(!E5.includes(t.type)){Q.error(a(`uploadTypeUnsupported`)),e.target.value=``;return}if(t.size>D5){Q.error(a(`uploadTooLarge`,{size:`2 MB`})),e.target.value=``;return}l(t.name);let i=URL.createObjectURL(t);s(i);try{let e=await u.mutate(t);s(e.url),r?.(e.url)}catch{s(n??null),Q.error(a(`uploadFailed`))}finally{URL.revokeObjectURL(i)}},disabled:u.loading}),o?(0,X.jsx)(`img`,{src:o,alt:c??`logo`,className:`max-h-14 max-w-full object-contain`}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Mc,{className:`w-4 h-4 text-text-secondary`}),(0,X.jsx)(`span`,{className:`text-[13px] text-text-secondary`,children:t})]}),u.loading&&(0,X.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-black/40 rounded-[8px]`,children:(0,X.jsx)(sc,{className:`w-6 h-6 text-white animate-spin`})})]})]})}function V5({label:e,hint:t,defaultSrc:n,onUpload:r,onUrlChange:i,uploadKind:a=`image`}){let{t:o}=V(`common`),[s,c]=(0,f.useState)(n??null),l=(0,f.useRef)(null),u=Ed(a);return(0,f.useEffect)(()=>{c(n??null)},[n]),(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsx)(`label`,{className:`text-[14px] font-medium text-text-primary`,children:e}),(0,X.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,X.jsxs)(`div`,{className:`relative w-20 h-20 rounded-full bg-bg-muted border border-border flex items-center justify-center shrink-0 overflow-hidden`,children:[s?(0,X.jsx)(`img`,{src:s,alt:``,className:`w-full h-full object-cover`}):(0,X.jsx)(tc,{className:`w-7 h-7 text-text-secondary`}),u.loading&&(0,X.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-black/40 rounded-full`,children:(0,X.jsx)(sc,{className:`w-6 h-6 text-white animate-spin`})})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(`input`,{ref:l,type:`file`,accept:`image/*`,className:`hidden`,onChange:async e=>{let t=e.target.files?.[0];if(!t)return;let a=URL.createObjectURL(t);c(a);try{let e=await u.mutate(t);c(e.url),r?.({url:e.url,id:e.id}),i?.(e.url)}catch{c(n??null),Q.error(o(`uploadFailed`))}finally{URL.revokeObjectURL(a)}},disabled:u.loading}),(0,X.jsxs)(Z,{type:`button`,variant:`secondary`,size:`sm`,onClick:()=>l.current?.click(),disabled:u.loading,className:`gap-1.5`,children:[(0,X.jsx)(Mc,{className:`w-3.5 h-3.5`}),o(s?`changeImage`:`uploadImage`)]}),s&&(0,X.jsx)(`button`,{type:`button`,onClick:()=>{c(null),l.current&&(l.current.value=``),r?.(null),i?.(null)},className:`text-[14px] text-text-secondary hover:text-danger transition-colors cursor-pointer`,children:o(`remove`)})]}),t&&(0,X.jsx)(`p`,{className:`text-[13px] text-text-secondary mt-1.5`,children:t})]})]})]})}function H5({number:e,title:t}){return(0,X.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,X.jsx)(`span`,{className:`w-6 h-6 rounded-full bg-brand text-white text-[12px] font-bold flex items-center justify-center shrink-0`,children:e}),(0,X.jsx)(`h3`,{className:`text-[17px] font-semibold text-text-primary`,children:t})]})}function U5({checked:e,onChange:t}){return(0,X.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":e,onClick:()=>t(!e),className:K(`relative w-10 h-[22px] rounded-full transition-colors duration-200 cursor-pointer shrink-0 overflow-hidden`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1`,e?`bg-brand`:`bg-border-strong`),children:(0,X.jsx)(`span`,{className:K(`absolute top-[3px] w-4 h-4 rounded-full bg-white shadow-sm transition-[left] duration-200`,e?`left-[21px]`:`left-[3px]`)})})}function W5({label:e,hint:t,tooltip:n,checked:r,onChange:i}){return(0,X.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,X.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,X.jsx)(`p`,{className:`text-[15px] text-text-primary font-medium`,children:e}),n&&(0,X.jsx)(tE,{content:n})]}),t&&(0,X.jsx)(`p`,{className:`text-[13px] text-text-secondary mt-0.5`,children:t})]}),(0,X.jsx)(U5,{checked:r,onChange:i})]})}function G5({label:e,children:t}){return(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsx)(`p`,{className:`text-[13px] font-medium text-text-secondary uppercase tracking-wide`,children:e}),(0,X.jsx)(`div`,{children:t})]})}function K5({checked:e,onChange:t,disabled:n}){return(0,X.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":e,disabled:n,onClick:()=>t(!e),className:K(`relative w-10 h-[22px] rounded-full transition-colors duration-200 shrink-0 overflow-hidden`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1`,n?`cursor-not-allowed opacity-50`:`cursor-pointer`,e?`bg-brand`:`bg-border-strong`),children:(0,X.jsx)(`span`,{className:K(`absolute top-[3px] w-4 h-4 rounded-full bg-white shadow-sm transition-[left] duration-200`,e?`left-[21px]`:`left-[3px]`)})})}function q5(){let{t:e}=V(`workspace`),{t}=V(`common`),{linkName:n}=$T();cE(n?`${n} â ${e(`nav.automation`)}`:e(`nav.automation`));let{linkId:r}=pa(),i=la(),{data:a,loading:o,refetch:s}=pd(r),{data:c,loading:l}=ef(r),u=o&&!a||l&&!c,d=fd(a),f=d?.id?String(d.id):void 0,p=f!=null,m=d?.is_open??!1,h=c?.length??0,{data:g}=Tf(f),_=(()=>
72{if(!g)return!1;let e=g.find(e=>e.source_type===`web`),t=g.filter(e=>e.source_type===`file`),n=g.find(e=>e.source_type===`manual`);return(e?.target_urls??[]).length===0&&t.length===0&&(n?.qa_pairs??[]).length===0})(),v=_f(),y=gf(),b=async t=>{if(t&&_){Q.error(e(`aiBot.enableBlockedNoData`));return}let n=d?.id;if(!(!r||n==null))try{await v.mutate({token:r,id:n,is_open:t,name:`Chatbot`,avatar:d?.avatar??`https://pinchat-prod.s3.ap-northeast-1.amazonaws.com/user/e2669806e2830fc502f8835f2e6e4abe.png`,type:`ai`}),await s()}catch{Q.error(e(`automation.toggleFailed`))}},x=async()=>{if(!p&&r)try{await y.mutate({token:r,name:`Chatbot`}),await s()}catch(t){if(t instanceof Du&&t.code===40004)Q.error(e(`automation.aiBotLimitReached`));else{let n=t instanceof Du&&t.message?t.message:e(`automation.botCreateFailed`);Q.error(n)}return}i(`${S}/ai-bot`)},S=`/dashboard/workspace/${r}/settings/automation`;return(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h2`,{className:`text-[28px] font-semibold text-text-primary mb-5`,children:e(`automation.title`)}),(0,X.jsx)(j8,{allowed:[`trial`,`starter`,`light`,`standard`,`enterprise`,`appsumo`],children:(0,X.jsx)(`div`,{className:`space-y-4`,children:u?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(J5,{}),(0,X.jsx)(J5,{})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`card p-5 flex items-center gap-4`,children:[(0,X.jsx)(`div`,{className:`w-10 h-10 rounded-[8px] bg-brand-tint flex items-center justify-center shrink-0`,children:(0,X.jsx)(js,{className:`w-5 h-5 text-brand`})}),(0,X.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,X.jsx)(`div`,{className:`flex items-center gap-2 mb-0.5`,children:(0,X.jsx)(`h3`,{className:`text-[17px] font-semibold text-text-primary`,children:e(`automation.aiBot`)})}),(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary truncate`,children:e(`automation.aiBotDescription`)})]}),(0,X.jsxs)(`div`,{className:`flex items-center gap-3 shrink-0`,children:[!o&&p&&(0,X.jsx)(K5,{checked:m,onChange:b,disabled:v.loading}),(0,X.jsx)(Z,{variant:p?`secondary`:`primary`,size:`sm`,onClick:x,loading:y.loading,children:t(p?`manage`:`configure`)})]})]}),(0,X.jsxs)(`div`,{className:`card p-5 flex items-center gap-4`,children:[(0,X.jsx)(`div`,{className:`w-10 h-10 rounded-[8px] bg-brand-tint flex items-center justify-center shrink-0`,children:(0,X.jsx)(Us,{className:`w-5 h-5 text-brand`})}),(0,X.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 mb-0.5`,children:[(0,X.jsx)(`h3`,{className:`text-[17px] font-semibold text-text-primary`,children:e(`automation.survey`)}),!l&&h>0&&(0,X.jsx)(`span`,{className:`text-[13px] text-text-secondary`,children:e(`automation.surveyCount`,{count:h})})]}),(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary truncate`,children:e(`automation.surveyDescription`)})]}),(0,X.jsx)(Z,{variant:h>0?`secondary`:`primary`,size:`sm`,className:`shrink-0`,onClick:()=>i(h>0?`${S}/survey`:`${S}/survey/new`),children:t(h>0?`manage`:`configure`)})]})]})})})]})}function J5(){return(0,X.jsxs)(`div`,{className:`card p-5 flex items-center gap-4`,children:[(0,X.jsx)(rD,{className:`w-10 h-10 rounded-[8px] shrink-0`}),(0,X.jsxs)(`div`,{className:`flex-1 min-w-0 space-y-2`,children:[(0,X.jsx)(rD,{className:`h-4 w-28`}),(0,X.jsx)(rD,{className:`h-3.5 w-56 max-w-full`})]}),(0,X.jsx)(rD,{className:`h-8 w-20 shrink-0`})]})}function Y5({page:e,totalPages:t,onChange:n,className:r}){let{t:i}=V(`common`);if(t<=1)return null;let a=e=>K(`w-8 h-8 flex items-center justify-center rounded-[8px] transition-colors`,e?`text-text-secondary opacity-40 cursor-not-allowed`:`hover:bg-bg-subtle text-text-primary cursor-pointer`);return(0,X.jsxs)(`div`,{className:K(`flex items-center justify-end gap-1`,r),children:[(0,X.jsx)(`button`,{type:`button`,onClick:()=>n(Math.max(1,e-1)),disabled:e===1,"aria-label":i(`previousPage`),className:a(e===1),children:(0,X.jsx)(Ls,{className:`w-4 h-4`})}),Array.from({length:t},(e,t)=>t+1).map(t=>(0,X.jsx)(`button`,{type:`button`,onClick:()=>n(t),"aria-current":t===e?`page`:void 0,className:K(`w-8 h-8 flex items-center justify-center rounded-[8px] text-[14px] transition-colors cursor-pointer`,t===e?`bg-brand-tint text-brand font-medium`:`hover:bg-bg-subtle text-text-primary`),children:t},t)),(0,X.jsx)(`button`,{type:`button`,onClick:()=>n(Math.min(t,e+1)),disabled:e===t,"aria-label":i(`nextPage`),className:a(e===t),children:(0,X.jsx)(Rs,{className:`w-4 h-4`})})]})}function X5({text:e,className:t}){let n=(0,f.useRef)(null),[r,i]=(0,f.useState)(!1);return(0,f.useEffect)(()=>{let e=n.current;if(!e)return;let t=()=>i(e.scrollWidth>e.clientWidth);t();let r=new ResizeObserver(t);return r.observe(e),()=>r.disconnect()},[]),(0,X.jsx)(tE,{content:r?e:``,className:`min-w-0`,children:(0,X.jsx)(`span`,{ref:n,className:K(`truncate cursor-default`,t),children:e})})}function One({files:e,stagedFiles:t,downloadingIds:n,page:r,totalPages:i,onPageChange:a,onDownload:o,onRemove:s,onRemoveStaged:c}){let{t:l,i18n:u}=V(`workspace`);if(e.length===0&&t.length===0)return null;let d=e=>new Intl.DateTimeFormat(u.language,{year:`numeric`,month:`numeric`,day:`numeric`,hour:`2-digit`,minute:`2-digit`}).format(e);return(0,X.jsxs)(`div`,{className:`space-y-3`,children:[(0,X.jsxs)(`div`,{className:`border border-border rounded-[8px] overflow-hidden`,children:[(0,X.jsxs)(`div`,{className:`file-list-row px-4 py-2 bg-bg-subtle border-b border-border`,children:[(0,X.jsx)(`span`,{className:`text-[12px] font-medium text-text-tertiary`,children:l(`aiBot.fileColName`)}),(0,X.jsx)(`span`,{className:`text-[12px] font-medium text-text-tertiary hidden lg:block`,children:l(`aiBot.fileColSize`)}),(0,X.jsx)(`span`,{className:`text-[12px] font-medium text-text-tertiary hidden lg:block`,children:l(`aiBot.fileColDate`)}),(0,X.jsx)(`div`,{})]}),t.map(e=>(0,X.jsxs)(`div`,{className:`file-list-row px-4 py-3 border-t border-border`,children:[(0,X.jsx)(X5,{text:e.file.name,className:`text-[14px] text-text-secondary`}),(0,X.jsx)(`span`,{className:`text-[13px] text-text-tertiary hidden lg:block`,children:pu(e.file.size)}),(0,X.jsx)(`div`,{className:`hidden lg:flex items-center`,children:(0,X.jsx)(`span`,{className:`text-[11px] font-medium px-1.5 py-0.5 rounded-[4px] bg-brand-tint text-brand`,children:l(`aiBot.fileStagedLabel`)})}),(0,X.jsx)(`div`,{className:`flex items-center justify-end`,children:(0,X.jsx)(`button`,{onClick:()=>c(e.id),className:`p-1 text-text-secondary hover:text-danger transition-colors cursor-pointer`,children:(0,X.jsx)(kc,{className:`w-3.5 h-3.5`})})})]},e.id)),e.map(e=>(0,X.jsxs)(`div`,{className:`border-t border-border`,children:[(0,X.jsxs)(`div`,{className:`file-list-row px-4 py-3`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,X.jsx)(X5,{text:e.name,className:`text-[14px] text-text-primary`}),e.dataStatus===`failed`&&(0,X.jsx)(`span`,{className:`shrink-0 text-[11px] font-medium px-1.5 py-0.5 rounded-[4px] bg-danger/10 text-danger`,children:l(`aiBot.trainFailed`)})]}),(0,X.jsx)(`span`,{className:`text-[13px] text-text-secondary hidden lg:block`,children:e.size}),(0,X.jsx)(`span`,{className:`text-[13px] text-text-secondary hidden lg:block`,children:d(new Date(e.updatedAt))}),(0,X.jsxs)(`div`,{className:`flex items-center justify-end gap-0.5`,children:[(0,X.jsx)(`button`,{onClick:()=>o(e.id,e.name),disabled:n.has(e.id),className:`p-1 text-text-secondary hover:text-text-primary transition-colors cursor-pointer disabled:opacity-40`,title:`Download`,children:n.has(e.id)?(0,X.jsx)(sc,{className:`w-3.5 h-3.5 animate-spin`}):(0,X.jsx)(qs,{className:`w-3.5 h-3.5`})}),(0,X.jsx)(`button`,{onClick:()=>s(e.id),className:`p-1 text-text-secondary hover:text-danger transition-colors cursor-pointer`,children:(0,X.jsx)(kc,{className:`w-3.5 h-3.5`})})]})]}),e.dataStatus===`failed`&&(0,X.jsxs)(`div`,{className:`flex items-start gap-2 px-4 pb-3`,children:[(0,X.jsx)(zs,{className:`w-3.5 h-3.5 text-danger shrink-0 mt-0.5`}),(0,X.jsx)(`p`,{className:`text-[12px] text-danger/90 leading-snug`,children:e.errorMessage||l(`aiBot.trainFailedSub`)})]})]},e.id))]}),(0,X.jsx)(Y5,{page:r,totalPages:i,onChange:a})]})}function Z5(e){if(/\s/.test(e.trim()))return!1;try{let t=new URL(e);return t.protocol===`http:`||t.protocol===`https:`}catch{return!1}}var Q5=[`;`,` `];function $5(e,t=`,`){let n=e.trim();if(!n.startsWith(`"`))return n.split(t)[0].trim();let r=``;for(let e=1;e<n.length;e+=1){if(n[e]!==`"`){r+=n[e];continue}if(n[e+1]===`"`){r+=`"`,e+=1;continue}break}return r.trim()}function kne(e){return/[",\r\n]/.test(e)?`"${e.replace(/"/g,`""`)}"`:e}function Ane(e){for(let t of Q5){let n=e.split(t);if(n.length>1&&$5(n.join(t),t).toLowerCase()===`url`)return t}return`,`}function jne(e,t){let n=$5(e,t);if(!n||Z5(n))return n;for(let n of Q5){if(n===t)continue;let r=$5(e,n);if(r&&Z5(r))return r}return n}function Mne(e){let t=e.replace(/^\uFEFF/,``).split(/\r?\n/),n=Ane(t[0]??``),r=[],i=[],a=new Set;for(let[e,o]of t.entries()){let t=jne(o,n);if(t&&!(e===0&&t.toLowerCase()===`url`)){if(!Z5(t)){i.push(t);continue}a.has(t)||(a.add(t),r.push(t))}}
72return{urls:r,invalid:i}}function Nne(e){return`url\r\n${e.map(kne).join(`\r 73`)}${e.length>0?`\r 74`:``}`}function Pne(e,t,n){let r=[n.getFullYear(),String(n.getMonth()+1).padStart(2,`0`),String(n.getDate()).padStart(2,`0`)].join(``);return[...[e7(e),e7(t)].filter(Boolean),`ai-bot-urls`,r].join(`-`)+`.csv`}function e7(e){return(e??``).replace(/[\\/:*?"<>|\u0000-\u001f]+/g,``).replace(/\s+/g,`-`).replace(/^[-.]+|[-.]+$/g,``).slice(0,60)}var t7={enabled:!1,idle_minutes:5},n7={"zh-CN":`zh-Hans`,"pt-BR":`pt`},Fne=Object.fromEntries(Object.entries(n7).map(([e,t])=>[t,e]));function Ine(e){return n7[e]??e}function Lne(e){return Fne[e]??e}function r7(e,t){if(e)return Lne(e);if(Kt.includes(t))return t;let n=t.split(`-`)[0];return Kt.find(e=>e===n||e.split(`-`)[0]===n)??`zh-TW`}var Rne=`pinchat:ai-bot-train-task:`,i7=e=>`${Rne}${e}`,zne=[`queued`,`collecting`,`indexing`,`summarizing`],Bne=[`collecting`,`indexing`,`summarizing`],Vne=[`ready`,`failed`,`partial_failure`,`empty`],a7=2e3,o7=[`.txt`,`.pdf`,`.docx`,`.csv`,`.md`,`.xlsx`,`.png`,`.jpg`,`.jpeg`],Hne=o7.join(`,`),Une=10*1024*1024,Wne=50,Gne=!1,s7=10;function Kne(e){let t=e.lastIndexOf(`.`);return t===-1?``:e.slice(t).toLowerCase()}function qne(e){return{id:e.id,name:e.name,size:pu(e.config_snapshot?.config?.file_size??e.file_size),updatedAt:e.updated_at??e.created_at,dataStatus:e.data_status,errorMessage:e.error_message}}function Jne(e){return e?(e.datasources??[]).filter(e=>e.data_status===`failed`).map(e=>e.name).filter(e=>!!e):[]}function c7(e){let t=Number.parseInt(e,10);return Number.isFinite(t)?Math.min(120,Math.max(1,t)):t7.idle_minutes}function l7(e){let t=e.filter(e=>!e.valid),n=e.filter(e=>e.valid),r={};for(let e of n)try{let t=new URL(e.url),n=t.pathname.split(`/`).filter(Boolean)[0]??``,i=n?`${t.hostname}/${n}/`:t.hostname;r[i]=[...r[i]??[],e]}catch{}let i=[];t.length>0&&i.push({group:null,items:t});for(let[e,t]of Object.entries(r))i.push({group:e,items:t});return i}var u7=`h-10 w-full rounded-[8px] border border-border bg-bg-card px-3 text-[15px] text-text-primary placeholder:text-text-secondary placeholder:opacity-50 outline-none focus:border-border-strong transition-colors`,d7=`h-10 w-full rounded-[8px] border border-border bg-bg-card px-3 text-[15px] text-text-primary outline-none focus:border-border-strong transition-colors appearance-none cursor-pointer`,Yne=255,Xne=255,f7=500,p7=300,m7=200,Zne=[{value:``,labelKey:`aiBot.toneFriendly`},{value:`__custom__`,labelKey:`aiBot.toneCustom`}];function Qne(){let{t:e,i18n:t}=V(`workspace`),{t:n}=V(`common`),{linkName:r}=$T();cE(r?`${r} â ${e(`aiBot.pageTitle`)}`:e(`aiBot.pageTitle`));let{linkId:i}=pa(),a=la(),{logAnalyticsEvent:o}=BS(),s=zf(e=>e.user?.plan??``),c=dC.has(s),{data:l,loading:u,refetch:d}=pd(i),p=fd(l),m=p?.id?String(p.id):void 0,{data:h,loading:g,error:_,refetch:v}=vf(m),{data:y,loading:b,error:x,refetch:S}=xf(m),C=yf(m),w=bf(m),T=Sf(m),E=_f(),D=Ed(`image`),{data:O,loading:k,error:A,refetch:j}=Tf(m),M=u&&!l||g&&!h||b&&!y||k&&!O,N=Ef(m),ee=Df(m),P=Of(m),F=kf(m),I=Af(m),te=jf(m),L=Nf(m),{data:ne}=Pf(m),[R,z]=(0,f.useState)(`settings`),[B,re]=(0,f.useState)(!1),[ie,ae]=(0,f.useState)(`Chatbot`),[oe,se]=(0,f.useState)(``),[ce,le]=(0,f.useState)(``),[ue,de]=(0,f.useState)(`knowledge`),[fe,pe]=(0,f.useState)(``),[me,he]=(0,f.useState)(``),ge=fe===`__custom__`?me:fe,[_e,ve]=(0,f.useState)(``),[ye,be]=(0,f.useState)(`gpt-5.2`),[xe,Se]=(0,f.useState)(null),[Ce,we]=(0,f.useState)(0),[Te,Ee]=(0,f.useState)(!1),[De,Oe]=(0,f.useState)(t7.enabled),[ke,Ae]=(0,f.useState)(String(t7.idle_minutes)),[je,Me]=(0,f.useState)(()=>r7(null,t.language)),[Ne,Pe]=(0,f.useState)(je),[Fe,Ie]=(0,f.useState)(!1),Le=(0,f.useRef)({botName:`Chatbot`,selfIntro:``,description:``});(0,f.useEffect)(()=>{if(!h)return;re(p?.is_open??!1);let e={botName:p?.name??`Chatbot`,selfIntro:h.name??``,description:h.description??``},t=Le.current;ae(n=>n===t.botName?e.botName:n),se(n=>n===t.selfIntro?e.selfIntro:n),le(n=>n===t.description?e.description:n),Le.current=e},[h,p]),(0,f.useEffect)(()=>{et(e=>e&&e.startsWith(`blob:`)?e:p?.avatar??null)},[p]),(0,f.useEffect)(()=>
74{if(!y)return;de(y.persona?.bot_type??`knowledge`);let e=y.persona?.tone??``;e===``||e===`__custom__`?(pe(e),he(``)):(pe(`__custom__`),he(e)),ve(y.persona?.fallback_contact??``),be(y.generation?.model??`gpt-5.2`),Se(y.generation?.chat_provider_id??null),Ee(!!y.generation?.chat_provider_id),we(y.generation?.temperature??0),Oe(y.conversation_analysis?.enabled??t7.enabled),Ae(String(y.conversation_analysis?.idle_minutes??t7.idle_minutes));let n=r7(y.localization?.operator_content_language,t.language);Me(n),Pe(n),Ie(!1)},[y]);let Re=_??x??A??null,ze=(0,f.useRef)(!1);(0,f.useEffect)(()=>{if(!Re){ze.current=!1;return}ze.current||(ze.current=!0,Q.error(Re.message||n(`loadFailed`)))},[Re,n]);let[Be,Ve]=(0,f.useState)(!1),He=async()=>{Ve(!0),ze.current=!1,await Promise.allSettled([v(),S(),j()]),Ve(!1)},{data:Ue}=lf(),{data:We}=uf(),Ge=(We?.length??0)>0,Ke=(()=>{if(!Te){let e=Ue?.find(e=>e.id===`openai`)?.models??[];return e.length===0?[{value:`gpt-5.2`,label:`GPT-5.2`,providerId:null}]:e.map(e=>({value:e.id,label:e.name,providerId:null}))}let e=[];for(let t of We??[]){let n=Ue?.find(e=>e.id===t.provider_type);if(n)for(let r of n.models)e.push({value:r.id,label:`${r.name} (${n.name})`,providerId:t.id})}return e})(),[qe,Je]=(0,f.useState)(!1),[Ye,Xe]=(0,f.useState)(!1),[Ze,Qe]=(0,f.useState)(``),[$e,et]=(0,f.useState)(null),[tt,nt]=(0,f.useState)(null),rt=(0,f.useRef)(null),[it,at]=(0,f.useState)(new Set),[ot,st]=(0,f.useState)(new Set),[ct,lt]=(0,f.useState)(new Set),ut=O?.find(e=>e.source_type===`web`),dt=(O??[]).filter(e=>e.source_type===`file`),ft=O?.find(e=>e.source_type===`manual`),pt=[...ut?.target_urls??[]].filter(e=>!it.has(e)).sort((e,t)=>e.localeCompare(t)).map((e,t)=>({id:`web-${t}-${e}`,url:e,valid:Z5(e)})),mt=dt.filter(e=>!ot.has(e.id)).map(qne).sort((e,n)=>e.name.localeCompare(n.name,t.language,{numeric:!0})),ht=(ft?.qa_pairs??[]).map((e,t)=>({id:`qa-${t}`,question:e.question,answer:e.answer})).filter(e=>!ct.has(e.id)),gt=ut!=null&&ut.index_status!==`completed`||dt.some(e=>e.index_status!==`completed`)||ft!=null&&ft.index_status!==`completed`,[_t,vt]=(0,f.useState)([]),[yt,bt]=(0,f.useState)(new Set),[xt,St]=(0,f.useState)(!1),[Ct,wt]=(0,f.useState)([]),[Tt,Et]=(0,f.useState)(1),Dt=Math.max(1,Math.ceil(mt.length/s7)),Ot=mt.slice((Tt-1)*s7,Tt*s7);(0,f.useEffect)(()=>{Tt>Dt&&Et(Dt)},[Tt,Dt]),mt.length+_t.length;let kt=1/0,At=kt===0,jt=pt.length===0&&mt.length===0&&_t.length===0&&ht.length===0&&Ct.length===0,Mt=!gt&&_t.length===0&&Ct.length===0&&it.size===0&&ot.size===0&&ct.size===0,[Nt,Pt]=(0,f.useState)(``),[Ft,It]=(0,f.useState)(``),[Lt,Rt]=(0,f.useState)(`crawl`),[zt,Bt]=(0,f.useState)(!1),[Vt,Ht]=(0,f.useState)(new Set),[Ut,Wt]=(0,f.useState)(!1),[Gt,Kt]=(0,f.useState)(!1),[Jt,Yt]=(0,f.useState)(0),[Xt,Zt]=(0,f.useState)(!1),[Qt,$t]=(0,f.useState)([]),[en,tn]=(0,f.useState)(0),nn=(0,f.useRef)(null),[rn,an]=(0,f.useState)(!1),on=(0,f.useRef)(null),[sn,cn]=(0,f.useState)(new Set),[ln,un]=(0,f.useState)(``),[dn,fn]=(0,f.useState)(``),[pn,mn]=(0,f.useState)(null),[hn,gn]=(0,f.useState)(``),[_n,vn]=(0,f.useState)(``),yn=(0,f.useRef)(null),bn=(0,f.useRef)(null),xn=(0,f.useRef)(!1),Sn=(0,f.useRef)(!1),Cn=(0,f.useRef)(!1),[wn,Tn]=(0,f.useState)(null),En=wn??ne,[Dn,On]=(0,f.useState)(!1),[kn,An]=(0,f.useState)(!1),[jn,Mn]=(0,f.useState)(!1),[Nn,Pn]=(0,f.useState)(0),[Fn,In]=(0,f.useState)(!1),Ln=En?.completed_at??null,Rn=En?.phase,zn=kn||!Dn&&Rn===`queued`?`preparing`:!Dn&&(Rn===`collecting`||Rn===`indexing`||Rn===`summarizing`)?`training`:`idle`,Bn=Math.min(100,Math.max(0,En?.progress?.percentage??0)),Vn=Rn===`ready`||Rn===`partial_failure`?100:Bn,Hn=(0,f.useCallback)(()=>{bn.current&&=(bn.current(),null)},[]),Un=(0,f.useCallback)(e=>{m&&(Hn(),Cn.current=!1,In(!0),bn.current=Ff(m,e,e=>{An(!1),Pn(e=>e+1),Cn.current=!0,Bne.includes(e.phase)&&(Sn.current=!0,On(!1)),Tn(e)},()=>{An(!1),bn.current=null,In(!1),Sn.current||On(!0)},()=>{An(!1),bn.current=null,In(!1),Cn.current||On(!0)},()=>{Pn(e=>e+1)}))},[m,Hn]),Wn=`/dashboard/workspace/${i}/settings/automation`,Gn=async t=>{if(o(`toggle_switch`,{element_id:i,feature_name:`pinbot_ai`,feature_state:t}),t&&jt){Q.error(e(`aiBot.enableBlockedNoData`));return}let n=p?.id;if(!(!i||n==null)){re(t);try{await E.mutate({token:i,id:n,is_open:t,name:ie,avatar:p?.avatar??`https://pinchat-prod.s3.ap-northeast-1.amazonaws.com/user/e2669806e2830fc502f8835f2e6e4abe.png`,type:`ai`})}catch{re(!t),Q.error(e(`automation.toggleFailed`))}}},Kn=De&&je!==Ne,qn=()=>
74{if(Kn){Ie(!0);return}Jn()},Jn=async()=>{if(o(`save_changes_click`,{link_token:i,feature_name:`pinbot_ai_basic_settings`}),!m){Q.error(e(`aiBot.noBotForLink`));return}try{let t=p?.avatar??``;tt&&(t=(await D.mutate(tt)).url,nt(null),et(t));let n=ue;await Promise.all([...i&&p?.id!=null?[E.mutate({token:i,id:p.id,is_open:B,name:ie,avatar:t,type:`ai`})]:[],C.mutate({name:oe,description:ce}),T.mutate({persona:{...y?.persona??{},bot_type:n,tone:ge,fallback_contact:_e,additional_instructions:y?.persona?.additional_instructions??``},generation:{...y?.generation??{model:`gpt-5.2`,temperature:0,max_tokens:1024,top_p:1,system_prompt:``,output_format:`markdown`},model:ye,temperature:Ce,chat_provider_id:Te?xe:null},conversation_analysis:{...y?.conversation_analysis??{},enabled:De,idle_minutes:c7(ke)},localization:{...y?.localization??{},operator_content_language:Ine(je)}})]),await Promise.all([v(),S(),d()]),Q.success(e(`aiBot.saved`))}catch(t){console.error(`AI Bot settings save failed`,t),Q.error(e(`aiBot.saveFailed`))}},Yn=e=>{at(t=>{if(!e.some(e=>t.has(e)))return t;let n=new Set(t);for(let t of e)n.delete(t);return n})},Xn=async()=>{let t=Ft.trim();if(!t||!m)return;if(pt.length>=a7){Q.info(e(`aiBot.urlLimitReached`,{max:a7}));return}let n=Array.from(new Set([...ut?.target_urls??[],t]));try{ut?await ee.mutate({datasourceId:ut.id,target_urls:n}):await N.mutate({name:`URLs`,source_url:t,target_urls:n}),Yn([t]),It(``);let e=(()=>{try{let e=new URL(t),n=e.pathname.split(`/`).filter(Boolean)[0]??``;return n?`${e.hostname}/${n}/`:e.hostname}catch{return``}})();e&&cn(t=>{let n=new Set(t);return n.delete(e),n}),await j()}catch{Q.error(e(`aiBot.urlAddFailed`))}},Zn=()=>{let e=Nne(pt.map(e=>e.url)),t=new Blob([e],{type:`text/csv;charset=utf-8`}),n=URL.createObjectURL(t),a=document.createElement(`a`);a.href=n,a.download=Pne(r,i,new Date),a.click(),URL.revokeObjectURL(n)},Qn=async t=>{if(m){an(!0);try{let{urls:n,invalid:r}=Mne(await t.text());if(n.length===0){Q.error(r.length>0?e(`aiBot.urlImportAllInvalid`,{count:r.length}):e(`aiBot.urlImportEmpty`));return}let i=ut?.target_urls??[],a=new Set(i),o=n.filter(e=>!a.has(e)),s=n.length-o.length,c=Math.max(0,a7-pt.length),l=o.slice(0,c),u=o.length-l.length;if(l.length===0){Q.info(c===0?e(`aiBot.urlLimitReached`,{max:a7}):e(`aiBot.urlImportNothingNew`,{duplicates:s}));return}let d=Array.from(new Set([...i,...l]));ut?await ee.mutate({datasourceId:ut.id,target_urls:d}):await N.mutate({name:`URLs`,source_url:l[0],target_urls:d}),Yn(l),await j();let f=[s>0?e(`aiBot.urlImportSkippedDuplicates`,{count:s}):null,r.length>0?e(`aiBot.urlImportSkippedInvalid`,{count:r.length}):null,u>0?e(`aiBot.urlImportSkippedOverLimit`,{count:u,max:a7}):null].filter(Boolean).join(` · `);f?Q.rich({type:`success`,message:e(`aiBot.urlImportAdded`,{count:l.length}),subtitle:f}):Q.success(e(`aiBot.urlImportAdded`,{count:l.length}))}catch{Q.error(e(`aiBot.urlImportFailed`))}finally{an(!1)}}},$n=()=>{nn.current&&=(nn.current(),null),Zt(!1)},er=()=>{let t=Nt.trim();if(t){if(pt.length>=a7){Q.info(e(`aiBot.urlLimitReached`,{max:a7}));return}if(!Z5(t)){Q.error(e(`aiBot.urlInvalidLabel`));return}m&&($t([]),tn(0),Zt(!0),nn.current=If(m,t,(e,t)=>{t>=0&&tn(t),e.length!==0&&$t(t=>{let n=new Set([...pt.map(e=>e.url),...t]),r=e.filter(e=>!n.has(e));return r.length>0?[...t,...r]:t})},()=>{nn.current=null,Zt(!1),Q.error(e(`aiBot.crawlStreamError`))},()=>{nn.current=null,Zt(!1)}))}},tr=async()=>{if(!m||Qt.length===0)return;let t=Array.from(new Set([...ut?.target_urls??[],...Qt]));try{ut?await ee.mutate({datasourceId:ut.id,target_urls:t}):await N.mutate({name:`URLs`,source_url:Qt[0],target_urls:t}),Yn(Qt),$t([]),Pt(``),await j()}catch{Q.error(e(`aiBot.urlAddFailed`))}};(0,f.useEffect)(()=>{Xt&&pt.length+Qt.length>=a7&&($n(),Q.info(e(`aiBot.urlLimitToast`,{max:a7})))},[pt.length,Qt.length,Xt,e]);let nr=e=>{let t=pt.find(t=>t.id===e)?.url;t&&at(e=>new Set(e).add(t))},rr=e=>{let t=l7(pt).find(t=>t.group===e);t&&at(e=>{let n=new Set(e);for(let e of t.items)n.add(e.url);return n})},ir=()=>{Vt.size!==0&&(at(e=>{let t=new Set(e);for(let e of pt)Vt.has(e.id)&&t.add(e.url);return t}),Ht(new Set),Bt(!1))},ar=e=>{Ht(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},or=e=>{Ht(t=>{let n=new Set(t),r=e.every(e=>n.has(e.id));for(let t of e)r?n.delete(t.id):n.add(t.id);return n})},sr=()=>{Ht(e=>e.size===pt.length?new Set:new Set(pt.map(e=>e.id)))},cr=t=>{if(t.length===0)return;let n=[],r=[],a=[];
74t.forEach(e=>{o7.includes(Kne(e.name))?e.size>Une?a.push(e.name):n.push(e):r.push(e.name)});let s=t=>t.join(e(`aiBot.fileListSeparator`));r.length>0&&Q.error(e(`aiBot.fileTypeRejected`,{files:s(r)})),a.length>0&&Q.error(e(`aiBot.fileTooLarge`,{files:s(a),size:`10 MB`}));let c=n.slice(0,kt),l=n.length-c.length;l>0&&Q.error(e(`aiBot.fileCountExceeded`,{max:Wne,count:l})),c.length!==0&&(c.forEach(e=>o(`file_upload`,{element_id:i,file_size:e.size,file_type:e.type,upload_location:`ai_bot`})),vt(e=>[...e,...c.map(e=>({id:mu(),file:e}))]))},lr=e=>{let t=Array.from(e.target.files??[]);e.target.value=``,cr(t)},ur=e=>{e.preventDefault(),St(!1),cr(Array.from(e.dataTransfer.files))},dr=e=>{vt(t=>t.filter(t=>t.id!==e))},fr=e=>{st(t=>new Set(t).add(e))},pr=async(t,n)=>{if(!(!m||yt.has(t))){bt(e=>new Set(e).add(t));try{let e=await Mf(m,t),r=document.createElement(`a`);r.href=e,r.download=n,r.target=`_blank`,r.rel=`noopener noreferrer`,document.body.appendChild(r),r.click(),document.body.removeChild(r)}catch{Q.error(e(`aiBot.fileDownloadFailed`))}finally{bt(e=>{let n=new Set(e);return n.delete(t),n})}}},mr=()=>{o(`pinbot_data_qa_add`,{element_id:i});let e=ln.trim(),t=dn.trim();!e||!t||(wt(n=>[...n,{id:`staged-qa-${Date.now()}`,question:e,answer:t}]),un(``),fn(``))},hr=e=>{if(o(`pinbot_data_qa_delete`,{element_id:i}),e.startsWith(`staged-qa-`)){wt(t=>t.filter(t=>t.id!==e));return}lt(t=>new Set(t).add(e))},gr=()=>{o(`pinbot_data_qa_delete_all`,{element_id:i}),wt([]),ft?.qa_pairs&<(e=>{let t=new Set(e);for(let e=0;e<ft.qa_pairs.length;e++)t.add(`qa-${e}`);return t})},_r=e=>{mn(e.id),gn(e.question),vn(e.answer)},vr=async()=>{if(!pn)return;let t=hn.trim(),n=_n.trim();if(!t||!n)return;if(pn.startsWith(`staged-qa-`)){wt(e=>e.map(e=>e.id===pn?{...e,question:t,answer:n}:e)),mn(null);return}if(!m||!ft)return;let r=ht.findIndex(e=>e.id===pn);if(r<0)return;let i=(ft.qa_pairs??[]).map((e,i)=>i===r?{question:t,answer:n}:e);try{await I.mutate({datasourceId:ft.id,qa_pairs:i}),await j(),mn(null)}catch{Q.error(e(`aiBot.qaRemoveFailed`))}},yr=e=>new Intl.DateTimeFormat(t.language,{year:`numeric`,month:`numeric`,day:`numeric`,hour:`2-digit`,minute:`2-digit`}).format(e),br=()=>({botName:ie,token:i??``,onCopyToken:async()=>{await uu(Sd(i??``,l?.custom_domain)),Q.success(e(`aiBot.linkCopied`))}}),xr=(0,f.useRef)(!1),Sr=async()=>{if(o(`pinbot_train_click`,{element_id:i}),!(!m||xr.current||L.loading||zn!==`idle`)){xr.current=!0;try{On(!1),Yt(0);let t=ut?(ut.target_urls??[]).filter(e=>!it.has(e)):[],n=ut!=null&&t.length===0,r=ut!=null&&it.size>0&&t.length>0,i=0;(n||r)&&(i+=1),i+=ot.size,ct.size>0&&ft&&(i+=1),i+=_t.length,Ct.length>0&&(i+=1);let a=0,o=()=>{a++,i>0&&Yt(Math.round(a/i*100))},s=!1;if(n){try{await te.mutate(ut.id)}catch{Q.error(e(`aiBot.urlRemoveFailed`));return}at(new Set),s=!0,o()}else if(r){try{await ee.mutate({datasourceId:ut.id,target_urls:t})}catch{Q.error(e(`aiBot.urlRemoveFailed`));return}at(new Set),s=!0,o()}if(ot.size>0){for(let t of ot){try{await te.mutate(t)}catch{Q.error(e(`aiBot.fileRemoveFailed`));return}o()}st(new Set),s=!0}if(ct.size>0&&ft){let t=(ft.qa_pairs??[]).filter((e,t)=>!ct.has(`qa-${t}`));try{t.length===0?await te.mutate(ft.id):await I.mutate({datasourceId:ft.id,qa_pairs:t})}catch{Q.error(e(`aiBot.qaRemoveFailed`));return}lt(new Set),s=!0,o()}if(s&&await j(),_t.length>0){Wt(!0);let t=new Set(dt.map(e=>e.name));for(let n of _t){try{await P.mutate(n.file)}catch{try{let e=await wf(m),n=new Set(e.filter(e=>e.source_type===`file`&&!t.has(e.name)).map(e=>e.name));n.size>0&&vt(e=>e.filter(e=>!n.has(e.file.name)))}catch{}await j(),Wt(!1),Q.error(e(`aiBot.fileUploadFailed`));return}o()}vt([]),Wt(!1),await j()}if(Ct.length>0){let t=[...ft?.qa_pairs??[],...Ct.map(e=>({question:e.question,answer:e.answer}))];Kt(!0);try{ft?await I.mutate({datasourceId:ft.id,qa_pairs:t}):await F.mutate({name:`Q&A`,qa_pairs:t}),wt([]),await j()}catch{Kt(!1),Q.error(e(`aiBot.qaAddFailed`));return}Kt(!1),o()}let c=null;try{c=(await L.mutate(void 0))?.data?.task_id??null}catch{Q.rich({type:`error`,message:e(`aiBot.trainFailed`),subtitle:e(`aiBot.trainFailedSub`),header:br(),timestamp:yr(new Date),duration:0});return}if(c)try{localStorage.setItem(i7(m),c)}catch{}An(!0),Un(c)}finally{xr.current=!1}}},Cr=(0,f.useRef)(Sr);Cr.current=Sr,(0,f.useEffect)(()=>
74{if(xn.current||!m||!ne)return;xn.current=!0;let e=ne.phase;if(!zne.includes(e))return;let t=null;try{t=localStorage.getItem(i7(m))}catch{}Un(t)},[m,ne,Un]),(0,f.useEffect)(()=>{xn.current=!1,Sn.current=!1,Cn.current=!1,Tn(null),On(!1),An(!1),In(!1),vt([]),wt([]),at(new Set),st(new Set),lt(new Set),wr.current=!1,Tr.current=!1},[m]),(0,f.useEffect)(()=>{if(zn!==`preparing`||!Fn)return;let e=setTimeout(()=>On(!0),3e4);return()=>clearTimeout(e)},[zn,Fn,Nn]),(0,f.useEffect)(()=>{if(Fn||Dn||!m||zn!==`preparing`&&zn!==`training`)return;let e=setTimeout(()=>{let e=null;try{e=localStorage.getItem(i7(m))}catch{}Un(e)},5e3);return()=>clearTimeout(e)},[Fn,zn,Dn,m,Un]),(0,f.useEffect)(()=>{if(!Rn||!Vne.includes(Rn))return;if(Hn(),m)try{localStorage.removeItem(i7(m))}catch{}if(j(),Tr.current=!0,!Sn.current)return;Sn.current=!1,(Rn===`ready`||Rn===`partial_failure`)&&(v(),S());let t=Jne(En),n=t.length>0?e(`aiBot.trainFailedSources`,{names:t.join(`, `)}):e(`aiBot.trainFailedSub`);if(Rn===`failed`){let t=En?.completed_at,r=t?new Date(t):new Date;Q.rich({type:`error`,message:e(`aiBot.trainFailed`),subtitle:n,header:br(),timestamp:yr(r),duration:0})}if(Rn===`partial_failure`){let t=En?.completed_at,r=t?new Date(t):new Date;Q.rich({type:`warning`,message:e(`aiBot.trainPartialFailed`),subtitle:n,header:br(),timestamp:yr(r),duration:0,action:{label:e(`aiBot.retrain`),onClick:()=>Cr.current()}})}},[Rn,m,Hn]),(0,f.useEffect)(()=>()=>Hn(),[Hn]),(0,f.useEffect)(()=>()=>{nn.current?.()},[]),(0,f.useEffect)(()=>{if(i)return hC(i,B),()=>gC(i)},[i,B]),(0,f.useEffect)(()=>{if(i)return vC(i),()=>yC(i)},[i]),(0,f.useEffect)(()=>{let e=e=>{let{token:t}=e.detail;t===i&&re(!0)};return window.addEventListener(bC,e),()=>window.removeEventListener(bC,e)},[i]),(0,f.useEffect)(()=>{if(!i)return;let e=e=>{let{token:t}=e.detail;t===i&&(v(),S(),j())};return window.addEventListener(xC,e),()=>window.removeEventListener(xC,e)},[i,v,S,j]);let wr=(0,f.useRef)(!1),Tr=(0,f.useRef)(!1);(0,f.useEffect)(()=>{!O||wr.current||(wr.current=!0,jt&&B&&Xe(!0))},[O,jt,B]),(0,f.useEffect)(()=>{!Tr.current||!O||(Tr.current=!1,jt&&B&&Xe(!0))},[O,jt,B]);let Er=Ut||Gt;(0,f.useEffect)(()=>{if(!Er)return;let e=e=>{e.preventDefault()};return window.addEventListener(`beforeunload`,e),()=>window.removeEventListener(`beforeunload`,e)},[Er]);let Dr=Na(Er),Or=async()=>{if(o(`pinbot_delete_click`,{element_id:i,feature_name:`pinbot_ai`}),!(Ze!==ie||w.loading))try{await w.mutate(),Je(!1),Q.success(e(`aiBot.deleteSuccess`)),a(Wn)}catch(t){console.error(`AI Bot delete failed`,t),Q.error(e(`aiBot.deleteFailed`))}},kr=e=>cn(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),Ar=l7(pt);return(0,X.jsxs)(`div`,{children:[(0,X.jsxs)(`button`,{onClick:()=>a(Wn),className:`flex items-center gap-1.5 text-[14px] text-text-secondary hover:text-text-primary mb-5 cursor-pointer transition-colors`,children:[(0,X.jsx)(Ds,{className:`w-4 h-4`}),e(`aiBot.backToList`)]}),(0,X.jsx)(`h2`,{className:`text-[28px] font-semibold text-text-primary mb-5`,children:e(`aiBot.title`)}),(0,X.jsxs)(`div`,{className:`flex flex-col md:flex-row gap-6 items-start`,children:[(0,X.jsx)(`div`,{className:`w-full md:w-44 shrink-0 order-1`,children:(0,X.jsxs)(`nav`,{className:`card p-2 space-y-0.5`,children:[(0,X.jsx)(`button`,{onClick:()=>z(`settings`),className:K(`w-full text-left px-3 h-9 rounded-[8px] text-[15px] transition-all duration-150 cursor-pointer`,R===`settings`?`bg-brand-tint text-brand font-medium`:`text-text-secondary hover:bg-bg-subtle hover:text-text-primary`),children:e(`aiBot.tabSettings`)}),(0,X.jsx)(`p`,{className:`px-3 pt-3 pb-1 text-[11px] font-medium text-text-secondary/60 uppercase tracking-wide`,children:e(`aiBot.tabKnowledge`)}),[`urls`,`files`,`qa`].map(t=>(0,X.jsx)(`button`,{onClick:()=>z(t),className:K(`w-full text-left px-3 h-9 rounded-[8px] text-[15px] transition-all duration-150 cursor-pointer flex items-center justify-between`,R===t?`bg-brand-tint text-brand font-medium`:`text-text-secondary hover:bg-bg-subtle hover:text-text-primary`),children:e(t===`urls`?`aiBot.sectionUrls`:t===`files`?`aiBot.sectionFiles`:`aiBot.sectionQA`)},t))]})}
74),(0,X.jsxs)(`div`,{className:`flex-1 min-w-0 w-full order-3 md:order-2`,children:[Re&&(0,X.jsxs)(`div`,{className:`mb-4 card p-4 flex items-start gap-3`,style:{borderColor:`rgba(235,87,87,0.25)`},children:[(0,X.jsx)(zs,{className:`w-4 h-4 text-danger shrink-0 mt-0.5`}),(0,X.jsxs)(`div`,{className:`flex-1 min-w-0 space-y-1`,children:[(0,X.jsx)(`p`,{className:`text-[14px] font-medium text-danger`,children:e(`aiBot.loadErrorTitle`)}),(0,X.jsx)(`p`,{className:`text-[13px] text-text-secondary`,children:e(`aiBot.loadErrorHint`)})]}),(0,X.jsxs)(`button`,{onClick:He,disabled:Be,className:`shrink-0 flex items-center gap-1.5 text-[13px] text-text-primary hover:text-brand transition-colors cursor-pointer disabled:opacity-40 disabled:cursor-default`,children:[Be&&(0,X.jsx)(sc,{className:`w-3.5 h-3.5 animate-spin`}),n(`retry`)]})]}),M&&(0,X.jsx)($ne,{}),(0,X.jsxs)(`div`,{className:K(`space-y-4`,(M||R!==`settings`)&&`hidden`),children:[(0,X.jsxs)(h7,{title:e(`aiBot.sectionEnable`),children:[(0,X.jsx)(_7,{label:e(`aiBot.labelEnable`),checked:B,onChange:Gn,disabled:E.loading}),jt&&!B&&(0,X.jsx)(`p`,{className:`text-[13px] text-text-secondary`,children:e(`aiBot.enableBlockedHint`)})]}),(0,X.jsxs)(h7,{title:e(`aiBot.sectionBasic`),children:[(0,X.jsx)(g7,{label:e(`aiBot.labelName`),children:(0,X.jsx)(`input`,{className:u7,maxLength:Yne,value:ie,onChange:e=>ae(e.target.value),placeholder:e(`aiBot.namePlaceholder`)})}),(0,X.jsx)(g7,{label:e(`aiBot.labelAvatar`),children:(0,X.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,X.jsxs)(`div`,{className:`relative w-20 h-20 rounded-full bg-brand-tint flex items-center justify-center shrink-0 overflow-hidden`,children:[$e?(0,X.jsx)(`img`,{src:$e,alt:``,className:`w-full h-full object-cover`}):(0,X.jsx)(js,{className:`w-10 h-10 text-brand`}),D.loading&&(0,X.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-black/40 rounded-full`,children:(0,X.jsx)(sc,{className:`w-6 h-6 text-white animate-spin`})})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(`input`,{ref:rt,type:`file`,accept:`image/png,image/jpeg`,className:`hidden`,onChange:e=>{let t=e.target.files?.[0];t&&(nt(t),et(URL.createObjectURL(t)))}}),(0,X.jsxs)(Z,{type:`button`,variant:`secondary`,size:`sm`,onClick:()=>rt.current?.click(),className:`gap-1.5`,children:[(0,X.jsx)(Mc,{className:`w-3.5 h-3.5`}),n($e?`changeImage`:`uploadImage`)]}),$e&&(0,X.jsx)(`button`,{type:`button`,onClick:()=>{et(null),nt(null),rt.current&&(rt.current.value=``)},className:`text-[14px] text-text-secondary hover:text-danger transition-colors cursor-pointer`,children:n(`remove`)})]}),(0,X.jsx)(`p`,{className:`text-[13px] text-text-secondary mt-1.5`,children:e(`aiBot.avatarHint`)})]})]})})]}),(0,X.jsxs)(h7,{title:e(`aiBot.sectionProfile`),subtitle:e(`aiBot.sectionProfileSubtitle`),children:[(0,X.jsx)(g7,{label:e(`aiBot.labelSelfIntro`),hint:e(`aiBot.labelSelfIntroHint`),children:(0,X.jsx)(`input`,{className:u7,maxLength:Xne,value:oe,onChange:e=>se(e.target.value),placeholder:e(`aiBot.selfIntroPlaceholder`)})}),(0,X.jsxs)(g7,{label:e(`aiBot.labelDescription`),hint:e(`aiBot.labelDescriptionHint`),children:[(0,X.jsx)(`textarea`,{className:K(u7,`h-auto py-2 resize-none`),rows:3,maxLength:f7,value:ce,onChange:e=>le(e.target.value),placeholder:e(`aiBot.descriptionPlaceholder`)}),(0,X.jsxs)(`p`,{className:`text-[12px] text-text-secondary text-right mt-1`,children:[ce.length,` / `,f7]}),(0,X.jsx)(`p`,{className:`text-[13px] text-text-secondary`,children:e(`aiBot.descriptionToneHint`)})]})]}),(0,X.jsxs)(h7,{title:e(`aiBot.sectionResponse`),children:[(0,X.jsx)(g7,{label:e(`aiBot.labelRole`),children:(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsxs)(`select`,{className:d7,value:ue,onChange:e=>de(e.target.value),children:[(0,X.jsx)(`option`,{value:`knowledge`,children:e(`aiBot.roleKnowledge`)}),(0,X.jsx)(`option`,{value:`sales`,children:e(`aiBot.roleSales`)})]}),(0,X.jsx)(Is,{className:`absolute right-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-text-secondary pointer-events-none`})]})}),(0,X.jsxs)(g7,{label:e(`aiBot.labelTone`),children:[(0,X.jsx)(`div`,{role:`radiogroup`,"aria-label":e(`aiBot.labelTone`),className:`flex flex-wrap gap-2`,children:Zne.map(({value:t,labelKey:n})=>{let r=fe===t;return(0,X.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":r,onClick:()=>
74pe(t),className:K(`h-10 px-4 rounded-[8px] border text-[15px] font-medium cursor-pointer transition-colors`,r?`bg-brand-tint border-brand text-brand`:`bg-bg-card border-border text-text-primary hover:bg-bg-subtle hover:border-border-strong`),children:e(n)},t||`default`)})}),fe===`__custom__`&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`textarea`,{className:K(u7,`h-auto py-2 resize-none mt-2`),rows:3,maxLength:p7,value:me,onChange:e=>he(e.target.value),placeholder:e(`aiBot.toneCustomPlaceholder`)}),(0,X.jsxs)(`p`,{className:`text-[12px] text-text-secondary text-right mt-1`,children:[me.length,` / `,p7]})]})]}),(0,X.jsxs)(g7,{label:e(`aiBot.labelContact`),children:[(0,X.jsx)(`textarea`,{className:K(u7,`h-auto py-2 resize-none`),rows:2,maxLength:m7,value:_e,onChange:e=>ve(e.target.value),placeholder:e(`aiBot.contactPlaceholder`)}),(0,X.jsxs)(`p`,{className:`text-[12px] text-text-secondary text-right mt-1`,children:[_e.length,` / `,m7]})]})]}),(0,X.jsxs)(h7,{title:e(`aiBot.sectionModel`),children:[(0,X.jsx)(g7,{label:e(`aiBot.labelLlm`),children:(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsx)(`select`,{className:d7,value:ye,onChange:e=>{be(e.target.value),Se(Ke.find(t=>t.value===e.target.value)?.providerId??null)},children:Ke.map(e=>(0,X.jsx)(`option`,{value:e.value,children:e.label},e.value))}),(0,X.jsx)(Is,{className:`absolute right-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-text-secondary pointer-events-none`})]})}),(0,X.jsx)(g7,{label:e(`aiBot.labelCreativity`),children:(0,X.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,X.jsx)(`span`,{className:`text-[13px] text-text-secondary shrink-0`,children:e(`aiBot.creativityConservative`)}),(0,X.jsx)(`input`,{type:`range`,min:0,max:1,step:.1,value:Ce,onChange:e=>we(Number(e.target.value)),className:`flex-1`,style:{background:`linear-gradient(to right, var(--brand) ${Ce*100}%, var(--border-strong) ${Ce*100}%)`}}),(0,X.jsx)(`span`,{className:`text-[13px] text-text-secondary shrink-0`,children:e(`aiBot.creativityCreative`)}),(0,X.jsx)(`span`,{className:`text-[13px] font-medium text-text-primary w-8 text-right tabular-nums`,children:Ce.toFixed(1)})]})}),c&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(_7,{label:e(`aiBot.labelByok`),checked:Te&&Ge,onChange:Ee,disabled:!Ge}),!Ge&&(0,X.jsx)(`p`,{className:`text-[13px] text-text-secondary -mt-2`,children:(0,X.jsx)(qo,{to:`/dashboard/billing`,className:`text-brand hover:underline`,children:e(`aiBot.byokNoKeyHint`)})})]})]}),(0,X.jsxs)(h7,{title:e(`aiBot.sectionAnalysis`),subtitle:e(`aiBot.sectionAnalysisSubtitle`),children:[(0,X.jsx)(_7,{label:e(`aiBot.labelAnalysisEnable`),checked:De,onChange:Oe}),De&&(0,X.jsxs)(g7,{label:e(`aiBot.labelAnalysisIdleMinutes`),children:[(0,X.jsx)(`input`,{type:`number`,inputMode:`numeric`,className:K(u7,`max-w-40`),min:1,max:120,step:1,value:ke,onChange:e=>Ae(e.target.value),onBlur:()=>Ae(String(c7(ke)))}),(0,X.jsx)(`p`,{className:`text-[13px] text-text-secondary`,children:e(`aiBot.analysisIdleMinutesHint`)})]}),De&&(0,X.jsxs)(g7,{label:e(`aiBot.labelAnalysisLanguage`),children:[(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsxs)(`select`,{className:d7,value:je,onChange:e=>Me(e.target.value),children:[!qt.some(e=>e.code===je)&&(0,X.jsx)(`option`,{value:je,children:je}),qt.map(({code:e,label:t})=>(0,X.jsx)(`option`,{value:e,children:t},e))]}),(0,X.jsx)(Is,{className:`absolute right-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-text-secondary pointer-events-none`})]}),(0,X.jsx)(`p`,{className:`text-[13px] text-text-secondary`,children:e(`aiBot.analysisLanguageHint`)})]})]}),(0,X.jsx)(`div`,{className:`flex justify-end`,children:(0,X.jsx)(Z,{onClick:qn,disabled:!m||!!Re||D.loading||E.loading||C.loading||T.loading,children:D.loading||E.loading||C.loading||T.loading?n(`saving`):n(`save`)})}),(0,X.jsxs)(`div`,{className:`card p-5`,style:{borderColor:`rgba(235,87,87,0.25)`},children:[(0,X.jsx)(`h3`,{className:`text-[17px] font-semibold text-danger mb-4`,children:e(`aiBot.sectionDanger`)}),(0,X.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`p`,{className:`text-[15px] font-medium text-text-primary`,children:e(`aiBot.deleteTitle`)}),(0,X.jsx)(`p`,{className:`text-[13px] text-text-secondary mt-0.5`,children:e(`aiBot.deleteDesc`)})]}),(0,X.jsx)(Z,{variant:`danger`,size:`sm`,className:`shrink-0`,onClick:()=>{Qe(``),Je(!0)},children:e(`aiBot.deleteButton`)})]})]})]}),(0,X.jsx)(`div`,{className:M||R!==`urls`?`hidden`:``,children:(0,X.jsxs)(h7,{title:e(`aiBot.sectionUrls`),action:(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(`input`,{ref:on,type:`file`,"data-testid":`url-csv-input`,accept:`.csv,.txt,text/csv,text/plain`,className:`hidden`,onChange:e=>{let t=e.target.files?.[0];e.target.value=``,t&&Qn(t)}}),(0,X.jsx)(tE,{content:e(`aiBot.urlCsvHint`),children:(0,X.jsxs)(Z,{variant:`secondary`,size:`sm`,className:`gap-1.5 whitespace-nowrap shrink-0`,loading:rn,disabled:!m||rn||pt.length>=a7,onClick:()=>on.current?.click(),children:[(0,X.jsx)(Mc,{className:`w-3.5 h-3.5`}),e(`aiBot.urlImport`)]})}),(0,X.jsxs)(Z,{variant:`secondary`,size:`sm`,className:`gap-1.5 whitespace-nowrap shrink-0`,onClick:Zn,children:[(0,X.jsx)(qs,{className:`w-3.5 h-3.5`}),e(`aiBot.urlExport`)]})]}),children:[pt.length>=a7&&(0,X.jsxs)(`div`,{className:`flex items-start gap-2 rounded-[8px] bg-bg-subtle px-3 py-2.5`,children:[(0,X.jsx)(nc,{className:`w-4 h-4 text-text-secondary shrink-0 mt-0.5`}),(0,X.jsx)(`p`,{className:`text-[13px] text-text-secondary leading-snug`,children:e(`aiBot.urlLimitReached`,{max:a7})})]}),ut?.data_status===`failed`&&ut.failure_reason&&(0,X.jsxs)(`div`,{className:`flex items-start gap-2 rounded-[8px] bg-danger/10 px-3 py-2.5`,children:[(0,X.jsx)(zs,{className:`w-4 h-4 text-danger shrink-0 mt-0.5`}),(0,X.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,X.jsx)(`p`,{className:`text-[13px] font-medium text-danger leading-snug`,children:e(`aiBot.crawlFailed_${ut.failure_reason}`)}),(0,X.jsx)(`p`,{className:`text-[13px] text-danger/80 leading-snug`,children:e(`aiBot.crawlFailed_${ut.failure_reason}Desc`)})]})]}),ut?.data_status===`failed`&&!ut.failure_reason&&ut.error_message&&(0,X.jsxs)(`div`,{className:`flex items-start gap-2 rounded-[8px] bg-danger/10 px-3 py-2.5`,children:[(0,X.jsx)(zs,{className:`w-4 h-4 text-danger shrink-0 mt-0.5`}),(0,X.jsx)(`p`,{className:`text-[13px] text-danger leading-snug`,children:e(`aiBot.crawlFailedGeneric`,{message:ut.error_message})})]}),ut?.data_status===`completed`&&(ut.last_run_stats?.blocked??0)>0&&(0,X.jsxs)(`div`,{className:`flex items-start gap-2 rounded-[8px] bg-warning/10 px-3 py-2.5`,children:[(0,X.jsx)(jc,{className:`w-4 h-4 text-warning shrink-0 mt-0.5`}),(0,X.jsx)(`p`,{className:`text-[13px] text-warning leading-snug`,children:e(`aiBot.crawlPartialBlocked`,{blocked:ut.last_run_stats.blocked,discovered:ut.last_run_stats.discovered})})]}),(0,X.jsx)(`div`,{className:`flex rounded-[8px] border border-border overflow-hidden`,children:[`crawl`,`manual`].map(t=>(0,X.jsx)(`button`,{onClick:()=>Rt(t),className:K(`flex-1 h-9 text-[14px] transition-colors cursor-pointer`,t===`manual`&&`border-l border-border`,Lt===t?`bg-brand-tint text-brand font-medium`:`text-text-secondary hover:bg-bg-subtle`),children:e(t===`crawl`?`aiBot.urlModeCrawl`:`aiBot.urlModeManual`)},t))}),Lt===`crawl`&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`flex gap-2`,children:[(0,X.jsx)(`input`,{className:K(u7,`flex-1`),value:Nt,onChange:e=>Pt(e.target.value),placeholder:e(`aiBot.urlInputPlaceholder`),disabled:Xt,onKeyDown:e=>e.key===`Enter`&&!Xt&&er()}),Xt?(0,X.jsx)(Z,{variant:`secondary`,size:`md`,onClick:$n,className:`shrink-0`,children:e(`aiBot.urlStopBtn`)}
74):(0,X.jsx)(Z,{size:`md`,onClick:er,disabled:!Nt.trim(),className:`shrink-0`,children:e(`aiBot.urlCrawlBtn`)})]}),Xt&&(0,X.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between text-[13px] text-text-secondary`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,X.jsx)(sc,{className:`w-3.5 h-3.5 animate-spin shrink-0`}),(0,X.jsxs)(`span`,{children:[e(`aiBot.urlModeCrawl`),`...`]})]}),Qt.length>0&&(0,X.jsx)(`span`,{className:`tabular-nums`,children:e(`aiBot.urlCrawlFound`,{count:Qt.length})})]}),en>0&&(0,X.jsx)(`div`,{className:`h-1 rounded-full bg-border overflow-hidden`,children:(0,X.jsx)(`div`,{className:`h-full bg-brand transition-all duration-300`,style:{width:`${en}%`}})})]}),!Xt&&Qt.length>0&&(0,X.jsxs)(`div`,{className:`flex items-center justify-between rounded-[8px] border border-border bg-bg-subtle px-3 py-2`,children:[(0,X.jsx)(`span`,{className:`text-[13px] text-text-secondary`,children:e(`aiBot.urlCrawlFound`,{count:Qt.length})}),(0,X.jsx)(Z,{size:`sm`,onClick:tr,disabled:pt.length>=a7,children:e(`aiBot.urlAddCrawled`,{count:Math.min(Qt.length,a7-pt.length)})})]})]}),Lt===`manual`&&(0,X.jsxs)(`div`,{className:`flex gap-2`,children:[(0,X.jsx)(`input`,{className:K(u7,`flex-1`),value:Ft,autoFocus:!0,onChange:e=>It(e.target.value),placeholder:e(`aiBot.urlManualPlaceholder`),onKeyDown:e=>e.key===`Enter`&&Xn()}),(0,X.jsxs)(Z,{variant:`secondary`,size:`md`,onClick:Xn,disabled:!Ft.trim(),className:`shrink-0 gap-1.5`,children:[(0,X.jsx)(xc,{className:`w-4 h-4`}),e(`aiBot.urlAddManual`)]})]}),(0,X.jsx)(`div`,{className:`flex items-center justify-between pt-1`,children:zt?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsxs)(`button`,{type:`button`,role:`checkbox`,"aria-checked":pt.length>0&&Vt.size===pt.length?!0:Vt.size>0?`mixed`:!1,onClick:sr,className:K(`w-4 h-4 rounded-[4px] border flex items-center justify-center shrink-0 transition-colors cursor-pointer`,Vt.size>0?`bg-brand border-brand`:`border-border bg-bg-card hover:border-border-strong`),children:[Vt.size===pt.length&&pt.length>0&&(0,X.jsx)(Fs,{className:`w-2.5 h-2.5 text-white`,strokeWidth:3}),Vt.size>0&&Vt.size<pt.length&&(0,X.jsx)(mc,{className:`w-2.5 h-2.5 text-white`,strokeWidth:3})]}),(0,X.jsx)(`span`,{className:`text-[13px] font-medium text-text-secondary`,children:e(`aiBot.selectAll`)})]}),(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(Z,{variant:`danger`,size:`sm`,disabled:Vt.size===0,onClick:ir,children:e(`aiBot.deleteSelected`,{count:Vt.size})}),(0,X.jsx)(Z,{variant:`ghost`,size:`sm`,onClick:()=>{Bt(!1),Ht(new Set)},children:e(`aiBot.cancelSelect`)})]})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,X.jsx)(`p`,{className:`text-[13px] font-medium text-text-secondary`,children:e(`aiBot.urlListTitle`)}),(0,X.jsxs)(`p`,{className:`text-[13px] text-text-secondary/60 tabular-nums`,children:[`(`,e(`aiBot.urlCount`,{count:pt.length,max:a7}),`)`]})]}),pt.length>0&&(0,X.jsx)(Z,{variant:`ghost`,size:`sm`,onClick:()=>Bt(!0),children:e(`aiBot.selectMode`)})]})}),Ar.length===0?(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary py-4 text-center`,children:e(`aiBot.noUrls`)}):(0,X.jsx)(`div`,{className:`border border-border rounded-[8px] overflow-hidden`,children:Ar.map(({group:t,items:n})=>{let r=t??`__invalid__`,i=!sn.has(r),a=t===null;return(0,X.jsxs)(`div`,{className:`border-b border-border last:border-0`,children:[(0,X.jsxs)(`div`,{className:`group/hdr flex items-center justify-between px-4 py-2.5 cursor-pointer bg-bg-muted hover:bg-bg-subtle transition-colors`,style:a?{backgroundColor:`rgba(235,87,87,0.05)`}:void 0,onClick:()=>kr(r),children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0 flex-1 mr-2`,children:[zt&&(()=>{let e=n.every(e=>Vt.has(e.id)),t=!e&&n.some(e=>Vt.has(e.id));return(0,X.jsxs)(`button`,{type:`button`,role:`checkbox`,"aria-checked":t?`mixed`:e,onClick:e=>{e.stopPropagation(),or(n)},className:K(`w-4 h-4 rounded-[4px] border flex items-center justify-center shrink-0 transition-colors cursor-pointer`,e||t?`bg-brand border-brand`:`border-border bg-bg-card hover:border-border-strong`),children:[e&&(0,X.jsx)(Fs,{className:`w-2.5 h-2.5 text-white`,strokeWidth:3}),t&&(0,X.jsx)(mc,{className:`w-2.5 h-2.5 text-white`,strokeWidth:3})]})})(),i?(0,X.jsx)(Is,{className:`w-4 h-4 text-text-secondary shrink-0`}):(0,X.jsx)(Rs,{className:`w-4 h-4 text-text-secondary shrink-0`}),a?(0,X.jsx)(zs,{className:`w-3.5 h-3.5 text-danger shrink-0`}):null,(0,X.jsx)(`span`,{className:K(`text-[13px] font-semibold truncate min-w-0`,a?`text-danger`:`text-text-secondary`),children:a?e(`aiBot.urlInvalidLabel`):t}),(0,X.jsxs)(`span`,{className:`text-[12px] text-text-tertiary shrink-0`,children:[`(`,n.length,`)`]})]}),!zt&&(0,X.jsx)(tE,{content:e(`aiBot.removeGroup`),children:(0,X.jsx)(`button`,{onClick:e=>{e.stopPropagation(),rr(t)},className:`shrink-0 p-1 text-text-secondary hover:text-danger transition-colors cursor-pointer md:opacity-0 md:group-hover/hdr:opacity-100`,children:(0,X.jsx)(Ic,{className:`w-3.5 h-3.5`})})})]}),i&&n.map(e=>(0,X.jsxs)(`div`,{className:`group/item flex items-center justify-between pl-10 pr-4 py-2 border-t border-border/50 bg-bg-card min-w-0`,children:[zt&&(0,X.jsx)(`button`,{type:`button`,role:`checkbox`,"aria-checked":Vt.has(e.id),onClick:()=>ar(e.id),className:K(`w-4 h-4 rounded-[4px] border flex items-center justify-center shrink-0 transition-colors cursor-pointer mr-2`,Vt.has(e.id)?`bg-brand border-brand`:`border-border bg-bg-card hover:border-border-strong`),children:Vt.has(e.id)&&(0,X.jsx)(Fs,{className:`w-2.5 h-2.5 text-white`,strokeWidth:3})}),(0,X.jsx)(`span`,{className:K(`text-[14px] truncate flex-1 min-w-0 mr-3`,e.valid?`text-text-primary`:`text-danger`),children:e.url}),!zt&&(0,X.jsx)(`button`,{onClick:()=>nr(e.id),className:`shrink-0 p-1 text-text-secondary hover:text-danger transition-colors cursor-pointer md:opacity-0 md:group-hover/item:opacity-100`,children:(0,X.jsx)(Ic,{className:`w-3.5 h-3.5`})})]},e.id))]},r)})})]})}),(0,X.jsx)(`div`,{className:M||R!==`files`?`hidden`:``,children:(0,X.jsxs)(h7,{title:e(`aiBot.sectionFiles`),children:[(0,X.jsx)(`input`,{ref:yn,type:`file`,accept:Hne,multiple:!0,className:`hidden`,onChange:lr}),(0,X.jsxs)(`button`,{"aria-disabled":At,onClick:()=>{At||yn.current?.click()},onDragOver:e=>{e.preventDefault(),At||St(!0)},onDragEnter:e=>{e.preventDefault(),At||St(!0)},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||St(!1)},onDrop:ur,className:K(`w-full flex flex-col items-center justify-center gap-2 py-6 rounded-[8px] border-2 transition-colors`,At?`border-solid border-border bg-bg-subtle text-text-tertiary opacity-70 cursor-not-allowed`:K(`border-dashed cursor-pointer`,xt?`border-brand bg-bg-subtle text-brand`:`border-border bg-bg-muted text-text-secondary`)),children:[At?(0,X.jsx)(ks,{className:`w-4 h-4`}):(0,X.jsx)(Mc,{className:`w-4 h-4`}),(0,X.jsx)(`span`,{className:`text-[14px]`,children:e(At?`aiBot.fileLimitReached`:`aiBot.fileUploadBtn`)}),(0,X.jsx)(`span`,{className:`text-[12px]`,children:e(At?`aiBot.fileLimitReachedHint`:`aiBot.fileUploadHint`)}),Gne]}),(0,X.jsx)(One,{files:Ot,stagedFiles:_t,downloadingIds:yt,page:Tt,totalPages:Dt,onPageChange:Et,onDownload:pr,onRemove:fr,onRemoveStaged:dr})]})}),(0,X.jsx)(`div`,{className:M||R!==`qa`?`hidden`:``,children:(0,X.jsxs)(h7,{title:e(`aiBot.sectionQA`),action:ht.length>0||Ct.length>0?(0,X.jsx)(`button`,{onClick:gr,className:`text-[13px] text-text-secondary hover:text-danger transition-colors cursor-pointer`,children:e(`aiBot.qaClearAll`)}):void 0,children:[ft?.data_status===`failed`&&(0,X.jsxs)(`div`,{className:`flex items-start gap-2 rounded-[8px] bg-danger/10 px-3 py-2.5`,children:[(0,X.jsx)(zs,{className:`w-4 h-4 text-danger shrink-0 mt-0.5`}),(0,X.jsx)(`p`,{className:`text-[13px] text-danger leading-snug`,children:ft.error_message||e(`aiBot.trainFailedSub`)})]}),(0,X.jsxs)(`div`,{className:`border border-border rounded-[8px] p-4 space-y-3`,children:[(0,X.jsx)(`input`,{className:u7,value:ln,onChange:e=>un(e.target.value),placeholder:e(`aiBot.qaQuestionPlaceholder`)}),(0,X.jsx)(`textarea`,{className:K(u7,`h-auto py-2 resize-y`),rows:3,value:dn,onChange:e=>fn(e.target.value),placeholder:e(`aiBot.qaAnswerPlaceholder`)}),(0,X.jsxs)(Z,{variant:`secondary`,size:`sm`,onClick:mr,disabled:!ln.trim()||!dn.trim(),className:`gap-1.5 disabled:opacity-40`,children:[(0,X.jsx)(xc,{className:`w-3.5 h-3.5`}),e(`aiBot.qaAddBtn`)]})]}),(ht.length>0||Ct.length>0)&&(0,X.jsx)(`div`,{className:`space-y-2`,children:[...ht,...Ct].map(t=>(0,X.jsx)(`div`,{className:`card p-4`,children:pn===t.id?(0,X.jsxs)(`div`,{className:`space-y-3`,children:[(0,X.jsx)(`input`,{className:u7,value:hn,onChange:e=>gn(e.target.value),placeholder:e(`aiBot.qaQuestionPlaceholder`)}),(0,X.jsx)(`textarea`,{className:K(u7,`h-auto py-2 resize-y`),rows:3,value:_n,onChange:e=>vn(e.target.value),placeholder:e(`aiBot.qaAnswerPlaceholder`)}),(0,X.jsxs)(`div`,{className:`flex gap-2`,children:[(0,X.jsx)(Z,{variant:`secondary`,size:`sm`,onClick:vr,disabled:!hn.trim()||!_n.trim(),children:n(`save`)}),(0,X.jsx)(Z,{variant:`ghost`,size:`sm`,onClick:()=>mn(null),children:n(`cancel`)})]})]}):(0,X.jsxs)(`div`,{className:`flex justify-between items-start gap-3`,children:[(0,X.jsxs)(`div`,{className:`flex-1 min-w-0 space-y-1`,children:[(0,X.jsxs)(`p`,{className:`text-[14px] font-medium text-text-primary`,children:[(0,X.jsx)(`span`,{className:`text-text-secondary mr-1`,children:`Q:`}),t.question]}),(0,X.jsxs)(`p`,{className:`text-[14px] text-text-secondary`,children:[(0,X.jsx)(`span`,{className:`mr-1`,children:`A:`}),t.answer]})]}),(0,X.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(t.id.startsWith(`staged-qa-`)||ft!=null&&ft.index_status!==`completed`)&&(0,X.jsx)(`span`,{className:`text-[11px] font-medium px-1.5 py-0.5 rounded-[4px] bg-brand-tint text-brand`,children:e(`aiBot.fileStagedLabel`)}),(0,X.jsx)(`button`,{onClick:()=>_r(t),className:`p-1 text-text-secondary hover:text-text-primary transition-colors cursor-pointer`,children:(0,X.jsx)(vc,{className:`w-3.5 h-3.5`})}),(0,X.jsx)(`button`,{onClick:()=>hr(t.id),className:`p-1 text-text-secondary hover:text-danger transition-colors cursor-pointer`,children:(0,X.jsx)(kc,{className:`w-3.5 h-3.5`})})]})]})},t.id))})]})})]}),(0,X.jsxs)(`div`,{className:`w-full md:w-56 md:shrink-0 order-2 md:order-3`,children:[M&&(0,X.jsx)(ere,{}),(0,X.jsxs)(`div`,{className:K(`card p-5 space-y-4`,M&&`hidden`),children:[(0,X.jsx)(`h3`,{className:`text-[17px] font-semibold text-text-primary`,children:e(`aiBot.tabSummary`)}),(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsxs)(`div`,{className:`flex justify-between text-[14px]`,children:[(0,X.jsx)(`span`,{className:`text-text-secondary`,children:e(`aiBot.sectionUrls`)}),(0,X.jsx)(`span`,{className:`font-medium text-text-primary tabular-nums`,children:pt.length})]}),(0,X.jsxs)(`div`,{className:`flex justify-between text-[14px]`,children:[(0,X.jsx)(`span`,{className:`text-text-secondary`,children:e(`aiBot.sectionFiles`)}),(0,X.jsx)(`span`,{className:`font-medium text-text-primary tabular-nums`,children:mt.length+_t.length})]}),(0,X.jsxs)(`div`,{className:`flex justify-between text-[14px]`,children:[(0,X.jsx)(`span`,{className:`text-text-secondary`,children:e(`aiBot.sectionQA`)}),(0,X.jsx)(`span`,{className:`font-medium text-text-primary tabular-nums`,children:ht.length+Ct.length})]})]}),Er&&(0,X.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,X.jsx)(`p`,{className:`text-[12px] text-text-secondary tabular-nums`,children:e(`aiBot.trainUploading`,{percent:Jt})}),(0,X.jsx)(`div`,{className:`w-full h-1.5 rounded-full bg-bg-subtle overflow-hidden`,children:(0,X.jsx)(`div`,{className:`h-full bg-brand rounded-full transition-[width] duration-100`,style:{width:`${Jt}%`}})})]}),zn===`training`&&(0,X.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,X.jsx)(`p`,{className:`text-[12px] text-text-secondary tabular-nums`,children:e(`aiBot.trainProgressLabel`,{percent:Vn})}),(0,X.jsx)(`div`,{className:`w-full h-1.5 rounded-full bg-bg-subtle overflow-hidden`,children:(0,X.jsx)(`div`,{className:`h-full bg-brand rounded-full transition-[width] duration-100`,style:{width:`${Vn}%`}})})]}),(0,X.jsxs)(`div`,{className:`pt-2 border-t border-border`,children:[(0,X.jsx)(`p`,{className:`text-[12px] text-text-secondary`,children:e(`aiBot.summaryLastTrained`)}),(0,X.jsx)(`p`,{className:`text-[13px] text-text-primary mt-0.5`,children:Ln?yr(new Date(Ln)):e(`aiBot.summaryNeverTrained`)})]}),(0,X.jsx)(Z,{loading:Er||L.loading||zn!==`idle`,disabled:Er||L.loading||zn!==`idle`||jt,onClick:()=>Mt?Mn(!0):Sr(),className:`w-full gap-2 disabled:opacity-60`,children:Er?e(`aiBot.trainUploadingBtn`):L.loading||zn===`preparing`?e(`aiBot.trainPreparing`):e(zn===`training`?`aiBot.trainingBtn`:Mt?`aiBot.rebuildBtn`:`aiBot.trainBtn`)})]})]})]}),(0,X.jsx)(GS,{open:qe,onClose:()=>Je(!1),title:e(`aiBot.deleteTitle`),children:(0,X.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary`,children:e(`aiBot.deleteDesc`)}),(0,X.jsx)(`p`,{className:`text-[14px] text-text-primary`,children:e(`aiBot.deleteConfirmPrompt`)}
74),(0,X.jsx)(`input`,{className:u7,value:Ze,onChange:e=>Qe(e.target.value),placeholder:ie,autoFocus:!0}),(0,X.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,X.jsx)(Z,{variant:`secondary`,onClick:()=>Je(!1),children:e(`aiBot.deleteCancel`)}),(0,X.jsx)(Z,{variant:`danger`,loading:w.loading,disabled:Ze!==ie,className:`disabled:opacity-40`,onClick:Or,children:e(`aiBot.deleteConfirmButton`)})]})]})}),(0,X.jsx)(GS,{open:jn,onClose:()=>Mn(!1),title:e(`aiBot.rebuildTitle`),children:(0,X.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-2 text-[14px] text-text-secondary`,children:[(0,X.jsx)(`p`,{children:e(`aiBot.rebuildDesc`)}),(0,X.jsxs)(`ul`,{className:`list-disc pl-5 space-y-1`,children:[(0,X.jsx)(`li`,{children:e(`aiBot.rebuildStepClear`)}),(0,X.jsx)(`li`,{children:e(`aiBot.rebuildStepRecrawl`)}),(0,X.jsx)(`li`,{children:e(`aiBot.rebuildStepEmbed`)})]}),(0,X.jsx)(`p`,{children:e(`aiBot.rebuildNote`)})]}),(0,X.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,X.jsx)(Z,{variant:`secondary`,onClick:()=>Mn(!1),children:e(`aiBot.deleteCancel`)}),(0,X.jsx)(Z,{loading:Er||L.loading,disabled:Er||L.loading,onClick:()=>{Mn(!1),Sr()},children:e(`aiBot.rebuildBtn`)})]})]})}),(0,X.jsx)(GS,{open:Fe,onClose:()=>Ie(!1),title:e(`aiBot.analysisLanguageConfirmTitle`),children:(0,X.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-2 text-[14px] text-text-secondary`,children:[(0,X.jsx)(`p`,{children:e(`aiBot.analysisLanguageConfirmDesc`)}),(0,X.jsxs)(`ul`,{className:`list-disc pl-5 space-y-1`,children:[(0,X.jsx)(`li`,{children:e(`aiBot.analysisLanguageConfirmKeepsExisting`)}),(0,X.jsx)(`li`,{children:e(`aiBot.analysisLanguageConfirmAppliesToNew`)})]})]}),(0,X.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,X.jsx)(Z,{variant:`secondary`,onClick:()=>Ie(!1),children:e(`aiBot.deleteCancel`)}),(0,X.jsx)(Z,{loading:C.loading||T.loading,disabled:C.loading||T.loading,onClick:()=>{Ie(!1),Jn()},children:e(`aiBot.analysisLanguageConfirmBtn`)})]})]})}),(0,X.jsxs)(GS,{open:Dr.state===`blocked`,onClose:()=>Dr.reset?.(),title:e(`aiBot.uploadLeaveTitle`),children:[(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary mb-5`,children:e(`aiBot.uploadLeaveBody`)}),(0,X.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,X.jsx)(Z,{variant:`secondary`,onClick:()=>Dr.reset?.(),children:e(`aiBot.uploadLeaveCancel`)}),(0,X.jsx)(Z,{variant:`danger`,onClick:()=>Dr.proceed?.(),children:e(`aiBot.uploadLeaveConfirm`)})]})]}),(0,X.jsx)(GS,{open:Ye,onClose:()=>Xe(!1),title:e(`aiBot.emptyKnowledgeTitle`),children:(0,X.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary`,children:e(`aiBot.emptyKnowledgeDesc`)}),(0,X.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,X.jsx)(Z,{variant:`secondary`,onClick:()=>Xe(!1),children:e(`aiBot.emptyKnowledgeKeep`)}),(0,X.jsx)(Z,{variant:`danger`,onClick:()=>{Gn(!1),Xe(!1)},children:e(`aiBot.emptyKnowledgeDisable`)})]})]})})]})}function $ne(){return(0,X.jsx)(`div`,{className:`space-y-4`,children:[3,2,2].map((e,t)=>(0,X.jsxs)(`div`,{className:`card p-5 space-y-4`,children:[(0,X.jsx)(rD,{className:`h-4 w-32`}),Array.from({length:e}).map((e,t)=>(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(rD,{className:`h-3.5 w-24`}),(0,X.jsx)(rD,{className:`h-10 w-full`})]},t))]},t))})}function ere(){return(0,X.jsxs)(`div`,{className:`card p-5 space-y-4`,children:[(0,X.jsx)(rD,{className:`h-4 w-28`}),(0,X.jsx)(`div`,{className:`space-y-2`,children:Array.from({length:3}).map((e,t)=>(0,X.jsxs)(`div`,{className:`flex justify-between gap-3`,children:[(0,X.jsx)(rD,{className:`h-3.5 w-16`}),(0,X.jsx)(rD,{className:`h-3.5 w-6`})]},t))}),(0,X.jsx)(rD,{className:`h-10 w-full`})]})}function h7({title:e,subtitle:t,children:n,action:r}){return(0,X.jsxs)(`div`,{className:`card p-5 space-y-4`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-3 flex-wrap`,children:[(0,X.jsx)(`h3`,{className:`text-[17px] font-semibold text-text-primary`,children:e}),r]}),t&&(0,X.jsx)(`p`,{className:`text-[13px] text-text-secondary mt-1`,children:t})]}),n]})}function g7({label:e,hint:t,children:n}){return(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,X.jsx)(`label`,{className:`text-[14px] font-medium text-text-primary`,children:e}),t&&(0,X.jsx)(tE,{content:t})]}),n]})}function tre({checked:e,onChange:t,disabled:n}){return(0,X.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":e,disabled:n,onClick:()=>t(!e),className:K(`relative w-10 h-[22px] rounded-full transition-colors duration-200 shrink-0 overflow-hidden`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1`,n?`cursor-not-allowed opacity-50`:`cursor-pointer`,e?`bg-brand`:`bg-border-strong`),children:(0,X.jsx)(`span`,{className:K(`absolute top-[3px] w-4 h-4 rounded-full bg-white shadow-sm transition-[left] duration-200`,e?`left-[21px]`:`left-[3px]`)})})}function _7({label:e,checked:t,onChange:n,disabled:r}){return(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,X.jsx)(`p`,{className:K(`text-[15px] font-medium`,r?`text-text-secondary`:`text-text-primary`),children:e}),(0,X.jsx)(tre,{checked:t,onChange:n,disabled:r})]})}function v7(){let{t:e}=V(`workspace`);return(0,X.jsxs)(`div`,{className:`mb-5 flex items-start gap-2 rounded-[8px] border border-border bg-bg-subtle px-3 py-2.5`,children:[(0,X.jsx)(nc,{className:`w-4 h-4 shrink-0 mt-0.5 text-text-secondary`}),(0,X.jsx)(`p`,{className:`text-[13px] text-text-secondary`,children:e(`survey.channelNote`)})]})}function nre(e){return{id:String(e.survey.id),name:e.survey.name,active:e.survey.is_use,questionCount:e.surveyFlow?.length??0,updatedAt:e.survey.updatedAt}}function rre({checked:e,onChange:t,disabled:n}){return(0,X.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":e,disabled:n,onClick:()=>t(!e),className:K(`relative w-10 h-[22px] rounded-full transition-colors duration-200 cursor-pointer shrink-0 overflow-hidden`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1`,e?`bg-brand`:`bg-border-strong`,n&&`opacity-50 cursor-default`),children:(0,X.jsx)(`span`,{className:K(`absolute top-[3px] w-4 h-4 rounded-full bg-white shadow-sm transition-[left] duration-200`,e?`left-[21px]`:`left-[3px]`)})})}function ire({onEdit:e,onCopy:t,onDelete:n}){let{t:r}=V(`workspace`),[i,a]=(0,f.useState)(!1),o=(0,f.useRef)(null);return(0,f.useEffect)(()=>
74{if(!i)return;let e=e=>{o.current&&!o.current.contains(e.target)&&a(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[i]),(0,X.jsxs)(`div`,{className:`relative`,ref:o,children:[(0,X.jsx)(`button`,{onClick:()=>a(e=>!e),className:`w-8 h-8 flex items-center justify-center rounded-[8px] text-text-secondary hover:bg-bg-subtle hover:text-text-primary transition-all cursor-pointer`,children:(0,X.jsx)(Js,{className:`w-4 h-4`})}),i&&(0,X.jsxs)(`div`,{className:`absolute right-0 top-9 w-36 card p-1 z-20`,style:{boxShadow:`var(--shadow-3)`},children:[(0,X.jsxs)(`button`,{onClick:()=>{a(!1),e()},className:`w-full flex items-center gap-2.5 px-3 h-9 rounded-[8px] text-[14px] text-text-primary hover:bg-bg-subtle transition-colors cursor-pointer text-left`,children:[(0,X.jsx)(vc,{className:`w-3.5 h-3.5 text-text-secondary shrink-0`}),r(`survey.menuEdit`)]}),(0,X.jsxs)(`button`,{onClick:()=>{a(!1),t()},className:`w-full flex items-center gap-2.5 px-3 h-9 rounded-[8px] text-[14px] text-text-primary hover:bg-bg-subtle transition-colors cursor-pointer text-left`,children:[(0,X.jsx)(Gs,{className:`w-3.5 h-3.5 text-text-secondary shrink-0`}),r(`survey.menuCopy`)]}),(0,X.jsx)(`div`,{className:`my-1 border-t border-border`}),(0,X.jsxs)(`button`,{onClick:()=>{a(!1),n()},className:`w-full flex items-center gap-2.5 px-3 h-9 rounded-[8px] text-[14px] text-danger hover:bg-danger/5 transition-colors cursor-pointer text-left`,children:[(0,X.jsx)(kc,{className:`w-3.5 h-3.5 shrink-0`}),r(`survey.menuDelete`)]})]})]})}function are(){let{t:e,i18n:t}=V(`workspace`),{t:n}=V(`common`),{linkName:r}=$T();cE(r?`${r} â ${e(`survey.pageTitle`)}`:e(`survey.pageTitle`));let{linkId:i}=pa(),a=la(),{logAnalyticsEvent:o}=BS(),{data:s,loading:c,error:l,refetch:u}=ef(i),d=af(),p=rf(),m=nf(),[h,g]=(0,f.useState)(null),_=(s??[]).map(nre),v=`/dashboard/workspace/${i}/settings/automation`,y=e=>e?`/dashboard/workspace/${i}/settings/automation/survey/${e}/edit`:`/dashboard/workspace/${i}/settings/automation/survey/new`,b=e=>e?new Intl.DateTimeFormat(t.language,{year:`numeric`,month:`numeric`,day:`numeric`,hour:`2-digit`,minute:`2-digit`}).format(new Date(e)):`â`,x=async t=>{if(!i||t.active)return;let n=_.find(e=>e.active);try{await d.mutate({id:Number(t.id),token:i}),await u(),n&&Q.success(e(`survey.toggleToast`,{off:n.name,on:t.name}))}catch{Q.error(e(`survey.toggleFailed`))}},S=async t=>{if(i)try{await p.mutate({id:Number(t.id),token:i}),await u(),Q.success(e(`survey.copySuccess`,{name:t.name}))}catch{Q.error(e(`survey.copyFailed`))}};return c&&!s?(0,X.jsx)(`div`,{className:`card p-6 text-center text-text-secondary text-[14px]`,children:n(`loading`)}):l&&!s?(0,X.jsxs)(`div`,{className:`card p-6 flex flex-col items-center gap-3`,children:[(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary`,children:n(`loadFailed`)}),(0,X.jsx)(Z,{variant:`secondary`,size:`md`,onClick:()=>void u(),children:n(`retry`)})]}):(0,X.jsxs)(`div`,{children:[(0,X.jsxs)(`button`,{onClick:()=>a(v),className:`flex items-center gap-1.5 text-[14px] text-text-secondary hover:text-text-primary mb-5 cursor-pointer transition-colors`,children:[(0,X.jsx)(Ds,{className:`w-4 h-4`}),e(`survey.backToList`)]}),(0,X.jsxs)(`div`,{className:`flex items-center justify-between mb-5`,children:[(0,X.jsx)(`h2`,{className:`text-[28px] font-semibold text-text-primary tracking-[-0.3px]`,children:e(`survey.title`)}),(0,X.jsxs)(Z,{onClick:()=>{o(`survey_add_click`,{element_id:i}),a(y())},className:`gap-2`,children:[(0,X.jsx)(xc,{className:`w-4 h-4`}),e(`survey.createBtn`)]})]}),(0,X.jsx)(v7,{}),_.length===0&&(0,X.jsxs)(`div`,{className:`card p-12 flex flex-col items-center text-center gap-4`,children:[(0,X.jsx)(`div`,{className:`w-12 h-12 rounded-full bg-bg-subtle flex items-center justify-center`,children:(0,X.jsx)(Us,{className:`w-6 h-6 text-text-secondary`})}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`p`,{className:`text-[15px] font-medium text-text-primary mb-1`,children:e(`survey.emptyTitle`)}),(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary`,children:e(`survey.emptyDesc`)})]}),(0,X.jsxs)(Z,{onClick:()=>{o(`survey_add_click`,{element_id:i}),a(y())},className:`gap-2 mt-1`,children:[(0,X.jsx)(xc,{className:`w-4 h-4`}),e(`survey.createBtn`)]})]}),_.length>0&&(0,X.jsx)(`div`,{className:`space-y-3`,children:_.map(t=>(0,X.jsx)(`div`,{className:`card p-5`,children:(0,X.jsxs)(`div`,{className:`flex items-start gap-4`,children:[(0,X.jsx)(`div`,{className:`w-9 h-9 rounded-[8px] bg-brand-tint flex items-center justify-center shrink-0 mt-0.5`,children:(0,X.jsx)(Us,{className:`w-4.5 h-4.5 text-brand`,style:{width:18,height:18}})}),(0,X.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap mb-1`,children:[(0,X.jsx)(`span`,{className:`text-[15px] font-semibold text-text-primary`,children:t.name}),t.active&&(0,X.jsx)(a8,{variant:`success`,children:e(`survey.active`)})]}),(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-0.5 text-[13px] text-text-secondary`,children:[(0,X.jsx)(`span`,{children:e(`survey.questionsCount`,{count:t.questionCount})}),t.updatedAt&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`w-px h-3 bg-border shrink-0`}),(0,X.jsx)(`span`,{children:e(`survey.updatedAt`,{date:b(t.updatedAt)})})]})]})]}),(0,X.jsxs)(`div`,{className:`flex items-center gap-3 shrink-0`,children:[!t.active&&(0,X.jsx)(rre,{checked:!1,onChange:()=>x(t),disabled:d.loading}),(0,X.jsx)(ire,{onEdit:()=>{o(`survey_edit_click`,{link_token:i}),a(y(t.id))},onCopy:()=>{o(`survey_duplicate_click`,{element_id:i}),S(t)},onDelete:()=>{o(`survey_delete_click`,{element_id:i}),g(t)}})]})]})},t.id))}),(0,X.jsx)(GS,{open:!!h,onClose:()=>g(null),title:e(`survey.deleteTitle`),children:(0,X.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary`,children:e(`survey.deleteDesc`,{name:h?.name??``})}),(0,X.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,X.jsx)(Z,{variant:`secondary`,onClick:()=>g(null),disabled:m.loading,children:e(`aiBot.deleteCancel`)}),(0,X.jsx)(Z,{variant:`danger`,onClick:async()=>
74{if(!(!i||!h))try{await m.mutate({id:Number(h.id),token:i}),await u(),Q.success(e(`survey.deleteSuccess`)),g(null)}catch{Q.error(e(`survey.deleteFailed`))}},disabled:m.loading,children:m.loading?n(`loading`):e(`survey.deleteBtn`)})]})]})})]})}var y7=10,ore=10,sre=2,b7=[``,``],cre={single_choice:`choice`,rating:`rating`,text_input:`command`},lre={choice:`single_choice`,rating:`rating`,command:`text_input`},x7=`h-10 w-full rounded-[8px] border border-border bg-bg-card px-3 text-[15px] text-text-primary placeholder:text-text-secondary placeholder:opacity-50 outline-none focus:border-border-strong transition-colors`,ure=`h-10 w-full rounded-[8px] border border-border bg-bg-card px-3 text-[15px] text-text-primary outline-none focus:border-border-strong transition-colors appearance-none cursor-pointer`;function S7({label:e,hint:t,required:n,children:r}){return(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsxs)(`label`,{className:`text-[14px] font-medium text-text-primary`,children:[n&&(0,X.jsx)(`span`,{className:`text-danger mr-0.5`,children:`*`}),e]}),r,t&&(0,X.jsx)(`p`,{className:`text-[13px] text-text-secondary`,children:t})]})}function dre({type:e}){return e===`rating`?(0,X.jsx)(Dc,{className:`w-4 h-4 text-warning shrink-0`}):e===`text_input`?(0,X.jsx)(Oc,{className:`w-4 h-4 text-brand shrink-0`}):(0,X.jsx)(Ec,{className:`w-4 h-4 text-text-secondary shrink-0`})}function C7(){let{t:e}=V(`workspace`),{t}=V(`common`),{linkId:n,surveyId:r}=pa(),i=!!r,{linkName:a}=$T(),o=e(i?`survey.editPageTitle`:`survey.newPageTitle`);cE(a?`${a} â ${o}`:o);let{data:s,loading:c,error:l,refetch:u}=ef(n);if(c&&!s)return(0,X.jsx)(`div`,{className:`card p-6 text-center text-text-secondary text-[14px]`,children:t(`loading`)});if(l&&!s)return(0,X.jsxs)(`div`,{className:`card p-6 flex flex-col items-center gap-3`,children:[(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary`,children:t(`loadFailed`)}),(0,X.jsx)(Z,{variant:`secondary`,size:`md`,onClick:()=>void u(),children:t(`retry`)})]});if(!n)return null;let d=i?s?.find(e=>String(e.survey.id)===r):void 0;return(0,X.jsx)(fre,{linkId:n,existing:d,isEdit:i},d?`${d.survey.id}-${d.surveyFlow.length}`:`new`)}function fre({linkId:e,existing:t,isEdit:n}){let{t:r}=V(`workspace`),{t:i}=V(`common`),a=la(),{logAnalyticsEvent:o}=BS(),[s]=(0,f.useState)(()=>typeof navigator<`u`?navigator.language.toLowerCase():`en`),c=tf(),l=of(),u=sf(),d=af(),p=`/dashboard/workspace/${e}/settings/automation/survey`,[m,h]=(0,f.useState)(t?.survey.name??``),[g,_]=(0,f.useState)(t?.survey.keyword??``),[v,y]=(0,f.useState)(t?.survey.end_message??``),[b,x]=(0,f.useState)(()=>(t?.surveyFlow??[]).map((e,t)=>({id:`srv-${e.id}`,serverId:e.id,type:lre[e.type]??`single_choice`,content:e.setting?.[0]?.text??``,options:(e.setting?.[0]?.actions??[]).map(e=>e.text),_sort:t}))),[S,C]=(0,f.useState)(!1),[w,T]=(0,f.useState)(!1),E=(0,f.useRef)(null),[D,O]=(0,f.useState)(!1),k=()=>{S||C(!0)},A=(0,f.useCallback)(e=>{S?(E.current=e,T(!0)):a(e)},[S,a]),j=()=>{T(!1),E.current&&a(E.current)},M=()=>{b.length>=y7||(x(e=>[...e,{id:Date.now().toString(),type:`single_choice`,content:``,options:[...b7]}]),k())},N=e=>{x(t=>t.filter(t=>t.id!==e)),k()},ee=(e,t)=>{x(n=>n.map(n=>n.id===e?{...n,...t}:n)),k()},P=(e,t)=>ee(e,{type:t,options:t===`single_choice`?[...b7]:[]}),F=e=>ee(e,{options:[...b.find(t=>t.id===e)?.options??[],``]}),I=(e,t,n)=>x(r=>r.map(r=>r.id===e?{...r,options:r.options.map((e,r)=>r===t?n:e)}:r)),te=(e,t)=>x(n=>n.map(n=>n.id===e?{...n,options:n.options.filter((e,n)=>n!==t)}:n)),L=(0,f.useRef)(null),ne=e=>{L.current=e},R=e=>{let t=L.current;t===null||t===e||(x(n=>{let r=[...n],[i]=r.splice(t,1);return r.splice(e,0,i),r}),L.current=null,k())};return(0,X.jsxs)(`div`,{children:[(0,X.jsxs)(`button`,{onClick:()=>A(p),className:`flex items-center gap-1.5 text-[14px] text-text-secondary hover:text-text-primary mb-5 cursor-pointer transition-colors`,children:[(0,X.jsx)(Ds,{className:`w-4 h-4`}),r(`survey.backToList`)]}),(0,X.jsx)(`h2`,{className:`text-[28px] font-semibold text-text-primary tracking-[-0.3px] mb-5`,children:r(n?`survey.formTitleEdit`:`survey.formTitleCreate`)}),(0,X.jsx)(v7,{}),(0,X.jsxs)(`div`,{className:`space-y-4`,children:[(0,X.jsxs)(`div`,{className:`card p-5 space-y-4`,children:[(0,X.jsx)(`h3`,{className:`text-[17px] font-semibold text-text-primary`,children:r(`survey.sectionBasic`)}),(0,X.jsx)(S7,{label:r(`survey.labelName`),required:!0,children:(0,X.jsx)(`input`,{className:x7,value:m,onChange:e=>{h(e.target.value),k()},placeholder:r(`survey.namePlaceholder`),autoFocus:!n})}),(0,X.jsx)(S7,{label:r(`survey.labelKeyword`),hint:r(`survey.keywordHint`),children:(0,X.jsx)(`input`,{className:x7,value:g,onChange:e=>{_(e.target.value),k()},placeholder:r(`survey.keywordPlaceholder`)})}),(0,X.jsx)(S7,{label:r(`survey.labelClosing`),required:!0,children:(0,X.jsx)(`input`,{className:x7,value:v,onCh
74ange:e=>{y(e.target.value),k()},placeholder:r(`survey.closingPlaceholder`)})})]}),(0,X.jsxs)(`div`,{className:`card p-5 space-y-4`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,X.jsx)(`h3`,{className:`text-[17px] font-semibold text-text-primary`,children:r(`survey.labelQuestions`)}),(0,X.jsxs)(`span`,{className:`text-[13px] text-text-secondary tabular-nums`,children:[b.length,` / `,y7]})]}),b.length===0&&(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary text-center py-4`,children:r(`survey.questionLimitHint`,{max:y7})}),(0,X.jsx)(`div`,{className:`space-y-3`,children:b.map((e,t)=>(0,X.jsxs)(`div`,{draggable:!0,onDragStart:()=>ne(t),onDragOver:e=>e.preventDefault(),onDrop:()=>R(t),className:`border border-border rounded-[8px] p-4 space-y-3 bg-bg-card`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(ec,{className:`w-4 h-4 text-border-strong cursor-grab active:cursor-grabbing shrink-0`}),(0,X.jsxs)(`span`,{className:`text-[13px] font-medium text-text-secondary shrink-0 w-6 tabular-nums`,children:[t+1,`.`]}),(0,X.jsxs)(`div`,{className:`relative flex-1 max-w-[180px]`,children:[(0,X.jsx)(`div`,{className:`absolute left-2.5 top-1/2 -translate-y-1/2 pointer-events-none`,children:(0,X.jsx)(dre,{type:e.type})}),(0,X.jsxs)(`select`,{className:K(ure,`pl-8 pr-7`),value:e.type,onChange:t=>P(e.id,t.target.value),children:[(0,X.jsx)(`option`,{value:`single_choice`,children:r(`survey.typeSingleChoice`)}),(0,X.jsx)(`option`,{value:`rating`,children:r(`survey.typeRating`)}),(0,X.jsx)(`option`,{value:`text_input`,children:r(`survey.typeTextInput`)})]}),(0,X.jsx)(Is,{className:`absolute right-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-text-secondary pointer-events-none`})]}),(0,X.jsx)(`div`,{className:`flex-1`}),(0,X.jsx)(`button`,{onClick:()=>N(e.id),className:`p-1 text-text-secondary hover:text-danger transition-colors cursor-pointer`,children:(0,X.jsx)(kc,{className:`w-3.5 h-3.5`})})]}),(0,X.jsx)(`input`,{className:x7,value:e.content,onChange:t=>ee(e.id,{content:t.target.value}),placeholder:r(`survey.questionPlaceholder`)}),e.type===`single_choice`&&(0,X.jsxs)(`div`,{className:`space-y-2 pl-2`,children:[e.options.map((t,n)=>(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(`div`,{className:`w-3.5 h-3.5 rounded-full border-2 border-border shrink-0`}),(0,X.jsx)(`input`,{className:K(x7,`flex-1`),value:t,onChange:t=>I(e.id,n,t.target.value),placeholder:r(`survey.optionPlaceholder`,{n:n+1})}),e.options.length>sre&&(0,X.jsx)(`button`,{onClick:()=>te(e.id,n),className:`p-1 text-text-secondary hover:text-danger transition-colors cursor-pointer shrink-0`,children:(0,X.jsx)(Ic,{className:`w-3.5 h-3.5`})})]},n)),e.options.length<ore&&(0,X.jsxs)(`button`,{onClick:()=>F(e.id),className:`flex items-center gap-1.5 text-[13px] text-brand hover:text-brand/80 transition-colors cursor-pointer pl-5`,children:[(0,X.jsx)(xc,{className:`w-3.5 h-3.5`}),r(`survey.addOption`)]})]})]},e.id))}),b.length<y7&&(0,X.jsxs)(`button`,{onClick:M,className:`w-full flex items-center justify-center gap-2 h-10 rounded-[8px] border border-dashed border-border text-[14px] text-text-secondary hover:bg-bg-subtle hover:text-text-primary hover:border-border-strong transition-colors cursor-pointer`,children:[(0,X.jsx)(xc,{className:`w-4 h-4`}),r(`survey.addQuestion`)]}),b.length>=y7&&(0,X.jsx)(`p`,{className:`text-[13px] text-text-secondary text-center`,children:r(`survey.questionLimitHint`,{max:y7})})]}),(0,X.jsx)(`div`,{className:`flex justify-end`,children:(0,X.jsx)(Z,{onClick:async()=>{if(o(`save_changes_click`,{element_id:e,feature_name:`survey`}),!(!m.trim()||!v.trim()||D)){O(!0);try{let n=await c.mutate({name:m,is_open:t?.survey.is_open??!1,keyword:g,end_message:v,token:e,...t?.survey.id?{id:t.survey.id}:{}}),i=new Set((t?.surveyFlow??[]).map(e=>e.id)),o=new Set(b.filter(e=>e.serverId).map(e=>e.serverId)),f=[...i].filter(e=>!o.has(e));await Promise.allSettled(f.map(t=>u.mutate({id:t,token:e})));for(let t=0;t<b.length;t++){let r=b[t],i=r.type===`single_choice`?r.options.map(e=>({text:e,label:e})):[];await l.mutate({survey_id:n,type:cre[r.type],setting:[{text:r.content,actions:i}],sort:t+1,lang:s,token:e,...r.serverId?{id:r.serverId}:{}})}t?.survey.is_use&&await d.mutate({id:n,token:e}),Q.success(r(`survey.savePublish`)),a(p)}catch{Q.error(r(`survey.saveFailed`))}finally{O(!1)}}},disabled:!m.trim()||!v.trim()||D,className:`disabled:opacity-40`,children:i(D?`loading`:`save`)})})]}),(0,X.jsx)(GS,{open:w,onClose:()=>T(!1),title:r(`survey.unsavedTitle`),children:(0,X.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary`,children:r(`survey.unsavedDesc`)}),(0,X.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,X.jsx)(Z,{variant:`secondary`,onClick:()=>T(!1),children:r(`survey.unsavedCancel`)}),(0,X.jsx)(Z,{variant:`danger`,onClick:j,children:r(`survey.unsavedConfirm`)})]})]})})]})}function w7(e,t){if(!t)return!1;switch(e){case`line`:return!!t.line_messaging_channel_access_token;case`whatsapp`:return!!(t.whatsapp_phone_number_id&&t.whatsapp_access_token);case`messenger`:return!!(t.fb_page_id&&t.fb_page_access_token);case`instagram`:return!!(t.ig_page_id&&t.ig_page_access_token);case`slack`:return!!t.slack_webhook_url}}function pre(e){switch(e){case`line`:return{line_messaging_channel_access_token:``};case`whatsapp`:return{whatsapp_phone_number_id:``,whatsapp_access_token:``};case`messenger`:return{fb_page_id:``,fb_page_access_token:``};case`instagram`:return{ig_page_id:``,ig_page_access_token:``};case`slack`:return{slack_webhook_url:``}}}function mre(){let{t:e}=V(`workspace`),{t}=V(`common`),{linkName:n}=$T();cE(n?`${n} â ${e(`nav.integrations`)}`:e(`nav.integrations`));let{linkId:r}=pa(),i=la(),{data:a}=pd(r),o=a?.type===`group`,s=`/dashboard/workspace/${r}/settings/integrations`,c=[{id:`web`,label:e(`integrations.webPlugin`),icon:$s,iconColor:`#FFFFFF`,iconBg:`#6366F1`,desc:e(`integrations.webPluginDescription`),connected:void 0,route:`${s}/web-plugin`,disabled:!1},{id:`whatsapp`,label:e(`integrations.whatsapp`),icon:Tc,iconColor:`#FFFFFF`,iconBg:`#25D366`,desc:e(`integrations.whatsappDescription`),connected:w7(`whatsapp`,a),route:`${s}/third-party?tab=whatsapp`,disabled:o},{id:`messenger`,label:e(`integrations.messenger`),icon:pc,iconColor:`#FFFFFF`,iconBg:`#0084FF`,desc:e(`integrations.messengerDescription`),connected:w7(`messenger`,a),route:`${s}/third-party?tab=messenger`,disabled:o},{id:`instagram`,label:e(`integrations.instagram`),icon:Ns,iconColor:`#FFFFFF`,iconBg:`#E1306C`,desc:e(`integrations.instagramDescription`),connected:w7(`instagram`,a),route:`${s}/third-party?tab=instagram`,disabled:o},{id:`slack`,label:e(`integrations.slack`),icon:As,iconColor:`#FFFFFF`,iconBg:`#4A154B`,desc:e(`integrations.slackDescription`),connected:w7(`slack`,a),route:`${s}/third-party?tab=slack`,disabled:o},{id:`line`,label:e(`integrations.line`),icon:dc,iconColor:`#FFFFFF`,iconBg:`#06C755`,desc:e(`integrations.lineDescription`),connected:w7(`line`,a),route:`${s}/third-party?tab=line`,disabled:o}];return(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h2`,{className:`text-[28px] font-semibold text-text-primary mb-5`,children:e(`integrations.title`)}),(0,X.jsx)(j8,{allowed:[`starter`,`light`,`standard`,`enterprise`,`appsumo`],children:(0,X.jsx)(`div`,{className:`space-y-3`,children:c.map(({id:n,label:r,icon:a,iconColor:o,iconBg:s,desc:c,connected:l,route:u,disabled:d})=>{let f=(0,X.jsxs)(`div`,{className:K(`card p-5 flex items-center gap-4`,d&&`opacity-50`),children:[(0,X.jsx)(`div`,{className:`w-10 h-10 rounded-[8px] flex items-center justify-center shrink-0`,style:{backgroundColor:s},children:(0,X.jsx)(a,{className:`w-5 h-5`,style:{color:o}})}),(0,X.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 mb-0.5`,children:[(0,X.jsx)(`h3`,{className:`text-[17px] font-semibold text-text-primary`,children:r}),l!==void 0&&!d&&(0,X.jsx)(a8,{variant:l?`success`:`neutral`,children:t(l?`connected`:`disconnected`)})]}),(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary truncate`,children:c})]}),(0,X.jsx)(Z,{variant:l===!1&&!d?`primary`:`secondary`,size:`sm`,onClick:d?void 0:()=>i(u),className:K(`shrink-0`,d&&`cursor-not-allowed`),children:t(l===!1&&!d?`configure`:`manage`)})]});return d?(0,X.jsx)(tE,{content:e(`integrations.groupDisabledTooltip`),className:`block`,children:f},n):(0,X.jsx)(`div`,{children:f},n)})})})]})}var T7=`/assets/chat_logo-B-mZpMBt.png`,hre={circle:`circle`,"rect-right":`rectangle`,"rect-left":`rectangle_left`,fullwidth:`full`},gre={circle:`circle`,rectangle:`rect-right`,rectangle_left:`rect-left`,full:`fullwidth`},E7=[`#02B13F`,`#3B82F6`,`#8B5CF6`,`#EF4444`,`#F97316`,`#1F2937`],D7=[`#FFFFFF`,`#1F2937`,`#02B13F`,`#6
74B7280`],_re=`h-10 w-full rounded-[8px] border border-border bg-bg-card px-3 text-[15px] text-text-primary placeholder:text-text-secondary placeholder:opacity-50 outline-none focus:border-border-strong transition-colors`;function vre(e){return{style:e?.widget_type?gre[e.widget_type]:`circle`,bgColor:(e?.float_button_color??`#02B13F`).toUpperCase(),textColor:(e?.float_button_text_color??`#FFFFFF`).toUpperCase(),displayText:e?.float_button_text??``,iconUrl:e?.widget_logo??null}}function yre(){let{t:e}=V(`workspace`),{t}=V(`common`),{linkName:n}=$T();cE(n?`${n} â ${e(`integrations.webPluginPageTitle`)}`:e(`integrations.webPluginPageTitle`));let{linkId:r}=pa(),{data:i,loading:a,error:o,refetch:s}=pd(r);return a&&!i?(0,X.jsx)(`div`,{className:`card p-6 text-center text-text-secondary text-[14px]`,children:t(`loading`)}):o&&!i?(0,X.jsxs)(`div`,{className:`card p-6 flex flex-col items-center gap-3`,children:[(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary`,children:t(`loadFailed`)}),(0,X.jsx)(Z,{variant:`secondary`,size:`md`,onClick:()=>void s(),children:t(`retry`)})]}):i?(0,X.jsx)(bre,{config:i,refetch:s},i.updatedAt):null}function bre({config:e,refetch:t}){let{t:n}=V(`workspace`),{t:r}=V(`common`),{linkId:i}=pa(),a=la(),{logAnalyticsEvent:o}=BS(),s=md(),c=Ed(`widget_logo`),[l,u]=(0,f.useState)(()=>vre(e)),[d,p]=(0,f.useState)(!1),[m,h]=(0,f.useState)(!1),g=(0,f.useRef)(null),_=(e,t)=>{let n=(e===`bgColor`||e===`textColor`)&&typeof t==`string`?t.toUpperCase():t;u(t=>({...t,[e]:n})),h(!0)},v=l.style===`circle`,y=l.style===`fullwidth`,b=!E7.includes(l.bgColor),x=!D7.includes(l.textColor),S=`<script defer src="${wu.VITE_WIDGET_BASE}/pinchat.js?token=${e.token}"><\/script>`,C=async()=>{await uu(S),p(!0),setTimeout(()=>p(!1),2e3),Q.success(n(`integrations.wpCodeCopied`))},w=async t=>{let n=t.target.files?.[0];if(!n)return;let i=URL.createObjectURL(n);_(`iconUrl`,i);try{_(`iconUrl`,(await c.mutate(n)).url)}catch{_(`iconUrl`,e.widget_logo??null),Q.error(r(`uploadFailed`))}finally{URL.revokeObjectURL(i)}},T=async()=>{o(`save_changes_click`,{element_id:i,feature_name:`chat_widget`});try{await s.mutate({id:e.id,token:e.token,widget_type:hre[l.style],float_button_color:l.bgColor,float_button_text_color:l.textColor,float_button_text:l.displayText,widget_logo:l.iconUrl??``}),await t(),Q.success(n(`integrations.wpSaved`))}catch{Q.error(n(`integrations.wpSaveFailed`))}},E=[{id:`circle`,label:n(`integrations.wpStyleCircle`)},{id:`rect-right`,label:n(`integrations.wpStyleRectRight`)},{id:`rect-left`,label:n(`integrations.wpStyleRectLeft`)},{id:`fullwidth`,label:n(`integrations.wpStyleFullwidth`)}];return(0,X.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,X.jsxs)(`button`,{type:`button`,onClick:()=>a(`/dashboard/workspace/${i}/settings/integrations`),className:`inline-flex items-center gap-1.5 text-[14px] text-text-secondary hover:text-text-primary cursor-pointer self-start transition-colors`,children:[(0,X.jsx)(Ds,{className:`w-3.5 h-3.5`}),n(`integrations.backToList`)]}),(0,X.jsx)(`h2`,{className:`text-[28px] font-semibold text-text-primary -mt-2`,children:n(`integrations.webPlugin`)}),(0,X.jsxs)(`div`,{className:`flex flex-col lg:flex-row gap-6 items-start`,children:[(0,X.jsxs)(`div`,{className:`flex-1 min-w-0 flex flex-col gap-5`,children:[(0,X.jsxs)(`div`,{className:`card p-6 flex flex-col gap-5`,children:[(0,X.jsx)(`h3`,{className:`text-[17px] font-semibold text-text-primary`,children:n(`integrations.wpStyleSection`)}),(0,X.jsx)(`div`,{className:`grid grid-cols-2 xl:grid-cols-4 gap-3`,children:E.map(({id:e,label:t})=>(0,X.jsx)(`button`,{type:`button`,onClick:()=>_(`style`,e),className:K(`flex items-center justify-center h-11 rounded-[8px] border-2 cursor-pointer transition-all text-[13px] font-medium`,l.style===e?`border-brand bg-brand/5 text-brand`:`border-border bg-bg-muted hover:border-border-strong text-text-secondary`),children:t},e))}),(0,X.jsx)(`div`,{className:`border-t border-border`}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,X.jsx)(`p`,{className:`text-[14px] font-medium text-text-primary`,children:n(`integrations.wpBgColor`)}),(0,X.jsxs)(`div`,{className:`flex gap-2.5 flex-wrap items-center`,children:[E7.map(e=>(0,X.jsx)(`button`,{type:`button`,onClick:()=>_(`bgColor`,e),className:`w-7 h-7 rounded-full cursor-pointer transition-transform hover:scale-110`,style:{backgroundColor:e,boxShadow:l.bgColor===e?`0 0 0 2px var(--bg-card), 0 0 0 4px ${e}`:void 0,transform:l.bgColor===e?`scale(1.15)`:void 0}},e)),(0,X.jsx)(g5,{value:l.bgColor,onChange:e=>_(`bgColor`,e),trigger:({toggle:e})=>(0,X.jsx)(`button`,{type:`button`,onClick:e,className:`w-7 h-7 rounded-full cursor-pointer transition-transform hover:scale-110 border border-border overflow-hidden relative`,style:{backgroundColor:b?l.bgColor:void 0,background:b?l.bgColor:`conic-gradient(red, yellow, lime, cyan, blue, magenta, red)`,boxShadow:b?`0 0 0 2px var(--bg-card), 0 0 0 4px ${l.bgColor}`:void 0,transform:b?`scale(1.15)`:void 0}})})]})]}),!v&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{className:`border-t border-border`}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,X.jsx)(`p`,{className:`text-[14px] font-medium text-text-primary`,children:n(`integrations.wpTextColor`)}),(0,X.jsxs)(`div`,{className:`flex gap-2.5 flex-wrap items-center`,children:[D7.map(e=>(0,X.jsx)(`button`,{type:`button`,onClick:()=>_(`textColor`,e),className:`w-7 h-7 rounded-full cursor-pointer border border-border transition-transform hover:scale-110`,style:{backgroundColor:e,boxShadow:l.textColor===e?`0 0 0 2px var(--bg-card), 0 0 0 4px var(--border-strong)`:void 0,transform:l.textColor===e?`scale(1.15)`:void 0}},e)),(0,X.jsx)(g5,{value:l.textColor,onChange:e=>_(`textColor`,e),trigger:({toggle:e})=>(0,X.jsx)(`button`,{type:`button`,onClick:e,className:`w-7 h-7 rounded-full cursor-pointer transition-transform hover:scale-110 border border-border overflow-hidden relative`,style:{backgroundColor:x?l.textColor:void 0,background:x?l.textColor:`conic-gradient(red, yellow, lime, cyan, blue, magenta, red)`,boxShadow:x?`0 0 0 2px var(--bg-card), 0 0 0 4px var(--border-strong)`:void 0,transform:x?`scale(1.15)`:void 0}})})]})]})]}),!v&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{className:`border-t border-border`}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsx)(`label`,{className:`text-[14px] font-medium text-text-primary`,children:n(`integrations.wpDisplayText`)}),(0,X.jsx)(`input`,{value:l.displayText,onChange:e=>_(`displayText`,e.target.value),placeholder:n(`integrations.wpDisplayTextPlaceholder`),maxLength:20,className:_re})]})]}),(0,X.jsx)(`div`,{className:`border-t border-border`}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsx)(`label`,{className:`text-[14px] font-medium text-text-primary`,children:n(`integrations.wpIconLabel`)}),(0,X.jsxs)(`label`,{className:K(`relative w-full flex flex-col items-center justify-center gap-2 py-6 rounded-[8px] border-2 border-dashed border-border bg-bg-muted transition-colors text-text-secondary`,c.loading?`cursor-wait opacity-60`:`cursor-pointer`),children:[(0,X.jsx)(`input`,{ref:g,type:`file`,accept:`image/*`,className:`sr-only`,onChange:w,disabled:c.loading}),l.iconUrl?(0,X.jsx)(`img`,{src:l.iconUrl,className:`w-8 h-8 rounded-full object-cover`}):(0,X.jsx)(Mc,{className:`w-4 h-4`}),(0,X.jsx)(`span`,{className:`text-[13px]`,children:n(`integrations.wpIconHint`)}),c.loading&&(0,X.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-black/40 rounded-[8px]`,children:(0,X.jsx)(sc,{className:`w-6 h-6 text-white animate-spin`})})]})]})]}),(0,X.jsxs)(`div`,{className:`card p-6 flex flex-col gap-4`,children:[(0,X.jsx)(`h3`,{className:`text-[17px] font-semibold text-text-primary`,children:n(`integrations.wpEmbedSection`)}),(0,X.jsx)(`pre`,{className:`bg-bg-muted rounded-[8px] p-4 text-[12px] font-mono text-text-primary whitespace-pre-wrap break-all border border-border leading-relaxed`,children:S}),(0,X.jsxs)(Z,{variant:`secondary`,size:`md`,onClick:C,className:`self-start gap-2`,children:[d?(0,X.jsx)(Fs,{className:`w-4 h-4`}):(0,X.jsx)(Gs,{className:`w-4 h-4`}),n(`integrations.wpCopyCode`)]})]}),(0,X.jsx)(Z,{disabled:!m||s.loading,className:`self-start disabled:opacity-40`,onClick:T,children:s.loading?r(`saving`):r(`saveChanges`)})]}),(0,X.jsx)(`div`,{className:`w-full lg:w-72 shrink-0 sticky top-6`,children:(0,X.jsxs)(`div`,{className:`card p-5 flex flex-col gap-4`,children:[(0,X.jsx)(`h3`,{className:`text-[17px] font-semibold text-text-primary`,children:n(`integrations.wpPreviewSection`)}),(0,X.jsx)(xre,{styleId:l.style,bgColor:l.bgColor,textColor:l.textColor,text:l.displayText||n(`integrations.wpDisplayTextPlaceholder`),iconUrl:l.iconUrl,isFullwidth:y})]})})]})]})}function xre({styleId:e,bgColor:t,textColor:n,text:r,iconUrl:i,isFullwidth:a}){let o=i?(0,X.jsx)(`img`,{src:i,className:`w-9 h-9 rounded-full object-cover`}):(0,X.jsx)(`img`,{src:T7,className:`w-9 h-9 object-contain`}),s=i?(0,X.jsx)(`img`,{src:i,className:`w-6 h-6 rounded-full object-cover`}):(0,X.jsx)(`img`,{src:T7,className:`w-6 h-6 object-contain`}
74),c=e===`circle`?(0,X.jsx)(`div`,{className:`w-14 h-14 rounded-full flex items-center justify-center cursor-pointer shadow-lg`,style:{backgroundColor:t},children:o}):e===`fullwidth`?(0,X.jsxs)(`div`,{className:`w-full h-12 flex items-center justify-center gap-2 cursor-pointer`,style:{backgroundColor:t},children:[s,(0,X.jsx)(`span`,{className:`text-[15px] font-medium`,style:{color:n},children:r})]}):(0,X.jsxs)(`div`,{className:`h-12 rounded-[14px] flex items-center gap-2.5 px-5 cursor-pointer shadow-lg`,style:{backgroundColor:t},children:[e===`rect-left`&&s,(0,X.jsx)(`span`,{className:`text-[15px] font-medium`,style:{color:n},children:r}),e===`rect-right`&&s]});return(0,X.jsxs)(`div`,{className:`relative rounded-[8px] border border-border bg-bg-subtle overflow-hidden`,style:{height:a?80:140},children:[(0,X.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center opacity-20`,children:(0,X.jsx)(`div`,{className:`space-y-1.5`,children:[100,80,90,60].map((e,t)=>(0,X.jsx)(`div`,{className:`h-2 rounded bg-border`,style:{width:e}},t))})}),(0,X.jsx)(`div`,{className:K(`absolute`,a?`bottom-0 left-0 right-0`:`bottom-4 right-4`),children:c})]})}var O7=`h-10 w-full rounded-[8px] border border-border bg-bg-card px-3 text-[15px] text-text-primary placeholder:text-text-secondary placeholder:opacity-50 outline-none focus:border-border-strong transition-colors`,Sre={line:`LINE Official Account`,whatsapp:`WhatsApp`,messenger:`Messenger`,instagram:`Instagram`,slack:`Slack`},k7={line:{zhTW:`https://funtek.notion.site/LINE-Messenger-eb36ffbfbb924b15958c4136c6ae804e?pvs=4`,other:`https://funtek.notion.site/LINE-Messenger-ffcd84a8612047dd9dd877557b23486e?pvs=4`},whatsapp:{zhTW:`https://funtek.notion.site/WhatsApp-ef98871fe105832989d50199419077ac`,other:`https://funtek.notion.site/WhatsApp-311bb7f48481487eaa7be12ce7112900`},messenger:{zhTW:`https://funtek.notion.site/Messenger-56f0ee3bca054786a4d7104d709d9c0a?pvs=4`,other:`https://funtek.notion.site/Messenger-3bb7eaabe4d64fac957861edb57d9eb7?pvs=4`},instagram:{zhTW:`https://funtek.notion.site/Instagram-3a1b206ce41548dcb764507e80110f8c?pvs=4`,other:`https://funtek.notion.site/Instagram-b09d5e5f1a3f4879826700d1cd8e94f1?pvs=44`},slack:{zhTW:`https://funtek.notion.site/Slack-b23d80d4e1c44589af290e2b0250b170?pvs=4`,other:`https://funtek.notion.site/Slack-4e1bf5edb8dc4759b10ae7b700ac09b5?pvs=4`}};function Cre(e,t){switch(e){case`line`:return{line_messaging_channel_access_token:t.lineToken};case`whatsapp`:return{whatsapp_phone_number_id:t.waPhoneId,whatsapp_access_token:t.waPermanentToken};case`messenger`:return{fb_page_id:t.fbPageId,fb_page_access_token:t.fbPageToken};case`instagram`:return{ig_page_id:t.igPageId,ig_page_access_token:t.igPageToken};case`slack`:return{slack_webhook_url:t.slackWebhook}}}function wre(e){return{lineToken:e?.line_messaging_channel_access_token??``,waPhoneId:e?.whatsapp_phone_number_id??``,waPermanentToken:e?.whatsapp_access_token??``,fbPageId:e?.fb_page_id??``,fbPageToken:e?.fb_page_access_token??``,igPageId:e?.ig_page_id??``,igPageToken:e?.ig_page_access_token??``,slackWebhook:e?.slack_webhook_url??``}}function Tre(){let{t:e}=V(`workspace`),{t}=V(`common`),{linkName:n}=$T();cE(n?`${n} â ${e(`integrations.thirdPartyPageTitle`)}`:e(`integrations.thirdPartyPageTitle`));let{linkId:r}=pa(),[i]=ts(),a=i.get(`tab`)??`line`,{data:o,loading:s,error:c,refetch:l}=pd(r);return s&&!o?(0,X.jsx)(`div`,{className:`card p-6 text-center text-text-secondary text-[14px]`,children:t(`loading`)}):c&&!o?(0,X.jsxs)(`div`,{className:`card p-6 flex flex-col items-center gap-3`,children:[(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary`,children:t(`loadFailed`)}),(0,X.jsx)(Z,{variant:`secondary`,size:`md`,onClick:()=>void l(),children:t(`retry`)})]}):o?(0,X.jsx)(Ere,{config:o,platform:a,refetch:l},`${o.updatedAt}-${a}`):null}function Ere({config:e,platform:t,refetch:n}){let{t:r,i18n:i}=V(`workspace`),{t:a}=V(`common`),{linkId:o}=pa(),s=la(),{logAnalyticsEvent:c}=BS(),l=md(),u=Sre[t]??t,d=w7(t,e),p=i.language===`zh-TW`?k7[t].zhTW:k7[t].other,m=Tu(`/api/${{line:`line`,whatsapp:`whatsapp`,messenger:`fbmsg`,instagram:`instagram`,slack:`slack`}[t]}/webhook/${e.token}`),[h,g]=(0,f.useState)(()=>wre(e)),[_,v]=(0,f.useState)(!1),[y,b]=(0,f.useState)(!1),x=(e,t)=>{g(n=>({...n,[e]:t})),v(!0)};return(0,X.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,X.jsxs)(`button`,{type:`button`,onClick:()=>s(`/dashboard/workspace/${o}/settings/integrations`),className:`inline-flex items-center gap-1.5 text-[14px] text-text-secondary hover:text-text-primary curs
74or-pointer self-start transition-colors`,children:[(0,X.jsx)(Ds,{className:`w-3.5 h-3.5`}),r(`integrations.backToList`)]}),(0,X.jsx)(`h2`,{className:`text-[28px] font-semibold text-text-primary -mt-2`,children:u}),(0,X.jsxs)(`div`,{className:`card p-6 flex flex-col gap-5`,children:[(0,X.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary leading-relaxed flex-1`,children:r(`integrations.${t}Intro`)}),(0,X.jsxs)(`a`,{href:p,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 text-[13px] text-brand hover:underline shrink-0`,children:[(0,X.jsx)(Ys,{className:`w-3 h-3`}),r(`integrations.learnMoreArticle`)]})]}),(0,X.jsx)(`div`,{className:`border-t border-border`}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[t===`line`&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(A7,{number:1,text:r(`integrations.lineStep1`)}),(0,X.jsx)(A7,{number:2,text:r(`integrations.lineStep2`)}),(0,X.jsx)(A7,{number:3,text:r(`integrations.lineStep3`),children:(0,X.jsx)(`input`,{value:h.lineToken,onChange:e=>x(`lineToken`,e.target.value),placeholder:r(`integrations.lineTokenPlaceholder`),className:O7})}),(0,X.jsx)(A7,{number:4,text:r(`integrations.lineStep4`),children:(0,X.jsx)(j7,{url:m})}),(0,X.jsx)(A7,{number:5,text:r(`integrations.lineStep5`)})]}),t===`whatsapp`&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(A7,{number:1,text:r(`integrations.waStep1`),children:(0,X.jsx)(`input`,{value:h.waPhoneId,onChange:e=>x(`waPhoneId`,e.target.value),placeholder:r(`integrations.waPhoneIdPlaceholder`),className:O7})}),(0,X.jsx)(A7,{number:2,text:r(`integrations.waStep2`),children:(0,X.jsx)(j7,{url:m})}),(0,X.jsx)(A7,{number:3,text:r(`integrations.waStep3`)}),(0,X.jsx)(A7,{number:4,text:r(`integrations.waStep4`),children:(0,X.jsx)(`input`,{value:h.waPermanentToken,onChange:e=>x(`waPermanentToken`,e.target.value),placeholder:r(`integrations.waPermanentTokenPlaceholder`),className:O7})}),(0,X.jsx)(A7,{number:5,text:r(`integrations.waStep5`)})]}),t===`messenger`&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(A7,{number:1,text:r(`integrations.messengerStep1`),children:(0,X.jsx)(j7,{url:m})}),(0,X.jsx)(A7,{number:2,text:r(`integrations.messengerStep2`)}),(0,X.jsx)(A7,{number:3,text:r(`integrations.messengerStep3`),children:(0,X.jsx)(`input`,{value:h.fbPageId,onChange:e=>x(`fbPageId`,e.target.value),placeholder:r(`integrations.fbPageIdPlaceholder`),className:O7})}),(0,X.jsx)(A7,{number:4,text:r(`integrations.messengerStep4`),children:(0,X.jsx)(`input`,{value:h.fbPageToken,onChange:e=>x(`fbPageToken`,e.target.value),placeholder:r(`integrations.fbPageTokenPlaceholder`),className:O7})}),(0,X.jsx)(A7,{number:5,text:r(`integrations.messengerStep5`)})]}),t===`instagram`&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(A7,{number:1,text:r(`integrations.instagramStep1`)}),(0,X.jsx)(A7,{number:2,text:r(`integrations.instagramStep2`),children:(0,X.jsx)(`input`,{value:h.igPageId,onChange:e=>x(`igPageId`,e.target.value),placeholder:r(`integrations.fbPageIdPlaceholder`),className:O7})}),(0,X.jsx)(A7,{number:3,text:r(`integrations.instagramStep3`),children:(0,X.jsx)(`input`,{value:h.igPageToken,onChange:e=>x(`igPageToken`,e.target.value),placeholder:r(`integrations.fbPageTokenPlaceholder`),className:O7})}),(0,X.jsx)(A7,{number:4,text:r(`integrations.instagramStep4`),children:(0,X.jsx)(j7,{url:m})}),(0,X.jsx)(A7,{number:5,text:r(`integrations.instagramStep5`)})]}),t===`slack`&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(A7,{number:1,text:r(`integrations.slackStep1`)}),(0,X.jsx)(A7,{number:2,text:r(`integrations.slackStep2`)}),(0,X.jsx)(A7,{number:3,text:r(`integrations.slackStep3`),children:(0,X.jsx)(`input`,{value:h.slackWebhook,onChange:e=>x(`slackWebhook`,e.target.value),placeholder:r(`integrations.slackWebhookPlaceholder`),className:O7})}),(0,X.jsx)(A7,{number:4,text:r(`integrations.slackStep4`)})]})]})]}),(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,X.jsx)(Z,{disabled:!_||l.loading,className:`disabled:opacity-40`,onClick:async()=>{try{let i={id:e.id,token:e.token,...Cre(t,h)};await l.mutate(i),await n(),Q.success(r(`integrations.thirdPartySaved`))}catch{Q.error(r(`integrations.thirdPartySaveFailed`))}},children:l.loading?a(`saving`):a(`saveChanges`)}),d&&(0,X.jsx)(Z,{variant:`secondary`,disabled:l.loading,onClick:()=>b(!0),className:`text-danger`,children:r(`integrations.disconnect`)})]}),(0,X.jsxs)(GS,{open:y,onClose:()=>b(!1),title:r(`integrations.disconnectConfirmTitle`,{platform:u}),children:[(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary leading-relaxed mb-5`,children:r(`integrations.disconnectConfirmDesc`)}),(0,X.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,X.jsx)(Z,{variant:`secondary`,onClick:()=>b(!1),children:a(`cancel`)}),(0,X.jsx)(Z,{variant:`danger`,loading:l.loading,onClick:async()=>{c(`disconnect_click`,{element_id:o,feature_name:`integration_${t}`});try{await l.mutate({id:e.id,token:e.token,...pre(t)}),await n(),b(!1),Q.success(r(`integrations.disconnected`))}catch{Q.error(r(`integrations.disconnectFailed`))}},children:r(`integrations.disconnect`)})]})]})]})}function A7({number:e,text:t,children:n}){return(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,X.jsx)(`span`,{className:`w-6 h-6 rounded-full bg-brand text-white text-[12px] font-bold flex items-center justify-center shrink-0`,children:e}),(0,X.jsx)(`p`,{className:`text-[15px] text-text-primary`,children:t})]}),n&&(0,X.jsx)(`div`,{className:`pl-9`,children:n})]})}function j7({url:e}){let{t}=V(`common`),[n,r]=(0,f.useState)(!1);return(0,X.jsxs)(`div`,{className:`flex items-center`,children:[(0,X.jsx)(`input`,{readOnly:!0,value:e,className:`h-10 flex-1 rounded-l-[8px] border border-r-0 border-border bg-bg-muted px-3 text-[13px] font-mono text-text-secondary outline-none truncate`}),(0,X.jsxs)(`button`,{type:`button`,onClick:async()=>{await uu(e),r(!0),setTimeout(()=>r(!1),2e3)},className:K(`h-10 px-3 rounded-r-[8px] border border-border bg-bg-card text-[13px] font-medium cursor-pointer shrink-0`,`flex items-center gap-1.5 transition-colors`,n?`text-brand`:`text-text-secondary hover:bg-bg-subtle hover:text-text-primary`),children:[n?(0,X.jsx)(Fs,{className:`w-3.5 h-3.5`}):(0,X.jsx)(Gs,{className:`w-3.5 h-3.5`}),t(n?`copiedWebhookUrl`:`copyWebhookUrl`)]})]})}var M7=10;function Dre({checked:e,onChange:t}){return(0,X.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":e,onClick:()=>t(!e),className:K(`relative w-10 h-[22px] rounded-full transition-colors duration-200 cursor-pointer shrink-0`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1`,e?`bg-brand`:`bg-border-strong`),children:(0,X.jsx)(`span`,{className:K(`absolute top-[3px] w-4 h-4 rounded-full bg-white shadow-sm transition-[left] duration-200`,e?`left-[21px]`:`left-[3px]`)})})}function N7({checked:e,indeterminate:t,onChange:n,disabled:r}){return(0,X.jsxs)(`button`,{type:`button`,role:`checkbox`,"aria-checked":t?`mixed`:e,onClick:()=>!r&&n(!e),disabled:r,className:K(`w-4 h-4 rounded border-2 shrink-0 flex items-center justify-center transition-colors cursor-pointer`,e||t?`bg-brand border-brand`:`border-border bg-bg-card hover:border-border-strong`,r&&`opacity-40 cursor-default`),children:[e&&(0,X.jsx)(Fs,{className:`w-2.5 h-2.5 text-white`,strokeWidth:3}),t&&!e&&(0,X.jsx)(mc,{className:`w-2.5 h-2.5 text-white`,strokeWidth:3})]})}function P7({name:e}){return(0,X.jsx)(`div`,{className:`w-8 h-8 rounded-full bg-brand-tint flex items-center justify-center shrink-0 text-[14px] font-semibold text-brand`,children:e.charAt(0)})}function F7({page:e,total:t,onChange:n}){return t<=1?null:(0,X.jsxs)(`div`,{className:`flex items-center justify-center gap-1 pt-2`,children:[(0,X.jsx)(`button`,{onClick:()=>n(e-1),disabled:e===1,className:`w-7 h-7 flex items-center justify-center rounded-[8px] text-text-secondary hover:bg-bg-subtle disabled:opacity-30 transition-colors cursor-pointer disabled:cursor-default`,children:(0,X.jsx)(Ls,{className:`w-4 h-4`})}),(0,X.jsxs)(`span`,{className:`text-[13px] text-text-secondary tabular-nums px-1`,children:[e,` / `,t]}),(0,X.jsx)(`button`,{onClick:()=>n(e+1),disabled:e===t,className:`w-7 h-7 flex items-center justify-center rounded-[8px] text-text-secondary hover:bg-bg-subtle disabled:opacity-30 transition-colors cursor-pointer disabled:cursor-default`,children:(0,X.jsx)(Rs,{className:`w-4 h-4`})})]})}function Ore(e,t,n,r){let i=new Map(t.map(e=>[e.subAccountId,e.role])),a=[],o=[];for(let t of e){let e=(t.rules??[]).filter(e=>e.token!==r),n=i.get(t.id);n?o.push({id:t.id,rules:[...e,{token:r,rule:n}],curRole:n}):a.push({id:t.id,rules:e,curRole:``})}return{shareAvatars:n,withoutEnterpoint:a,withinEnterpoint:o}}function kre(){let{t:e}=V(`workspace`),{t}=V(`common`),{linkName:n}=$T();cE(n?`${n} â ${e(`nav.subAccountAssignment`)}`:e(`nav.subAccountAssignment`));let{linkId:r}=pa(),{data:i,loading:a,error:o,refetch:s}=Nd(r),[c,l]=(0,f.useState)(0),u=(0,f.useCallback)(async()=>{await s(),l(e=>e+1)},[s]);return a&&!i?(0,X.jsx)(`div`,{className:`card p-6 text-center text-text-secondary text-[14px]`,children:t(`loading`)}):o&&!i?(0,X.jsxs)(`div`,{className:`card p-6 flex flex-col items-center gap-3`,children:[(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary`,children:t(`loadFailed`)}),(0,X.jsx)(Z,{variant:`secondary`,size:`md`,onClick:()=>void s(),children:t(`retry`)}
74)]}):!i||!r?null:(0,X.jsx)(Are,{linkId:r,data:i,refetch:u},c)}function Are({linkId:e,data:t,refetch:n}){let{t:r}=V(`workspace`),{t:i}=V(`common`),{logAnalyticsEvent:a}=BS(),o=Pd(e),[s,c]=(0,f.useState)(()=>t.list.filter(t=>t.rules?.some(t=>t.token===e)).map(t=>{let n=t.rules.find(t=>t.token===e),r=[`admin`,`analyst`,`editor`,`support`].includes(n.rule)?n.rule:`support`;return{subAccountId:t.id,role:r}})),[l,u]=(0,f.useState)(t.shareAvatars),[d,p]=(0,f.useState)(new Set),[m,h]=(0,f.useState)(new Set),[g,_]=(0,f.useState)(!1),v=(0,f.useRef)(null),[y,b]=(0,f.useState)(1),[x,S]=(0,f.useState)(1),[C,w]=(0,f.useState)(!1);(0,f.useEffect)(()=>{if(!g)return;let e=e=>{v.current&&!v.current.contains(e.target)&&_(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[g]);let T=()=>{C||w(!0)},E=new Set(s.map(e=>e.subAccountId)),D=t.list.filter(e=>!E.has(e.id)),O=t.list.filter(e=>E.has(e.id)),k=Math.max(1,Math.ceil(D.length/M7)),A=Math.max(1,Math.ceil(O.length/M7)),j=D.slice((y-1)*M7,y*M7),M=O.slice((x-1)*M7,x*M7),N=e=>{p(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},ee=e=>{h(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},P=()=>{d.size===D.length?p(new Set):p(new Set(D.map(e=>e.id)))},F=()=>{m.size===O.length?h(new Set):h(new Set(O.map(e=>e.id)))},I=()=>{if(d.size===0)return;let e=[...d].map(e=>({subAccountId:e,role:`admin`}));c(t=>[...t,...e]),p(new Set),S(Math.max(1,Math.ceil((O.length+e.length)/M7))),T()},te=()=>{m.size!==0&&(c(e=>e.filter(e=>!m.has(e.subAccountId))),h(new Set),T())},L=(t,n)=>{c(e=>e.map(e=>e.subAccountId===t?{...e,role:n}:e)),a(`menu_selection`,{element_id:e,option_name:`subaccount_role_${n}`}),T()},ne=async()=>{a(`save_changes_click`,{element_id:e,feature_name:`sub-account`});try{let i=Ore(t.list,s,l,e);await o.mutate(i),await n(),Q.success(r(`subAccounts.saved`))}catch{Q.error(r(`subAccounts.saveFailed`))}};if(t.list.length===0)return(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h2`,{className:`text-[28px] font-semibold text-text-primary mb-5`,children:r(`subAccounts.title`)}),(0,X.jsxs)(`div`,{className:`card p-12 flex flex-col items-center text-center gap-4`,children:[(0,X.jsx)(`div`,{className:`w-12 h-12 rounded-full bg-bg-subtle flex items-center justify-center`,children:(0,X.jsx)(Nc,{className:`w-6 h-6 text-text-secondary`})}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`p`,{className:`text-[17px] font-semibold text-text-primary mb-1`,children:r(`subAccounts.noAccountsTitle`)}),(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary`,children:r(`subAccounts.noAccountsDesc`)}),(0,X.jsx)(qo,{to:`/dashboard/settings`,className:`inline-flex items-center gap-1 text-[14px] text-brand hover:underline mt-2`,children:r(`subAccounts.goToManagement`)})]})]})]});let R=D.length>0&&d.size===D.length,z=d.size>0&&d.size<D.length,B=O.length>0&&m.size===O.length,re=m.size>0&&m.size<O.length;return(0,X.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,X.jsx)(`h2`,{className:`text-[28px] font-semibold text-text-primary`,children:r(`subAccounts.title`)}),(0,X.jsxs)(`div`,{className:`flex flex-col md:flex-row gap-4 items-stretch`,children:[(0,X.jsxs)(`div`,{className:`flex-1 card flex flex-col`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-3 border-b border-border`,children:[(0,X.jsx)(N7,{checked:R,indeterminate:z,onChange:P}),(0,X.jsx)(`span`,{className:`text-[17px] font-semibold text-text-primary flex-1`,children:r(`subAccounts.colAll`)}),(0,X.jsx)(`span`,{className:`text-[13px] text-text-secondary tabular-nums`,children:D.length})]}),(0,X.jsx)(`div`,{className:`flex-1 divide-y divide-border`,children:j.length===0?(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary text-center py-6 px-4`,children:r(`subAccounts.colAllEmpty`)}):j.map(e=>(0,X.jsxs)(`div`,{onClick:()=>N(e.id),className:`flex items-center gap-3 px-4 py-3 hover:bg-bg-subtle cursor-pointer transition-colors`,children:[(0,X.jsx)(N7,{checked:d.has(e.id),onChange:()=>N(e.id)}),(0,X.jsx)(P7,{name:e.name}),(0,X.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,X.jsx)(`p`,{className:`text-[15px] font-medium text-text-primary truncate`,children:e.name}),e.email&&(0,X.jsx)(`p`,{className:`text-[13px] text-text-secondary truncate`,children:e.email})]})]},e.id))}),(0,X.jsxs)(`div`,{className:`px-4 pb-3 pt-2 border-t border-border flex flex-col gap-2`,children:[(0,X.jsx)(F7,{page:y,total:k,onChange:b}),(0,X.jsxs)(Z,{size:`sm`,onClick:I,disabled:d.size===0,className:`w-full disabled:opacity-40 gap-1.5`,children:[r(`subAccounts.addBtn`),
74(0,X.jsx)(Rs,{className:`w-3.5 h-3.5`})]})]})]}),(0,X.jsxs)(`div`,{className:`flex-1 card flex flex-col`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-3 border-b border-border`,children:[(0,X.jsx)(N7,{checked:B,indeterminate:re,onChange:F,disabled:O.length===0}),(0,X.jsx)(`span`,{className:`text-[17px] font-semibold text-text-primary`,children:r(`subAccounts.colAssigned`)}),(0,X.jsxs)(`div`,{className:`relative flex-1`,ref:v,children:[(0,X.jsxs)(`button`,{type:`button`,onClick:()=>_(e=>!e),className:`inline-flex items-center gap-1 text-[13px] text-text-secondary hover:text-text-primary transition-colors cursor-pointer`,children:[(0,X.jsx)(Hs,{className:`w-3.5 h-3.5`}),r(`subAccounts.roleTableTitle`)]}),g&&(0,X.jsx)(`div`,{className:`absolute left-0 top-6 z-30 card overflow-hidden`,style:{boxShadow:`var(--shadow-3)`,minWidth:400},children:(0,X.jsx)(`div`,{className:`overflow-x-auto`,children:(0,X.jsxs)(`table`,{className:`w-full text-[13px]`,children:[(0,X.jsx)(`thead`,{children:(0,X.jsxs)(`tr`,{className:`bg-bg-muted border-b border-border`,children:[(0,X.jsx)(`th`,{className:`text-left px-4 py-2.5 font-medium text-text-secondary w-28`}),(0,X.jsx)(`th`,{className:`text-center px-4 py-2.5 font-medium text-text-secondary`,children:r(`subAccounts.permEditLink`)}),(0,X.jsx)(`th`,{className:`text-center px-4 py-2.5 font-medium text-text-secondary`,children:r(`subAccounts.permViewAnalytics`)}),(0,X.jsx)(`th`,{className:`text-center px-4 py-2.5 font-medium text-text-secondary`,children:r(`subAccounts.permReply`)})]})}),(0,X.jsx)(`tbody`,{className:`divide-y divide-border`,children:[[`admin`,[!0,!0,!0]],[`analyst`,[!1,!0,!0]],[`editor`,[!0,!1,!0]],[`support`,[!1,!1,!0]]].map(([e,t])=>(0,X.jsxs)(`tr`,{children:[(0,X.jsx)(`td`,{className:`px-4 py-2.5 font-medium text-text-primary`,children:r(`subAccounts.role${e.charAt(0).toUpperCase()+e.slice(1)}`)}),t.map((e,t)=>(0,X.jsx)(`td`,{className:`px-4 py-2.5 text-center`,children:e?(0,X.jsx)(Fs,{className:`w-4 h-4 text-brand mx-auto`}):(0,X.jsx)(`span`,{className:`block w-4 h-px bg-border mx-auto`})},t))]},e))})]})})})]}),(0,X.jsx)(`span`,{className:`text-[13px] text-text-secondary tabular-nums`,children:O.length})]}),(0,X.jsx)(`div`,{className:`flex-1 divide-y divide-border`,children:M.length===0?(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary text-center py-6 px-4`,children:r(`subAccounts.colAssignedEmpty`)}):M.map(e=>{let t=s.find(t=>t.subAccountId===e.id);return(0,X.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-3 hover:bg-bg-subtle transition-colors`,children:[(0,X.jsx)(N7,{checked:m.has(e.id),onChange:()=>ee(e.id)}),(0,X.jsx)(P7,{name:e.name}),(0,X.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,X.jsx)(`p`,{className:`text-[14px] font-medium text-text-primary truncate`,children:e.name}),e.email&&(0,X.jsx)(`p`,{className:`text-[12px] text-text-secondary truncate`,children:e.email})]}),(0,X.jsxs)(`div`,{className:`relative w-28 shrink-0`,children:[(0,X.jsxs)(`select`,{value:t.role,onChange:t=>L(e.id,t.target.value),className:`h-8 w-full rounded-full border border-brand/30 bg-brand/5 pl-3 pr-6 text-[13px] font-medium text-brand outline-none focus:border-brand transition-colors appearance-none cursor-pointer`,onClick:e=>e.stopPropagation(),children:[(0,X.jsx)(`option`,{value:`admin`,children:r(`subAccounts.roleAdmin`)}),(0,X.jsx)(`option`,{value:`analyst`,children:r(`subAccounts.roleAnalyst`)}),(0,X.jsx)(`option`,{value:`editor`,children:r(`subAccounts.roleEditor`)}),(0,X.jsx)(`option`,{value:`support`,children:r(`subAccounts.roleSupport`)})]}),(0,X.jsx)(Is,{className:`absolute right-2 top-1/2 -translate-y-1/2 w-3 h-3 text-brand/60 pointer-events-none`})]})]},e.id)})}),(0,X.jsxs)(`div`,{className:`px-4 pb-3 pt-2 border-t border-border flex flex-col gap-2`,children:[(0,X.jsx)(F7,{page:x,total:A,onChange:S}),(0,X.jsxs)(Z,{variant:`secondary`,size:`sm`,onClick:te,disabled:m.size===0,className:`w-full disabled:opacity-40 gap-1.5`,children:[(0,X.jsx)(Ls,{className:`w-3.5 h-3.5`}),r(`subAccounts.removeBtn`)]})]})]})]}),(0,X.jsxs)(`div`,{className:`card p-5`,children:[(0,X.jsx)(`h3`,{className:`text-[17px] font-semibold text-text-primary mb-4`,children:r(`subAccounts.advancedTitle`)}),(0,X.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`p`,{className:`text-[14px] font-medium text-text-primary`,children:r(`subAccounts.shareAvatar`)}),(0,X.jsx)(`p`,{className:`text-[13px] text-text-secondary mt-0.5`,children:r(`subAccounts.shareAvatarHint`)})]}),(0,X.jsx)(Dre,{checked:l,onChange:e=>{u(e),T()}})]})]}),(0,X.jsx)(Z,{disabled:!C||o.loading,onClick:ne,className:`self-start disabled:opacity-40`,children:o.loading?i(`saving`):i(`saveChanges`)})]})}function jre(){let[e]=ts(),{t}=V(`myLinks`),[n,r]=(0,f.useState)(!1),i=e.get(`name`)??`PinChat Link`,a=e.get(`url`)??window.location.href,o=`pinchat.app`,s=``;try{let e=new URL(a);o=e.hostname,s=e.pathname.replace(/^\//,``)}catch{}return(0,X.jsxs)(`div`,{className:`min-h-screen w-full flex flex-col`,style:{background:`radial-gradient(ellipse 100% 50% at 50% 100%, rgba(2,177,63,0.10) 0%, transparent 65%), linear-gradient(180deg, #f8faf8 0%, #ffffff 100%)`},children:[(0,X.jsxs)(`header`,{className:`px-8 pt-6 pb-4 shrink-0`,children:[(0,X.jsx)(`img`,{src:VS,alt:`PinChat`,className:`h-8 w-auto block dark:hidden`}),(0,X.jsx)(`img`,{src:HS,alt:`PinChat`,className:`h-8 w-auto hidden dark:block`})]}),(0,X.jsx)(`main`,{className:`flex-1 flex items-center justify-center px-6 py-10 sm:py-16`,children:(0,X.jsxs)(`div`,{className:`flex flex-col items-center gap-6 sm:gap-8 max-w-md w-full`,children:[(0,X.jsxs)(`div`,{className:`relative inline-flex flex-col items-center`,children:[(0,X.jsx)(`span`,{className:`inline-flex items-center px-5 sm:px-7 h-11 sm:h-14 roun
74ded-[14px] sm:rounded-[16px] text-[16px] sm:text-[20px] font-semibold text-white`,style:{backgroundColor:`var(--brand)`},children:t(`showcaseJoinText`)}),(0,X.jsx)(`span`,{className:`w-0 h-0`,style:{borderLeft:`10px solid transparent`,borderRight:`10px solid transparent`,borderTop:`11px solid var(--brand)`}})]}),(0,X.jsx)(`div`,{className:`rounded-[24px] sm:rounded-[32px] bg-white p-5 sm:p-8`,style:{boxShadow:`0 16px 56px rgba(0,0,0,0.10), 0 2px 10px rgba(0,0,0,0.05)`},children:(0,X.jsx)(UE,{value:a,size:260,bgColor:`#ffffff`,fgColor:`#1A1C22`,level:`M`})}),(0,X.jsxs)(`div`,{className:`flex flex-col items-center gap-1.5 text-center w-full`,children:[(0,X.jsx)(`h1`,{className:`text-[28px] sm:text-[36px] font-bold text-text-primary leading-tight tracking-tight`,children:i}),(0,X.jsxs)(`div`,{className:`flex items-center gap-1.5 max-w-full`,children:[(0,X.jsxs)(`p`,{className:`text-[14px] sm:text-[15px] text-text-secondary font-mono break-all`,children:[o,s?`/${s}`:``]}),(0,X.jsx)(`button`,{onClick:async()=>{await uu(a),r(!0),setTimeout(()=>r(!1),2e3)},"aria-label":t(`copyLinkUrl`),className:`w-6 h-6 flex items-center justify-center rounded-[8px] transition-all cursor-pointer active:scale-90`,style:{color:n?`var(--brand)`:`var(--text-secondary)`},children:n?(0,X.jsx)(Fs,{className:`w-3.5 h-3.5`}):(0,X.jsx)(Gs,{className:`w-3.5 h-3.5`})})]})]}),(0,X.jsxs)(`button`,{onClick:()=>window.open(`#`,`_blank`),className:`w-full flex items-center justify-center gap-2 h-12 rounded-full text-[15px] font-semibold border-2 transition-all cursor-pointer active:scale-95`,style:{borderColor:`var(--brand)`,color:`var(--brand)`},onMouseEnter:e=>e.currentTarget.style.backgroundColor=`var(--brand-tint)`,onMouseLeave:e=>e.currentTarget.style.backgroundColor=`transparent`,children:[(0,X.jsx)(Ys,{className:`w-4 h-4`}),t(`openChatRoom`)]})]})})]})}var I7=`h-10 w-full rounded-[8px] border border-border bg-bg-card px-3 text-[15px] text-text-primary placeholder:text-text-secondary placeholder:opacity-50 outline-none focus:border-border-strong transition-colors`;function Mre(){let{t:e}=V(`account`),{t}=V(`common`);cE(e(`title`));let{user:n}=zf(),r=zf(e=>!!e.userSetting?.subAccount),i=la(),{logAnalyticsEvent:a}=BS(),o=Hu(!0),[s,c]=(0,f.useState)(n?.name??``),[l,u]=(0,f.useState)(null),[d,p]=(0,f.useState)(null),[m,h]=(0,f.useState)(!1),g=(0,f.useRef)(null),[_,v]=(0,f.useState)(``),[y,b]=(0,f.useState)(``),[x,S]=(0,f.useState)(``),[C,w]=(0,f.useState)(!1),[T,E]=(0,f.useState)(!1),[D,O]=(0,f.useState)(!1),[k,A]=(0,f.useState)([]),[j,M]=(0,f.useState)(!0),[N,ee]=(0,f.useState)(!1),[P,F]=(0,f.useState)(n?.email??``),[I,te]=(0,f.useState)(!1),[L,ne]=(0,f.useState)(!1),[R,z]=(0,f.useState)(``),B=ud(5),re=ud(50),ie=Ed(`image`),ae=Wu(),oe=Gu(),se=Ku(),ce=qu(),le=(0,f.useRef)(!1);return(0,f.useEffect)(()=>{let e=o.data;if(e&&(m||c(e.subAccount?e.subAccount.name??``:e.display_name??e.name??``),!le.current))if(le.current=!0,e.subAccount){let t=e.subAccount.notifyEmail??``;F(t),ee(!!t)}else{let t=e.notify_email??n?.email??``,r=e.notify_type,i=e.is_open_notify===!0;F(t),ee(i&&r===20)}},[o.data,n?.email,m]),(0,X.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,X.jsx)(`h2`,{className:`text-[28px] font-semibold text-text-primary`,children:e(`title`)}),(0,X.jsxs)(`div`,{className:`card p-6 flex flex-col gap-5`,children:[(0,X.jsx)(`h3`,{className:`text-[17px] font-semibold text-text-primary`,children:e(`sectionAccount`)}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsx)(`label`,{className:`text-[14px] font-medium text-text-primary`,children:e(`labelAvatar`)}),(0,X.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,X.jsxs)(`div`,{className:`relative w-20 h-20 rounded-full bg-brand flex items-center justify-center text-white text-[28px] font-bold shrink-0 overflow-hidden`,children:[d||n?.avatar?(0,X.jsx)(`img`,{src:d??n.avatar,className:`w-full h-full object-cover`,alt:``}):n?.name?.[0]??`?`,ie.loading&&(0,X.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-black/40 rounded-full`,children:(0,X.jsx)(sc,{className:`w-6 h-6 text-white animate-spin`})})]}),(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(`input`,{ref:g,type:`file`,accept:`image/*`,className:`hidden`,onChange:e=>{let t=e.target.files?.[0];t&&(u(t),p(URL.createObjectURL(t)),h(!0))}}),(0,X.jsxs)(Z,{type:`button`,variant:`secondary`,size:`sm`,onClick:()=>g.current?.click(),className:`gap-1.5`,children:[(0,X.jsx)(Mc,{className:`w-3.5 h-3.5`}),t(d?`changeImage`:`uploadImage`)]}),d&&(0,X.jsx)(`button`,{type:`button`,onClick:()=>{p(null),g.current&&(g.current.value=``),h(!0)},className:`text-[14px] text-text-secondary hover:text-danger transition-colors cursor-pointer`,children:t(`remove`)})]})]}),(0,X.jsx)(`p`,{className:`text-[13px] text-text-secondary`,children:e(`avatarHint`)})]}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsx)(`label`,{className:`text-[14px] font-medium text-text-primary`,children:e(`labelDisplayName`)}),(0,X.jsx)(`input`,{value:s,onChange:e=>{c(e.target.value),h(!0)},className:I7})]}),!r&&(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsx)(`label`,{className:`text-[14px] font-medium text-text-primary`,children:e(`labelEmail`)}),(0,X.jsx)(`input`,{readOnly:!0,value:n?.email??``,className:K(I7,`bg-bg-muted text-text-secondary cursor-default`)})]}),(0,X.jsx)(Z,{disabled:!m||ae.loading||ie.loading,className:`self-start disabled:opacity-40`,onClick:async()=>{a(`save_changes_click`,{feature_name:`account_setting`});try{let t;l&&(t=(await ie.mutate(l)).id),await ae.mutate({name:s,...t==null?{}:{image_id:t}}
74),Q.success(e(`accountSaved`)),h(!1),u(null),o.refetch()}catch(t){let n=t instanceof Du&&t.message?t.message:e(`accountSaveFailed`);Q.error(n)}},children:ae.loading||ie.loading?t(`saving`):t(`saveChanges`)})]}),!r&&(0,X.jsxs)(`div`,{className:`card p-6 flex flex-col gap-4`,children:[(0,X.jsx)(`h3`,{className:`text-[17px] font-semibold text-text-primary`,children:e(`sectionPassword`)}),(0,X.jsx)(L7,{label:e(`labelOldPassword`),value:_,onChange:v,show:C,onToggle:()=>w(e=>!e)}),(0,X.jsx)(L7,{label:e(`labelNewPassword`),value:y,onChange:b,show:T,onToggle:()=>E(e=>!e)}),(0,X.jsx)(L7,{label:e(`labelConfirmPassword`),value:x,onChange:S,show:D,onToggle:()=>O(e=>!e)}),(0,X.jsx)(`p`,{className:`text-[13px] text-text-secondary -mt-1`,children:e(`passwordHint`)}),k.length>0&&(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[k.includes(`weak`)&&(0,X.jsx)(`p`,{className:`text-[13px] text-danger`,children:e(`errorPasswordWeak`)}),k.includes(`mismatch`)&&(0,X.jsx)(`p`,{className:`text-[13px] text-danger`,children:e(`errorPasswordMismatch`)})]}),(0,X.jsx)(Z,{disabled:!_||!y||!x||oe.loading,className:`self-start disabled:opacity-40`,onClick:async()=>{a(`save_changes_click`,{feature_name:`change_password`});let t=[];if((y.length<8||!/[A-Z]/.test(y)||!/[0-9]/.test(y))&&t.push(`weak`),y!==x&&t.push(`mismatch`),A(t),!(t.length>0))try{await oe.mutate({old_password:_,new_password:y,new_password_confirmation:x}),Q.success(e(`passwordSaved`)),v(``),b(``),S(``),A([])}catch(t){let n=t instanceof Du&&t.message?t.message:e(`passwordSaveFailed`);Q.error(n)}},children:oe.loading?t(`loading`):e(`updatePassword`)})]}),(0,X.jsxs)(`div`,{className:`card p-6 flex flex-col gap-4`,children:[(0,X.jsx)(`h3`,{className:`text-[17px] font-semibold text-text-primary`,children:e(`sectionNotifications`)}),(0,X.jsx)(R7,{label:e(`labelPushNotifications`),checked:j,onChange:e=>{a(`toggle_switch`,{feature_name:`push_notifications`,feature_state:e}),M(e)}}),(0,X.jsx)(`div`,{className:`border-t border-border`}),(0,X.jsx)(R7,{label:e(`labelEmailNotifications`),checked:N,onChange:e=>{a(`toggle_switch`,{feature_name:`email_notifications`,feature_state:e}),ee(e)}}),N&&(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,X.jsx)(`input`,{type:`email`,value:P,onChange:e=>F(e.target.value),placeholder:e(`labelNotificationEmail`),className:I7}),!P.trim()&&(0,X.jsx)(`p`,{className:`text-[13px] text-danger`,children:e(`notifEmailRequired`)})]}),(0,X.jsx)(Z,{className:`self-start disabled:opacity-40`,onClick:async()=>{a(`save_changes_click`,{feature_name:`account_notification_setting`});try{await se.mutate({email:N?P:``,is_open_notify:N,type:N?20:0}),Q.success(e(`notifSaved`)),o.refetch()}catch(t){let n=t instanceof Du&&t.message?t.message:e(`notifSaveFailed`);Q.error(n)}},disabled:se.loading||N&&!P.trim(),children:se.loading?t(`saving`):t(`saveChanges`)})]}),(0,X.jsxs)(`div`,{className:`card p-6 flex flex-col gap-4`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,X.jsx)(`h3`,{className:`text-[17px] font-semibold text-text-primary`,children:e(`sectionActivity`)}),(0,X.jsx)(`button`,{type:`button`,onClick:()=>{a(`account_activity_record_click`),te(!0)},className:`text-[13px] text-brand hover:underline cursor-pointer`,children:e(`viewAll`)})]}),(0,X.jsx)(`div`,{className:`overflow-x-auto rounded-[8px] border border-border`,children:(0,X.jsxs)(`table`,{className:`w-full text-left min-w-[480px]`,children:[(0,X.jsx)(`thead`,{children:(0,X.jsx)(`tr`,{className:`bg-bg-muted border-b border-border`,children:[`colBrowser`,`colDevice`,`colIp`,`colTime`].map(t=>(0,X.jsx)(`th`,{className:`px-4 py-2.5 text-[12px] font-medium text-text-secondary uppercase tracking-[0.6px] whitespace-nowrap`,children:e(t)},t))})}),(0,X.jsx)(`tbody`,{children:(B.data??[]).slice(0,3).map((e,t)=>(0,X.jsxs)(`tr`,{className:`border-b border-border last:border-0 hover:bg-bg-subtle transition-colors`,children:[(0,X.jsx)(`td`,{className:`px-4 py-3 text-[14px] text-text-primary whitespace-nowrap`,children:e.browser}),(0,X.jsx)(`td`,{className:`px-4 py-3 text-[14px] text-text-primary whitespace-nowrap`,children:e.os}),(0,X.jsx)(`td`,{className:`px-4 py-3 text-[14px] font-mono text-text-primary whitespace-nowrap`,children:e.ip}),(0,X.jsx)(`td`,{className:`px-4 py-3 text-[14px] text-text-secondary whitespace-nowrap`,children:e.createdAt})]},t))})]})})]}),!r&&(0,X.jsxs)(`div`,{className:`card p-6 flex flex-col gap-4`,style:{borderColor:`rgba(235,87,87,0.25)`},children:[(0,X.jsx)(`h3`,{className:`text-[17px] font-semibold text-danger`,children:e(`sectionDanger`)}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,X.jsx)(`p`,{className:`text-[15px] font-medium text-text-primary`,children:e(`deleteTitle`)}),(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary`,children:e(`deleteDesc`)})]}),(0,X.jsx)(Z,{variant:`danger`,className:`self-start`,onClick:()=>{a(`account_delete_click`),z(``),ne(!0)},children:e(`deleteButton`)})]}),(0,X.jsx)(GS,{open:I,onClose:()=>te(!1),title:e(`sectionActivity`),className:`max-w-2xl`,children:(0,X.jsx)(`div`,{className:`overflow-x-auto rounded-[8px] border border-border`,children:(0,X.jsxs)(`table`,{className:`w-full text-left min-w-[480px]`,children:[(0,X.jsx)(`thead`,{children:(0,X.jsx)(`tr`,{className:`bg-bg-muted border-b border-border`,children:[`colBrowser`,`colDevice`,`colIp`,`
74colTime`].map(t=>(0,X.jsx)(`th`,{className:`px-4 py-2.5 text-[12px] font-medium text-text-secondary uppercase tracking-[0.6px] whitespace-nowrap`,children:e(t)},t))})}),(0,X.jsx)(`tbody`,{children:(re.data??[]).map((e,t)=>(0,X.jsxs)(`tr`,{className:`border-b border-border last:border-0 hover:bg-bg-subtle transition-colors`,children:[(0,X.jsx)(`td`,{className:`px-4 py-3 text-[14px] text-text-primary whitespace-nowrap`,children:e.browser}),(0,X.jsx)(`td`,{className:`px-4 py-3 text-[14px] text-text-primary whitespace-nowrap`,children:e.os}),(0,X.jsx)(`td`,{className:`px-4 py-3 text-[14px] font-mono text-text-primary whitespace-nowrap`,children:e.ip}),(0,X.jsx)(`td`,{className:`px-4 py-3 text-[14px] text-text-secondary whitespace-nowrap`,children:e.createdAt})]},t))})]})})}),(0,X.jsx)(GS,{open:L,onClose:()=>ne(!1),title:e(`deleteTitle`),children:(0,X.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary`,children:e(`deleteDesc`)}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsx)(`label`,{className:`text-[14px] font-medium text-text-primary`,children:e(`deleteConfirmPrompt`)}),(0,X.jsx)(`input`,{value:R,onChange:e=>z(e.target.value),placeholder:e(`deleteConfirmWord`),className:I7,autoFocus:!0})]}),(0,X.jsxs)(`div`,{className:`flex justify-end gap-2 pt-1`,children:[(0,X.jsx)(Z,{variant:`secondary`,onClick:()=>ne(!1),children:t(`cancel`)}),(0,X.jsx)(Z,{variant:`danger`,disabled:R!==e(`deleteConfirmWord`)||ce.loading,className:`disabled:opacity-40`,onClick:async()=>{try{await ce.mutate(),cd(),ne(!1),i(`/login`,{replace:!0})}catch(t){let n=t instanceof Du&&t.message?t.message:e(`accountDeleteFailed`);Q.error(n)}},children:ce.loading?t(`loading`):e(`deleteButton`)})]})]})})]})}function L7({label:e,value:t,onChange:n,show:r,onToggle:i}){let{t:a}=V(`account`);return(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsx)(`label`,{className:`text-[14px] font-medium text-text-primary`,children:e}),(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsx)(`input`,{type:r?`text`:`password`,value:t,onChange:e=>n(e.target.value),placeholder:`â¢â¢â¢â¢â¢â¢â¢â¢`,className:K(`h-10 w-full rounded-[8px] border border-border bg-bg-card px-3 pr-10 text-[15px] text-text-primary`,`placeholder:text-text-secondary placeholder:opacity-50 outline-none focus:border-border-strong transition-colors`)}),(0,X.jsx)(`button`,{type:`button`,onClick:i,"aria-label":a(r?`hidePassword`:`showPassword`),className:`absolute right-3 top-1/2 -translate-y-1/2 text-text-secondary hover:text-text-primary transition-colors cursor-pointer`,children:r?(0,X.jsx)(Xs,{className:`w-4 h-4`}):(0,X.jsx)(Zs,{className:`w-4 h-4`})})]})]})}function R7({label:e,checked:t,onChange:n}){return(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,X.jsx)(`p`,{className:`text-[15px] font-medium text-text-primary`,children:e}),(0,X.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":t,onClick:()=>n(!t),className:K(`relative w-10 h-[22px] rounded-full transition-colors duration-200 cursor-pointer shrink-0`,t?`bg-brand`:`bg-border-strong`),children:(0,X.jsx)(`span`,{className:K(`absolute top-[3px] w-4 h-4 rounded-full bg-white shadow-sm transition-[left] duration-200`,t?`left-[21px]`:`left-[3px]`)})})]})}var Nre=[`free`,`starter`,`standard`,`enterprise`],z7={free:[`feat_free_1`,`feat_free_2`,`feat_free_3`,`feat_free_4`],trial:[`feat_starter_1`,`feat_starter_2`,`feat_starter_4`,`feat_starter_3`,`feat_starter_5`],starter:[`feat_starter_1`,`feat_starter_2`,`feat_starter_4`,`feat_starter_3`,`feat_starter_5`,`feat_starter_6`],light:[`feat_standard_1`,`feat_standard_2`,`feat_standard_4`],standard:[`feat_standard_1`,`feat_standard_2`,`feat_standard_4`,`feat_standard_3`],enterprise:[`feat_enterprise_1`,`feat_enterprise_2`,`feat_enterprise_3`,`feat_enterprise_4`],appsumo:[`feat_appsumo_common_3`,`feat_appsumo_common_1`,`feat_appsumo_common_4`,`feat_appsumo_common_2`,`feat_appsumo_common_5`,`feat_appsumo_common_10`,`feat_appsumo_common_7`,`feat_appsumo_common_12`,`feat_appsumo_common_13`,`feat_appsumo_common_6`,`feat_appsumo_common_8`,`feat_appsumo_common_15`,`feat_appsumo_common_16`,`feat_appsumo_common_9`,`feat_appsumo_common_14`]},B7={trial:`free`,starter:`free`,light:`starter`,standard:`starter`,enterprise:`standard`},V7={free:`planFree`,trial:`planTrial`,starter:`planStarter`,light:`planLight`,standard:`planStandard`,enterprise:`planEnterprise`,appsumo:`planAppSumo`},H7={free:`priceFree`,trial:`priceFree`,starter:`priceStarter`,light:`priceStandard`,standard:`priceStandard`,enterprise:`priceEnterprise`,appsumo:`priceAppSumo`},U7={starter:`starter3_month`,standard:`standard4_month`},Pre=[`starter`,`standard`],W7=[{id:`anthropic`,name:`Anthropic`,color:`#D97706`,abbr:`A`},{id:`gemini`,name:`Google Gemini`,color:`#4285F4`,abbr:`G`},{id:`openai`,name:`OpenAI`,color:`#10A37F`,abbr:`O`}],Fre={1:1,2:2,3:5,4:10,5:10,6:10};function G7(e,t){return e===0?`LINE Pay`:t(e===1?`payMethodCreditCard`:`payMethodOnline`)}var K7=wu.VITE_PINCHAT_API_BASE.includes(`beta.funtek.io`)?`https://pinchat-landing.beta.funtek.io/contact`:`https://pinchat.app/contact`;function Ire(e){if(!e)return 0;let t=e.match(/pinchat_tier(\d+)/);return t?parseInt(t[1],10):0}function Lre(e){return{free:`planFree`,starter:`planStarter`,standard:`planStandard`,enterprise:`planEnterprise`,appsumo:`planEnterprise`}
74[uC(e)]??`planStandard`}function q7(e,t){if(!e)return`-`;let n=new Date(e);if(isNaN(n.getTime()))return`-`;try{return n.toLocaleDateString(t,{year:`numeric`,month:`long`,day:`numeric`})}catch{return e}}function J7(e,t){if(!e)return`-`;let n=new Date(e);if(isNaN(n.getTime()))return`-`;try{return n.toLocaleString(t,{year:`numeric`,month:`long`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}catch{return e}}function Rre(e){return{id:e.order_id,date:e.payment_at??``,price:e.price,amount:e.amount,currency:e.currency,status:e.status===1?`paid`:`unpaid`,planKey:Lre(e.plan_uid),method:e.method,discount:e.coupon?.code??null,discountValue:e.coupon?.discount_value??null,discountType:e.coupon?.discount_type??null,name:e.name??``,email:e.email??``,invoiceTitle:e.invoice_title??``,taxId:e.uniform_invoice_numbers??``}}function zre(e){return e>=90?`bg-danger`:e>=80?`bg-[var(--warning)]`:`bg-brand`}function Bre(e){return e>=90?`text-danger`:e>=80?`text-[var(--warning)]`:`text-text-primary`}function Vre({plan:e,t,chatLink:n,mau:r,aiMessages:i}){let a=B7[e];function o(e){return(e===`feat_free_1`||e===`feat_starter_1`||e===`feat_standard_1`)&&n!=null?n>0?t(`featChatLinks`,{count:n}):t(`feat_enterprise_1`):(e===`feat_free_2`||e===`feat_starter_2`||e===`feat_standard_2`)&&r!=null&&r>0?t(`tierMau`,{count:r.toLocaleString()}):(e===`feat_starter_4`||e===`feat_standard_4`)&&i!=null&&i>0?t(`featAiMessages`,{count:i.toLocaleString()}):t(e)}return(0,X.jsxs)(`ul`,{className:`space-y-2`,children:[a&&(0,X.jsxs)(`li`,{className:`flex items-center gap-2 text-[14px] text-text-secondary`,children:[(0,X.jsx)(Fs,{className:`w-3.5 h-3.5 text-brand shrink-0`}),t(`planFeaturesIncludes`,{plan:t(V7[a])})]}),z7[e].map(e=>(0,X.jsxs)(`li`,{className:`flex items-center gap-2 text-[14px] text-text-secondary`,children:[(0,X.jsx)(Fs,{className:`w-3.5 h-3.5 text-brand shrink-0`}),o(e)]},e))]})}function Hre({tier:e,mauTotal:t,aiTotal:n,subAccountsLimit:r,t:i}){let a=Fre[e]??1;return(0,X.jsxs)(`div`,{className:`space-y-3`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`p`,{className:`text-[13px] font-medium text-text-secondary mb-2`,children:i(`appsumoTierTitle`,{tier:e})}),(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[t>0&&(0,X.jsx)(`span`,{className:`px-3 py-1.5 rounded-full bg-bg-subtle border border-border text-[13px] font-medium text-text-primary`,children:i(`tierMau`,{count:t.toLocaleString()})}),n>0&&n!==99999&&(0,X.jsx)(`span`,{className:`px-3 py-1.5 rounded-full bg-bg-subtle border border-border text-[13px] font-medium text-text-primary`,children:i(`tierAiMessages`,{count:n.toLocaleString()})}),(0,X.jsx)(`span`,{className:`px-3 py-1.5 rounded-full bg-bg-subtle border border-border text-[13px] font-medium text-text-primary`,children:r===0?i(`tierSubUnlimited`):i(`tierSubAccounts`,{count:r})}),(0,X.jsx)(`span`,{className:`px-3 py-1.5 rounded-full bg-bg-subtle border border-border text-[13px] font-medium text-text-primary`,children:i(`tierAiBots`,{count:a})})]})]}),(0,X.jsx)(`ul`,{className:`space-y-1.5`,children:z7.appsumo.map(e=>(0,X.jsxs)(`li`,{className:`flex items-center gap-2 text-[13px] text-text-secondary`,children:[(0,X.jsx)(Fs,{className:`w-3 h-3 text-brand shrink-0`}),i(e)]},e))})]})}function Ure({usedMau:e,totalMau:t,usedAi:n,totalAi:r,t:i}){return(0,X.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[t>0&&(0,X.jsx)(Y7,{title:i(`mauTitle`),used:e,total:t}),r>0&&(0,X.jsx)(Y7,{title:i(`aiTitle`),used:n,total:r,unlimited:r===99999,unlimitedLabel:i(`byokUnlimited`)})]})}function Y7({title:e,used:t,total:n,unlimited:r,unlimitedLabel:i}){let{t:a}=V(`billing`),o=n>0?Math.min(t/n*100,100):0;return(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,X.jsx)(`p`,{className:`text-[14px] font-medium text-text-primary`,children:e}),r?(0,X.jsx)(`p`,{className:`text-[13px] text-text-secondary`,children:i}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`flex items-baseline justify-between`,children:[(0,X.jsx)(`span`,{className:K(`text-[22px] font-semibold tabular-nums`,Bre(o)),children:t.toLocaleString()}),(0,X.jsxs)(`span`,{className:`text-[13px] text-text-secondary`,children:[`/ `,n.toLocaleStr
74ing()]})]}),(0,X.jsx)(`div`,{className:`h-2 rounded-full bg-bg-subtle overflow-hidden`,children:(0,X.jsx)(`div`,{className:K(`h-2 rounded-full transition-all duration-300`,zre(o)),style:{width:`${o}%`}})}),(0,X.jsxs)(`p`,{className:`text-[13px] text-text-secondary`,children:[a(`remaining`),` `,Math.max(0,n-t).toLocaleString()]})]})]})}function Wre(e,t){if(t<=7)return Array.from({length:t},(e,t)=>t+1);let n=new Set([1,e-1,e,e+1,t].filter(e=>e>=1&&e<=t)),r=Array.from(n).sort((e,t)=>e-t),i=[],a=0;for(let e of r)e-a===2?i.push(a+1):e-a>2&&i.push(`ellipsis`),i.push(e),a=e;return i}function Gre(){let{t:e,i18n:n}=V(`billing`),{t:i}=V(`common`);cE(e(`title`));let{logAnalyticsEvent:a}=BS(),o=la(),{data:s,refetch:c}=Hu(!0),l=zf(e=>e.setUser),u=cC(e=>e.setCurrentPlan);(0,f.useEffect)(()=>{s&&(l(s),u(uC(s.plan_uid)))},[s,l,u]),(0,f.useEffect)(()=>{a(`page_view`,{page_name:`billing_page`})},[a]);let d=cC(e=>e.currentPlan),p=Ire(s?.plan_uid),m=Hd(),h=Ud(),g=m.data?.map(Rre)??[],_=Gd(),v=Jd(),y=s?.used_MAU??0,b=s?.active_MAU??0,x=s?.used_AI_bot_msg??0,S=s?.active_ai_usage??0,C=b>0&&y>b||S>0&&S!==99999&&x>S,w=n.language===`zh-TW`?`TWD`:`USD`,{data:T=[]}=Bd(w),E=(0,f.useMemo)(()=>{let t=w===`TWD`?`NT$`:`$`,n=n=>{let r=U7[n],i=r?T.find(e=>e.uid===r):void 0;return i?`${t}${i.price.toLocaleString(`en-US`)}`:e(H7[n])};return{free:`${t}0`,trial:`${t}0`,starter:n(`starter`),light:n(`standard`),standard:n(`standard`),enterprise:e(H7.enterprise),appsumo:e(H7.appsumo)}},[w,T,e]),D=s?.coupon_code&&s?.coupon_type!==`discount`?{code:s.coupon_code,value:s.discount_value??0,type:s.discount_type??``}:null,[O,k]=(0,f.useState)(!1),[A,j]=(0,f.useState)(!1),[M,N]=(0,f.useState)(!1),[ee,P]=(0,f.useState)(null),[F,I]=(0,f.useState)(null),te=(0,f.useRef)(null),[L,ne]=(0,f.useState)(1),[R,z]=(0,f.useState)(!1),[B,re]=(0,f.useState)(null),ie=Vd(),[ae,oe]=(0,f.useState)(null),se=uf(),ce=df(),le=ff(),ue=se.data??[],[de,fe]=(0,f.useState)({anthropic:!1,gemini:!1,openai:!1}),[pe,me]=(0,f.useState)({anthropic:``,gemini:``,openai:``}),[he,ge]=(0,f.useState)({anthropic:!1,gemini:!1,openai:!1}),[_e,ve]=(0,f.useState)({anthropic:!1,gemini:!1,openai:!1}),[ye,be]=(0,f.useState)(``),[xe,Se]=(0,f.useState)(!1),Ce=(0,f.useCallback)(async e=>{(0,fs.flushSync)(()=>I(e));let n=te.current;if(!n){I(null);return}try{let[{default:i},{default:a}]=await Promise.all([r(()=>import(`./html2canvas-CkeJErw0.js`).then(e=>t(e.default,1)),__vite__mapDeps([0,1])),r(()=>import(`./jspdf.es.min-BcW4vZmN.js`),__vite__mapDeps([2,1,3,4]))]),o=await i(n,{scale:2,useCORS:!0,logging:!1}),s=o.toDataURL(`image/png`),c=new a(`p`,`mm`,`a4`),l=c.internal.pageSize.getWidth(),u=o.height*l/o.width;c.addImage(s,`PNG`,0,0,l,u);let d=new Date(e.date).toLocaleDateString(`sv`).replace(/-/g,``);c.save(`PinChat_Receipt_${d}.pdf`)}catch(e){console.error(`Invoice download failed`,e),Q.error(`Download failed`)}finally{I(null)}},[]),we=async t=>{if(a(`choose_plan_click`,{element_id:t,page_name:`billing_page`}),t===`free`){k(!1),j(!0);return}if(t===`enterprise`||d!==`free`&&d!==`trial`){k(!1),window.open(K7,`_blank`,`noopener,noreferrer`);return}if(w===`TWD`){k(!1),o(`/dashboard/billing/checkout/${t}`);return}let n=U7[t];if(!n){Q.error(e(`polarCheckoutFailed`));return}oe(t);try{let t=(await ie.mutate([n]))?.[n];if(!t){Q.error(e(`polarCheckoutFailed`));return}k(!1),window.open(t,`_blank`)||(window.location.href=t)}catch{Q.error(e(`polarCheckoutFailed`))}finally{oe(null)}},Te=async e=>{let t=pe[e].trim();if(t){ge(t=>({...t,[e]:!0})),ve(t=>({...t,[e]:!1}));try{let n=W7.find(t=>t.id===e);await ce.mutate({name:n?.name??e,provider_type:e,api_key:t}),await se.refetch(),fe(t=>({...t,[e]:!1})),me(t=>({...t,[e]:``}))}catch{ve(t=>({...t,[e]:!0}))}finally{ge(t=>({...t,[e]:!1}))}}},Ee=async()=>{if(!B)return;let t=ue.find(e=>e.provider_type===B);if(!t){re(null);return}let n=W7.find(e=>e.id===B)?.name??``;try{await le.mutate(t.id),await se.refetch(),re(null),Q.success(e(`byokRemoved`,{provider:n}))}catch(t){let n=t instanceof Du&&t.message?t.message:e(`byokDeleteFailed`);Q.error(n)}},De=async()=>{if(ye.trim()){Se(!1);try{await _.mutate(ye.trim()),await c(),a(`use_coupon_code`,{coupon_code:ye.trim(),result:`success`,page_name:`billing_page`}),be(``)}catch{a(`use_coupon_code`,{coupon_code:ye.trim(),result:`fail`,page_name:`billing_page`}),Se(!0)}}};return(0,X.jsxs)(`div`,{className:`space-y-5`,children:[(0,X.jsx)(`h1`,{className:`text-[28px] font-semibold text-text-primary tracking-[-0.3px]`,children:e(`title`)}),(0,X.jsxs)(`div`,{className:`card p-6 space-y-5`,children:[C&&
74(0,X.jsxs)(`div`,{className:`flex items-start gap-3 rounded-[8px] border border-danger/20 bg-[rgba(235,87,87,0.08)] px-4 py-3`,children:[(0,X.jsx)(jc,{className:`w-4 h-4 text-danger shrink-0 mt-0.5`}),(0,X.jsx)(`p`,{className:`text-[14px] text-danger leading-snug`,children:e(`overQuotaAlert`)})]}),(0,X.jsxs)(`div`,{className:`flex items-start justify-between gap-4 flex-wrap`,children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-x-8 gap-y-3`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,X.jsx)(`p`,{className:`text-[13px] font-medium text-text-secondary uppercase tracking-[0.6px]`,children:e(`planLabel`)}),d===`appsumo`?(0,X.jsxs)(`p`,{className:`text-[17px] font-semibold text-brand`,children:[`AppSumo License Tier `,p]}):(0,X.jsx)(a8,{variant:`brand`,className:`text-[14px] px-3 py-1 self-start`,children:e(V7[d])})]}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,X.jsx)(`p`,{className:`text-[13px] font-medium text-text-secondary uppercase tracking-[0.6px]`,children:e(`startDate`)}),(0,X.jsx)(`p`,{className:`text-[15px] text-text-primary`,children:q7(s?.plan_payment_at,n.language)})]}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,X.jsx)(`p`,{className:`text-[13px] font-medium text-text-secondary uppercase tracking-[0.6px]`,children:e(`endDate`)}),(0,X.jsx)(`p`,{className:`text-[15px] text-text-primary`,children:d===`appsumo`?e(`planEndDateLifetime`):q7(s?.plan_end_at,n.language)})]})]}),(0,X.jsx)(Z,{variant:`secondary`,size:`sm`,onClick:()=>{a(`change_plan_click`,{page_name:`billing_page`}),k(!0)},children:e(`changePlan`)})]}),(0,X.jsxs)(`div`,{className:`border-t border-border pt-4`,children:[(0,X.jsxs)(`button`,{onClick:()=>N(e=>!e),className:`flex items-center gap-1.5 text-[14px] font-medium text-text-secondary hover:text-text-primary transition-colors cursor-pointer`,children:[e(`planFeaturesLabel`),(0,X.jsx)(Is,{className:K(`w-4 h-4 transition-transform duration-200`,M&&`rotate-180`)})]}),M&&(0,X.jsx)(`div`,{className:`mt-4`,children:d===`appsumo`?(0,X.jsx)(Hre,{tier:p,mauTotal:b,aiTotal:S,subAccountsLimit:s?.sub_accounts_limit??0,t:e}):(0,X.jsx)(Vre,{plan:d,t:e,chatLink:s?.chat_link??null,mau:s?.active_MAU??null,aiMessages:s?.active_ai_usage??null})})]}),(0,X.jsx)(`div`,{className:`border-t border-border pt-5`,children:d===`appsumo`?(0,X.jsx)(Ure,{usedMau:y,totalMau:b,usedAi:x,totalAi:S,t:e}):(0,X.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,X.jsx)(Y7,{title:e(`mauTitle`),used:y,total:b,unlimited:!!s&&b===0,unlimitedLabel:e(`byokUnlimited`)}),S>0&&(0,X.jsx)(Y7,{title:e(`aiTitle`),used:x,total:S,unlimited:!!s&&S===99999,unlimitedLabel:e(`byokUnlimited`)})]})})]}),h.data&&(0,X.jsxs)(`div`,{className:`card p-6 space-y-4`,children:[(0,X.jsx)(`h2`,{className:`text-[17px] font-semibold text-text-primary`,children:e(`sectionPaymentInfo`)}),(0,X.jsxs)(`div`,{className:`flex flex-col sm:flex-row gap-6`,children:[(0,X.jsxs)(`div`,{className:`flex-1 min-w-0 flex flex-col gap-1`,children:[(0,X.jsx)(`p`,{className:`text-[13px] font-medium text-text-secondary uppercase tracking-[0.6px]`,children:e(`paymentMethod`)}),h.data.method===1&&h.data.last_four?(0,X.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,X.jsxs)(`p`,{className:`text-[15px] text-text-primary font-medium`,children:[{1:`VISA`,2:`MasterCard`,3:`JCB`,4:`UnionPay`,5:`AMEX`}[h.data.type??0]??`Card`,` **** **** **** `,h.data.last_four]}),h.data.expiry_date&&(0,X.jsxs)(`p`,{className:`text-[13px] text-text-secondary`,children:[h.data.expiry_date.slice(0,4),`/`,h.data.expiry_date.slice(4)]})]}):h.data.method===0?(0,X.jsx)(`p`,{className:`text-[15px] text-text-primary`,children:e(`paymentLinePayLinked`)}):h.data.method===2?(0,X.jsx)(`p`,{className:`text-[15px] text-text-primary`,children:e(`paymentOnline`)}):(0,X.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,X.jsx)(`p`,{className:`text-[15px] text-text-primary`,children:e(`paymentInfoUnavailable`)}),(0,X.jsx)(`p`,{className:`text-[13px] text-text-secondary`,children:e(`paymentInfoSubscriptionOk`)})]})]}),(h.data.email||h.data.phone)&&(0,X.jsxs)(`div`,{className:`flex-1 min-w-0 flex flex-col gap-1`,children:[(0,X.jsx)(`p`,{className:`text-[13px] font-medium text-text-secondary uppercase tracking-[0.6px]`,children:e(`paymentContactInfo`)}),h.data.email&&(0,X.jsx)(`p`,{className:`text-[15px] text-text-primary`,children:h.data.email}),h.data.phone&&(0,X.jsx)(`p`,{className:`text-[13px] text-text-secondary`,children:h.data.phone})]})]})]}),dC.has(s?.plan_uid??``)&&(0,X.jsxs)(`div`,{className:`card p-6 space-y-4`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h2`,{className:`text-[17px] font-semibold text-text-primary`,children:e(`sectionAdvanced`)}),(0,X.jsx)(`p`,{className:`text-[13px] text-text-secondary mt-1`,children:e(`byokDesc`)})]}),(0,X.jsx)(`div`,{className:`space-y-3`,children:W7.map(t=>{let n=ue.some(e=>e.provider_type===t.id),r=ue.find(e=>e.provider_type===t.id)?.api_key_preview;return(0,X.jsxs)(`div`,{className:`border border-border rounded-[8px] overflow-hidden`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-3`,children:[(0,X.jsx)(`div`,{className:`w-9 h-9 rounded-[8px] flex items-center justify-center text-white text-[13px] font-bold shrink-0`,style:{backgroundColor:t.color},children:t.abbr}),(0,X.jsxs)(`div`,{className:`flex-1 min-w-0 flex flex-col sm:flex-row sm:items-center gap-1 sm:gap-2`,children:[(0,X.jsx)(`span`,{className:`text-[15px] font-medium text-text-primary flex-1`,children:t.name}),n?(0,X.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,X.jsx)(`span`,{className:`text-[13px] text-text-secondary whitespace-nowrap font-mono`,children:r??e(`byokSet`)}),(0,X.jsxs)(`button`,{onClick:()=>re(t.id),className:`inline-flex items-center gap-1 text-[13px] text-danger hover:underline cursor-pointer whitespace-nowrap`,children:[(0,X.jsx)(kc,{className:`w-3.5 h-3.5`}),i(`delete`)]})]}):(0,X.jsx)(`button`,{onClick:()=>fe(e=>({...e,[t.id]:!e[t.id]})),className:`text-[13px] text-brand hover:underline cursor-pointer whitespace-nowrap self-start sm:self-auto`,children:de[t.id]?i(`cancel`):e(`byokAddKey`)})]})]}),!n&&de[t.id]&&(0,X.jsxs)(`div`,{className:`border-t border-border px-4 py-3 bg-bg-page space-y-2`,children:[(0,X.jsx)(iE,{type:`password`,placeholder:e(`byokKeyPlaceholder`),value:pe[t.id],onChange:e=>{me(n=>({...n,[t.id]:e.target.value})),_e[t.id]&&ve(e=>({...e,[t.id]:!1}))},className:_e[t.id]?`border-danger focus:border-danger`:``}),_e[t.id]&&(0,X.jsx)(`p`,{className:`text-[13px] text-danger`,children:e(`byokInvalid`)}),(0,X.jsxs)(`div`,{className:`flex gap-2`,children:[(0,X.jsx)(Z,{size:`sm`,loading:he[t.id],disabled:!pe[t.id].trim(),onClick:()=>Te(t.id),children:e(`byokSave`)}),(0,X.jsx)(Z,{variant:`secondary`,size:`sm`,onClick:()=>{fe(e=>({...e,[t.id]:!1})),me(e=>({...e,[t.id]:``})),ve(e=>({...e,[t.id]:!1}))},children:i(`cancel`)})]})]})]},t.id)})})]}),(0,X.jsxs)(`div`,{className:`card p-6 space-y-4`,children:[(0,X.jsx)(`h2`,{className:`text-[17px] font-semibold text-text-primary`,children:e(`sectionPayments`)}),g.length===0?(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary py-4 text-center`,children:e(`noPayments`)}):(()=>{let t=Math.ceil(g.length/5),r=Math.min(L,t),i=g.slice((r-1)*5,r*5);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{className:`overflow-x-auto -mx-1`,children:(0,X.jsxs)(`table`,{className:`w-full min-w-[540px]`,children:[(0,X.jsx)(`thead`,{children:(0,X.jsxs)(`tr`,{className:`border-b border-border`,children:[(0,X.jsx)(`th`,{className:`text-left py-2 px-1 text-[13px] font-medium text-text-secondary uppercase tracking-[0.6px]`,children:e(`colDate`)}),(0,X.jsx)(`th`,{className:`text-left py-2 px-1 text-[13px] font-medium text-text-secondary uppercase tracking-[0.6px]`,children:e(`colAmount`)}),(0,X.jsx)(`th`,{className:`text-left py-2 px-1 text-[13px] font-medium text-text-secondary uppercase tracking-[0.6px]`,children:e(`colStatus`)}),(0,X.jsx)(`th`,{className:`py-2 px-1`})]})}),(0,X.jsx)(`tbody`,{children:i.map(t=>(0,X.jsxs)(`tr`,{className:`border-b border-border last:border-0`,children:[(0,X.jsx)(`td`,{className:`py-3 px-1 text-[15px] text-text-primary`,children:q7(t.date,n.language)}),(0,X.jsxs)(`td`,{className:`py-3 px-1 text-[15px] text-text-primary font-medium`,children:[t.currency,` `,t.amount.toLocaleStr
74ing()]}),(0,X.jsx)(`td`,{className:`py-3 px-1`,children:(0,X.jsx)(a8,{variant:t.status===`paid`?`success`:`warning`,children:e(t.status)})}),(0,X.jsx)(`td`,{className:`py-3 px-1`,children:(0,X.jsxs)(`div`,{className:`flex items-center gap-1 justify-end`,children:[(0,X.jsxs)(`button`,{onClick:()=>P(t),className:`inline-flex items-center gap-1.5 text-[13px] text-brand hover:underline cursor-pointer`,children:[(0,X.jsx)(Zs,{className:`w-3.5 h-3.5`}),e(`viewDetails`)]}),(0,X.jsx)(`span`,{className:`text-border mx-1`,children:`|`}),(0,X.jsxs)(`button`,{onClick:()=>Ce(t),className:`inline-flex items-center gap-1.5 text-[13px] text-text-secondary hover:text-text-primary cursor-pointer`,children:[(0,X.jsx)(qs,{className:`w-3.5 h-3.5`}),e(`downloadInvoice`)]})]})})]},t.id))})]})}),t>1&&(0,X.jsxs)(`div`,{className:`flex items-center justify-center gap-1 pt-1`,children:[(0,X.jsx)(`button`,{onClick:()=>ne(e=>Math.max(e-1,1)),disabled:r<=1,className:`h-8 w-8 flex items-center justify-center rounded-[8px] text-[13px] text-text-secondary hover:bg-bg-subtle disabled:opacity-30 disabled:cursor-not-allowed transition-colors cursor-pointer`,children:`â¹`}),Wre(r,t).map((e,t)=>e===`ellipsis`?(0,X.jsx)(`span`,{className:`h-8 w-6 flex items-center justify-center text-[13px] text-text-secondary select-none`,children:`â¦`},`ellipsis-${t}`):(0,X.jsx)(`button`,{onClick:()=>ne(e),className:K(`h-8 w-8 flex items-center justify-center rounded-[8px] text-[13px] transition-colors cursor-pointer`,e===r?`bg-brand text-white font-medium`:`text-text-secondary hover:bg-bg-subtle`),children:e},e)),(0,X.jsx)(`button`,{onClick:()=>ne(e=>Math.min(e+1,t)),disabled:r>=t,className:`h-8 w-8 flex items-center justify-center rounded-[8px] text-[13px] text-text-secondary hover:bg-bg-subtle disabled:opacity-30 disabled:cursor-not-allowed transition-colors cursor-pointer`,children:`âº`})]})]})})()]}),(0,X.jsxs)(`div`,{className:`card p-6 space-y-4`,children:[(0,X.jsx)(`h2`,{className:`text-[17px] font-semibold text-text-primary`,children:e(`sectionDiscount`)}),D?(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5 text-[14px]`,children:[(0,X.jsxs)(`div`,{className:`flex gap-3`,children:[(0,X.jsx)(`span`,{className:`text-text-secondary w-24 shrink-0`,children:e(`discountCode`)}),(0,X.jsx)(`span`,{className:`font-mono font-medium text-text-primary`,children:D.code})]}),(0,X.jsxs)(`div`,{className:`flex gap-3`,children:[(0,X.jsx)(`span`,{className:`text-text-secondary w-24 shrink-0`,children:e(`discountBenefit`)}),(0,X.jsx)(`span`,{className:`text-text-primary`,children:D.type===`days`?e(`discountBenefitDays`,{value:D.value}):D.type===`percentage`||D.type===`percent`?e(`discountBenefitPct`,{value:D.value}):`NT$${D.value.toLocaleString()}`})]})]}):(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsxs)(`div`,{className:`flex gap-2`,children:[(0,X.jsx)(iE,{placeholder:e(`discountPlaceholder`),value:ye,onChange:e=>{be(e.target.value),xe&&Se(!1)},className:K(`flex-1`,xe&&`border-danger focus:border-danger`),onKeyDown:e=>{e.key===`Enter`&&De()}}),(0,X.jsx)(Z,{loading:_.loading,disabled:!ye.trim(),onClick:De,children:e(`discountApply`)})]}),xe&&(0,X.jsx)(`p`,{className:`text-[13px] text-danger`,children:e(`discountError`)})]})]}),d!==`free`&&d!==`trial`&&!s?.isSubscriptionCanceled&&(0,X.jsxs)(`div`,{className:`card p-6 space-y-4`,style:{borderColor:`rgba(235,87,87,0.25)`},children:[(0,X.jsx)(`h2`,{className:`text-[17px] font-semibold text-danger`,children:e(`cancelTitle`)}),(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary leading-relaxed`,children:e(`cancelDesc`)}),(0,X.jsx)(`div`,{children:(0,X.jsx)(Z,{variant:`danger`,size:`sm`,onClick:()=>{a(`cancel_subscription_click`,{element_id:d}),z(!0)},children:e(`cancelButton`)})})]}),(0,X.jsx)(Kre,{open:O,onClose:()=>k(!1),currentPlan:d,planUid:s?.plan_uid??``,onSelectPlan:we,planPriceLabels:E,loadingPlan:ae,t:e}),(0,X.jsx)(GS,{open:A,onClose:()=>j(!1),title:e(`checkout.cancelRequiredTitle`),children:(0,X.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary`,children:e(`checkout.cancelRequiredDesc`)}),(0,X.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,X.jsx)(Z,{variant:`secondary`,onClick:()=>j(!1),children:i(`cancel`)}),(0,X.jsx)(Z,{variant:`danger`,onClick:()=>{j(!1),z(!0)},children:e(`checkout.cancelRequiredConfirm`)})]})]})}),ee&&(0,X.jsx)(qre,{payment:ee,lang:n.language,onClose:()=>P(null),onDownload:()=>Ce(ee),t:e,tc:i}),(0,X.jsxs)(GS,{open:!!B,onClose:()=>
74re(null),title:e(`byokDeleteTitle`),children:[(0,X.jsx)(`p`,{className:`text-[15px] text-text-secondary leading-relaxed mb-5`,children:e(`byokDeleteDesc`)}),(0,X.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,X.jsx)(Z,{variant:`secondary`,onClick:()=>re(null),children:i(`cancel`)}),(0,X.jsx)(Z,{variant:`danger`,onClick:Ee,children:i(`confirm`)})]})]}),(0,X.jsxs)(GS,{open:R,onClose:()=>z(!1),title:e(`cancelConfirmTitle`),children:[(0,X.jsx)(`p`,{className:`text-[15px] text-text-secondary leading-relaxed mb-5`,children:e(`cancelConfirmDesc`,{date:q7(s?.plan_end_at,n.language)})}),(0,X.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,X.jsx)(Z,{variant:`secondary`,onClick:()=>z(!1),children:i(`cancel`)}),(0,X.jsx)(Z,{variant:`danger`,loading:v.loading,onClick:async()=>{a(`cancel_subscription_confirm_click`,{element_id:d});try{let t=h.data?.method??2;await v.mutate(t),await c(),z(!1),a(`cancel_subscription_confirm_click`,{element_id:d,result:`success`}),Q.success(e(`cancelSuccess`))}catch(t){a(`cancel_subscription_confirm_click`,{element_id:d,result:`fail`});let n=t instanceof Du&&t.message?t.message:e(`cancelFailed`);Q.error(n)}},children:e(`cancelConfirmButton`)})]})]}),F&&(()=>{let t=F.currency===`TWD`?`NT$`:`${F.currency} `,r=e=>`${t}${e.toLocaleString()}`,i=F.discountType===`percentage`||F.discountType===`percent`,a=F.discountValue==null?0:i?Math.round(F.price*F.discountValue/100):Math.min(F.discountValue,F.price),o=e=>({padding:`10px 0`,fontSize:`11px`,fontWeight:700,color:`#888`,letterSpacing:`0.6px`,textTransform:`uppercase`,textAlign:e,borderBottom:`1px solid #e2e8f0`});return(0,X.jsx)(`div`,{style:{position:`fixed`,left:`-9999px`,top:`-9999px`,zIndex:-1},children:(0,X.jsxs)(`div`,{ref:te,style:{width:`794px`,padding:`48px`,backgroundColor:`#ffffff`,fontFamily:`-apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif`,fontSize:`14px`,color:`#000000`},children:[(0,X.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`flex-start`,marginBottom:`32px`},children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`div`,{style:{fontSize:`22px`,fontWeight:700,marginBottom:`4px`},children:`PinChat`}),(0,X.jsx)(`div`,{style:{fontSize:`13px`,color:`#555`},children:`[email protected]`})]}),(0,X.jsxs)(`div`,{style:{textAlign:`right`,maxWidth:`280px`},children:[(0,X.jsx)(`div`,{style:{fontSize:`22px`,fontWeight:700,marginBottom:`4px`},children:e(`invoicePdf.title`)}),(0,X.jsx)(`div`,{style:{fontFamily:`monospace`,fontSize:`12px`,color:`#555`,wordBreak:`break-all`},children:F.id})]})]}),(0,X.jsx)(`div`,{style:{borderTop:`1px solid #e2e8f0`,marginBottom:`28px`}}),(0,X.jsxs)(`div`,{style:{display:`flex`,gap:`48px`,marginBottom:`32px`},children:[(0,X.jsxs)(`div`,{style:{flex:1},children:[(0,X.jsx)(`div`,{style:{fontSize:`11px`,fontWeight:700,color:`#888`,letterSpacing:`0.6px`,textTransform:`uppercase`,marginBottom:`10px`},children:e(`invoicePdf.info`)}),[{label:e(`invoicePdf.date`),value:J7(F.date,n.language)},{label:e(`invoicePdf.payment`),value:G7(F.method,e)},{label:e(`invoicePdf.status`),value:(0,X.jsx)(`span`,{style:{color:`#16a34a`,fontWeight:600},children:e(`invoicePdf.paid`)})}].map(({label:e,value:t})=>(0,X.jsxs)(`div`,{style:{display:`flex`,gap:`8px`,marginBottom:`4px`},children:[(0,X.jsx)(`span`,{style:{color:`#555`,minWidth:`72px`},children:e}),(0,X.jsx)(`span`,{children:t})]},e))]}),(0,X.jsxs)(`div`,{style:{flex:1},children:[(0,X.jsx)(`div`,{style:{fontSize:`11px`,fontWeight:700,color:`#888`,letterSpacing:`0.6px`,textTransform:`uppercase`,marginBottom:`10px`},children:e(`invoicePdf.billedTo`)}),(0,X.jsx)(`div`,{style:{fontWeight:600,marginBottom:`2px`},children:F.name}),(0,X.jsx)(`div`,{style:{color:`#555`,marginBottom:`2px`},children:F.email}),F.invoiceTitle&&(0,X.jsx)(`div`,{style:{marginTop:`6px`},children:F.invoiceTitle}),F.taxId&&(0,X.jsx)(`div`,{style:{fontFamily:`monospace`,fontSize:`13px`,color:`#555`},children:F.taxId})]})]}),(0,X.jsx)(`div`,{style:{borderTop:`1px solid #e2e8f0`}}),(0,X.jsxs)(`table`,{style:{width:`100%`,borderCollapse:`collapse`},children:[(0,X.jsx)(`thead`,{children:(0,X.jsxs)(`tr`,{children:[(0,X.jsx)(`th`,{style:o(`left`),children:e(`invoicePdf.description`)}),(0,X.jsx)(`th`,{style:{...o(`center`),width:`60px`},children:e(`invoicePdf.qty`)}),(0,X.jsx)(`th`,{style:{...o(`right`),width:`130px`},children:e(`invoicePdf.unitPrice`)}),(0,X.jsx)(`th`,{style:{...o(`right`),width:`130px`},children:e(`invoicePdf.amount`)})]})}),(0,X.jsxs)(`tbody`,{children:[(0,X.jsxs)(`tr`,{style:{borderBottom:`1px solid #f1f5f9`},children:[(0,X.jsx)(`td`,{style:{padding:`12px 0`,fontWeight:500},children:e(F.planKey)}),(0,X.jsx)(`td`,{style:{padding:`12px 0`,textAlign:`center`,color:`#555`},children:`1`}),(0,X.jsx)(`td`,{style:{padding:`12px 0`,textAlign:`right`,fontFamily:`monospace`},children:r(F.price)}),(0,X.jsx)(`td`,{style:{padding:`12px 0`,textAlign:`right`,fontFamily:`monospace`},children:r(F.price)})]}),F.discount&&F.discountValue!=null&&(0,X.jsxs)(`tr`,{style:{borderBottom:`1px solid #f1f5f9`},children:[(0,X.jsxs)(`td`,{style:{padding:`12px 0`,color:`#555`},children:[e(`invoicePdf.discount`),` (`,F.discount,`)`]}),(0,X.jsx)(`td`,{style:{padding:`12px 0`}}),(0,X.jsx)(`td`,{style:{padding:`12px 0`}}),(0,X.jsx)(`td`,{style:{padding:`12px 0`,textAlign:`right`,fontFamily:`monospace`,color:`#16a34a`},children:`\u2212${r(a)}`})]}),(0,X.jsxs)(`tr`,{children:[(0,X.jsx)(`td`,{colSpan:3,style:{padding:`14px 0 0`,textAlign:`right`,fontWeight:700,fontSize:`15px`,borderTop:`2px solid #000`},children:e(`invoicePdf.total`)}),(0,X.jsx)(`td`,{style:{padding:`14px 0 0`,textAlign:`right`,fontFamily:`monospace`,fontWeight:700,fontSize:`18px`,borderTop:`2px solid #000`},children:r(F.amount)})]})]})]}),(0,X.jsx)(`div`,{style:{borderTop:`1px solid #e2e8f0`,margin:`28px 0 20px`}}),(0,X.jsxs)(`div`,{style:{fontSize:`12px`,color:`#888`,lineHeight:`1.8`},children:[(0,X.jsx)(`div`,{children:e(`invoicePdf.thanks`)}),(0,X.jsxs)(`div`,{children:[e(`invoicePdf.enquiries`),` `,(0,X.jsx)(`span`,{style:{fontFamily:`monospace`},children:`[email protected]`})]})]})]})})})()]})}function Kre({open:e,onClose:t,currentPlan:n,planUid:r,onSelectPlan:i,planPriceLabels:a,loadingPlan:o,t:s}){return(0,X.jsxs)(GS,{open:e,onClose:t,title:s(`changePlanTitle`),className:`!max-w-5xl`,children:[(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary mb-1`,children:s(`changePlanNote`)}),(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary mb-5`,children:(0,X.jsx)(ht,{t:s,i18nKey:`changePlanContactNote`,components:{a:(0,X.jsx)(`a`,{href:K7,target:`_blank`,rel:`noopener noreferrer`,className:`text-brand hover:underline`})}})}),(0,X.jsx)(`div`,{className:`grid grid-cols-2 lg:grid-cols-4 gap-3 items-stretch`,children:Nre.map(e=>{let t=U7[e],c=t?r===t:e===n;return(0,X.jsxs)(`div`,{className:K(`rounded-[12px] border p-4 flex flex-col`,c?`border-brand bg-brand-tint/30`:`border-border`),children:[(0,X.jsx)(`div`,{className:`flex items-start justify-between gap-1 mb-3`,children:(0,X.jsx)(`p`,{className:`text-[17px] font-semibold text-text-primary`,children:s(V7[e])})}),(0,X.jsx)(`p`,{className:`text-[28px] font-bold text-text-primary tracking-[-0.5px] mb-4 leading-none`,children:a[e]}),(0,X.jsxs)(`ul`,{className:`space-y-2 flex-1 mb-5`,children:[B7[e]&&(0,X.jsxs)(`li`,{className:`flex items-start gap-2 text-[13px] text-text-secondary`,children:[(0,X.jsx)(Fs,{className:`w-3.5 h-3.5 text-brand mt-0.5 shrink-0`}),s(`planFeaturesIncludes`,{plan:s(V7[B7[e]])})]}),z7[e].map(e=>(0,X.jsxs)(`li`,{className:`flex items-start gap-2 text-[13px] text-text-secondary`,children:[(0,X.jsx)(Fs,{className:`w-3.5 h-3.5 text-brand mt-0.5 shrink-0`}),s(e)]},e))]}),c?(0,X.jsxs)(`div`,{className:`h-9 flex items-center justify-center gap-1.5 text-[14px] font-medium text-brand select-none`,children:[(0,X.jsx)(Fs,{className:`w-4 h-4 shrink-0`}),s(`currentPlanBadge`)]}):e===`free`&&n===`trial`?(0,X.jsx)(`div`,{className:`h-9`}):(0,X.jsx)(Z,{variant:`secondary`,size:`sm`,className:`w-full`,loading:o===e,disabled:o!==null&&e!==`free`&&e!==`enterprise`,onClick:()=>i(e),children:s(e===`enterprise`||n!==`free`&&n!==`trial`&&e!==`free`?`contactUs`:(n===`free`||n===`trial`)&&e!==`free`?`upgrade`:`selectPlan`)})]},e)})})]})}function qre({payment:e,lang:t,onClose:n,onDownload:r,t:i,tc:a}){let o=[{label:i(`detailInvoice`),value:(0,X.jsx)(`span`,{className:`font-mono text-[14px]`,children:e.id})}
74,{label:i(`detailPlan`),value:i(e.planKey)},{label:i(`detailPlanAmount`),value:`${e.currency} ${e.price.toLocaleString()}`},...e.discount?[{label:i(`detailDiscount`),value:(0,X.jsx)(`span`,{className:`font-mono text-[14px]`,children:e.discount})}]:[],{label:i(`detailPayTime`),value:J7(e.date,t)},{label:i(`detailPayMethod`),value:G7(e.method,i)},{label:i(`detailStatus`),value:(0,X.jsx)(a8,{variant:e.status===`paid`?`success`:`warning`,children:i(e.status)})},{label:i(`detailTotal`),value:(0,X.jsxs)(`span`,{className:`font-semibold`,children:[e.currency,` `,e.amount.toLocaleString()]})}];return(0,X.jsxs)(GS,{open:!0,onClose:n,title:q7(e.date,t),children:[(0,X.jsx)(`div`,{className:`space-y-3 mb-5`,children:o.map(e=>(0,X.jsxs)(`div`,{className:`flex gap-3`,children:[(0,X.jsx)(`span`,{className:`text-[14px] text-text-secondary shrink-0 w-28`,children:e.label}),(0,X.jsx)(`span`,{className:`text-[14px] text-text-primary`,children:e.value})]},e.label))}),(0,X.jsxs)(`div`,{className:`flex justify-end gap-2 pt-3 border-t border-border`,children:[(0,X.jsx)(Z,{variant:`secondary`,size:`sm`,onClick:n,children:a(`close`)}),(0,X.jsxs)(Z,{size:`sm`,onClick:r,children:[(0,X.jsx)(qs,{className:`w-4 h-4`}),i(`downloadReceipt`)]})]})]})}function Jre(){return new Promise((e,t)=>{if(!window.TPDirect){t(Error(`TapPay SDK not loaded`));return}window.TPDirect.card.getPrime(n=>{n.status===0?e(n.card.prime):t(Error(n.msg||`Card error`))})})}function Yre(e){return!!e&&Pre.includes(e)}function X7(e,t){return`${t}${e.toLocaleString(`en-US`)}`}function Xre(){let{t:e,i18n:t}=V(`billing`);cE(e(`checkout.title`));let{plan:n}=pa(),r=la(),i=cC(e=>e.setCurrentPlan),{logAnalyticsEvent:a}=BS();(0,f.useEffect)(()=>{a(`page_view`,{page_name:`payment_page`})},[a]);let[o,s]=(0,f.useState)(`creditCard`),[c,l]=(0,f.useState)(``),[u,d]=(0,f.useState)(`+886`),[p,m]=(0,f.useState)(``),[h,g]=(0,f.useState)(``),[_,v]=(0,f.useState)(!1),[y,b]=(0,f.useState)(!1),x=(0,f.useRef)(!1);(0,f.useEffect)(()=>{if(window.TPDirect){b(!0);return}let e=document.querySelector(`script[src*="tappaysdk.com"]`);if(e){e.addEventListener(`load`,()=>b(!0));return}let t=document.createElement(`script`);return t.src=`https://js.tappaysdk.com/tpdirect/v5.13.1`,t.onload=()=>b(!0),document.head.appendChild(t),()=>{document.querySelectorAll(`body > iframe`).forEach(e=>e.remove())}},[]);let[S,C]=(0,f.useState)(`b2c`),[w,T]=(0,f.useState)(``),[E,D]=(0,f.useState)(``),O=Kd(),k=qd(),A=Wd(),[j,M]=(0,f.useState)(``),[N,ee]=(0,f.useState)(!1),[P,F]=(0,f.useState)(!1),[I,te]=(0,f.useState)(null),[L,ne]=(0,f.useState)(`idle`);(0,f.useEffect)(()=>{L!==`success`&&L!==`failure`||document.querySelectorAll(`body > iframe`).forEach(e=>e.remove())},[L]);let R=Yre(n)?n:null,z=t.language===`zh-TW`?`TWD`:`USD`,B=z===`TWD`?`NT$`:`$`,{data:re=[]}=Bd(z),ie=R?U7[R]:void 0,ae=ie?re.find(e=>e.uid===ie)?.price??0:0,oe=I?I.discount_type===`percentage`?Math.round(ae*(I.discount_value/100)):Math.min(I.discount_value,ae):0,se=Math.max(0,ae-oe),ce=R?B7[R]:void 0,le=(0,f.useMemo)(()=>R?z7[R]:[],[R]),ue=async()=>{let e=j.trim();if(e){ee(!0),F(!1);try{let t=await A.mutate({code:e,currency:z});if(t.discount_type===`cash`&&ae>0&&t.discount_value>ae){F(!0);return}a(`use_coupon_code`,{coupon_code:e,result:`success`,page_name:`payment_page`}),te({code:e.toUpperCase(),discount_type:t.discount_type,discount_value:t.discount_value}),M(``)}catch{a(`use_coupon_code`,{coupon_code:j.trim(),result:`fail`,page_name:`payment_page`}),F(!0)}finally{ee(!1)}}};return(0,f.useEffect)(()=>{if(o!==`creditCard`){v(!1);return}if(!(!y||!window.TPDirect))return x.current||(x.current=!0,window.TPDirect.setupSDK(Number(wu.VITE_TAPPAY_APP_ID),wu.VITE_TAPPAY_APP_KEY,wu.VITE_TAPPAY_ENV||`sandbox`)),window.TPDirect.card.setup({fields:{number:{element:`#tappay-card-number`,placeholder:`â¢â¢â¢â¢ â¢â¢â¢â¢ â¢â¢â¢â¢ â¢â¢â¢â¢`},expirationDate:{element:`#tappay-card-expiry`,placeholder:`MM / YY`},ccv:{element:`#tappay-card-ccv`,placeholder:`â¢â¢â¢`}},styles:{input:{color:`#333333`,"font-size":`15px`,"font-family":`-apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif`},":focus":{color:`#111111`},".valid":{color:`#333333`},".invalid":{color:`#cc0000`},"::placeholder":{color:`#9ca3af`}}}),window.TPDirect.card.onUpdate(e=>{v(e.canGetPrime)}),()=>{[`tappay-card-number`,`tappay-card-expiry`,`tappay-card-ccv`].forEach(e
74=>{let t=document.getElementById(e);t&&(t.innerHTML=``)})}},[o,y]),R?(0,X.jsxs)(`div`,{className:`h-full w-full flex flex-col bg-bg-page`,children:[(0,X.jsxs)(`header`,{className:`h-16 bg-bg-card border-b border-border flex items-center px-4 lg:px-8 shrink-0`,children:[(0,X.jsxs)(`button`,{onClick:()=>r(`/dashboard/billing`),className:`flex items-center gap-1.5 text-[14px] text-text-secondary hover:text-text-primary cursor-pointer transition-colors`,children:[(0,X.jsx)(Ds,{className:`w-4 h-4`}),e(`checkout.backToBilling`)]}),(0,X.jsx)(`div`,{className:`flex-1`}),(0,X.jsxs)(`a`,{href:`/`,className:`flex items-center`,children:[(0,X.jsx)(`img`,{src:VS,alt:`PinChat`,className:`h-8 w-auto block dark:hidden`}),(0,X.jsx)(`img`,{src:HS,alt:`PinChat`,className:`h-8 w-auto hidden dark:block`})]})]}),(0,X.jsx)(`main`,{className:`flex-1 overflow-auto px-4 lg:px-8 py-8`,children:(0,X.jsx)(`div`,{className:`max-w-5xl mx-auto`,children:L===`success`?(0,X.jsx)(Zre,{planName:e(V7[R]),onBack:()=>{R&&(a(`checkout_complete`,{plan:R,result:`success`}),i(R),Q.success(e(`checkout.successDesc`,{plan:e(V7[R])})),r(`/dashboard/billing`))},t:e}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`h1`,{className:`text-[28px] font-semibold text-text-primary mb-6`,children:e(`checkout.title`)}),(0,X.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-[minmax(0,1fr)_360px] gap-6 items-start`,children:[(0,X.jsxs)(`div`,{className:`space-y-4 order-2 lg:order-1 min-w-0`,children:[(0,X.jsxs)(`section`,{className:`card p-6 space-y-5`,children:[(0,X.jsx)(`h2`,{className:`text-[17px] font-semibold text-text-primary`,children:e(`checkout.sectionPayment`)}),(0,X.jsx)(`div`,{className:`flex rounded-[8px] border border-border overflow-hidden`,children:[`creditCard`,`linePay`].map((t,n)=>(0,X.jsx)(`button`,{onClick:()=>s(t),className:K(`flex-1 h-11 text-[14px] font-medium transition-colors cursor-pointer`,n>0&&`border-l border-border`,o===t?`bg-brand-tint text-brand`:`text-text-secondary hover:bg-bg-subtle`),children:e(t===`creditCard`?`checkout.methodCreditCard`:`checkout.methodLinePay`)},t))}),(0,X.jsxs)(`div`,{className:`space-y-4`,children:[(0,X.jsx)(iE,{label:e(o===`creditCard`?`checkout.cardholderName`:`checkout.payerName`),placeholder:e(`checkout.cardholderNamePlaceholder`),value:c,onChange:e=>l(e.target.value)}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,X.jsx)(`label`,{className:`text-[14px] font-medium text-text-primary`,children:e(`checkout.email`)}),(0,X.jsx)(`input`,{type:`email`,placeholder:`[email protected]`,value:h,onChange:e=>g(e.target.value),className:`h-10 w-full rounded-[8px] border border-border bg-bg-card px-3 text-[15px] text-text-primary placeholder:text-text-secondary placeholder:opacity-50 outline-none focus:border-border-strong transition-colors`}),(0,X.jsx)(`p`,{className:`text-[13px] text-text-secondary`,children:e(`checkout.emailHint`)})]}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,X.jsx)(`label`,{className:`text-[14px] font-medium text-text-primary`,children:e(`checkout.phone`)}),(0,X.jsxs)(`div`,{className:`flex rounded-[8px] border border-border bg-bg-card focus-within:border-border-strong transition-colors overflow-hidden`,children:[(0,X.jsxs)(`select`,{value:u,onChange:e=>d(e.target.value),className:`h-10 pl-3 pr-2 text-[15px] text-text-primary bg-transparent outline-none appearance-none cursor-pointer border-r border-border`,"aria-label":e(`checkout.phoneCountryCode`),children:[(0,X.jsx)(`option`,{value:`+886`,children:`+886`}),(0,X.jsx)(`option`,{value:`+852`,children:`+852`}),(0,X.jsx)(`option`,{value:`+1`,children:`+1`}),(0,X.jsx)(`option`,{value:`+81`,children:`+81`}),(0,X.jsx)(`option`,{value:`+82`,children:`+82`}),(0,X.jsx)(`option`,{value:`+65`,children:`+65`}),(0,X.jsx)(`option`,{value:`+44`,children:`+44`}),(0,X.jsx)(`option`,{value:`+49`,children:`+49`})]}),(0,X.jsx)(`input`,{type:`tel`,value:p,onChange:e=>m(e.target.value.replace(/\D/g,``)),placeholder:`912 345 678`,className:`flex-1 min-w-0 h-10 px-3 text-[15px] text-text-primary bg-transparent placeholder:text-text-secondary placeholder:opacity-50 outline-none`})]})]})]}
74),o===`creditCard`&&(0,X.jsxs)(`div`,{className:`space-y-4 pt-4 border-t border-border`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,X.jsxs)(`label`,{className:`text-[14px] font-medium text-text-primary flex items-center gap-1.5`,children:[(0,X.jsx)(Ks,{className:`w-4 h-4 text-text-secondary`}),e(`checkout.cardNumber`)]}),(0,X.jsx)(`div`,{className:`h-10 w-full rounded-[8px] border border-border bg-bg-card overflow-hidden`,children:(0,X.jsx)(`div`,{id:`tappay-card-number`,className:`h-full mx-3`})})]}),(0,X.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,X.jsx)(`label`,{className:`text-[14px] font-medium text-text-primary`,children:e(`checkout.expiry`)}),(0,X.jsx)(`div`,{className:`h-10 w-full rounded-[8px] border border-border bg-bg-card overflow-hidden`,children:(0,X.jsx)(`div`,{id:`tappay-card-expiry`,className:`h-full mx-3`})})]}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,X.jsx)(`label`,{className:`text-[14px] font-medium text-text-primary`,children:e(`checkout.cvc`)}),(0,X.jsx)(`div`,{className:`h-10 w-full rounded-[8px] border border-border bg-bg-card overflow-hidden`,children:(0,X.jsx)(`div`,{id:`tappay-card-ccv`,className:`h-full mx-3`})})]})]})]})]}),(0,X.jsxs)(`section`,{className:`card p-6 space-y-4`,children:[(0,X.jsx)(`h2`,{className:`text-[17px] font-semibold text-text-primary`,children:e(`checkout.sectionInvoice`)}),(0,X.jsx)(`div`,{className:`space-y-2`,children:[`b2c`,`b2b`].map(t=>{let n=S===t;return(0,X.jsxs)(`label`,{className:K(`flex items-center gap-3 px-3 py-2.5 rounded-[8px] cursor-pointer transition-colors`,n?`bg-brand-tint/30`:`hover:bg-bg-subtle`),children:[(0,X.jsx)(`input`,{type:`radio`,name:`invoiceType`,checked:n,onChange:()=>C(t),className:`sr-only`}),(0,X.jsx)(`span`,{className:K(`w-4 h-4 rounded-full border flex items-center justify-center shrink-0 transition-colors`,n?`border-brand`:`border-border-strong`),children:n&&(0,X.jsx)(`span`,{className:`w-2 h-2 rounded-full bg-brand`})}),(0,X.jsx)(`span`,{className:`text-[14px] text-text-primary`,children:e(t===`b2c`?`checkout.invoiceB2C`:`checkout.invoiceB2B`)})]},t)})}),S===`b2b`&&(0,X.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-4 pt-2`,children:[(0,X.jsx)(iE,{label:e(`checkout.invoiceCompanyName`),placeholder:e(`checkout.invoiceCompanyNamePlaceholder`),value:w,onChange:e=>T(e.target.value)}),(0,X.jsx)(iE,{label:e(`checkout.invoiceTaxId`),inputMode:`numeric`,placeholder:`12345678`,value:E,onChange:e=>D(e.target.value.replace(/\D/g,``).slice(0,8))})]}),(0,X.jsxs)(`p`,{className:`text-[13px] text-text-secondary leading-relaxed`,children:[e(`checkout.invoiceDeliveryHint`),` `,(0,X.jsx)(`a`,{href:`mailto:[email protected]`,className:`text-brand hover:underline`,children:e(`checkout.invoiceDeliveryContact`)}),`ã`]})]})]}),(0,X.jsxs)(`aside`,{className:`card p-5 space-y-5 order-1 lg:order-2 lg:sticky lg:top-6`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h2`,{className:`text-[13px] font-medium text-text-secondary uppercase tracking-[0.6px] mb-2`,children:e(`checkout.sectionOrder`)}),(0,X.jsx)(`p`,{className:`text-[22px] font-bold text-text-primary`,children:e(V7[R])})]}),(0,X.jsxs)(`ul`,{className:`space-y-2 text-[13px] text-text-secondary`,children:[ce&&(0,X.jsxs)(`li`,{className:`flex items-start gap-2`,children:[(0,X.jsx)(Fs,{className:`w-3.5 h-3.5 text-brand mt-0.5 shrink-0`}),e(`planFeaturesIncludes`,{plan:e(V7[ce])})]}),le.map(t=>(0,X.jsxs)(`li`,{className:`flex items-start gap-2`,children:[(0,X.jsx)(Fs,{className:`w-3.5 h-3.5 text-brand mt-0.5 shrink-0`}),e(t)]},t))]}),(0,X.jsxs)(`div`,{className:`space-y-2 pt-4 border-t border-border`,children:[(0,X.jsx)(`label`,{className:`text-[14px] font-medium text-text-primary`,children:e(`checkout.sectionDiscount`)}),I?(0,X.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2 rounded-[8px] bg-brand-tint/50 border border-brand/30`,children:[(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsx)(`p`,{className:`text-[13px] font-medium text-brand font-mono truncate`,children:I.code}),(0,X.jsx)(`p`,{className:`text-[12px] text-text-secondary`,children:I.discount_type===`percentage`?`-${I.discount_value}%`:`-${X7(I.discount_value,B)}`})]}),(0,X.jsx)(`button`,{onClick:()=>te(null),className:`ml-2 shrink-0 text-text-secondary hover:text-danger transition-colors cursor-pointer`,"aria-label":e(`checkout.discountRemove`),children:(0,X.jsx)(Ic,{className:`w-4 h-4`})})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`flex gap-2`,children:[(0,X.jsx)(`input`,{value:j,onChange:e=>{M(e.target.value),P&&F(!1)},placeholder:e(`checkout.discountInputPlaceholder`),className:K(`flex-1 min-w-0 h-10 rounded-[8px] border px-3 text-[14px] bg-bg-card text-text-primary outline-none transition-colors`,P?`border-danger`:`border-border focus:border-border-strong`),disabled:N,onKeyDown:e=>e.key===`Enter`&&ue()}),(0,X.jsx)(Z,{variant:`secondary`,size:`md`,onClick:ue,loading:N,disabled:!j.trim()||N,className:`shrink-0`,children:e(`checkout.discountApply`)})]}),P&&(0,X.jsx)(`p`,{className:`text-[13px] text-danger`,children:e(`checkout.discountInvalid`)})]})]}),(0,X.jsxs)(`div`,{className:`space-y-1.5 pt-4 border-t border-border`,children:[(0,X.jsxs)(`div`,{className:`flex justify-between text-[14px]`,children:[(0,X.jsx)(`span`,{className:`text-text-secondary`,children:e(`checkout.subtotal`)}),(0,X.jsx)(`span`,{className:`text-text-primary tabular-nums`,children:X7(ae,B)})]}),I&&(0,X.jsxs)(`div`,{className:`flex justify-between text-[14px]`,children:[(0,X.jsx)(`span`,{className:`text-text-secondary`,children:e(`checkout.discount`)}),(0,X.jsxs)(`span`,{className:`text-brand tabular-nums`,children:[`â`,X7(oe,B)]})]}),(0,X.jsxs)(`div`,{className:`flex justify-between items-baseline pt-2 border-t border-border`,children:[(0,X.jsx)(`span`,{className:`text-[15px] font-semibold text-text-primary`,children:e(`checkout.total`)}),(0,X.jsx)(`span`,{className:`text-[22px] font-bold text-text-primary tabular-nums`,children:e(`checkout.priceMonthly`,{amount:X7(se,B)})})]})]}),(0,X.jsx)(Z,{onClick:async()=>
74{if(!R||!ie)return;ne(`processing`);let e=+(S===`b2b`),t=`${u}${p}`,n=I?.code;try{if(o===`linePay`){let r=(await k.mutate({planUid:ie,userName:c,phoneNumber:t,email:h,...n&&{couponCode:n},invoiceType:e,...S===`b2b`&&{invoiceTitle:w,uniformInvoiceNumbers:E},currency:z}))?.info?.paymentUrl?.web;if(!r)throw Error(`No LINE Pay URL`);window.location.href=r}else{let r=await Jre(),i=await O.mutate({uid:ie,name:c,phone:t,email:h,prime:r,additional_rule:[],...n&&{coupon_code:n},payment_type:1,invoice_type:e,...S===`b2b`&&{invoice_title:w,uniform_invoice_numbers:E},currency:z});if(i?.payment_url){window.location.href=i.payment_url;return}a(`purchase`,{element_id:R,result:`success`}),ne(`success`)}}catch{a(`purchase`,{element_id:R,result:`fail`}),ne(`failure`)}},loading:L===`processing`,disabled:L===`processing`||!c.trim()||!h.trim()||!p.trim()||o===`creditCard`&&!_,className:`w-full`,children:e(L===`processing`?`checkout.processing`:`checkout.confirmPayment`)}),(0,X.jsx)(`p`,{className:`text-[12px] text-text-secondary leading-relaxed`,children:e(`checkout.secureNote`)})]})]})]})})}),(0,X.jsx)(GS,{open:L===`failure`,onClose:()=>ne(`idle`),title:e(`checkout.failureTitle`),children:(0,X.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary`,children:e(`checkout.failureDesc`)}),(0,X.jsx)(`div`,{className:`flex justify-end gap-2`,children:(0,X.jsx)(Z,{variant:`secondary`,onClick:()=>ne(`idle`),children:e(`checkout.failureClose`)})})]})})]}):(0,X.jsx)(Ya,{to:`/dashboard/billing`,replace:!0})}function Zre({planName:e,onBack:t,t:n}){return(0,X.jsxs)(`div`,{className:`max-w-lg mx-auto pt-16 text-center`,children:[(0,X.jsx)(`div`,{className:`w-16 h-16 rounded-full bg-brand-tint flex items-center justify-center mx-auto mb-5`,children:(0,X.jsx)(Vs,{className:`w-9 h-9 text-brand`})}),(0,X.jsx)(`h1`,{className:`text-[28px] font-semibold text-text-primary mb-2`,children:n(`checkout.successTitle`)}),(0,X.jsx)(`p`,{className:`text-[15px] text-text-secondary mb-8`,children:n(`checkout.successDesc`,{plan:e})}),(0,X.jsx)(Z,{onClick:t,children:n(`checkout.successBackButton`)})]})}function Qre(e){try{let t=e.replace(/-/g,`+`).replace(/_/g,`/`),n=t+`=`.repeat((4-t.length%4)%4),r=atob(n),i=Uint8Array.from(r,e=>e.charCodeAt(0));return new TextDecoder().decode(i)}catch{return null}}function $re(e){let t=e.split(`.`);if(t.length!==3)return null;let n=Qre(t[1]);if(n===null)return null;try{let e=JSON.parse(n);if(typeof e!=`object`||!e)return null;let t=e.exp;return typeof t==`number`&&Number.isFinite(t)?t:null}catch{return null}}function eie(e,t=Date.now()){let n=$re(e);return n===null?!1:n*1e3<=t}async function Z7(e,t){let n=await q.post(`/chat/guest_${encodeURIComponent(e)}`,t,{skipAuth:!0});return n?.data&&typeof n.data==`object`?n.data:n}async function Q7(e,t){let n=await q.post(`/chat/guest/config/${encodeURIComponent(e)}`,void 0,{skipAuth:!0,headers:{Authorization:`Bearer ${t}`}});return n?.data&&typeof n.data==`object`?n.data:n}var $7=`session-`;function e9(e){if(typeof window>`u`)return null;let t=localStorage.getItem(`${$7}${e}`);if(!t)return null;try{let e=JSON.parse(t);return typeof e?.token==`string`&&typeof e?.roomId==`string`&&e.token.length>0&&e.roomId.length>0?{record:e,expired:eie(e.token)}:null}catch{return null}}function tie(e){let t=e9(e);return t?t.expired?t.record.accessToken?t.record:null:t.record:null}function t9(e,t){typeof window>`u`||localStorage.setItem(`${$7}${e}`,JSON.stringify(t))}function n9(e){typeof window>`u`||localStorage.removeItem(`${$7}${e}`)}async function r9(e){let t=await q.post(`/chat/guest/config/${encodeURIComponent(e)}`,void 0,{skipAuth:!0});return t?.data&&typeof t.data==`object`?t.data:t}async function i9(e,t,n){let r=`/chat/guest/notify/${encodeURIComponent(e)}?roomId=${encodeURIComponent(t)}`,i=await q.get(r,{skipAuth:!0,headers:{Authorization:`Bearer ${n}`}});return i?.data&&typeof i.data==`object`?i.data:i}async function a9(e,t,n){await q.post(`/chat/guest/notify/${encodeURIComponent(e)}`,t,{skipAuth:!0,headers:{Authorization:`Bearer ${n}`}})}async function nie(e,t,n){await q.post(`/customer/info`,{token:e,...t},{skipAuth:!0,headers:{Authorization:`Bearer ${n}`}})}async function rie(e){let t=await q.post(`/chat/guest/config/_by_domain`,{domain:e},{skipAuth:!0});return t?.data&&typeof t.data==`object`?t.data:t}async function iie(e){let t=await q.post(`/chat/guest/login`,e,{skipAuth:!0});return t?.data&&typeof t.data==`object`?t.data:t}async function o9(e,t){let n=new URLSearchParams({roomId:e});t&&(n.set(`email`,t),n.set(`is_send_email`,`true`));let r=await q.get(`/chat/message/export?${n.toString()}`);return t?{type:`emailed`}:typeof r==`string`?{type:`text`,text:r}:{type:`tooLarge`}}async function aie(e,t){await q.post(`/bot/${encodeURIComponent(e)}`,{is_open_bot:t})}async function oie(e){let t=e?{scope:`enterpoint`,roomTag:e}:{scope:`all`};return q.post(`/chat/pinchat-ai/room`,t)}async function s9(e,t,n){if(!(typeof window>`u`))try{let r=`${wu.VITE_PINCHAT_API_BASE}/api/${Eu()}/track/${e}`,i=navigator.language||navigator.userLanguage,a={"Content-Type":`application/json`};
74n&&(a.Authorization=`Bearer ${n}`),await fetch(r,{method:`POST`,headers:a,body:JSON.stringify({...t,language:i}),keepalive:!0})}catch{}}var sie={en:`en-US`,"en-US":`en-US`,"en-GB":`en-US`,ja:`ja-JP`,"ja-JP":`ja-JP`,ko:`ko-KR`,"ko-KR":`ko-KR`,fr:`fr-FR`,"fr-FR":`fr-FR`,de:`de-DE`,"de-DE":`de-DE`,es:`es-ES`,"es-ES":`es-ES`,pt:`pt-PT`,"pt-PT":`pt-PT`,"pt-BR":`pt-PT`,ro:`ro-RO`,"ro-RO":`ro-RO`,th:`th-TH`,"th-TH":`th-TH`,vi:`vi-VN`,"vi-VN":`vi-VN`,zh:`zh-TW`,"zh-TW":`zh-TW`,"zh-Hant":`zh-TW`,"zh-CN":`zh-CN`,"zh-Hans":`zh-CN`};function c9(e){return sie[e]??`en-US`}function l9(e){let[t,n]=(0,f.useState)(e?`shown`:`hidden`),[r,i]=(0,f.useState)(e);return e!==r&&(i(e),n(e?`entering`:`leaving`)),(0,f.useEffect)(()=>{if(t===`entering`){let e=requestAnimationFrame(()=>{requestAnimationFrame(()=>n(`shown`))});return()=>cancelAnimationFrame(e)}if(t===`leaving`){let e=setTimeout(()=>n(`hidden`),300);return()=>clearTimeout(e)}},[t]),{shouldRender:t!==`hidden`,slid:t===`shown`}}var cie={sendButtonEnabled:!1,showLeaveRoomButton:!0};function u9(e,t,n={}){let{settings:r,callbacks:i,firebaseConfig:a,firebaseVapidKey:o}=n,s=(0,f.useRef)(r),c=(0,f.useRef)(i),l=(0,f.useRef)(a),u=(0,f.useRef)(o);(0,f.useLayoutEffect)(()=>{s.current=r,c.current=i,l.current=a,u.current=o}),(0,f.useEffect)(()=>{if(t!==`ready`)return;let n=!1,r=0,i=()=>{if(n)return;let t=e.current;if(!t||typeof t.setConfig!=`function`){r=requestAnimationFrame(i);return}let a=c.current,o=typeof window<`u`&&window.self!==window.top,d=l.current,f=u.current;t.setConfig({settings:{...cie,showDarkModeSwitch:!o,...s.current??{}},...a&&Object.keys(a).length>0&&{callbacks:a},...d&&{firebaseConfig:d},...f&&{firebaseVapidKey:f}})};return i(),()=>{n=!0,r&&cancelAnimationFrame(r)}},[e,t,r?JSON.stringify(r):``,i?Object.keys(i).sort().join(`,`):``])}var lie=`1d7b6c6d7dce66ebef89a0e22757a047f0e43e18`;function d9(){return wu.VITE_IMKIT_BUNDLE_URL?wu.VITE_IMKIT_BUNDLE_URL:`https://cdn.jsdelivr.net/gh/imkit/imkit-vue-sdk@${lie}/imkit-custom-element.js`}var uie=[`--color-surface`,`--color-panel`,`--color-canvas`,`--color-field`,`--color-border`,`--color-border-strong`,`--color-content`,`--color-content-muted`,`--color-content-subtle`,`--color-content-faint`,`--color-surface-hover`,`--color-accent`,`--color-accent-hover`,`--color-accent-vivid`,`--color-danger-vivid`,`--text-base`,`--text-xs`];function f9(){let[e,t]=(0,f.useState)({});return(0,f.useEffect)(()=>{let e,n,r=e=>{let n=getComputedStyle(e),r={};for(let e of uie){let t=n.getPropertyValue(e).trim();t&&(r[e]=t)}t(r)},i=()=>{let e=document.querySelector(`imkit-room-list [style*="--color-canvas"],imkit-chat-room [style*="--color-canvas"],imkit-chat-room-info [style*="--color-canvas"]`);return e?(r(e),n=new MutationObserver(()=>r(e)),n.observe(e,{attributes:!0,attributeFilter:[`style`]}),!0):!1};return i()||(e=new MutationObserver(()=>{i()&&e?.disconnect()}),e.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`style`]})),()=>{e?.disconnect(),n?.disconnect()}},[]),e}var p9=`flex flex-col items-center justify-center gap-3 bg-white dark:bg-zinc-800`;function m9({message:e,className:t}){return(0,X.jsxs)(`div`,{className:K(p9,t),children:[(0,X.jsx)(sc,{className:`h-8 w-8 animate-spin text-brand`}),(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary`,children:e})]})}function h9({message:e,className:t}){return(0,X.jsxs)(`div`,{className:K(p9,t),children:[(0,X.jsx)(zs,{className:`h-8 w-8 text-danger`}),(0,X.jsx)(`p`,{className:`text-[14px] text-danger`,children:e})]})}var g9=`imkit-custom-element-script`,die=`pinchat_imkit_0703_2018_001_clientkey`,fie={showEndChatButton:!0,showDarkModeSwitch:!1,roomManagementEnabled:!1,fullPageEnabled:!0},pie=[`email`,`phone`,`date`,`text`],_9=null;function mie(){if(typeof document>`u`)return Promise.reject(Error(`no document`));let e=document.getElementById(g9);if(e&&_9)return _9;if(e)return _9=e.dataset.loaded===`1`?Promise.resolve():new Promise((t,n)=>{e.addEventListener(`load`,()=>t(),{once:!0}),e.addEventListener(`error`,()=>n(Error(`imkit bundle load failed`)),{once:!0})}),_9;let t=document.createElement(`script`);return t.id=g9,t.type=`module`,t.src=d9(),t.crossOrigin=`anonymous`,_9=new Promise((e,n
74)=>{t.addEventListener(`load`,()=>{t.dataset.loaded=`1`,e()},{once:!0}),t.addEventListener(`error`,()=>n(Error(`imkit bundle load failed`)),{once:!0})}),document.head.appendChild(t),_9}function hie({token:e,roomId:t,roomTag:n,apiBaseUrl:r,clientKey:i,theme:a,className:o,onEndChat:s,onMessageReceived:c,onMessageSent:l,onUnauthorized:u,onGoBack:d,onCustomerInfoSubmit:p,chatStyle:m,chatRoomInfoChildren:h,fixedRoomEnabled:g=!1,linkSettings:_}){let{t:v,i18n:y}=V(`common`),b=(0,f.useRef)(null),[x,S]=(0,f.useState)(`loading`),[C,w]=(0,f.useState)(!1),T=l9(C),E=f9();if((0,f.useEffect)(()=>{let e=!1;return mie().then(()=>{e||S(`ready`)}).catch(()=>{e||S(`error`)}),()=>{e=!0}},[]),(0,f.useEffect)(()=>{if(x!==`ready`||!n)return;let e=!1,t=0,r=async()=>{let i=b.current?.getStore();if(!i){t=requestAnimationFrame(r);return}i.setRoomTag(n);try{await i.fetchRooms()}catch{return}if(e||i.selectedRoomId)return;let a=i.sortedRooms?.[0],o=a?.id??a?._id;o&&i.$patch({selectedRoomId:o})};return r(),()=>{e=!0,t&&cancelAnimationFrame(t)}},[x,n]),u9(b,x,{settings:(0,f.useMemo)(()=>{let e={...fie,fixedRoomEnabled:g};if(_){let t=!(typeof window<`u`&&window.self!==window.top)&&(_.showGuestSetting??!0);e.showDirectChatRoomInfoButton=t,e.showGroupChatRoomInfoButton=t,e.enableReadReceipt=_.showIsRead??!0;let n=_.chatroomActionSetting;e.fileInputEnabled=n?.file??!1,e.locationInputEnabled=n?.location??!1,e.audioInputEnabled=n?.voice??!1}return e},[g,_]),callbacks:(0,f.useMemo)(()=>{let e={};return s&&(e.onEndChat=s),c&&(e.onMessageReceived=c),l&&(e.onMessageSent=l),u&&(e.onUnauthorized=u),Object.keys(e).length>0?e:void 0},[s,c,l,u])}),(0,f.useEffect)(()=>{if(x!==`ready`||!d)return;let e=b.current;if(!e)return;let t=()=>d();return e.addEventListener(`go-back`,t),()=>{e.removeEventListener(`go-back`,t)}},[x,d]),(0,f.useEffect)(()=>{if(x!==`ready`||!p)return;let e=b.current;if(!e)return;let t=async t=>{let n=t.detail,r=n?.message,i=n?.value;if(!r||typeof i!=`string`)return;let a=r.roomId,o=r.id;if(!a||!o)return;let s=r.contents?.body?.contents?.[1]?.contents?.[0]?.subtype,c=pie.includes(s??``)?s:`text`;try{await p({roomId:a,type:c,data:i,messageId:o})}catch{return}e.getStore()?.sendMessage({messageType:`text`,message:v(`customerInfoSubmitted.${c}`),roomId:a,extra:{templateType:`askCustomerInfo`}})};return e.addEventListener(`flex-message-input-submitted`,t),()=>{e.removeEventListener(`flex-message-input-submitted`,t)}},[x,p,v]),(0,f.useEffect)(()=>{if(x!==`ready`||m==null)return;let e=!1,t=0,n=()=>{if(e)return;let r=b.current;if(!r||typeof r.setChatStyle!=`function`){t=requestAnimationFrame(n);return}r.setChatStyle(m)};return n(),()=>{e=!0,t&&cancelAnimationFrame(t)}},[x,m]),(0,f.useEffect)(()=>{if(x!==`ready`)return;let e=!1,t=null,n=0,r=()=>{if(e)return;let i=b.current?.getStore();if(!i){n=requestAnimationFrame(r);return}let a=()=>w(!!i.isRoomInfoVisible);a(),t=i.$subscribe(a)};return r(),()=>{e=!0,n&&cancelAnimationFrame(n),t?.()}},[x]),x===`error`)return(0,X.jsx)(h9,{message:v(`chatLoadError`),className:o});if(x===`loading`||!e)return(0,X.jsx)(m9,{message:v(`chatLoading`),className:o});let D={token:e,"api-base-url":r??wu.VITE_CHAT_API_BASE,"client-key":i??die,theme:a,lang:c9(y.language)};return(0,X.jsxs)(`div`,{style:E,className:K(`imkit-vue-sdk relative flex bg-[var(--color-surface,#ffffff)] dark:bg-[var(--color-surface,#161616)]`,o),children:[(0,X.jsx)(`imkit-chat-room`,{ref:b,...D,"room-id":t,className:`absolute inset-0 w-full sm:relative sm:flex sm:w-auto sm:flex-1`}),T.shouldRender&&(0,X.jsx)(`imkit-chat-room-info`,{...D,"room-id":t,className:K(`absolute inset-0 transition-transform duration-300 ease-in-out`,`sm:relative sm:min-w-[320px] 2xl:min-w-[350px] sm:!translate-x-0 sm:border-l border-[var(--color-border,#e8e8e8)] dark:border-[var(--color-border,#424242)]`,T.slid?`translate-x-0`:`translate-x-full`),children:h}),(0,X.jsx)(`imkit-modals-container`,{...D})]})}var v9=`imkit-custom-element-script`,y9=null;function gie(){if(typeof document>`u`)return Promise.reject(Error(`no document`));let e=document.getElementById(v9);if(e&&y9)return y9;if(e)return y9=e.dataset.loaded===`1`?Promise.resolve():new Promise((t,n)=>{e.addEventListener(`load`,()=>t(),{once:!0}),e.addEventListener(`error`,()=>n(Error(`imkit bundle load failed`)),{once:!0})}),y9;let t=document.createElement(`script`);
74return t.id=v9,t.type=`module`,t.src=d9(),y9=new Promise((e,n)=>{t.addEventListener(`load`,()=>{t.dataset.loaded=`1`,e()},{once:!0}),t.addEventListener(`error`,()=>n(Error(`imkit bundle load failed`)),{once:!0})}),document.head.appendChild(t),y9}function _ie(){let[e,t]=(0,f.useState)(`loading`);return(0,f.useEffect)(()=>{let e=!1;return gie().then(()=>{e||t(`ready`)}).catch(()=>{e||t(`error`)}),()=>{e=!0}},[]),e}var b9=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,x9=e=>e.replace(/[\\/:*?"<>|]/g,`_`).trim(),vie=(e,t)=>{let n=new Date,r=`${n.getFullYear()}${String(n.getMonth()+1).padStart(2,`0`)}${String(n.getDate()).padStart(2,`0`)}`;return`${[`PinChat`,x9(e??``),x9(t??``),r].filter(Boolean).join(`_`)}.txt`};function yie({roomId:e,roomName:t,guestName:n}){let{t:r}=V(`common`),[i,a]=(0,f.useState)(!1),[o,s]=(0,f.useState)(!1),[c,l]=(0,f.useState)(``),[u,d]=(0,f.useState)(``),[p,m]=(0,f.useState)(!1),h=b9.test(c.trim()),g=e=>{let r=new Blob([e],{type:`text/plain;charset=utf-8`}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=vie(t,n),a.click(),URL.revokeObjectURL(i)};return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`button`,{type:`button`,"data-testid":`room-info-export`,"aria-label":r(`export.chatHistory`),title:r(`export.chatHistory`),className:K(`flex w-15 flex-col items-center gap-1.5 text-xs`,`text-[var(--color-content,#1a1a1a)]`,e&&!i?`cursor-pointer`:`cursor-not-allowed opacity-60`),onClick:async()=>{if(!(!e||i)){a(!0);try{let t=await o9(e);t.type===`text`&&t.text!=null?(g(t.text),Q.success(r(`export.downloadSuccess`))):t.type===`tooLarge`&&(l(``),d(``),s(!0))}catch(e){let t=e instanceof Du&&e.message?e.message:r(`export.failed`);Q.error(t)}finally{a(!1)}}},disabled:!e||i,children:[(0,X.jsx)(`span`,{className:`flex h-11 w-11 items-center justify-center rounded-full bg-[var(--color-surface-muted,#f9f9f9)] text-[var(--color-accent,#1f8235)] hover:bg-[var(--color-accent-subtle,#eef7f0)]`,children:i?(0,X.jsx)(sc,{className:`h-5 w-5 animate-spin`}):(0,X.jsx)(qs,{className:`h-5 w-5`})}),r(`export.quickAction`)]}),(0,X.jsx)(GS,{open:o,onClose:()=>p?void 0:s(!1),title:r(`export.emailModalTitle`),children:(0,X.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary`,children:r(`export.emailModalBody`)}),(0,X.jsx)(iE,{type:`email`,value:c,onChange:e=>{l(e.target.value),u&&d(``)},placeholder:r(`export.emailPlaceholder`),error:u||void 0,autoFocus:!0}),(0,X.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,X.jsx)(Z,{variant:`secondary`,onClick:()=>s(!1),disabled:p,children:r(`cancel`,{defaultValue:`Cancel`})}),(0,X.jsx)(Z,{variant:`primary`,onClick:async()=>{let t=c.trim();if(!b9.test(t)){d(r(`export.invalidEmail`));return}d(``),m(!0);try{await o9(e,t),Q.success(r(`export.emailSent`)),s(!1)}catch(e){let t=e instanceof Du&&e.message?e.message:r(`export.failed`);Q.error(t)}finally{m(!1)}},loading:p,disabled:!h,children:r(`export.send`)})]})]})})]})}var bie={agentPresenceEnabled:!1,fullPageEnabled:!0};function xie({embedded:e=!1,token:t,roomTag:n,roomId:r,apiBaseUrl:i,clientKey:a,theme:o,onMessageReceived:s}){let{t:c,i18n:l}=V(`common`),u=f9(),d=_ie(),p=(0,f.useRef)(null),[m,h]=(0,f.useState)(!1),[g,_]=(0,f.useState)(``),[v,y]=(0,f.useState)(``),[b,x]=(0,f.useState)(``),S=l9(!!g),C=l9(!!(g&&m)),w=(0,f.useCallback)(async(e,t)=>{try{return await aie(e,t),!0}catch{return!1}},[]),T=(0,f.useCallback)(async()=>oie(n),[n]);if(u9(p,d,{settings:{...bie,...e?{showDarkModeSwitch:!1,hostNavigationEnabled:!1}:{},pinchatAiEnabled:wu.VITE_PINCHAT_AI_ENABLED.toLowerCase()===`true`},callbacks:{onChatbotStateChange:w,onPinchatAiRoomRequested:T,...s?{onMessageReceived:s}:{}},firebaseConfig:FS,firebaseVapidKey:IS}),(0,f.useEffect)(()=>{if(d!==`ready`)return;let e=!1,t=null,n=0,r=()=>{if(e)return;let i=p.current?.getStore();if(!i){n=requestAnimationFrame(r);return}let a=()=>{let e=i.selectedRoomId||``;_(e),h(!!i.isRoomInfoVisible);let t=e?i.rooms?.[e]:null,n=t?.extra;y(t?.name||n?.title||n?.name||``);let r=n?.guestId,a=r?i.users:void 0;x(r?a?.[r]?.nickname??``:``)};a(),t=i.$subscribe(a)};return r(),()=>{e=!0,n&&cancelAnimationFrame(n),t?.()}},[d]),(0,f.useEffect)(()=>
74{if(d!==`ready`||!r)return;let e=!1,t=0,n=()=>{if(e)return;let i=p.current?.getStore();if(!i){t=requestAnimationFrame(n);return}i.$patch({selectedRoomId:r})};return n(),()=>{e=!0,t&&cancelAnimationFrame(t)}},[d,r]),d===`error`)return(0,X.jsxs)(`div`,{className:`flex h-dvh w-dvw flex-col items-center justify-center gap-3 bg-bg-page`,children:[(0,X.jsx)(zs,{className:`h-8 w-8 text-danger`}),(0,X.jsx)(`p`,{className:`text-[14px] text-danger`,children:c(`chatLoadError`)})]});if(d===`loading`||!t)return(0,X.jsxs)(`div`,{className:`flex h-dvh w-dvw flex-col items-center justify-center gap-3 bg-bg-page`,children:[(0,X.jsx)(sc,{className:`h-8 w-8 animate-spin text-brand`}),(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary`,children:c(`chatLoading`)})]});let E={token:t,"api-base-url":i??wu.VITE_CHAT_API_BASE,"client-key":a??`pinchat_imkit_0703_2018_001_clientkey`,theme:o,"room-tag":n,lang:c9(l.language)};return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{style:u,className:`imkit-vue-sdk relative flex h-[var(--imkit-viewport-height,100dvh)] w-dvw overflow-hidden bg-[var(--color-surface,#ffffff)] dark:bg-[var(--color-surface,#161616)]`,children:[(0,X.jsx)(`imkit-room-list`,{ref:p,...E,className:`w-full min-w-[320px] bg-[var(--color-panel,#ffffff)] dark:bg-[var(--color-panel,#161616)] sm:max-w-[320px] 2xl:min-w-[350px] 2xl:max-w-[350px] sm:border-r border-[var(--color-border,#e8e8e8)] dark:border-[var(--color-border,#424242)]`}),S.shouldRender&&(0,X.jsx)(`imkit-chat-room`,{...E,className:K(`absolute inset-0 grow overflow-hidden transition-transform duration-300 ease-in-out`,`sm:relative sm:flex sm:!translate-x-0`,S.slid?`translate-x-0`:`translate-x-full`)}),C.shouldRender&&(0,X.jsx)(`imkit-chat-room-info`,{...E,"room-id":g,className:K(`absolute inset-0 transition-transform duration-300 ease-in-out`,`sm:relative sm:min-w-[320px] 2xl:min-w-[350px] sm:!translate-x-0 sm:border-l border-[var(--color-border,#e8e8e8)]`,C.slid?`translate-x-0`:`translate-x-full`),children:(0,X.jsx)(`div`,{slot:`quickActions`,style:{display:`contents`},children:(0,X.jsx)(yie,{roomId:g,roomName:v,guestName:b})})})]}),(0,X.jsx)(`imkit-modals-container`,{...E})]})}function Sie(e,t){let n;try{n=e()}catch{return}return{getItem:e=>{let r=e=>e===null?null:JSON.parse(e,t?.reviver),i=n.getItem(e)??null;return i instanceof Promise?i.then(r):r(i)},setItem:(e,r)=>n.setItem(e,JSON.stringify(r,t?.replacer)),removeItem:e=>n.removeItem(e)}}var S9=e=>t=>{try{let n=e(t);return n instanceof Promise?n:{then(e){return S9(e)(n)},catch(e){return this}}}catch(e){return{then(e){return this},catch(t){return S9(t)(e)}}}},C9=xu()(((e,t)=>(n,r,i)=>{let a={storage:Sie(()=>window.localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},o=!1,s=0,c=new Set,l=new Set,u=a.storage;if(!u)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),n(...e)},r,i);let d=()=>{let e=a.partialize({...r()});return u.setItem(a.name,{state:e,version:a.version})},f=i.setState;i.setState=(e,t)=>(f(e,t),d());let p=e((...e)=>(n(...e),d()),r,i);i.getInitialState=()=>p;let m,h=()=>{if(!u)return;let e=++s;o=!1,c.forEach(e=>e(r()??p));let t=a.onRehydrateStorage?.call(a,r()??p)||void 0;return S9(u.getItem.bind(u))(a.name).then(e=>{if(e)if(typeof e.version==`number`&&e.version!==a.version){if(a.migrate){let t=a.migrate(e.state,e.version);return t instanceof Promise?t.then(e=>[!0,e]):[!0,t]}console.error(`State loaded from storage couldn't be migrated since no migrate function was provided`)}else return[!1,e.state];return[!1,void 0]}).then(t=>{if(e!==s)return;let[i,o]=t;if(m=a.merge(o,r()??p),n(m,!0),i)return d()}).then(()=>{e===s&&(t?.(r(),void 0),m=r(),o=!0,l.forEach(e=>e(m)))}).catch(n=>{e===s&&t?.(void 0,n)})};return i.persist={setOptions:e=>{a={...a,...e},e.storage&&(u=e.storage)},clearStorage:()=>{u?.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>h(),hasHydrated:()=>o,onHydrate:e=>(c.add(e),()=>{c.delete(e)}),onFinishHydration:e=>(l.add(e),()=>{l.delete(e)})},a.skipHydration||h(),m||p})(e=>({isDark:!1,toggle:()=>e(e=>{let t=!e.isDark;return document.documentElement.classList.toggle(`dark`,t),{isDark:t}}),setDark:t=>e(()=>(document.documentElement.classList.toggle(`dark`,t),{isDark:t}))}),{name:`pinchat-theme`}));function w9(){(0,f.useEffect)(()=>{let e=document.querySelector(`meta[name="viewport"]`);if(!e)return;let t=e.getAttribute(`content`);return e.setAttribute(`content`,`width=device-width, initial-scale=1.0, maximum-scale=1.0`),()=>{t&&e.setAttribute(`content`,t)}},[])}var Cie=`/favicon.svg`,wie=`/favicon-unread.svg`;function T9(e){if(typeof document>`u`)return;let t=document.querySelector(`link[rel="icon"]`);t||(t=document.createElement(`link`),t.rel=`icon`,document.head.appendChild(t)),t.type=`image/svg+xml`,t.href=e}function E9(e){let{t}=V(`common`),n=typeof window<`u`&&window.self===window.top,r=(0,f.useRef)(0),i=(0,f.useRef)(e),a=(0,f.useRef)(t),o=(0,f.useRef)(typeof document<`u`?document.title:``);(0,f.useLayoutEffect)(()=>{i.current=e,a.current=t});let s=(0,f.useCallback)(()=>{typeof document>`u`||(document.title=i.current||o.current,T9(Cie))},[]);return(0,f.useEffect)(()=>
74{if(!n)return;let e=()=>{document.hidden||(r.current=0,s())};return document.addEventListener(`visibilitychange`,e),()=>{document.removeEventListener(`visibilitychange`,e)}},[n,s]),(0,f.useEffect)(()=>{if(n)return()=>{r.current=0,s()}},[n,s]),(0,f.useCallback)((e,t)=>{if(!n||!document.hidden)return;r.current+=1;let i=t?.nickname?.trim()||a.current(`newMessageDefaultName`);document.title=`(${r.current}) ${a.current(`newMessageNotification`,{name:i})}`,T9(wie)},[n])}function Tie(){let{t:e}=V(`common`),t=e(`adminChatPageTitle`);cE(t);let n=E9(sE(t));w9();let[r]=ts(),i=r.get(`embedded`)===`android`||r.get(`embedded`)===`ios`,a=r.get(`theme`),o=i&&(a===`dark`||a===`light`)?a===`dark`:void 0,s=r.get(`token`)??``,c=r.get(`roomTag`)??void 0,l=r.get(`roomId`)??void 0,u=C9(e=>e.isDark),d=C9(e=>e.setDark);(0,f.useEffect)(()=>{let e=document.documentElement;if(o!==void 0){d(o);return}let t=()=>{let t=e.classList.contains(`dark`);t!==C9.getState().isDark&&d(t)};t();let n=new MutationObserver(t);return n.observe(e,{attributes:!0,attributeFilter:[`class`]}),()=>n.disconnect()},[d,o]);let{data:p,loading:m}=Hu(!0),h=zf(e=>e.setUser);(0,f.useEffect)(()=>{p&&h(p)},[p,h]);let g=typeof window<`u`?localStorage.getItem(`imkit-token`)??``:``;return(0,X.jsx)(xie,{theme:o??u?`dark`:`light`,embedded:i,token:m?``:s||g,roomTag:c,roomId:l,clientKey:p?.clientKey,onMessageReceived:n})}function D9({className:e}){return(0,X.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 96 96`,className:e,"aria-hidden":`true`,children:(0,X.jsx)(`path`,{d:`M9.2 13.2C8.4 14 8 18.6 8 27.1 8 37.3 8.3 40 9.6 41c.9.9 11.2 2.3 27.5 3.9C51.3 46.3 63 47.7 63 48c0 .3-11.7 1.7-25.9 3.1-16.3 1.6-26.6 3-27.5 3.9C8.3 56 8 58.7 8 69c0 13.8.7 15.8 5.2 14.6 5.7-1.6 73.3-32.5 74.2-33.9.8-1.2.8-2.2 0-3.4-1-1.6-72.6-34.1-75.4-34.2-.9-.1-2.1.4-2.8 1.1z`})})}var Eie=`border-t border-[var(--color-border,#e8e8e8)] py-4`,Die=`mx-4 mb-2 flex items-center font-bold uppercase tracking-wider text-[length:var(--text-xs,0.75rem)] text-[var(--color-content-subtle,#717171)]`,Oie=`flex h-11 items-center gap-1 rounded-full px-4 bg-[var(--color-field,#f7f7f7)] focus-within:ring-1 focus-within:ring-[var(--color-border-strong,#838383)]`,kie=`min-w-0 flex-1 bg-transparent outline-none disabled:cursor-not-allowed text-[length:var(--text-base,0.9375rem)] text-[var(--color-content,#1a1a1a)] placeholder:text-[var(--color-content-subtle,#717171)]`,O9=`flex h-8 w-8 shrink-0 cursor-pointer appearance-none items-center justify-center rounded-full border-0 bg-transparent p-0 transition-colors text-[var(--color-content-muted,#5b5b5b)] hover:bg-[var(--color-surface-hover,#f8f8f8)] hover:text-[var(--color-content,#1a1a1a)]`,k9=`text-[length:var(--text-base,0.9375rem)] text-[var(--color-content,#1a1a1a)]`;function A9(e){return e?`h-6 w-6 fill-[var(--color-accent-vivid,#1f8235)]`:`h-6 w-6 fill-[var(--color-content-faint,#a1a1a1)]`}function j9(e){return`flex shrink-0 appearance-none items-center justify-center border-0 bg-transparent p-0 `+(e?`cursor-pointer`:`cursor-not-allowed`)}var Aie=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function jie({linkToken:e,roomId:t,accessToken:n}){let{t:r}=V(`common`),[i,a]=(0,f.useState)(``),[o,s]=(0,f.useState)(!1),[c,l]=(0,f.useState)(!1),[u,d]=(0,f.useState)(!1),[p]=(0,f.useState)(`email`);(0,f.useEffect)(()=>{let r=!1;return i9(e,t,n).then(e=>{r||(a(e.email??``),s(!e.email))}).catch(()=>{r||s(!0)}),()=>{r=!0}},[e,t,n]);let m=async r=>{let a=r??i;if(a&&!Aie.test(a)){l(!0);return}l(!1),d(!0);try{await a9(e,{roomId:t,notifyType:p,email:p===`email`?a:``,phone:``},n),s(a===``)}finally{d(!1)}},h=!!i&&!c&&!u;return(0,X.jsxs)(`div`,{className:Eie,children:[(0,X.jsx)(`h5`,{className:Die,children:r(`guestNotify.title`)}),(0,X.jsxs)(`div`,{className:`px-4`,children:[(0,X.jsxs)(`div`,{className:K(Oie,c&&`ring-1 ring-[var(--color-danger-vivid,#cf3d29)]`),children:[(0,X.jsx)(`input`,{type:`email`,value:i,disabled:!o||u,onChange:e=>{a(e.target.value),l(!1)},onKeyUp:e=>{e.key===`Enter`&&m()},placeholder:r(`guestNotify.emailPlaceholder`),className:kie}),o?(0,X.jsx)(`button`,{type:`button`,onClick:()=>void m(),disabled:!h,className:j9(h),"aria-label":`Save`,children:(0,X.jsx)(D9,{className:A9(h)})}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`button`,{type:`button`,onClick:()=>s(!0),className:O9,"aria-label":`Edit`,children:(0,X.jsx)(vc,{className:`h-4 w-4`})}),(0,X.jsx)(`button`,{type:`button`,onClick:()=>{a(``),m(``)}
74,className:O9,"aria-label":`Delete`,children:(0,X.jsx)(kc,{className:`h-4 w-4`})})]})]}),c&&(0,X.jsx)(`div`,{className:K(`mt-2`,`text-[length:var(--text-xs,0.75rem)] text-[var(--color-danger-vivid,#cf3d29)]`),children:r(`guestNotify.invalidEmail`)})]})]})}function Mie(){let[e,t]=(0,f.useState)(null);return(0,f.useEffect)(()=>{let e,n,r,i=()=>{if(!r)return;let e=r.getBoundingClientRect();t({left:e.left,width:e.width,bottom:window.innerHeight-e.bottom})},a=()=>(r=document.querySelector(`[data-testid="chat-scroll-container"]`)??void 0,r?(i(),n=new ResizeObserver(i),n.observe(r),window.addEventListener(`resize`,i),window.addEventListener(`transitionend`,i,!0),!0):!1);return a()||(e=new MutationObserver(()=>{a()&&e?.disconnect()}),e.observe(document.body,{childList:!0,subtree:!0})),()=>{e?.disconnect(),n?.disconnect(),window.removeEventListener(`resize`,i),window.removeEventListener(`transitionend`,i,!0)}},[]),e}var Nie=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,M9=e=>`notify_modal_closed_${e}`;function Pie({linkToken:e,roomId:t,accessToken:n,enabled:r,sentCount:i}){let{t:a}=V(`common`),[o,s]=(0,f.useState)(`idle`),c=f9(),l=Mie(),[u,d]=(0,f.useState)(``),[p,m]=(0,f.useState)(!1),[h,g]=(0,f.useState)(!1),_=i>0,v=(0,f.useRef)(o);v.current=o,(0,f.useEffect)(()=>{if(!r||!_||v.current!==`idle`||localStorage.getItem(M9(e)))return;if(window.self!==window.top)try{if(new URL(document.referrer).searchParams.get(`enterpoint`)===`advanced`)return}catch{}let i=!1;return i9(e,t,n).then(e=>{i||e.open_notify_setting===!1||e.email||s(`open`)}).catch(()=>{i||s(`open`)}),()=>{i=!0}},[r,_,e,t,n]);let y=()=>{localStorage.setItem(M9(e),`true`),s(`idle`)},b=async()=>{if(!Nie.test(u)){m(!0);return}m(!1),g(!0);try{await a9(e,{roomId:t,notifyType:`email`,email:u,phone:``},n),s(`success`)}finally{g(!1)}};if(o===`idle`)return null;let x=!!u&&!p&&!h;return(0,X.jsxs)(`div`,{style:{...c,...l?{left:l.left,width:l.width,bottom:l.bottom}:{left:0,width:`100%`,bottom:0,visibility:`hidden`}},className:`fixed z-10 border-t border-b border-[var(--color-border,#e8e8e8)] bg-[var(--color-surface,#ffffff)] p-4`,children:[(0,X.jsxs)(`div`,{className:`mb-3`,children:[(0,X.jsxs)(`div`,{className:`flex h-9 items-center justify-between gap-2`,children:[o===`success`?(0,X.jsxs)(`div`,{className:K(`flex min-w-0 items-center gap-2 font-semibold`,k9),children:[(0,X.jsx)(Fs,{className:`h-5 w-5 shrink-0 rounded-full bg-[var(--color-accent,#1f8235)] p-1 text-white`,strokeWidth:3}),(0,X.jsx)(`span`,{className:`truncate`,children:a(`guestNotify.successTitle`)})]}):(0,X.jsxs)(`div`,{className:K(`flex min-w-0 items-center gap-2 font-semibold`,k9),children:[(0,X.jsx)(As,{className:`h-5 w-5 shrink-0 text-[var(--color-content-muted,#5b5b5b)]`}),(0,X.jsx)(`span`,{className:`truncate`,children:a(`guestNotify.title`)})]}),(0,X.jsx)(`button`,{type:`button`,onClick:y,"aria-label":`Close`,className:K(O9,`-mr-2 h-9 w-9`),children:(0,X.jsx)(Ic,{className:`h-4 w-4`})})]}),o===`success`&&(0,X.jsx)(`div`,{className:`mt-1.5 text-[length:var(--text-base,0.9375rem)] text-[var(--color-content-muted,#5b5b5b)]`,children:a(`guestNotify.successDesc`,{email:u})})]}),o===`open`&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:K(`flex h-11 items-center gap-1 rounded-full px-4 bg-[var(--color-field,#f7f7f7)] focus-within:ring-1 focus-within:ring-[var(--color-border-strong,#838383)]`,p&&`ring-1 ring-[var(--color-danger-vivid,#cf3d29)]`),children:[(0,X.jsx)(`input`,{type:`email`,value:u,disabled:h,onChange:e=>{d(e.target.value),m(!1)},onKeyUp:e=>{e.key===`Enter`&&b()},placeholder:a(`guestNotify.emailPlaceholder`),className:`min-w-0 flex-1 bg-transparent outline-none disabled:cursor-not-allowed text-[length:var(--text-base,0.9375rem)] text-[var(--color-content,#1a1a1a)] placeholder:text-[var(--color-content-subtle,#717171)]`}),(0,X.jsx)(`button`,{type:`button`,onClick:()=>void b(),disabled:!x,className:j9(x),"aria-label":`Save`,children:(0,X.jsx)(D9,{className:A9(x)})})]}),p&&(0,X.jsx)(`div`,{className:K(`mt-2`,`text-[length:var(--text-xs,0.75rem)] text-[var(--color-danger-vivid,#cf3d29)]`),children:a(`guestNotify.invalidEmail`)})]})]})}var N9=typeof window<`u`&&typeof window.matchMedia==`function`?window.matchMedia(`(prefers-color-scheme: dark)`):null;function Fie(){return(0,f.useSyncExternalStore)((0,f.useCallback)(e=>(N9?.addEventListener(`change`,e),()=>N9?.removeEventListener(`change`,e)),[]),()=>N9?.matches??!1,()=>!1)}function P9(e=!0,t){let n=Fie(),r=t?t===`dark`:n;return(0,f.useLayoutEffect)(()=>
74{if(!e)return;let t=document.documentElement,n=t.classList.contains(`dark`);return t.classList.toggle(`dark`,r),()=>{t.classList.toggle(`dark`,n)}},[r,e]),r}var Iie=new Set([`pinchat-beta.pinchatcorp.com`,`pinchat-v7.beta.funtek.io`,`pinchat.app`,`dnmljacu22mim.cloudfront.net`,`localhost`,`127.0.0.1`]);function F9(e){return Iie.has(e)}var Lie=`PinChat`;function I9({hostname:e,linkName:t,guestName:n,seoTitle:r}){let i=F9(e),a=!i&&r?r:t,o=n?`${n} - ${a}`:a;return i?`${o} | ${Lie}`:o}function L9(e,t,n,r){let i=document.head.querySelector(e),a=!1,o=``;return i?o=i.content:(i=document.createElement(`meta`),i.setAttribute(t,n),document.head.appendChild(i),a=!0),i.content=r,{el:i,created:a,previousContent:o}}function Rie(e){if(typeof document>`u`)return()=>{};let t={title:document.title,tags:[]};return e.title&&(document.title=e.title),e.description&&(t.tags.push(L9(`meta[name="description"]`,`name`,`description`,e.description)),t.tags.push(L9(`meta[property="og:description"]`,`property`,`og:description`,e.description))),e.title&&t.tags.push(L9(`meta[property="og:title"]`,`property`,`og:title`,e.title)),e.ogImage&&t.tags.push(L9(`meta[property="og:image"]`,`property`,`og:image`,e.ogImage)),e.keywords&&t.tags.push(L9(`meta[name="keywords"]`,`name`,`keywords`,e.keywords)),e.allowSeo||t.tags.push(L9(`meta[name="robots"]`,`name`,`robots`,`noindex`)),()=>{document.title=t.title;for(let{el:e,created:n,previousContent:r}of t.tags)n?e.parentNode?.removeChild(e):e.content=r}}function zie(){let{t:e}=V(`common`),{token:t}=pa(),[n]=ts();w9();let r=P9(),[i,a]=(0,f.useState)(`idle`),[o,s]=(0,f.useState)(``),[c,l]=(0,f.useState)(``),[u,d]=(0,f.useState)(``),[p,m]=(0,f.useState)(void 0),[h,g]=(0,f.useState)(!1),[_,v]=(0,f.useState)(``),[y,b]=(0,f.useState)(void 0),[x,S]=(0,f.useState)(``),[C,w]=(0,f.useState)(null),[T,E]=(0,f.useState)(void 0),[D,O]=(0,f.useState)(void 0),[k,A]=(0,f.useState)(!1),[j,M]=(0,f.useState)(0),N=(0,f.useCallback)(()=>M(e=>e+1),[]);(0,f.useEffect)(()=>{if(!t)return;let e=!1;return r9(t).then(t=>{e||(b(t.chat?.colors),S(t.title||t.name||``),w(t.page_title??null),t.clientKey&&m(t.clientKey),g(!0),E(t.showLanding!==!1),O({showGuestSetting:t.showGuestSetting,showIsRead:t.showIsRead,chatroomActionSetting:t.chat?.chatroom_action_setting}),A(t.open_notify_setting??!0))}).catch(()=>{e||g(!0)}),()=>{e=!0}},[t]);let ee=t?e9(t)?.record.name:``,P=(0,f.useMemo)(()=>ee||n.get(`name`)?.trim()||`Guest`,[ee,n]),F=(0,f.useMemo)(()=>x?I9({hostname:typeof window<`u`?window.location.hostname:``,linkName:x,guestName:P,seoTitle:C}):``,[x,P,C])||e(`loading`);lE(F);let I=E9(F),te=la(),L=(0,f.useCallback)(()=>{t&&(n9(t),te(`/${t}`,{replace:!0}))},[t,te]);(0,f.useEffect)(()=>{if(!t){a(`error`),v(`Missing link token`);return}let e=e9(t),r=e&&!e.expired?e.record:null;if(r){s(r.token),l(r.roomId),d(r.accessToken),r.clientKey&&(m(r.clientKey),g(!0)),a(`ready`);return}let i=!1;return a(`exchanging`),(async()=>{let r=(e,n,r)=>{t9(t,{token:e.chatToken,roomId:e.room_id,name:r,accessToken:n,link:t,clientKey:e.clientKey}),s(e.chatToken),l(e.room_id),d(n),e.clientKey&&(m(e.clientKey),g(!0)),a(`ready`)},o=e?.record,c=n.get(`name`)?.trim(),u=c||o?.name?.trim()||`Guest`,f=n.get(`regToken`)??void 0;if(e?.expired&&o?.accessToken&&!f){try{let e=await Q7(t,o.accessToken);if(i)return;if(e?.chatToken&&e.room_id){r(e,o.accessToken,o.name||u);return}}catch{}if(i)return}if(e?.expired&&!f&&!c){if(T===void 0&&!h)return;if(T===!0){L();return}}try{let e=await Z7(t,{name:u,domain:`pinchat.me`,regToken:f}),n=await Q7(t,e.access_token);if(i)return;r(n,e.access_token,u)}catch(e){if(i)return;v(e instanceof Du&&e.message?e.message:`Couldnât open this chat. Please try again.`),a(`error`)}})(),()=>{i=!0}},[t,n,T,h,L]);let ne=(0,f.useCallback)(()=>{t&&(n9(t),te(`/${t}`))},[t,te]),R=(0,f.useCallback)(()=>{t&&te(`/${t}`)},[t,te]),z=L,B=(0,f.useCallback)(async e=>{if(!t||!u)throw Error(`missing guest session`);await nie(t,e,u)},[t,u]);return i===`error`?(0,X.jsx)(h9,{message:_||e(`chatLoadError`),className:`h-dvh w-dvw`}):i!==`ready`||!h?(0,X.jsx)(m9,{message:e(`chatLoading`),className:`h-dvh w-dvw`}):(0,X.jsxs)(`div`,{className:`h-[var(--imkit-viewport-height,100dvh)] w-dvw overflow-hidden`,children:[(0,X.jsx)(hie,{theme:r?`dark`:`light`,token:o,roomId:c,clientKey:p,onEndChat:ne,onMessageReceived:I,onMessageSent:N,onUnauthorized:z,onGoBack:R,onCustomerInfoSubmit:B,chatStyle:y,fixedRoomEnabled:T===!1,linkSettings:D,chatRoomInfoChildren:t&&c&&u?(0,X.jsx)(jie,{linkToken:t,roomId:c,accessToken:u}):null,className:`h-full w-full`}),t&&c&&u&&(0,X.jsx)(Pie,{linkToken:t,roomId:c,accessToken:u,enabled:k,sentCount:j})]})}var Bie=/^[A-Za-z0-9_-]{1,64}$/;function Vie(e){return Bie.test(e)}var Hie=/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,Uie=/^[A-Z][0-9]{9}$/,Wie=/^\+?\d{8,15}$/,Gie=/^[a-zA-Z0-9]+$/;function Kie(e,t){let n=e.trim();switch(t){case`email`:return Hie.test(n);case`number`:return n.length>0&&Gie.test(n);case`id`:return Uie.test(n.toUpperCase());case`mobile`:return Wie.test(n.replace(/[\s-]/g,``));default:return n.length>0}}var R9={VIEW_WELCOME_PAGE:10,WELCOME_PAGE_LINK_INTERACTION:11,WELCOME_PAGE_STAY_DURATION:12,CHAT_ROOM_INTERACTION:20,CHAT_ROOM_SEND_MESSAGE:30};function qie({color:e}){let{t}=V(`common`),[n,r]=(0,f.useState)(!1);return(0,f.useEffect)(()=>{function e(e){let t=e.data;if(typeof t==`string`)try{t=JSON.parse(t)}catch{return}t&&typeof t==`object`&&t.pinchat_type===`actions`&&r(!0)}return window.addEventListener(`message`,e),window.parent!==window&&window.parent.postMessage(JSON.stringify({pinchat_type:`is_receive_widget_click`}),`*`),()=>window.removeEventListener(`message`,e)},[]),n?(0,X.jsx)(`button`,{type:`button`,"aria-label":t(`close`),onClick:()=>{window.parent.postMessage({type:`CLOSE_WIDGET`},`*`)},className:`fixed top-3 right-3 z-50 flex h-9 w-9 items-center justify-center rounded-full`,style:{color:e},children:(0,X.jsx)(Ic,{className:`h-6 w-6`})}):null}
74var Jie=(0,f.forwardRef)(function({value:e,onChange:t,error:n,focusBorderColor:r},i){let a=[(0,f.useRef)(null),(0,f.useRef)(null),(0,f.useRef)(null),(0,f.useRef)(null)],o=e.padEnd(4,`\0`).split(``).slice(0,4).map(e=>e===`\0`?``:e);(0,f.useImperativeHandle)(i,()=>({focusFirst:()=>a[0].current?.focus(),clear:()=>{t(``)}}));let s=e=>{t(e.join(``).slice(0,4))},c=e=>t=>{let n=t.target.value.replace(/\D/g,``).slice(-1),r=[...o];r[e]=n,s(r),n&&(e<3?a[e+1].current?.focus():a[e].current?.blur())},l=e=>{e.preventDefault();let t=(e.clipboardData?.getData(`text`)??``).replace(/\D/g,``);if(!t)return;let n=[...o],r=n.findIndex(e=>!e);if(r<0)return;let i=0;for(let e=r;e<4&&i<t.length;e++)n[e]||(n[e]=t[i],i+=1);s(n);let c=n.findIndex((e,t)=>t>=r&&!e);c>=0?a[c].current?.focus():a[3].current?.blur()},u=e=>t=>{if(t.key===`Backspace`){t.preventDefault();let n=[...o],r=n[e]?e:Math.max(0,e-1);n.splice(r,1),n.push(``),s(n);let i=Math.min(r,n.filter(Boolean).length);a[Math.max(0,i)].current?.focus()}else if(t.key===`Delete`){t.preventDefault();let n=[...o],r=e;for(;r<4&&!n[r];)r+=1;if(r>3&&(r=n.findIndex(e=>!!e),r<0))return;for(let e=r;e<3;e++)n[e]=n[e+1];n[3]=``,s(n),a[e].current?.focus()}};return(0,X.jsx)(`div`,{className:`flex w-full items-center justify-between px-6 py-4`,children:o.map((e,t)=>(0,X.jsx)(`input`,{ref:a[t],value:e,onChange:c(t),onPaste:l,onKeyDown:u(t),type:`text`,inputMode:`numeric`,maxLength:1,className:`w-10 rounded-md border border-gray-300 bg-white text-center text-lg font-bold shadow-none ring-0 outline-0 transition focus:shadow-none focus:ring-0 focus:outline-0`,style:{borderColor:e?n?`#ff4d4f`:r||void 0:void 0}},t))})});function Yie({settings:e,chatConfig:t,onLinkClick:n}){let[r,i]=(0,f.useState)(-1),a=t.welcome_link_prime_color||`#007ABF`,o=t.welcome_link_second_color||`#FFFFFF`,s=t.colors?.hr_color||`#aeafae`;return(0,X.jsxs)(`div`,{className:`flex w-full flex-col gap-2.5`,children:[t.hr_text&&(0,X.jsxs)(`div`,{className:`mb-2.5 flex items-center justify-center gap-4`,children:[(0,X.jsx)(`div`,{className:`h-px grow`,style:{backgroundColor:s}}),(0,X.jsx)(`div`,{className:`text-center text-sm`,style:{color:s},children:t.hr_text}),(0,X.jsx)(`div`,{className:`h-px grow`,style:{backgroundColor:s}})]}),e.map((e,t)=>(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,X.jsxs)(`button`,{type:`button`,className:`relative flex min-h-[48px] w-full cursor-pointer items-center justify-between rounded-xl border px-4 font-semibold transition-colors duration-150 ease-in-out hover:opacity-90`,style:{color:o,backgroundColor:a,borderColor:a},onClick:()=>{e.type===`select`?i(r===t?-1:t):e.link&&n(e.link,e.title)},children:[(0,X.jsx)(`span`,{className:`grow text-center`,children:e.title}),e.type===`select`&&(0,X.jsx)(`svg`,{width:`20`,height:`20`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,className:`absolute right-4`,"aria-hidden":`true`,children:(0,X.jsx)(`path`,{d:`M4 8L12 16L20 8`,strokeWidth:`2`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,stroke:o})})]}),e.type===`select`&&r===t&&e.links&&(0,X.jsx)(X.Fragment,{children:e.links.map((e,t)=>(0,X.jsx)(`button`,{type:`button`,className:`min-h-[36px] cursor-pointer rounded-xl font-semibold transition duration-150 ease-in-out hover:opacity-90`,style:{color:a,backgroundColor:o,borderColor:o},onClick:()=>n(e.link,e.title),children:e.title},`${e.title}-${t}`))})]},`${e.title}-${t}`))]})}function z9({linkToken:e}={}){P9();let t=pa(),[n]=ts(),r=la(),{t:i}=V(`landing`),a=e??t.linkId??``,o=n.get(`uid`)??``,s=n.get(`name`)??``,c=n.get(`regToken`)??``,[l,u]=(0,f.useState)(`loading`),[d,p]=(0,f.useState)(null),[m,h]=(0,f.useState)(s),[g,_]=(0,f.useState)(!1),[v,y]=(0,f.useState)(``),[b,x]=(0,f.useState)(!1),S=a||d?.token||``;(0,f.useEffect)(()=>{let e=!1;return u(`loading`),(async()=>{try{let t=typeof window<`u`?window.location.hostname:``,n=t&&!F9(t)&&!a?await rie(t):await r9(a);if(e)return;if(n.showLanding===!1&&n.token){r(`/chat/${n.token}`,{replace:!0});return}p(n),u(`ready`)}catch(t){if(e)return;if(a&&t instanceof Du&&t.status===400){typeof window<`u`&&window.location.replace(`/`);return}u(`config-error`)}})(),()=>{e=!0}},[a,r]),lE(l===`loading`?i(`loading`,{ns:`common`}):``),(0,f.useEffect)(()=>
74{if(d)return Rie({title:I9({hostname:typeof window<`u`?window.location.hostname:``,linkName:d.title||d.name,seoTitle:d.page_title}),description:d.page_desc,keywords:d.page_keywords,ogImage:d.page_og_image,allowSeo:d.without_seo_no_index===!0})},[d]);let C=(0,f.useRef)(null);(0,f.useEffect)(()=>{if(!(!d?.id||l!==`ready`))return C.current=Date.now(),s9(R9.VIEW_WELCOME_PAGE,{enterpointId:d.id}),()=>{if(C.current==null||!d.id)return;let e=Date.now()-C.current;s9(R9.WELCOME_PAGE_STAY_DURATION,{enterpointId:d.id,detail:JSON.stringify({time:e})})}},[d?.id,l]);let w=(0,f.useRef)(null);(0,f.useEffect)(()=>{o&&l===`ready`&&w.current?.focusFirst()},[o,l]),(0,f.useEffect)(()=>{c&&a&&n9(a)},[c,a]);async function T(e){if(!(!S||!d)){u(`requesting`);try{let t=await Z7(S,{name:e,domain:`pinchat.me`,regToken:c||void 0}),n=await Q7(S,t.access_token);t9(S,{token:n.chatToken,roomId:n.room_id,name:e,accessToken:t.access_token,link:S,clientKey:n.clientKey}),u(`redirecting`),r(`/chat/${S}`,{replace:!0})}catch{u(`signup-error`)}}}let E=(0,f.useRef)(!1);(0,f.useEffect)(()=>{E.current||l!==`ready`||!d||!S||s&&c&&(E.current=!0,T(s))});let D=(0,f.useMemo)(()=>S?tie(S):null,[S]),O=d?.chat,k=O?.colors,A=k?.start_btn_color||`#007ABF`,j=k?.start_btn_text_color||`#FFFFFF`,M=O?.welcome_text_color||`#1F2937`,N=O?.welcome_link_second_color||`#AEAFAE`,ee=(0,f.useMemo)(()=>O?O.welcome_bg_type===`image`&&O.welcome_bg_image?{backgroundImage:`url(${O.welcome_bg_image})`}:{backgroundColor:k?.background_color||`#FFFFFF`}:{},[O,k]),P=(0,f.useMemo)(()=>(O?.welcome_link_setting??[]).filter(e=>e.open),[O]),F=(0,f.useMemo)(()=>o?i(`openBtn`):O?.start_btn_text||i(`engageNow`),[O,o,i]),I=(e,t)=>{d?.id&&(s9(R9.WELCOME_PAGE_LINK_INTERACTION,{enterpointId:d.id,detail:JSON.stringify({title:t,link:e})}),window.open(e,`_blank`))},te=()=>{if(!O)return;if(o){v.length===4?L(v):x(!0);return}if(!O.nickname_required){T(m.trim()||i(`guestName`));return}let e=Kie(m,O.nickname_type);_(!e),e&&T(m.trim())};async function L(e){if(!(!S||!d)){u(`requesting`),x(!1);try{let t=await iie({pincode:e,uid:o,token:S}),n=await Q7(S,t.access_token);t9(S,{token:n.chatToken,roomId:n.room_id,name:m||i(`guestName`),accessToken:t.access_token,link:S,clientKey:n.clientKey}),u(`redirecting`),r(`/chat/${S}`,{replace:!0})}catch{u(`ready`),x(!0)}}}return l===`loading`?(0,X.jsx)(m9,{message:i(`chatLoading`,{ns:`common`}),className:`h-dvh w-dvw`}):l===`config-error`||!d||!O?(0,X.jsx)(`div`,{className:`flex h-dvh w-dvw items-center justify-center bg-white`,children:(0,X.jsx)(`p`,{className:`text-[14px] text-danger`,children:i(`loadConfigError`)})}):(0,X.jsxs)(`div`,{className:`flex min-h-dvh w-dvw items-start justify-center overflow-auto bg-cover bg-center bg-no-repeat`,style:ee,children:[(0,X.jsx)(qie,{color:M}),(0,X.jsxs)(`div`,{className:`flex min-h-dvh w-[357px] flex-col items-center bg-cover bg-center bg-no-repeat px-4 py-16`,children:[O.chat_logo?(0,X.jsx)(`img`,{className:`mb-5`,style:{width:`${O.chat_logo_size??50}%`},src:O.chat_logo,alt:`Chat Logo`}):(0,X.jsx)(`img`,{className:`mb-5`,style:{width:`${O.chat_logo_size??50}%`},src:`/images/pinchat-logo-default.png`,alt:`PinChat Logo`}),(0,X.jsx)(`div`,{className:`mb-10 text-center text-base whitespace-pre-line`,style:{color:M},children:O.welcome||``}),D&&l!==`requesting`?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{className:`mb-2 flex h-[100px] w-[100px] items-center justify-center rounded-full text-3xl font-semibold text-white`,style:{backgroundColor:A},children:(D.name||`G`).charAt(0).toUpperCase()}),(0,X.jsx)(`span`,{className:`mb-4 p-3`,style:{color:N},children:D.name}),(0,X.jsx)(`button`,{type:`button`,className:`mb-10 min-h-[48px] w-full rounded-xl px-4 py-2.5 text-sm font-semibold`,style:{backgroundColor:A,color:j},onClick:()=>r(`/chat/${S}`),children:i(`backToChatroom`)})]}):(0,X.jsxs)(X.Fragment,{children:[o?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Jie,{ref:w,value:v,onChange:e=>{y(e),b&&x(!1)},error:b,focusBorderColor:A}),b&&(0,X.jsx)(`div`,{className:`mb-2.5 text-warning`,children:i(`pincodeIncorrect`)})]}):(0,X.jsxs)(`div`,{className:`mb-2.5 flex w-full flex-col gap-1`,children:[(0,X.jsx)(`input`,{className:`placeholder-gray-400 min-h-[48px] w-full rounded-xl border bg-white px-4 py-2.5 text-[16px] text-gray-800 focus:ring-0 dark:text-gray-800`,style:{borderColor:g?`#ef4444`:A},placeholder:O.nickname_input_placeholder||i(`nicknamePlaceholder`),value:m,onChange:e=>{h(e.target.value),g&&_(!1)}}),g&&(0,X.jsx)(`div`,{className:`text-xs text-red-500`,children:i(`nicknameError.${O.nickname_type??`default`}`,{defaultValue:i(`nicknameError.default`)})})]}),l===`signup-error`&&(0,X.jsx)(`div`,{className:`mb-2.5 w-full rounded-lg bg-red-50 px-4 py-2.5 text-center text-sm text-red-600`,children:i(`signupError`)}),(0,X.jsx)(`button`,{type:`button`,className:`mb-10 min-h-[48px] w-full rounded-xl px-4 py-2.5 text-sm font-semibold disabled:opacity-60`,style:{backgroundColor:A,color:j},onClick:te,disabled:l===`requesting`||l===`redirecting`,children:l===`requesting`||l===`redirecting`?i(`requesting`):F})]}),P.length>0&&(0,X.jsx)(Yie,{settings:P,chatConfig:O,onLinkClick:I}),!O.remove_pinboard_footer&&(0,X.jsxs)(`a`,{target:`_blank`,href:`/`,rel:`noreferrer`,className:`mt-auto mb-10 pt-10 text-xs`,style:{color:M},children:[`Powered by `,(0,X.jsx)(`strong`,{children:`PinChat`})]})]})]})}function Xie(){let{linkId:e=``}=pa();return Vie(e)?(0,X.jsx)(z9,{linkToken:e}):(typeof window<`u`&&window.location.replace(`/`),null)}function Zie(){return F9(typeof window<`u`?window.location.hostname:``)?(0,X.jsx)(Ya,{to:`/dashboard`,replace:!0}):(0,X.jsx)(z9,{})}var Qie={"ja-jp":`ja`,"ko-kr":`ko`,"de-de":`de`,"fr-fr":`fr`,"es-es":`es`,"ro-ro":`ro`,"vi-vn":`vi`,"th-th":`th`};function $ie(e){let t=e.toLowerCase();return Qie[t]??t}function eae(){let[e]=ts(),{i18n:t,t:n}=V(`common`),[r,i]=(0,f.useState)(!1),[a,o]=(0,f.useState)(!1),s=e.get(`theme`),c=s===`dark`||s===`light`?s:void 0;return P9(e.has(`accessToken`),c),(0,f.useEffect)(()=>{let n=e.get(`accessToken`),r=e.get(`lang`);if(!n){o(!0);return}if(localStorage.setItem(Ou,n),r){let e=$ie(r);e!==t.language&&t.changeLanguage(e)}i(!0)},[]),a?(0,X.jsx)(`div`,{className:`flex items-center justify-center min-h-screen w-full bg-bg-card p-6`,children:(0,X.jsx)(`p`,{className:`text-[15px] text-text-secondary text-center`,children:n(`loadFailed`)})}):r?(0,X.jsxs)(`div`,{className:`min-h-screen w-full bg-bg-card overflow-y-auto scrollbar-none`,children:[(0,X.jsx)(Xa,{}),(0,X.jsx)(ZS,{className:`fixed top-8 left-5 right-5 z-50 flex flex-col gap-2`})]}):(0,X.jsx)(`div`,{className:`flex items-center justify-center min-h-screen w-full bg-bg-card`,children:(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary`,children:n(`loading`)})})}function B9(e){try{window.Android?.created&&window.Android.created()}catch{}try{window.webkit?.messageHandlers?.ToApp&&window.webkit.messageHandlers.ToApp.postMessage(e)}catch{}}
74var V9=[{id:5141,url:`/avatars/avatar-1.png`},{id:5142,url:`/avatars/avatar-2.png`},{id:5143,url:`/avatars/avatar-3.png`},{id:5144,url:`/avatars/avatar-4.png`}];typeof window<`u`&&V9.forEach(({url:e})=>{new Image().src=e});var H9=`h-10 w-full rounded-[8px] border border-border bg-bg-card px-3 text-[15px] text-text-primary placeholder:text-text-secondary placeholder:opacity-50 outline-none focus:border-border-strong transition-colors`;function tae(){let{t:e,i18n:t}=V(`mobile`),{t:n}=V(`common`);cE(e(`createLinkTitle`));let r=(0,f.useRef)(null),[i,a]=(0,f.useState)(`direct`),[o,s]=(0,f.useState)(``),[c,l]=(0,f.useState)(``),[u,d]=(0,f.useState)(``),[p,m]=(0,f.useState)(null),[h,g]=(0,f.useState)(V9[0].url),[_,v]=(0,f.useState)(V9[0].id),[y,b]=(0,f.useState)(``),[x,S]=(0,f.useState)(``),C=hd(),w=md(),T=Ed(`image`),E=yd(),D=C.loading||w.loading||T.loading;(0,f.useEffect)(()=>{let e=fE();s(e),E.mutate(e).catch(e=>{e instanceof Du&&e.message&&b(e.message)})},[]);let O=t=>/^[a-zA-Z0-9]{5,30}$/.test(t)?(b(``),!0):(b(e(`urlError`)),!1),k=e=>{let t=e.target.files?.[0];t&&(m(t),g(URL.createObjectURL(t)))},A=async()=>{let n=!0;if(O(o)||(n=!1),c.trim()?S(``):(S(e(`nameRequired`)),n=!1),n)try{let n=null;p&&(n=(await T.mutate(p)).id);let r=u.trim()||c.trim(),a=c.trim(),s=await C.mutate({token:o,name:r,title:a,type:i});await w.mutate({id:s.id,token:s.token,image_id:n??_??null,...pE,...mE,...hE(t.language)}),Q.success(e(`linkCreated`)),B9(`created link`)}catch(t){if(t instanceof Du&&t.code===40004)Q.error(e(`linkLimitReached`));else{let n=t instanceof Du&&t.message?t.message:e(`linkCreateFailed`);Q.error(n)}}},j=[`#6366F1`,`#3B82F6`,`#06B6D4`,`var(--brand)`,`#F59E0B`,`#EF4444`,`#8B5CF6`,`#EC4899`],M=j[c.charCodeAt(0)%j.length]??j[0];return(0,X.jsxs)(`div`,{className:`p-4`,children:[(0,X.jsxs)(`div`,{className:`space-y-4`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`p`,{className:`text-[14px] font-medium text-text-primary mb-2`,children:e(`fieldType`)}),(0,X.jsx)(`div`,{className:`flex gap-2`,children:[`direct`,`group`].map(t=>(0,X.jsx)(`button`,{type:`button`,onClick:()=>a(t),className:K(`flex-1 h-10 rounded-[8px] text-[15px] border transition-all duration-150 cursor-pointer`,i===t?`border-brand bg-brand-tint text-brand font-medium`:`border-border bg-bg-card text-text-primary hover:border-border-strong`),children:e(t===`direct`?`typeDirect`:`typeGroup`)},t))})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`p`,{className:`text-[14px] font-medium text-text-primary mb-2`,children:e(`fieldUrl`)}),(0,X.jsxs)(`div`,{className:K(`flex items-center rounded-[8px] border bg-bg-card overflow-hidden transition-colors`,y?`border-danger`:`border-border focus-within:border-border-strong`),children:[(0,X.jsx)(`span`,{className:`px-3 text-[14px] text-text-secondary border-r border-border h-10 flex items-center shrink-0 select-none`,children:typeof window<`u`?`${window.location.host}/`:`pinchat.app/`}),(0,X.jsx)(`input`,{value:o,onChange:e=>{s(e.target.value),y&&O(e.target.value)},onBlur:()=>O(o),maxLength:30,className:`flex-1 h-10 px-3 bg-transparent text-[15px] text-text-primary outline-none`})]}),y?(0,X.jsx)(`p`,{className:`text-[13px] text-danger mt-1`,children:y}):(0,X.jsx)(`p`,{className:`text-[13px] text-text-secondary mt-1`,children:e(`urlHint`)})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`p`,{className:`text-[14px] font-medium text-text-primary mb-2`,children:e(`fieldChatName`)}),(0,X.jsx)(`input`,{value:c,onChange:e=>{l(e.target.value.slice(0,35)),x&&S(``)},placeholder:e(`chatNamePlaceholder`),maxLength:35,className:K(H9,x&&`border-danger`)}),(0,X.jsxs)(`div`,{className:`flex justify-between mt-1`,children:[x?(0,X.jsx)(`p`,{className:`text-[13px] text-danger`,children:x}):(0,X.jsx)(`span`,{}),(0,X.jsxs)(`p`,{className:`text-[13px] text-text-secondary`,children:[c.length,`/35`]})]})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`p`,{className:`text-[14px] font-medium text-text-primary mb-2`,children:e(`fieldNickname`)}),(0,X.jsx)(`input`,{value:u,onChange:e=>d(e.target.value.slice(0,25)),placeholder:e(`nicknamePlaceholder`),maxLength:25,className:H9}),(0,X.jsxs)(`p`,{className:`text-[13px] text-text-secondary mt-1 text-right`,children:[u.length,`/25`]})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`p`,{className:`text-[14px] font-medium text-text-primary mb-2`,children:e(`fieldAvatar`)}),(0,X.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,X.jsxs)(`div`,{className:`relative w-20 h-20 rounded-full overflow-hidden shrink-0 flex items-center justify-center text-white text-[28px] font-semibold select-none`,style:{backgroundColor:h?void 0:M},children:[h?(0,X.jsx)(`img`,{src:h,alt:``,className:`w-full h-full object-cover`}):c.charAt(0).toUpperCase()||`?`,T.loading&&(0,X.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-black/40 rounded-full`,children:(0,X.jsx)(sc,{className:`w-6 h-6 text-white animate-spin`})})]}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,X.jsx)(`div`,{className:`flex gap-2`,children:V9.map(e=>(0,X.jsx)(`button`,{type:`button`,onClick:()=>{m(null),g(e.url),v(e.id),r.current&&(r.current.value=``)},className:K(`w-10 h-10 rounded-full overflow-hidden border-2 transition-all duration-150 cursor-pointer shrink-0`,!p&&_===e.id?`border-brand`:`border-transparent hover:border-border-strong`),children:(0,X.jsx)(`img`,{src:e.url,alt:``,className:`w-full h-full object-cover`})},e.id))}),(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(`input`,{type:`file`,accept:`image/*`,ref:r,onChange:k,className:`hidden`}),(0,X.jsxs)(Z,{type:`button`,variant:`secondary`,size:`sm`,onClick:()=>r.current?.click(),className:`gap-1.5`,children:[(0,X.jsx)(Mc,{className:`w-3.5 h-3.5`}),n(p?`changeImage`:`uploadImage`)]}),p&&(0,X.jsx)(`button`,{type:`button`,onClick:()=>{m(null),g(V9[0].url),v(V9[0].id),r.current&&(r.current.value=``)},className:`text-[14px] text-text-secondary hover:text-danger transition-colors cursor-pointer`,children:n(`remove`)})]})]})]})]})]}),(0,X.jsx)(`div`,{className:`mt-6 pt-4 border-t border-border`,children:(0,X.jsx)(Z,{onClick:A,disabled:D,className:`w-full`,children:n(D?`loading`:`create`)})})]})}function nae(){let{t:e}=V(`mobile`),{t}=V(`common`);cE(e(`linkInfoTitle`));let[n]=ts(),{data:r,loading:i,error:a,refetch:o}=pd((n.get(`token`)??``)||void 0),s=r?wd(r):void 0,c=md(),[l,u]=(0,f.useState)(``),[d,p]=(0,f.useState)(!1),[m,h]=(0,f.useState)(!1),g=()=>{s?.url&&(uu(s.url),h(!0),setTimeout(()=>h(!1),1500))},_=async()=>
74{if(r)try{await c.mutate({id:r.id,token:r.token,is_valid:!1}),Q.success(e(`deleteSuccess`)),B9(`deleted link`)}catch{Q.error(e(`deleteFailed`))}};if(i&&!r)return(0,X.jsx)(`div`,{className:`p-4 text-center text-text-secondary text-[14px]`,children:t(`loading`)});if(a&&!r)return(0,X.jsxs)(`div`,{className:`p-4 flex flex-col items-center gap-3`,children:[(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary`,children:t(`loadFailed`)}),(0,X.jsx)(Z,{variant:`secondary`,size:`md`,onClick:()=>void o(),children:t(`retry`)})]});let v=s?.url??`â`;return(0,X.jsxs)(`div`,{className:`p-4`,children:[(0,X.jsxs)(`div`,{className:`card p-5 flex flex-col gap-4 mb-4`,children:[(0,X.jsx)(`h3`,{className:`text-[17px] font-semibold text-text-primary`,children:e(`sectionBasicInfo`)}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsx)(`p`,{className:`text-[13px] font-medium text-text-secondary uppercase tracking-wide`,children:e(`labelType`)}),(0,X.jsx)(`span`,{className:`inline-flex items-center px-2.5 h-6 rounded-full text-[13px] font-medium bg-bg-subtle text-text-primary self-start`,children:s?.type===`group`?e(`typeGroup`):e(`typeDirect`)})]}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsx)(`p`,{className:`text-[13px] font-medium text-text-secondary uppercase tracking-wide`,children:e(`labelUrl`)}),(0,X.jsxs)(`button`,{onClick:g,className:`flex items-center gap-2 group cursor-pointer text-left`,children:[(0,X.jsx)(`span`,{className:`text-[14px] font-mono text-text-secondary break-all`,children:v}),m?(0,X.jsx)(Fs,{className:`w-4 h-4 text-brand shrink-0`}):(0,X.jsx)(Gs,{className:`w-4 h-4 shrink-0 text-transparent group-hover:text-text-secondary transition-colors duration-150`})]})]})]}),(0,X.jsxs)(`div`,{className:`card p-5`,style:{borderColor:`rgba(235,87,87,0.25)`},children:[(0,X.jsx)(`h3`,{className:`text-[17px] font-semibold text-danger mb-1`,children:e(`sectionDanger`)}),(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary mb-4`,children:e(`deleteDesc`)}),d?(0,X.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,X.jsxs)(`div`,{className:`flex items-start gap-2 p-3 rounded-[8px] border`,style:{backgroundColor:`rgba(235,87,87,0.05)`,borderColor:`rgba(235,87,87,0.2)`},children:[(0,X.jsx)(jc,{className:`w-4 h-4 text-danger shrink-0 mt-0.5`}),(0,X.jsxs)(`p`,{className:`text-[14px] text-danger`,children:[e(`deleteConfirmPrompt`),`ï¼`,(0,X.jsx)(`strong`,{children:s?.title??s?.name})]})]}),(0,X.jsx)(iE,{value:l,onChange:e=>u(e.target.value),placeholder:s?.title??s?.name}),(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(Z,{size:`md`,onClick:_,disabled:l!==(s?.title??s?.name)||c.loading,className:`disabled:opacity-40`,style:{backgroundColor:l===(s?.title??s?.name)?`#EB5757`:void 0},children:e(`deleteConfirmButton`)}),(0,X.jsx)(Z,{variant:`secondary`,size:`md`,onClick:()=>{p(!1),u(``)},children:t(`cancel`)})]})]}):(0,X.jsx)(Z,{variant:`secondary`,size:`md`,onClick:()=>p(!0),style:{borderColor:`rgba(235,87,87,0.35)`,color:`#EB5757`},children:e(`deleteButton`)})]})]})}var U9=[{id:`green`,color:`#02b13f`,welcome:{textColor:`#7d8a97`,btnColor:`#02b13f`,btnTextColor:`#ffffff`}},{id:`blue`,color:`#007abf`,welcome:{textColor:`#7d8a97`,btnColor:`#007abf`,btnTextColor:`#ffffff`}},{id:`orange`,color:`#ffa01a`,welcome:{textColor:`#7d8a97`,btnColor:`#ffa01a`,btnTextColor:`#ffffff`}},{id:`pink`,color:`#ff85b0`,welcome:{textColor:`#7d8a97`,btnColor:`#ff85b0`,btnTextColor:`#ffffff`}},{id:`purple`,color:`#cf93e6`,welcome:{textColor:`#7d8a97`,btnColor:`#cf93e6`,btnTextColor:`#ffffff`}},{id:`lime`,color:`#e0eb76`,welcome:{textColor:`#7d8a97`,btnColor:`#e0eb76`,btnTextColor:`#39701f`}}],W9=[{id:`p1`,url:`https://pinchat-prod.s3.ap-northeast-1.amazonaws.com/enterpoint/1f77b4ff50d6279648b27a42ed999826.png`},{id:`p2`,url:`https://pinchat-prod.s3.ap-northeast-1.amazonaws.com/enterpoint/dae136ba5563fa48cd4472c9867167e4.png`},{id:`p3`,url:`https://pinchat-prod.s3.ap-northeast-1.amazonaws.com/enterpoint/0b0a4793be55b1ca27e265e132e65773.png`},{id:`p4`,url:`https://pinchat-prod.s3.ap-northeast-1.amazonaws.com/enterpoint/ad545b6fc6f11bb451d944d5a8a02957.png`},{id:`p5`,url:`https://pinchat-prod.s3.ap-northeast-1.amazonaws.com/enterpoint/355bc6cb11e8ccb6904c88f00cdf8959.png`},{id:`p6`,url:`https://pinchat-prod.s3.ap-northeast-1.amazonaws.com/enterpoint/d30cb76255415d8e13f8563c05851354.png`}],G9=`h-10 w-full rounded-[8px] border border-border bg-bg-card px-3 text-[15px] text-text-primary placeholder:text-text-secondary placeholder:opacity-50 outline-none focus:border-border-strong transition-colors`,rae=`w-full px-3 py-2 rounded-[8px] border border-border bg-bg-card text-[15px] text-text-primary placeholder:text-text-secondary placeholder:opacity-50 outline-none focus:border-border-strong transition-colors resize-none`;function iae(){let{t:e}=V(`common`),[t]=ts(),{data:n,loading:r,error:i,refetch:a}=pd((t.get(`token`)??``)||void 0);return r&&!n?(0,X.jsx)(`div`,{className:`p-4 text-center text-text-secondary text-[14px]`,children:e(`loading`)}):i&&!n?(0,X.jsxs)(`div`,{className:`p-4 flex flex-col items-center gap-3`,children:[(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary`,children:e(`loadFailed`)}),(0,X.jsx)(Z,{variant:`secondary`,size:`md`,onClick:()=>void a(),children:e(`retry`)}
74)]}):n?(0,X.jsx)(aae,{config:n,refetch:a}):null}function aae({config:e,refetch:t}){let{t:n}=V(`mobile`),{t:r}=V(`workspace`),{t:i}=V(`common`);cE(n(`pinboardTitle`));let a=md(),[o,s]=(0,f.useState)(e.show_landing??!0),[c,l]=(0,f.useState)(e.welcome??``),[u,d]=(0,f.useState)(e.start_btn_text??``),[p,m]=(0,f.useState)(e.nickname_input_placeholder??``),[h,g]=(0,f.useState)(e.chat_logo_size??50),[_,v]=(0,f.useState)(e.chat_logo||null),[y,b]=(0,f.useState)(()=>U9.find(t=>t.welcome.textColor===e.welcome_text_color&&t.welcome.btnColor===e.start_btn_color&&t.welcome.btnTextColor===e.start_btn_text_color)?.id??``),[x,S]=(0,f.useState)(!1),[C,w]=(0,f.useState)(e.welcome_text_color??`#7d8a97`),[T,E]=(0,f.useState)(e.start_btn_color??`#02b13f`),[D,O]=(0,f.useState)(e.start_btn_text_color??`#ffffff`),[k,A]=(0,f.useState)(e.welcome_bg_type??`color`),[j,M]=(0,f.useState)(()=>W9.find(t=>t.url===e.welcome_bg_image)?.id??``),[N,ee]=(0,f.useState)(e.background_color??`#f7f8f9`),[P,F]=(0,f.useState)(e.welcome_bg_image??null),[I,te]=(0,f.useState)(!1),L=async()=>{try{await a.mutate({id:e.id,token:e.token,show_landing:o,welcome:c,start_btn_text:u,nickname_input_placeholder:p,chat_logo:_??``,chat_logo_size:h,welcome_text_color:C,start_btn_color:T,start_btn_text_color:D,welcome_bg_type:k,background_color:N,welcome_bg_image:P??``}),await t(),Q.success(n(`saved`)),window.isUnsaved=!1}catch{Q.error(n(`saveFailed`))}},ne=c||r(`welcome.welcomeMessagePlaceholder`),R=u||r(`welcome.startChatBtnPlaceholder`),z=k===`color`?{backgroundColor:N}:P?{backgroundImage:`url(${P})`,backgroundSize:`cover`,backgroundPosition:`center`}:{backgroundColor:`#ffffff`};return(0,X.jsxs)(`div`,{className:`flex flex-col min-h-screen`,children:[(0,X.jsx)(`div`,{className:`flex-1 p-4 pb-20`,children:(0,X.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,X.jsxs)(`div`,{className:`card p-5 flex flex-col gap-4`,children:[(0,X.jsx)(`h3`,{className:`text-[17px] font-semibold text-text-primary`,children:r(`welcome.sectionContent`)}),(0,X.jsx)(cae,{label:r(`welcome.labelShowWelcomePage`),checked:o,onChange:s}),(0,X.jsx)(K9,{}),(0,X.jsxs)(q9,{label:r(`welcome.labelWelcomeMessage`),children:[(0,X.jsx)(`textarea`,{value:c,onChange:e=>l(e.target.value),placeholder:r(`welcome.welcomeMessagePlaceholder`),maxLength:200,rows:3,className:rae}),(0,X.jsxs)(`p`,{className:`text-[13px] text-text-secondary text-right`,children:[c.length,`/200`]})]}),(0,X.jsx)(q9,{label:r(`welcome.labelNicknameDesc`),children:(0,X.jsx)(`input`,{value:p,onChange:e=>m(e.target.value),placeholder:r(`welcome.nicknameDescPlaceholder`),maxLength:60,className:G9})}),(0,X.jsx)(q9,{label:r(`welcome.labelStartChatBtn`),children:(0,X.jsx)(`input`,{value:u,onChange:e=>d(e.target.value),placeholder:r(`welcome.startChatBtnPlaceholder`),maxLength:30,className:G9})})]}),(0,X.jsxs)(`div`,{className:`card p-5 flex flex-col gap-4`,children:[(0,X.jsx)(`h3`,{className:`text-[17px] font-semibold text-text-primary`,children:r(`welcome.sectionAppearance`)}),(0,X.jsx)(J9,{label:r(`welcome.labelLogoUpload`),hint:r(`welcome.logoUploadHint`),defaultSrc:_??`/images/pinchat-logo-default.png`,onUrlChange:v,uploadKind:`logo`}),(0,X.jsx)(q9,{label:r(`welcome.labelLogoRatio`),children:(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(`input`,{type:`number`,value:h,onChange:e=>g(Math.min(100,Math.max(10,Number(e.target.value)))),min:10,max:100,className:K(G9,`w-24`)}),(0,X.jsx)(`span`,{className:`text-[14px] text-text-secondary`,children:`%`})]})}),(0,X.jsx)(K9,{}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-2.5`,children:[(0,X.jsx)(`p`,{className:`text-[14px] font-medium text-text-primary`,children:r(`welcome.labelThemeColor`)}),(0,X.jsx)(oae,{presetId:y,onPresetChange:e=>{let t=U9.find(t=>t.id===e);b(e),w(t.welcome.textColor),E(t.welcome.btnColor),O(t.welcome.btnTextColor)},fields:[{label:r(`welcome.labelWelcomeTextColor`),value:C,onChange:w},{label:r(`welcome.labelOpenChatBtnColor`),value:T,onChange:E},{label:r(`welcome.labelOpenChatBtnTextColor`),value:D,onChange:O}],open:x,onToggle:()=>S(e=>!e)})]}),(0,X.jsx)(K9,{}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,X.jsx)(`p`,{className:`text-[14px] font-medium text-text-primary`,children:r(`welcome.sectionBackgroun
74d`)}),(0,X.jsx)(`div`,{className:`flex gap-2`,children:[{id:`image`,icon:tc,label:r(`welcome.bgModeImage`)},{id:`color`,icon:gc,label:r(`welcome.bgModeColor`)}].map(({id:e,icon:t,label:n})=>(0,X.jsxs)(`button`,{type:`button`,onClick:()=>A(e),className:K(`flex flex-col items-center justify-center gap-1.5 w-20 h-20 rounded-[8px] border-2 transition-colors cursor-pointer`,k===e?`border-brand bg-brand-tint text-brand`:`border-border bg-bg-card text-text-secondary hover:border-border-strong hover:text-text-primary`),children:[(0,X.jsx)(t,{className:`w-5 h-5`}),(0,X.jsx)(`span`,{className:`text-[12px] font-medium`,children:n})]},e))}),k===`image`?(0,X.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,X.jsx)(`div`,{className:`flex gap-2 flex-wrap`,children:W9.map(e=>(0,X.jsx)(`button`,{type:`button`,onClick:()=>{M(e.id),F(e.url)},className:K(`w-12 h-12 rounded-[8px] border-2 transition-all cursor-pointer shrink-0 bg-cover bg-center`,j===e.id?`border-brand`:`border-transparent hover:border-border-strong`),style:{backgroundImage:`url(${e.url})`}},e.id))}),(0,X.jsx)(J9,{label:r(`welcome.bgUploadCustom`),hint:r(`welcome.bgUploadHint`),defaultSrc:P??void 0,onUrlChange:e=>{F(e),M(``)}})]}):(0,X.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,X.jsx)(`label`,{className:`text-[14px] text-text-secondary`,children:r(`welcome.labelBgColor`)}),(0,X.jsx)(g5,{value:N,onChange:ee})]})]})]}),(0,X.jsx)(`p`,{className:`text-[13px] text-text-secondary text-center`,children:(0,X.jsx)(ht,{i18nKey:`moreSettings`,ns:`mobile`,components:{lnk:(0,X.jsx)(`a`,{href:`https://pinchat.app/login`,target:`_blank`,rel:`noopener noreferrer`,className:`text-brand underline`})}})})]})}),(0,X.jsxs)(`div`,{className:`sticky bottom-0 bg-bg-card border-t border-border px-5 pt-4 pb-[max(1.25rem,env(safe-area-inset-bottom))] flex items-center gap-3`,children:[(0,X.jsxs)(Z,{variant:`secondary`,onClick:()=>te(!0),className:`gap-1.5`,children:[(0,X.jsx)(Zs,{className:`w-4 h-4`}),i(`preview`)]}),(0,X.jsx)(Z,{onClick:L,disabled:a.loading,className:`flex-1`,children:a.loading?i(`saving`):i(`saveChanges`)})]}),I&&(0,X.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onClick:()=>te(!1),children:(0,X.jsxs)(`div`,{className:`relative`,onClick:e=>e.stopPropagation(),children:[(0,X.jsx)(`button`,{type:`button`,onClick:()=>te(!1),className:`absolute -top-10 right-0 w-8 h-8 rounded-full bg-bg-card/90 flex items-center justify-center cursor-pointer`,children:(0,X.jsx)(Ic,{className:`w-4 h-4 text-text-primary`})}),(0,X.jsxs)(`div`,{className:`w-[280px] rounded-[14px] border border-border overflow-hidden flex flex-col`,style:{boxShadow:`var(--shadow-2)`,height:`80dvh`},children:[(0,X.jsxs)(`div`,{className:`h-6 flex items-center gap-1.5 px-3 bg-bg-muted border-b border-border shrink-0`,children:[(0,X.jsx)(`span`,{className:`w-2 h-2 rounded-full`,style:{backgroundColor:`#FF5F57`}}),(0,X.jsx)(`span`,{className:`w-2 h-2 rounded-full`,style:{backgroundColor:`#FFBD2E`}}),(0,X.jsx)(`span`,{className:`w-2 h-2 rounded-full`,style:{backgroundColor:`#28C840`}})]}),(0,X.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-6 flex flex-col items-center text-center gap-3`,style:z,children:[(0,X.jsx)(`img`,{src:_??`/images/pinchat-logo-default.png`,alt:`logo`,className:`max-w-full`,style:{width:`${h}%`}}),(0,X.jsx)(`p`,{className:`text-[13px] font-semibold leading-snug line-clamp-3 w-full`,style:{color:C},children:ne}),(0,X.jsx)(`input`,{readOnly:!0,placeholder:p||r(`welcome.nicknameDescPlaceholder`),className:`w-full h-8 px-2.5 rounded-[6px] border border-border bg-white/70 text-[12px] placeholder:text-text-secondary/60`}),(0,X.jsx)(`button`,{className:`w-full h-9 rounded-[8px] text-[13px] font-medium truncate px-2`,style:{backgroundColor:T,color:D},children:R})]})]})]})})]})}function K9(){return(0,X.jsx)(`div`,{className:`border-t border-border`})}function q9({label:e,tooltip:t,children:n}){return(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,X.jsx)(`label`,{className:`text-[14px] font-medium text-text-primary`,children:e}),t&&(0,X.jsx)(tE,{content:t})]}),n]})}function oae({presetId:e,onPresetChange:t,fields:n,open:r,onToggle:i}){let{t:a}=V(`workspace`);return(0,X.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-3 px-1`,children:[U9.map(n=>(0,X.jsx)(`button`,{type:`button`,onClick:()=>t(n.id),className:`w-7 h-7 rounded-full transition-transform duration-150 cursor-pointer hover:scale-110 shrink-0`,style:{backgroundColor:n.color,boxShadow:e===n.id?`0 0 0 2px var(--bg-card), 0 0 0 4px ${n.color}`:void 0,transform:e===n.id?`scale(1.15)`:void 0}},n.id)),(0,X.jsxs)(`button`,{type:`button`,onClick:i,className:`ml-auto flex items-center gap-1 text-[13px] text-text-secondary hover:text-text-primary curs
74or-pointer transition-colors`,children:[a(`linkInfo.customColor`),(0,X.jsx)(Is,{className:K(`w-3.5 h-3.5 transition-transform duration-200`,r&&`rotate-180`)})]})]}),r&&(0,X.jsx)(`div`,{className:`flex flex-col gap-2.5 pl-3 border-l-2 ml-1 min-w-0 overflow-hidden`,style:{borderColor:`var(--brand-tint-strong)`},children:n.map(e=>(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,X.jsx)(`span`,{className:`text-[14px] text-text-secondary truncate`,children:e.label}),(0,X.jsx)(g5,{value:e.value,onChange:e.onChange})]},e.label))})]})}function sae({checked:e,onChange:t}){return(0,X.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":e,onClick:()=>t(!e),className:K(`relative w-10 h-[22px] rounded-full transition-colors duration-200 cursor-pointer shrink-0 overflow-hidden`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1`,e?`bg-brand`:`bg-border-strong`),children:(0,X.jsx)(`span`,{className:K(`absolute top-[3px] w-4 h-4 rounded-full bg-white shadow-sm transition-[left] duration-200`,e?`left-[21px]`:`left-[3px]`)})})}function cae({label:e,checked:t,onChange:n}){return(0,X.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,X.jsx)(`p`,{className:`text-[15px] text-text-primary font-medium`,children:e}),(0,X.jsx)(sae,{checked:t,onChange:n})]})}function J9({label:e,hint:t,defaultSrc:n,onUrlChange:r,uploadKind:i=`image`}){let{t:a}=V(`common`),[o,s]=(0,f.useState)(n??null),c=Ed(i);return(0,f.useEffect)(()=>{s(n??null)},[n]),(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsx)(`label`,{className:`text-[14px] font-medium text-text-primary`,children:e}),(0,X.jsxs)(`label`,{className:K(`relative flex flex-col items-center justify-center gap-2 h-20 rounded-[8px] border-2 border-dashed border-border bg-bg-muted transition-colors overflow-hidden`,c.loading?`cursor-wait opacity-60`:`cursor-pointer`),children:[(0,X.jsx)(`input`,{type:`file`,accept:`image/*`,className:`sr-only`,onChange:async e=>{let t=e.target.files?.[0];if(!t)return;let i=URL.createObjectURL(t);s(i);try{let e=await c.mutate(t);s(e.url),r?.(e.url)}catch{s(n??null),Q.error(a(`uploadFailed`))}finally{URL.revokeObjectURL(i)}},disabled:c.loading}),o?(0,X.jsx)(`img`,{src:o,alt:``,className:`max-h-14 max-w-full object-contain`}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Mc,{className:`w-4 h-4 text-text-secondary`}),(0,X.jsx)(`span`,{className:`text-[13px] text-text-secondary`,children:t})]}),c.loading&&(0,X.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-black/40 rounded-[8px]`,children:(0,X.jsx)(sc,{className:`w-6 h-6 text-white animate-spin`})})]})]})}var Y9=[{id:`green`,color:`#02b13f`,chat:{headerBg:`#006b25`,headerText:`#ffffff`,bubbleBg:`#ddefe0`,bubbleBorder:`#ddefe0`,bubbleText:`#000000`}},{id:`blue`,color:`#007abf`,chat:{headerBg:`#007abf`,headerText:`#ffffff`,bubbleBg:`#b4cedc`,bubbleBorder:`#b4cedc`,bubbleText:`#000000`}},{id:`orange`,color:`#ffa01a`,chat:{headerBg:`#ffa01a`,headerText:`#000000`,bubbleBg:`#ffe4bc`,bubbleBorder:`#ffe4bc`,bubbleText:`#3c3c3c`}},{id:`pink`,color:`#ff85b0`,chat:{headerBg:`#ff85b0`,headerText:`#ffffff`,bubbleBg:`#ffe9f1`,bubbleBorder:`#ffe9f1`,bubbleText:`#7b7b7b`}},{id:`purple`,color:`#cf93e6`,chat:{headerBg:`#cf93e6`,headerText:`#ffffff`,bubbleBg:`#e7d0f0`,bubbleBorder:`#e7d0f0`,bubbleText:`#616081`}},{id:`lime`,color:`#e0eb76`,chat:{headerBg:`#e0eb76`,headerText:`#1d3d0e`,bubbleBg:`#39701e`,bubbleBorder:`#39701e`,bubbleText:`#ffffff`}}],X9=`h-10 w-full rounded-[8px] border border-border bg-bg-card px-3 text-[15px] text-text-primary placeholder:text-text-secondary placeholder:opacity-50 outline-none focus:border-border-strong transition-colors`,lae=`h-10 w-full rounded-[8px] border border-border bg-bg-card pl-3 pr-8 text-[15px] text-text-primary outline-none focus:border-border-strong transition-colors appearance-none cursor-pointer`,Z9=`w-full px-3 py-2 rounded-[8px] border border-border bg-bg-card text-[15px] text-text-primary placeholder:text-text-secondary placeholder:opacity-50 outline-none focus:border-border-strong transition-colors resize-none`;function uae(){let{t:e}=V(`common`),[t]=ts(),{data:n,loading:r,error:i,refetch:a}=pd((t.get(`token`)??``)||void 0);return r&&!n?(0,X.jsx)(`div`,{className:`p-4 text-center text-text-secondary text-[14px]`,children:e(`loading`)}):i&&!n?(0,X.jsxs)(`div`,{className:`p-4 flex flex-col items-center gap-3`,children:[(0,X.jsx)(`p`,{className:`text-[14px] text-text-secondary`,children:e(`loadFailed`)}),(0,X.jsx)(Z,{variant:`secondary`,size:`md`,onClick:()=>void a(),children:e(`retry`)}
74)]}):n?(0,X.jsx)(dae,{config:n,refetch:a},n.updatedAt):null}function dae({config:e,refetch:t}){let{t:n}=V(`mobile`),{t:r}=V(`workspace`),{t:i}=V(`common`);cE(n(`chatSettingTitle`));let a=md(),o=Md(),{data:s}=jd(e.token),[c,l]=(0,f.useState)(()=>Y9.find(t=>t.chat.headerBg===e.chat_header_color&&t.chat.headerText===e.chat_header_text_color&&t.chat.bubbleBg===e.chat_bubble_color&&t.chat.bubbleBorder===e.chat_bubble_border_color&&t.chat.bubbleText===e.chat_bubble_text_color)?.id??``),[u,d]=(0,f.useState)(!1),[p,m]=(0,f.useState)(e.chat_header_color??`#006b25`),[h,g]=(0,f.useState)(e.chat_header_text_color??`#ffffff`),[_,v]=(0,f.useState)(e.chat_bubble_color??`#ddefe0`),[y,b]=(0,f.useState)(e.chat_bubble_border_color??`#ddefe0`),[x,S]=(0,f.useState)(e.chat_bubble_text_color??`#000000`),[C,w]=(0,f.useState)(e.title??e.name??``),[T,E]=(0,f.useState)(e.name??``),[D,O]=(0,f.useState)(e.avatar??null),[k,A]=(0,f.useState)(e.image_id??null),[j,M]=(0,f.useState)(e.welcome_message??``),[N,ee]=(0,f.useState)(e.welcome_get_customer_info_type??`none`),[P,F]=(0,f.useState)(()=>r(`chat.emailTitleDefault`)),[I,te]=(0,f.useState)(()=>r(`chat.emailTextDefault`)),[L,ne]=(0,f.useState)(()=>r(`chat.otherTitleDefault`)),[R,z]=(0,f.useState)(()=>r(`chat.otherTextDefault`)),[B,re]=(0,f.useState)(!1);(0,f.useEffect)(()=>{s&&(s.email_title!=null&&F(s.email_title),s.email_text!=null&&te(s.email_text),s.other_title!=null&&ne(s.other_title),s.other_text!=null&&z(s.other_text))},[s]);let ie=async()=>{try{await a.mutate({id:e.id,token:e.token,name:T,title:C,avatar:D??``,...k==null?{}:{image_id:k},welcome_message:j,welcome_get_customer_info_type:N,chat_header_color:p,chat_header_text_color:h,chat_bubble_color:_,chat_bubble_border_color:y,chat_bubble_text_color:x}),N!==`none`&&await o.mutate({token:e.token,title:N===`email`?P:L,text:N===`email`?I:R,type:N}),await t(),Q.success(n(`saved`))}catch{Q.error(n(`saveFailed`))}},ae=j||r(`chat.defaultMsgPlaceholder`),oe=T||r(`chat.chatroomNicknamePlaceholder`),se=C||r(`chat.chatroomNamePlaceholder`),ce=(C||T||`?`).charAt(0).toUpperCase();return(0,X.jsxs)(`div`,{className:`flex flex-col min-h-screen`,children:[(0,X.jsx)(`div`,{className:`flex-1 p-4 pb-20`,children:(0,X.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,X.jsxs)(`div`,{className:`card p-5 flex flex-col gap-4`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,X.jsx)(`h3`,{className:`text-[17px] font-semibold text-text-primary`,children:r(`chat.labelThemeColor`)}),(0,X.jsx)(tE,{content:r(`chat.tipThemeColor`)})]}),(0,X.jsx)(fae,{presetId:c,onPresetChange:e=>{let t=Y9.find(t=>t.id===e);l(e),m(t.chat.headerBg),g(t.chat.headerText),v(t.chat.bubbleBg),b(t.chat.bubbleBorder),S(t.chat.bubbleText)},fields:[{label:r(`chat.labelHeaderBgColor`),value:p,onChange:m},{label:r(`chat.labelHeaderTextColor`),value:h,onChange:g},{label:r(`chat.labelBubbleBgColor`),value:_,onChange:v},{label:r(`chat.labelBubbleBorderColor`),value:y,onChange:b},{label:r(`chat.labelBubbleTextColor`),value:x,onChange:S}],open:u,onToggle:()=>d(e=>!e)})]}),(0,X.jsxs)(`div`,{className:`card p-5 flex flex-col gap-4`,children:[(0,X.jsx)(`h3`,{className:`text-[17px] font-semibold text-text-primary`,children:r(`chat.sectionBasic`)}),(0,X.jsx)(Q9,{label:r(`chat.labelChatroomName`),children:(0,X.jsx)(`input`,{value:C,onChange:e=>w(e.target.value),placeholder:r(`chat.chatroomNamePlaceholder`),maxLength:30,className:X9})}),(0,X.jsx)(Q9,{label:r(`chat.labelChatroomNickname`),children:(0,X.jsx)(`input`,{value:T,onChange:e=>E(e.target.value),placeholder:r(`chat.chatroomNicknamePlaceholder`),maxLength:25,className:X9})}),(0,X.jsx)(pae,{label:r(`chat.labelChatroomAvatar`),hint:r(`chat.avatarUploadHint`),defaultSrc:D??void 0,onUpload:e=>{O(e?.url??null),A(e?.id??null)}})]}),(0,X.jsxs)(`div`,{className:`card p-5 flex flex-col gap-4`,children:[(0,X.jsx)(`h3`,{className:`text-[17px] font-semibold text-text-primary`,children:r(`chat.sectionWelcomeMsg`)}),(0,X.jsxs)(Q9,{label:r(`chat.labelDefaultMsg`),children:[(0,X.jsx)(`textarea`,{value:j,onChange:e=>M(e.target.value),placeholder:r(`chat.defaultMsgPlaceholder`),maxLength:200,rows:3,className:Z9}),(0,X.jsxs)(`p`,{className:`text-[13px] text-text-secondary text-right`,children:[j.length,`/200`]})]}),(0,X.jsx)(Q9,{label:r(`chat.labelCustomerInputBox`),children:(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsxs)(`select`,{value:N,onChange:e=>ee(e.target.value),className:lae,children:[(0,X.jsx)(`option`,{value:`none`,children:r(`chat.customerInputNone`)}),(0,X.jsx)(`option`,{value:`email`,children:r(`chat.customerInputEmail`)}),(0,X.jsx)(`option`,{value:`text`,children:r(`chat.customerInputText`)})]}),(0,X.jsx)(Is,{className:`absolute right-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-text-secondary pointer-events-none`})]})}),N!==`none`&&(0,X.jsx)(`div`,{className:`pt-1 pl-3 border-l-2 ml-1`,style:{borderColor:`var(--brand-tint-strong)`},children:(0,X.jsx)(Q9,{label:r(`chat.labelTypeText`),children:(0,X.jsx)(`textarea`,{value:N===`email`?I:R,onChange:e=>N===`email`?te(e.target.value):z(e.target.value),placeholder:r(`chat.typeTextPlaceholder`),rows:3,className:Z9})})})]}),(0,X.jsx)(`p`,{className:`text-[13px] text-text-secondary text-center`,children:(0,X.jsx)(ht,{i18nKey:`moreSettings`,ns:`mobile`,components:{lnk:(0,X.jsx)(`a`,{href:`https://pinchat.app/login`,target:`_blank`,rel:`noopener noreferrer`,className:`text-brand underline`})}})})]})}),(0,X.jsxs)(`div`,{className:`sticky bottom-0 bg-bg-card border-t border-border px-5 pt-4 pb-[max(1.25rem,env(safe-area-inset-bottom))] flex items-center gap-3`,children:[(0,X.jsxs)(Z,{variant:`secondary`,onClick:()=>re(!0),className:`gap-1.5`,children:[(0,X.jsx)(Zs,{className:`w-4 h-4`}),i(`preview`)]}),(0,X.jsx)(Z,{onClick:ie,disabled:a.loading,className:`flex-1`,children:a.loading?i(`saving`):i(`saveChanges`)})]}),B&&(0,X.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onClick:()=>re(!1),children:(0,X.jsxs)(`div`,{className:`relative`,onClick:e=>e.stopPropagation(),children:[(0,X.jsx)(`button`,{type:`button`,onClick:()=>re(!1),className:`absolute -top-10 right-0 w-8 h-8 rounded-full bg-bg-card/90 flex items-center justify-center cursor-pointer`,children:(0,X.jsx)(Ic,{className:`w-4 h-4 text-text-primary`})}),(0,X.jsxs)(`div`,{className:`w-[280px] rounded-[14px] border border-border overflow-hidden flex flex-col`,style:{boxShadow:`var(--shadow-2)`,height:`80dvh`},children:[(0,X.jsxs)(`div`,{className:`h-6 flex items-center gap-1.5 px-3 bg-bg-muted border-b border-border shrink-0`,children:[(0,X.jsx)(`span`,{className:`w-2 h-2 rounded-full`,style:{backgroundColor:`#FF5F57`}}),(0,X.jsx)(`span`,{className:`w-2 h-2 rounded-full`,style:{backgroundColor:`#FFBD2E`}}),(0,X.jsx)(`span`,{className:`w-2 h-2 rounded-full`,style:{backgroundColor:`#28C840`}})]}),(0,X.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2 shrink-0`,style:{backgroundColor:p},children:[(0,X.jsx)(`div`,{className:`w-8 h-8 rounded-full overflow-hidden shrink-0 flex items-center justify-center text-[12px] font-bold`,style:{backgroundColor:`rgba(255,255,255,0.25)`,color:h},children:D?(0,X.jsx)(`img`,{src:D,alt:``,className:`w-full h-full object-cover`}):ce}),(0,X.jsx)(`p`,{className:`text-[13px] font-semibold truncate`,style:{color:h},children:se})]}),(0,X.jsxs)(`div`,{className:`bg-bg-muted flex-1 flex flex-col gap-2.5 px-3 py-3 overflow-y-auto`,children:[(0,X.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,X.jsx)(`div`,{className:`w-6 h-6 rounded-full overflow-hidden shrink-0 flex items-center justify-center text-[9px] font-bold`,style:{backgroundColor:p,color:h},children:D?(0,X.jsx)(`img`,{src:D,alt:``,className:`w-full h-full object-cover`}):ce}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-0.5 min-w-0`,style:{maxWidth:`80%`},children:[(0,X.jsx)(`span`,{className:`text-[10px] text-text-secondary ml-1`,children:oe}),(0,X.jsx)(`div`,{className:`rounded-[8px] rounded-bl-[3px] px-2.5 py-2 text-[11px] leading-snug break-words bg-bg-card border border-border text-text-primary`,children:ae})]})]}),N!==`none`&&(0,X.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,X.jsx)(`div`,{className:`w-6 h-6 rounded-full overflow-hidden shrink-0 flex items-center justify-center text-[9px] font-bold`,style:{backgroundColor:p,color:h},children:D?(0,X.jsx)(`img`,{src:D,alt:``,className:`w-full h-full object-cover`}):ce}),(0,X.jsxs)(`div`,{className:`rounded-[8px] rounded-bl-[3px] px-2.5 py-2 text-[11px] leading-snug bg-bg-card border border-border text-text-primary`,style:{maxWidth:`80%`},children:[(0,X.jsx)(`p`,{className:`mb-1 text-[10px]`,children:N===`email`?I:R}),(0,X.jsx)(`div`,{className:`flex items-center bg-bg-card/70 rounded px-2 py-1`,children:(0,X.jsx)(`span`,{className:`text-[10px] text-text-secondary truncate`,children:N===`email`?`[email protected]`:`...`})})]})]}),(0,X.jsx)(`div`,{className:`flex justify-end`,children:(0,X.jsx)(`div`,{className:`rounded-[8px] rounded-br-[3px] px-2.5 py-2 text-[11px]`,style:{backgroundColor:_,border:`1px solid ${y}`,color:x},children:`Hello ð`})})]}),(0,X.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2 bg-bg-card border-t border-border shrink-0`,children:[(0,X.jsx)(`div`,{className:`flex-1 flex items-center bg-bg-muted rounded-[6px] px-2.5 h-7`,children:(0,X.jsx)(`span`,{className:`text-[10px] text-text-secondary truncate`,children:r(`chat.previewInputPlaceholder`)})}),(0,X.jsx)(`div`,{className:`w-6 h-6 rounded-full flex items-center justify-center shrink-0`,style:{backgroundColor:p},children:(0,X.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 24 24`,fill:h,children:(0,X.jsx)(`path`,{d:`M2.01 21L23 12 2.01 3 2 10l15 2-15 2z`})})})]})]})]})})]})}function Q9({label:e,tooltip:t,children:n}){return(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,X.jsx)(`label`,{className:`text-[14px] font-medium text-text-primary`,children:e}),t&&(0,X.jsx)(tE,{content:t})]}),n]})}function fae({presetId:e,onPresetChange:t,fields:n,open:r,onToggle:i}){let{t:a}=V(`workspace`);return(0,X.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-3 px-1`,children:[Y9.map(n=>(0,X.jsx)(`button`,{type:`button`,onClick:()=>t(n.id),className:`w-7 h-7 rounded-full transition-transform duration-150 cursor-pointer hover:scale-110 shrink-0`,style:{backgroundColor:n.color,boxShadow:e===n.id?`0 0 0 2px var(--bg-card), 0 0 0 4px ${n.color}`:void 0,transform:e===n.id?`scale(1.15)`:void 0}},n.id)),(0,X.jsxs)(`button`,{type:`button`,onClick:i,className:`ml-auto flex items-center gap-1 text-[13px] text-text-secondary hover:text-text-primary curs
74or-pointer transition-colors`,children:[a(`linkInfo.customColor`),(0,X.jsx)(Is,{className:K(`w-3.5 h-3.5 transition-transform duration-200`,r&&`rotate-180`)})]})]}),r&&(0,X.jsx)(`div`,{className:`flex flex-col gap-2.5 pl-3 border-l-2 ml-1 min-w-0 overflow-hidden`,style:{borderColor:`var(--brand-tint-strong)`},children:n.map(e=>(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,X.jsx)(`span`,{className:`text-[14px] text-text-secondary truncate`,children:e.label}),(0,X.jsx)(g5,{value:e.value,onChange:e.onChange})]},e.label))})]})}function pae({label:e,hint:t,defaultSrc:n,onUpload:r,onUrlChange:i}){let{t:a}=V(`common`),[o,s]=(0,f.useState)(n??null),c=(0,f.useRef)(null),l=Ed(`image`);return(0,f.useEffect)(()=>{s(n??null)},[n]),(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsx)(`label`,{className:`text-[14px] font-medium text-text-primary`,children:e}),(0,X.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,X.jsxs)(`div`,{className:`relative w-20 h-20 rounded-full bg-bg-muted border border-border flex items-center justify-center shrink-0 overflow-hidden`,children:[o?(0,X.jsx)(`img`,{src:o,alt:``,className:`w-full h-full object-cover`}):(0,X.jsx)(tc,{className:`w-7 h-7 text-text-secondary`}),l.loading&&(0,X.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-black/40 rounded-full`,children:(0,X.jsx)(sc,{className:`w-6 h-6 text-white animate-spin`})})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(`input`,{ref:c,type:`file`,accept:`image/*`,className:`hidden`,onChange:async e=>{let t=e.target.files?.[0];if(!t)return;let o=URL.createObjectURL(t);s(o);try{let e=await l.mutate(t);s(e.url),r?.({url:e.url,id:e.id}),i?.(e.url)}catch{s(n??null),Q.error(a(`uploadFailed`))}finally{URL.revokeObjectURL(o)}},disabled:l.loading}),(0,X.jsxs)(Z,{type:`button`,variant:`secondary`,size:`sm`,onClick:()=>c.current?.click(),disabled:l.loading,className:`gap-1.5 whitespace-nowrap`,children:[(0,X.jsx)(Mc,{className:`w-3.5 h-3.5`}),a(o?`changeImage`:`uploadImage`)]}),o&&(0,X.jsx)(`button`,{type:`button`,onClick:()=>{s(null),c.current&&(c.current.value=``),r?.(null),i?.(null)},className:`text-[14px] text-text-secondary hover:text-danger transition-colors cursor-pointer`,children:a(`remove`)})]}),t&&(0,X.jsx)(`p`,{className:`text-[13px] text-text-secondary mt-1.5`,children:t})]})]})]})}function mae(){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(gs,{}),(0,X.jsx)(Xa,{})]})}function $9({to:e}){let{search:t}=oa();return(0,X.jsx)(Ya,{to:`${e}${t}`,replace:!0})}var hae=Ho($a((0,X.jsxs)(H,{element:(0,X.jsx)(mae,{}),children:[(0,X.jsx)(H,{path:`/`,element:(0,X.jsx)(Zie,{})}),(0,X.jsx)(H,{path:`/chat/:token`,element:(0,X.jsx)(zie,{})}),(0,X.jsx)(H,{path:`/:linkId`,element:(0,X.jsx)(Xie,{})}),(0,X.jsxs)(H,{path:`/mobile`,element:(0,X.jsx)(eae,{}),children:[(0,X.jsx)(H,{path:`create-link`,element:(0,X.jsx)(tae,{})}),(0,X.jsx)(H,{path:`link-info`,element:(0,X.jsx)(nae,{})}),(0,X.jsx)(H,{path:`pinboard`,element:(0,X.jsx)(iae,{})}),(0,X.jsx)(H,{path:`chat-setting`,element:(0,X.jsx)(uae,{})})]}),(0,X.jsx)(H,{path:`/login`,element:(0,X.jsx)(Cee,{})}),(0,X.jsx)(H,{path:`/login-phone`,element:(0,X.jsx)(Tee,{})}),(0,X.jsx)(H,{path:`/sublogin`,element:(0,X.jsx)(Eee,{})}),(0,X.jsx)(H,{path:`/forgot-password-phone`,element:(0,X.jsx)(Dee,{})}),(0,X.jsx)(H,{path:`/set-password-phone`,element:(0,X.jsx)(kee,{})}),(0,X.jsx)(H,{path:`/register`,element:(0,X.jsx)(Nee,{})}),(0,X.jsx)(H,{path:`/forgot-password`,element:(0,X.jsx)(Pee,{})}),(0,X.jsx)(H,{path:`/check-email`,element:(0,X.jsx)(Iee,{})}),(0,X.jsx)(H,{path:`/verify-email`,element:(0,X.jsx)(Fee,{})}),(0,X.jsx)(H,{path:`/reset-password`,element:(0,X.jsx)(Ree,{})}),(0,X.jsxs)(H,{path:`/dashboard`,children:[(0,X.jsx)(H,{path:`login`,element:(0,X.jsx)($9,{to:`/login`})}),(0,X.jsx)(H,{path:`login-phone`,element:(0,X.jsx)($9,{to:`/login-phone`})}),(0,X.jsx)(H,{path:`sublogin`,element:(0,X.jsx)($9,{to:`/sublogin`})}),(0,X.jsx)(H,{path:`forgot-password-phone`,element:(0,X.jsx)($9,{to:`/forgot-password-phone`})}),(0,X.jsx)(H,{path:`set-password-phone`,element:(0,X.jsx)($9,{to:`/set-password-phone`})}),(0,X.jsx)(H,{path:`register`,element:(0,X.jsx)($9,{to:`/register`})}),(0,X.jsx)(H,{path:`forgot-password`,element:(0,X.jsx)($9,{to:`/forgot-password`})}),(0,X.jsx)(H,{path:`check-email`,element:(0,X.jsx)($9,{to:`/check-email`})}),(0,X.jsx)(H,{path:`verify-email`,element:(0,X.jsx)($9,{to:`/verify-email`})}),(0,X.jsx)(H,{path:`reset-password`,element:(0,X.jsx)($9,{to:`/reset-password`})}),(0,X.jsxs)(H,{element:(0,X.jsx)(rE,{children:(0,X.jsx)(ZT,{})}),children:[(0,X.jsx)(H,{index:!0,element:(0,X.jsx)(eD,{})}),(0,X.jsxs)(H,{path:`analytics`,element:(0,X.jsx)(nD,{}),children:[(0,X.jsx)(H,{index:!0,element:(0,X.jsx)(K6,{})}),(0,X.jsx)(H,{path:`link`,element:(0,X.jsx)(t8,{})})]}),(0,X.jsx)(H,{path:`account`,element:(0,X.jsx)(Mre,{})}),(0,X.jsx)(H,{path:`billing`,element:(0,X.jsx)(Gre,{})}),(0,X.jsxs)(H,{path:`settings`,element:(0,X.jsx)(n8,{}),children:[(0,X.jsx)(H,{index:!0,element:(0,X.jsx)(s8,{})}),(0,X.jsx)(H,{path:`general`,element:(0,X.jsx)(r8,{})}),(0,X.jsx)(H,{path:`payment`,element:(0,X.jsx)(g8,{})})]})]}),(0,X.jsxs)(H,{path:`workspace/:linkId`,element:(0,X.jsx)(rE,{children:(0,X.jsx)(nE,{})}),children:[(0,X.jsx)(H,{index:!0,element:(0,X.jsx)(Ya,{to:`data`,replace:!0})}),(0,X.jsx)(H,{path:`data`,element:(0,X.jsx)(y8,{})}),(0,X.jsx)(H,{path:`customers`,element:(0,X.jsx)(D8,{})}),(0,X.jsx)(H,{path:`settings/info`,element:(0,X.jsx)(j5,{})}),(0,X.jsx)(H,{path:`settings/automation`,element:(0,X.jsx)(q5,{})}),(0,X.jsx)(H,{path:`settings/automation/ai-bot`,element:(0,X.jsx)(Qne,{})}),(0,X.jsx)(H,{path:`settings/automation/survey`,element:(0,X.jsx)(are,{})}),(0,X.jsx)(H,{path:`settings/automation/survey/new`,element:(0,X.jsx)(C7,{})}),(0,X.jsx)(H,{path:`settings/automation/survey/:surveyId/edit`,element:(0,X.jsx)(C7,{})}),(0,X.jsx)(H,{path:`settings/integrations`,element:(0,X.jsx)(mre,{})}),(0,X.jsx)(H,{path:`settings/integrations/web-plugin`,element:(0,X.jsx)(yre,{})}),(0,X.jsx)(H,{path:`settings/integrations/third-party`,element:(0,X.jsx)(Tre,{})}),(0,X.jsx)(H,{path:`settings/sub-accounts`,element:(0,X.jsx)(kre,{})})]}
74),(0,X.jsx)(H,{path:`billing/checkout/:plan`,element:(0,X.jsx)(Xre,{})}),(0,X.jsx)(H,{path:`showcase`,element:(0,X.jsx)(jre,{})}),(0,X.jsx)(H,{path:`chat`,element:(0,X.jsx)(rE,{children:(0,X.jsx)(Tie,{})})})]}),(0,X.jsx)(H,{path:`*`,element:(0,X.jsx)(Ya,{to:`/dashboard`,replace:!0})})]})));function gae(){return(0,X.jsx)(ps,{router:hae})}(0,p.createRoot)(document.getElementById(`root`)).render((0,X.jsx)(f.StrictMode,{children:(0,X.jsx)(gae,{})}));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.